I have several z-wave dimmer switches, and I have always found it mildly frustrating that when I toggle one of them on, the switch in the UI doesn’t immediately stay on. My assumption has been that the dimmer doesn’t report its new value right away to my z-wave hub. The behavior is this - I toggle the switch on in the UI; it immediately turns off (although the light itself goes on); and after some significant delay, the switch in the UI goes back on to reflect the actual state of the light.
Even worse, if I ask an Echo device to turn one of my lights on, Alexa reports that my device is not responding (even though the light does turn on).
Here’s my solution - a simple automation that asks zwave-js to immediately refresh the light’s value as soon as it is turned on. It’s so simple that I’m surprised this isn’t default behavior. I would love to know if I’m actually missing something, and a configuration tweak would take care of this.
The only downside I’ve found is that this also triggers on non-z-wave lights, which creates an error in your log. No biggie, but I can’t find a way around it.
It seems to me that your issue should really be fixed in zwave-js. Open an issue.
In the meantime…
The only way around this that I can think of is to create a group containing all your zwave lights, group.your_zwave_lights and check to see in a template condition if trigger.event.data.service_data.entity_id is in the group.
condition:
condition: template
value_template: "{{ trigger.event.data.service_data.entity_id in expand('group.your_zwave_lights') | map(attribute='entity_id') | list }}
@tom_l It’s always been a problem for me; it’s just somewhat worse under zwave-js (and the Echo problem is new).
I don’t think your suggestion works, because I don’t think an automation condition can reference a trigger (the automation isn’t triggered until the condition is evaluated, I believe). In any event, I believe this is why I had problems trying to do what you suggest. However, I was able to do the same thing with the condition as part of automation actions.
In my case, all of my z-wave devices (and none of my others) have “current_value” in their id. So I modified my automation as follows; this works quite well, without any errors: