Help me find the error of my ways with zigbee2mqtt and entities?

Hello all!

Extremely new to HA and im realizing just how deep this pool I just jumped in is…

So I am attempting to setup my new Heiman HS2WD-E zigbee siren with my new installation of zigbee2mqtt. I have been following the instructions laid out in:

At one point in the article the author mentions to create 3 entities for Alarmo to reference. 2 for basic ON/OFF function and 1 to act as a toggle on the dashboard.

I am attempting to create a script using the YAML editor and inputting

#Turn ON the Heiman Siren Alarm 
alias: Heiman Siren Turn On
sequence:
  - service: mqtt.publish
    data:
      topic: 'zigbee2mqtt/Main level alarm siren/set'
      payload: '{"warning": {"mode": burglar, "level": very_high, "strobe_level": high, "strobe": true, "strobe_duty_cycle": 10, "duration": 1800}}'
mode: single
icon: mdi:alarm-light-off

unfortunately When I try to save this script I get a error of “unable to determine action @ data[‘sequence’][0]”

Could someone please point out what is causing this error and where I can go to read up more about how to trouble shoot it on my own in the future? Like I said, still really new and trying to learn as best as I can, but I feel a bit in over my head to start with.

Thank so much for any help and pointers!

Your siren doesn’t expose entities for those values? My Zigbee siren exposes all its parameters as entities, I just have scripts that set them to the values I want then turn it on. No MQTT required.

No as far as I can tell they don’t seem to expose any entities… I can go into zigbee2mqtt and push a command that turns them on, but I can’t seem to find any other entities populated by the system. I was surprised by this, but again, can’t seem to find any real documentation supporting how it really should be…

Just copy/pasted and got no errors.

Note that your JSON is not valid, though. String values like burglar or very_high should be enclosed between double quotes.

THANK YOU! You solved a error that I didnt know I had. good lord it would have taken me forever to learn that. Turns out my issue was that I was going a bit too far through the script wizard before switching it to YAML… I feel like im gonna be learning for years to try and figure this out. Should probably start learning python beyond the extreme basics.

One last question, I am hoping to use this scrip to fire the same package to multiple sirens. My thinking is to copy the entire block between Sequence and Mode. Like this:

#Turn ON the Heiman Siren Alarm 
alias: Heiman Siren Turn On
sequence:
  - service: mqtt.publish
    data:
      topic: 'zigbee2mqtt/Siren1/set'
      payload: '{"warning": {"mode": "burglar", "level": "very_high", "strobe_level": "high", "strobe": "true", "strobe_duty_cycle": 10, "duration": 1800}}'
sequence:
  - service: mqtt.publish
    data:
      topic: 'zigbee2mqtt/Siren2/set'
      payload: '{"warning": {"mode": "burglar", "level": "very_high", "strobe_level": "high", "strobe": "true", "strobe_duty_cycle": 10, "duration": 1800}}'
mode: single
icon: mdi:alarm-light-off

There must be a more elegant way to format that, correct?

The very first step would probably be to create an MQTT switch inside HA, rather than a plain MQTT publish

Then you could group them once and for all

Note that a siren is an actual entity type in HA, and that you could create MQTT base ones

Problem is that you cannot currently group them.

See Group Helper for Sirens for a feature request

Awesome. Thanks for all the info, Ill start digging through those asap