thx, working like a charme here with 24x hue dimmer switches and set homeassistant_legacy_triggers: false.
Will migrate over my 24x hue dimmer switches to your blueprint.
So Z2M 2.0.0 can come for me…
P.S.: Also my feelings are like yours, the reaction is slightly faster.
Thank you for your contribution. I’ll make sure to update the blueprint before Z2M 2.0 release. I’m a bit hesitant to do so right now as I have several different third-party blueprints that will likely break, so it would take quite some time updating them all.
@JetSerge if you use my proposed approach (with MQTT topic), then it will work already with < 1.42 Z2M version. You should be able to test it immediately. The event type from within Z2M will come after 2.0.0, but I think we shall wait for Z2M to become stable in the event aspect, since there is a warning that somethings may change.
MQTT topic approach is being used with the Hue Tap switch since a while. I use one Blueprint from the link below:
However, already in tap dial automation I come across warning messages in the HA log after a restart when I deactivate (in preparation for zigbee2mqtt 2.0) the homeassistant legacy_triggers in z2m. For example:
Template variable warning: 'dict object' has no attribute 'action' when rendering '{{ trigger.payload_json.action is match('^button_[1-4]_press$') }}'
Template variable warning: 'dict object' has no attribute 'action' when rendering '{{ trigger.payload_json.action is match('button_[1-4]_press_release') and states(counter_var) > '1' }}'
Template variable warning: 'dict object' has no attribute 'action' when rendering '{{ trigger.payload_json.action is match('button_[1-4]_press_release') }}'
Template variable warning: 'dict object' has no attribute 'action' when rendering '{{ states(input_text_var) == '3' and trigger.payload_json.action is match('^dial_rotate_') }}'
It affects all template lines that contain trigger.payload_json.action
Thank you for your answer. I think I have to describe it a little more precisely, because the automations work. So when I press a button, action is also published.
The warning messages in the HA Log only appear after a restart or full restart of HA. Probably because during the evaluation of the automations, the zigbee device (Tap Dial or dimmer) has not yet sent a topic, or zigbee2mqtt is not yet fully loaded at this time. Maybe something needs to be added to the templates to prevent this?
I have the same zigbee2mqtt configuration as you, except for the experimental event entities.
Thank you for your support. Unfortunately, I won’t be able to try it out for a few days. I’ll come back and report if it works.
Edit: @tilz0R
I was able to test it and it looks very good. I did several reboots and also a full reboot:
No more warnings appear in the log! Thank you very much for your support and have a nice weekend.
Thank you for your solution. Has anybody gotten a blueprint that works with the event entity instead though? I am hoping to not create additional event helper entities if it’s not necessary.
It doesn’t seem to work with Z2M 2 so I’ve checked the legacy option and it seems to work again. Do we know when the Blueprint will be updated to support it?
Also, is it possible to append the version number of the Blueprint to the name so it’s easy to work out whether we need to reimport to get the latest changes?