Hi all, I’m having a look at MQTT device triggers as it seems it is the recommended way to deal with button click according to zigbee2mqtt docs
However, the trigger requires parameters that encodes also the action (discovery_id and subtype). This complicates the creation of automation (at least for what I’ve been able to see): I was planning to use a condition on those parameters but it seems not doable. Is there any design choice that requires those fields to be required? I looked at the code (core/homeassistant/components/mqtt/device_trigger.py) but I’m not able to see why they are required
Hi @fabio.coatti
Did you find an answer to this?
Fast forward one year and the docs are still not really clear about this.
Currently I’m using the Via MQTT in my automations and I can’t seem to think it doesn’t get more simple than this.
alias: Turn on lights
trigger:
- platform: mqtt
topic: zigbee2mqtt/Kitchenswitch/action
payload: press_1
Perhaps it has to do with the speed and reliability of the messages? When using the device trigger, the reaction is perhaps almost instant whereas using MQTT there’s a slight delay?
Perhaps @Koenkk can elaborate?