ZA03 sirene in automation - help needed

Hi,

I recently added a tuya ZA03 into HA over Z2M. I’m struggling how to use the device over an automation :frowning:

The details (volumne, ring tone & duration) are working over the Z2M page. How should I use them in a automation?

My issue: Sometimes it does what I configured. Sometimes not. For example, I added a ringtone 4, sometimes it uses that, sometimes the old value I have. How I’m supposed to send the data?

Currently the yml looks like this:

actions:
  - sequence:
      - device_id: 99958591d17f7ad5f496bd248995919b
        domain: number
        entity_id: ce048f199ad274a6415abed20a629853
        type: set_value
        value: 1
      - device_id: 99958591d17f7ad5f496bd248995919b
        domain: select
        entity_id: 064f314948fa208a04aa0b7f9823a363
        type: select_option
        option: ringtone 3
      - device_id: 99958591d17f7ad5f496bd248995919b
        domain: select
        entity_id: 8e9863b65a0e8a1b5907396f54e70a60
        type: select_option
        option: low
      - type: turn_on
        device_id: 99958591d17f7ad5f496bd248995919b
        entity_id: 84e3a7d98847d799971770ce255c7ff0
        domain: switch

I did everything via UX - as a sequence. I guess I need to send the full payload just once with all the parameters right? How can I do that?

Device: Tuya ZA03 control via MQTT | Zigbee2MQTT

Hi, welcome to the forum!

Have a look at this: Why and how to avoid device_ids in automations and scripts
Are the entities exposed in HA?

Yes thanks - got it. But i highly doubt its related to my issue - as mentioned it is basically working. It just ignores some of my /sets…

Meanwhile, i’m playing around by sending the payload directly:

I do see the call in the log. However, it doesnt respect my duration.

I think its how the integration works, somehow. Triggering the stuff from Z2M:

`z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/2_office_sirene',
 payload 
'{"alarm":"OFF","duration":4,"last_seen":"2024-11-04T13:40:04+01:00","linkquality":252,"ringtone":"ringtone
 2","volume":"low"}'`
`z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/2_office_sirene',
 payload 
'{"alarm":"ON","duration":null,"last_seen":"2024-11-04T13:32:28+01:00","linkquality":255,"ringtone":"ringtone
 2","volume":"low"}'`

It basically first sends the duraction in an OFF state and setting the value. After that, it will activate the state but with a duration of null. If i’m sending the duration together with the ON it wont work.

Probably something’s odd in Z2M but considering this I’ll just send a first payload with OFF and the parameters, followed by the ON call.

That link about device_id’s was just as info.
Switching devices from one state to another can be an issue which might be solved by adding a small delay in between those actions.

I think its more some kind of bug…

Have a look at this automation:

Triggered and checked the logs:

No idea whats going on and how mq2tt ends up with a wrong payload :frowning: