Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

[feat] Configuration templates, apply to many devices #336

Open
LordMike opened this issue Apr 1, 2020 · 6 comments
Open

[feat] Configuration templates, apply to many devices #336

LordMike opened this issue Apr 1, 2020 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@LordMike
Copy link

LordMike commented Apr 1, 2020

Is your feature request related to a problem? Please describe.
I've acquired three Aeotec door/window sensor 6's, and I'd like to configure them in the same fashion (send X when open, monitor battery ,.. etc). Currently, I have to do this individually, per device - and then on that, I need to verify the settings took hold (There's an option to persist the queued messages, so even on z2m restarts the set-configuration should still be sent ..).

I also envision getting more of these, and they should all have the same configuration - and I'd like to know of anomalies / devices without the configuration.

Describe the solution you'd like
A template of the configuration that I can create and configure - and apply to all devices of the same type. It should display a table of all matched devices (by type), along with f.ex. the last time the configuration was refreshed from the device, if it's "compliant" and a button to re-set all configuration parameters.

A template should essentially be a list of parameters for the device type, along with a checkbox for each specifying if it should be set.

Describe alternatives you've considered
N/A

Additional context
N/A

@LordMike LordMike added the enhancement New feature or request label Apr 1, 2020
@robertsLando
Copy link
Member

Thats intreresting @LordMike . Would you like to create a PR for this? I will add this to the todos but requires some effort on front end side

@LordMike
Copy link
Author

LordMike commented Apr 1, 2020

It unfortunately does. I'm not that familiar with larger apps in JS .. but if I get around to it, I might give it a whirl. :)

Thanks for the effort on the project. It looks good :)

@robertsLando
Copy link
Member

robertsLando commented Apr 2, 2020

@LordMike If you need help to understand how code works, I'm here :)

I think that there is an 'easy way' that consists in add a button in configuration section (near refresh button) like 'Create template' that once pressed calls an api that stores in the JSON store (the same used for scenes and nodes info) an objet like:

<deviceId>: {
<valueID>: value
}

It will contain all templates of each deviceID that has one, near that button there should be an 'Apply template' button that checks if there are existing templtes and if so it sends each configuration value to that device :)

@robertsLando
Copy link
Member

@chilicheech Would you like to implement this?

@LordMike
Copy link
Author

LordMike commented Apr 2, 2020

EDIT: Scratch my entire thing. @robertsLando already sketched out all there needs to be. I'm just overthinking this.


Quick sketch of what I imagine the feature will do. It's very similar to @robertsLando - but I'll reiterate it to be sure:

  • Add a template management page, that can display all templates, clicking on one will show non-compliant devices
    • For each device, there should be an "Apply template" which queues all the necessary setParameter thingies.
  • Add a "Make template" link/button on the configuration page, which prompts for a name - when submitted, it stores all the current configuration values in the document style below.
    • It could prompt to overwrite existing templates

The template config should be something like:

{
  "filter": {
    "deviceId": "134-112-2"
  },
  "settings": {
    "15": "value 1",
    "18": "property for parameter no. 18",
    "54": 554
  }
}

Note that the filter object can be expanded in the future to f.ex. match devices by their name. We could also ditch that, and move deviceId one up. A future name filter could then be a sibling to that.

EDIT: Running over this again. @robertsLando is probably on the right track by not having names etc.. Should the object be more complex like this, though, to support future setup w/ names and whatnot.

.... then again.. Z-Wave can have a max of 256 devices - right?.. so maybe I'm just overthinking it.

@robertsLando
Copy link
Member

I like your idea but I think it add lot complexity to something that is not complex at all. All devices have diffetent configurations valueId with different parameters (so there is no reason to use a filter, the only thing to use is the deviceId that unique identify a device). Also each value has a unique id inside the device and for configuration values they all have command class 112 so the vlaueid will always be 112-instanceId-index that will be the indentifier of the value. So I still think that my idea is not just easier to implement but also more correct for this use. Would you like to give it a try?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants