I have a siren (Neo NAS-AB02B2 control via MQTT | Zigbee2MQTT) that im trying to implement in my alarm setup;
from the Zigbee2MQTT panel everything is ok (i’m able to trigger the siren, change volume, melody and so on)
Now im adding it to a script, for example i need to play a certain melody at a certain volume, so i added a sequence of MQTT publish like:
alias: Sirena Countdown
sequence:
- service: mqtt.publish
data:
qos: "2"
payload: "{\"volume\": \"low\"}"
topic: zigbee2mqtt/Sirena/set
enabled: true
- service: mqtt.publish
data:
qos: "2"
payload: "{\"melody\": 8}"
topic: zigbee2mqtt/Sirena/set
enabled: true
- service: mqtt.publish
data:
qos: "2"
payload: "{\"alarm\": true}"
topic: zigbee2mqtt/Sirena/set
enabled: true
mode: single
icon: mdi:bullhorn
but it looks like that the MQTT publish sometimes are not in the order i (for example it plays before changing melody) or skipped (for example the two first command are sent, the last one is not)
i also tried using the device, something like:
alias: Sirena Countdown
sequence:
- device_id: 4533564bc2a0622ddc4733cdea313035
domain: select
entity_id: select.sirena_volume
type: select_option
option: low
- device_id: 4533564bc2a0622ddc4733cdea313035
domain: select
entity_id: select.sirena_melody
type: select_option
option: "9"
- type: turn_on
device_id: 4533564bc2a0622ddc4733cdea313035
entity_id: switch.sirena_alarm
domain: switch
mode: single
icon: mdi:bullhorn
but still sometimes the sequence fail, is there a way to get a more “reliable” situation using mqtt?