Configuration Management for Z-wave device configuration and associations #2137
LordMike
started this conversation in
Show and tell
Replies: 1 comment 4 replies
-
@LordMike Thanks! BTW cannot find the links to the tool :) |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey all,
When I want to do something with z-wave, or any system, I prototype it using code, such that I can quickly iterate and work on finding out how stuff works and how best to do it. Some of these things move on to feature requests, if I think those features could benefit others.
I wanted to show off three of these features that I made.
Note: For those not in the know: "Configuration Management" is a discipline where configuration of devices, services and systems is centrally managed and rolled out. The manager will know which configurations have "drifted" (changed outside the system), and thereby reapply them as needed. The benefit of config management is streamlining, as in you'll centrally be able to configure "all" of something.
Note2: The code and tool is not available right now. I could make it available.
Configuration management
I've made a tool that I can run, which uses the MQTT API of Zwavejs2mqtt to query all nodes (
getNodes
api) and thereby know all devices and their settings. I then have a config file like the following:Example devices config
This config snippet configures a lot of settings on my ZDB5100's (wall switches with LEDs), and for some devices, it sets up different settings than the "default" (the lines with
product:ZDB5100
). Each configuration line "appends" to the previous, so you can make generic configuration first, and then more specific configuration later.In my case, I want to do a lot to a new ZDB5100 - I want to disable the default LED's that light up, and then change stuff like the dimming duration (5 seconds by default) or which button controls the current dimmer (usually 1, top-left - but sometimes I want it differently)..
Using this, I can run a quick command on my system to run my code, which then queries all values and changes those as needed:
Associations management
I haven't quite figured out a good way to model associations in general, but this is currently for me more of a way to "save" associations and "restore" them. This can help when I want to test out things, or re-include all my devices using S2 (which factory resets everything)..
Like before, I can run commands:
Example associations commands
The json file looks like this:
Example associations config
Configuration overview
I was troubleshooting an issue where one device was acting differently from the others. When I looked into this, I couldn't spot why it was acting differently, so I turned to configurations again.. something must be off. I made a
dump-config
that again usesgetNodes
and looks at a set of devices (the same model f.ex.), and writes out all configurations and their current values. I can then plot this in Excel, and actually get a nice table of each setting and device (since all devices have the same settings), and quickly identify the odd on out.Using that, I found out that at some point I had tweaked a setting I didn't manage, manually on one device - the one acting out. It meant that its LED acted differently than other devices, so I couldn't control it like I normally do.
Dump config output
The actual data
My pivot table in excel that groups by setting
Benefits
This may seem like a lot of work, but it has benefits when messing with or tweaking the system. For example, recently, I wanted to reinclude some devices with S2 to try it out. This resets the devices, but I can quickly restore both configurations and associations, so that my home continues working as intended. All I need to do, is maintain the naming of my devices, and then I can reapply.
Beta Was this translation helpful? Give feedback.
All reactions