I’m playing around with pyscript to bulk modify values on all my devices easily. At the moment I’m trying to switch the default_all_led_off_color on my inovelli switches. I managed to get a Pyscript going that runs through all states, finds the right ones and set the value. However, these values are not reflected on the device. I think that I need to call the Zigbee Home Automation: Set zigbee cluster attribute service but that’s super cumbersome, specially since I don’t seem to be able to get the Device ID from the state…
Any ideas what I could do solve this? Is there a way to run the service automatically when a state changes?
You can’t tell a Zigbee device that it has a different value than what it is telling you. The change state Python script is a kludge that temporarily fools HA with a new value until it is refreshed by the integration.
It might help if you explain what you are trying to do because it sounds like you are doing everything opposite to how HA is designed. You’ll only end up frustrated and disappointed if you continue going down that path.
I’m trying to get a script that can bulk modify values on switches. Basically I want them to all behave the same way and I don’t want to have to do this on every switch manually, doing it that way is such a legendary pain! In my example above, I want to change the LED color for all 20 or so switches in my house in a single click.
I figured that state.set was the method that the ZHA UI used but I guess not…
Do you know how to change the LED for a single switch using an action within HA? (Not using pyscript.)
The native way within HA to target multiple entities would be to use areas, labels, templates, or some combination of the 3.
If you can share the YAML code for how to change a single switch’s LED it should be easy to modify that code so it works for all your switches.
If it were me, I’d create a label for those switches (something simple like “Inovelli Light Switches”), add that label to every switch entity, and then send your zwave parameter command to those devices with the {{ label_entities('inovelli_light_switches') }} template