Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
12.06k stars 1.67k forks source link

Heiman HS2WD-E siren not really compatible ? #14424

Closed marcgtp closed 1 year ago

marcgtp commented 2 years ago

What happened?

The siren device from Heiman (HS2WD-E) doesn't work properly. There was already exchanges on this topic but it seems that the problem is not solved.

The problem is that, when sending MQTT commands like '{"warning":{"duration":2,"level":"low","mode":"burglar","strobe":true,"strobe_duty_cycle":1,"strobe_level":"low"}}', all parameters are ignored except:

All relative to strobe is not taken into account. There is no information coming back via MQTT giving the state of the siren.

The same behavior is observed when using the Front-end and this device doesn't appear on the dashboard.

Is there a way to solve this issue ?

What did you expect to happen?

I expect a normal behavior with all parameters taken into account when sending commands.

How to reproduce it (minimal and precise)

It is the observed behavior when just adding this device in the network.

Zigbee2MQTT version

1.28.0

Adapter firmware version

20220219

Adapter

SONOFF Zigbee 3.0 USB Dongle Plus

Debug log

debug 2022-10-10 12:42:15Succesfully pinged 'Si_Heiman_1' (attempt 1/2) debug 2022-10-10 12:42:31Saving state to file /opt/zigbee2mqtt/data/state.json debug 2022-10-10 12:44:58Received MQTT message on 'zigbee2mqtt_1/Si_Heiman_1/set' with data '{"warning":{"duration":2,"level":"low","mode":"burglar","strobe":true,"strobe_duty_cycle":1,"strobe_level":"low"}}' debug 2022-10-10 12:44:58Publishing 'set' 'warning' to 'Si_Heiman_1' debug 2022-10-10 12:47:31Saving state to file /opt/zigbee2mqtt/data/state.json debug 2022-10-10 12:50:47Received Zigbee message from 'Le_Tuya_1', type 'readResponse', cluster 'genBasic', data '{"zclVersion":3}' from endpoint 1 with groupID 0 debug 2022-10-10 12:50:47Succesfully pinged 'Le_Tuya_1' (attempt 1/2) debug 2022-10-10 12:52:16Received Zigbee message from 'Si_Heiman_1', type 'readResponse', cluster 'genBasic', data '{"zclVersion":3}' from endpoint 1 with groupID 0 debug 2022-10-10 12:52:16Succesfully pinged 'Si_Heiman_1' (attempt 1/2) debug 2022-10-10 12:52:31Received Zigbee message from 'Si_Heiman_1', type 'attributeReport', cluster 'genPowerCfg', data '{"batteryPercentageRemaining":200}' from endpoint 1 with groupID 0 info 2022-10-10 12:52:31MQTT publish: topic 'zigbee2mqtt_1/Si_Heiman_1', payload '{"battery":100,"linkquality":43}' debug 2022-10-10 12:52:31Received Zigbee message from 'Si_Heiman_1', type 'commandStatusChangeNotification', cluster 'ssIasZone', data '{"extendedstatus":0,"zonestatus":16}' from endpoint 1 with groupID 0 debug 2022-10-10 12:52:31No converter available for 'HS2WD-E' with cluster 'ssIasZone' and type 'commandStatusChangeNotification' and data '{"extendedstatus":0,"zonestatus":16}' debug 2022-10-10 12:52:31Saving state to file /opt/zigbee2mqtt/data/state.json debug 2022-10-10 12:57:31Saving state to file /opt/zigbee2mqtt/data/state.json

marcgtp commented 2 years ago

In fact, after investigating on this device, the reason for limited control is that this siren doesn't have all functions as described in the "Zigbee2MQTT Devices information". The only controls are the mode (On-Off), the strobe (On-Off) and the duration. The warning (composite) is not exposed as it doesn't exist. The remaining question is: Why nothing is exposed except LinkQuality ?

Maybe the Zigbee2MQTT-Devices information should be updated ?

vincentBesseau commented 1 year ago

Hi, How do you turn the alarm on or off using MQTT? In my case the alarm does not even react image image image

can you explain me what happened ?

marcgtp commented 1 year ago

Hi,

I control the siren by using:

In all the cases there is nothing exposed in return.

vincentBesseau commented 1 year ago
by using my own automation system based on Mosquito and Python MQTT Client (Paho MQTT) for zigbee devices.
in this case the payload is {"warning": {"duration": 5, "strobe": true,"mode": "emergency"}}
(I observe no effect from strobe attribute)

But you have à sound from siren ? For me, there no sound and strobe ..

marcgtp commented 1 year ago

Yes, I have the sound (probably corresponding to very high level) during the right duration. However, the strobe doesn't work.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

marcgtp commented 1 year ago

It seems that this topic doesn't generate high interest. I would propose, at least, to update the z2m information page in order to make the potential user aware that the functionality is very limited. Is it acceptable ? If yes how to do it ?

ASNNetworks commented 1 year ago

I have this device for a year now. Indeed, nothing is exposed to Home Assistant sadly. However, you can use it fine with mqtt calls through HA automation and Node-RED. You could also create an input_boolean helper that sends the alarm state through mqtt when turned on and send the off state when input_boolean turned off.

These are my payloads with Node-RED and call-service node with mqtt and publish.

Turning on with duration:

{
    "topic": "zigbee2mqtt/Woonkamer Sirene/set",
    "payload": "{\"warning\": {\"duration\": 120, \"mode\": \"burglar\", \"level\": \"very_high\", \"strobe\": true}}"
}

Stopping alarm:

{
    "topic": "zigbee2mqtt/Woonkamer Sirene/set",
    "payload": "{\"warning\": {\"duration\": 5, \"mode\": \"stop\", \"level\": \"low\", \"strobe\": true}}"
}
marcgtp commented 1 year ago

This is what I do with a different mqtt client. The only parameters taken into account are:

All the other parameters are ignored ("level" and "strobe")

Do you observe the same ?

ASNNetworks commented 1 year ago

This is what I do with a different mqtt client. The only parameters taken into account are:

  • mode:
    • all except "stop" leads to siren ON with the same "melody"
    • "stop" leads to siren stop
  • duration

All the other parameters are ignored ("level" and "strobe")

Do you observe the same ?

Yes correct, I basically all it does is either send a fixed alarm sound with a predefined duration, or stop it.

fehgab commented 1 year ago

With ZHA the duration is working correctly, however I can not change the volume level and only one melody is available.

device firmware: 2020.8.20 (attribute: date_code)

action:

luixal commented 1 year ago

Same problem in my case.

Really annoying as I bought this siren instead of a cheaper one because of z2m support shown in docs.

Just have a look and, to make it quite strange, this device is referenced in some testing code:

it('HS2WD-E emergency warning', async () => {
        const endpoint = zigbeeHerdsman.devices.HS2WD.getEndpoint(1);
        const payload = {warning: {duration: 10, mode: 'emergency', strobe: false, level: 'very_high'}};
        await MQTT.events.message('zigbee2mqtt/siren/set', stringify(payload));
        await flushPromises();
        expect(endpoint.command).toHaveBeenCalledTimes(1);
        expect(endpoint.command).toHaveBeenCalledWith("ssIasWd", "startWarning", {"startwarninginfo": 51, "warningduration": 10, "strobedutycycle": 0, "strobelevel": 1}, {disableDefaultResponse: true});
    });

    it('HS2WD-E emergency without level', async () => {
        const endpoint = zigbeeHerdsman.devices.HS2WD.getEndpoint(1);
        const payload = {warning: {duration: 10, mode: 'emergency', strobe: false}};
        await MQTT.events.message('zigbee2mqtt/siren/set', stringify(payload));
        await flushPromises();
        expect(endpoint.command).toHaveBeenCalledTimes(1);
        expect(endpoint.command).toHaveBeenCalledWith("ssIasWd", "startWarning", {"startwarninginfo": 49, "warningduration": 10, "strobedutycycle": 0, "strobelevel": 1}, {disableDefaultResponse: true});
    });

    it('HS2WD-E wrong payload (should use defaults)', async () => {
        const endpoint = zigbeeHerdsman.devices.HS2WD.getEndpoint(1);
        const payload = {warning: 'wrong'};
        await MQTT.events.message('zigbee2mqtt/siren/set', stringify(payload));
        await flushPromises();
        expect(endpoint.command).toHaveBeenCalledTimes(1);
        expect(endpoint.command).toHaveBeenCalledWith("ssIasWd", "startWarning", {"startwarninginfo": 53, "warningduration": 10, "strobedutycycle": 0, "strobelevel": 1}, {disableDefaultResponse: true});
    });

Maybe someone is working on this or at least the error is showing up when running tests.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

onedr0p commented 1 year ago

Not stale.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

onedr0p commented 1 year ago

Not stale.

J-Bot87 commented 1 year ago

Same for me ! Level don't work 🙄

marcgtp commented 1 year ago

I tried again with the last versions of z2m (1.30.3) and adapter firmware (zStack3x0 - 20221226) and the behaviour is the same. In summary, this device proposes only On-Off capability (one melody and one level) without exposing any parameters except battery and link quality. Personally, I am not able, at the moment, to modify converters so, if this topic has quite low interest I think we should modify the documentation by adding a note on this problem, this would help before bying this device.

Vanntag commented 1 year ago

Hello, i have the same issue. Thank you for this informations. I get this siren because in Z2M documentation, it was possible to set the level sound or melody. Hope, i can send it back….

chicknlil commented 1 year ago

The lack of official response to this issue is disheartening.

Koenkk commented 1 year ago

My expectation is that the siren does not implement all the features, can anyone test it with the original gateway?

marcgtp commented 1 year ago

You are right. As I explained in the discussion, after investigation with the seller, this siren has only sound On-Off, strobe On-Off and duration capabilities. The remaining problems are:

Koenkk commented 1 year ago

If it indeed supports strobe, then it should be able to be activated through a certain mode, did you play with different paramter values and check what happend? If no combination triggers the strobe someone should sniff the traffic with the original gateway such that we can reverse engineer the command that has to be send.

marcgtp commented 1 year ago

I tried several combinations and I succeeded to switch On the strobe by adding "strobe_duty_cycle" on the payload. Instead of {"warning": {"duration": 5, "mode": "emergency", "strobe": true}} the payload should be: {"warning": {"duration": 5, "mode": "emergency", "strobe": true, "strobe_duty_cycle": 1}}

The duty cycle default value seems to lead to infinite time where the strobe is Off !

However, whatever the value for strobe_duty-cycle, the blinking period is 1 second ... but it is better than nothing ! The exposed parameters are still limited to battery and linkquality

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

cesarvoggithub commented 1 year ago

not stale

Mackile commented 1 year ago

Any news ?

solarmill commented 1 year ago

still not working. I made a script to send direct commands, but noticed that since my Z2M converter is not properly addressing it that it doesn't show up properly in MQTT explorer, which made hacking a bit more difficult.

The below script for home assistant will make the device "chirp." It sends an on command, wait for 120ms, then send an off command. Since sometimes the messages get missed, there's another brief delay followed by another off. As noted in another thread, the on payload must include strobe_duty_cycle or it will not fire.

alias: Heiman Chirp
sequence:
  - service: mqtt.publish
    data:
      retain: false
      payload: >-
        {"warning": {"duration": 1, "mode": "emergency", "level": "low",
        "strobe": true, "strobe_duty_cycle": 1}}
      topic: zigbee2mqtt/0x000d6f0014f82293/set
  - delay:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 150
  - service: mqtt.publish
    data:
      retain: false
      topic: zigbee2mqtt/0x000d6f0014f82293/set
      payload: "{\"warning\": {\"mode\": \"stop\", \"strobe\": false}}"
      qos: "0"
  - delay:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 30
  - service: mqtt.publish
    data:
      retain: false
      topic: zigbee2mqtt/0x000d6f0014f82293/set
      payload: "{\"warning\": {\"mode\": \"stop\", \"strobe\": false}}"
      qos: "0"
sesardelaisla commented 1 year ago

Any way to light the strobe without the siren sound? I would like to do some sort of light “chirp” (blink) but with no sound.

solarmill commented 1 year ago

Yes, this is trivial to do. Just change the payload sent in MQTT.

🔊 with sound but no strobe:

{"warning": {"duration": 1, "mode": "emergency", "level": "low", "strobe": false, "strobe_duty_cycle": 5}}

🚨with strobe but no sound:

{"warning": {"duration": 1, "mode": "off", "level": "low", "strobe": true, "strobe_duty_cycle": 5}}

the variables of duration and _strobe_dutycycle will be useful to adjust the effect. The duty cycle determines amount of time the light is on or off out of a second.

"10" is on the entire duration. "8" is on for 0.8 seconds and off for 0.2s.

"5" will be on for 50% of the time and off for 50% of the time. Extend the duration and you have a steady on/off pulsing light.

{"warning": {"duration": 8, "mode": "off", "level": "low", "strobe": true, "strobe_duty_cycle": 5}}

Shorten the duration to the minimum (1s) and lower the _strobe_dutycycle to "1" and you get a nice blink that is 100ms long.

{"warning": {"duration": 1, "mode": "off", "level": "low", "strobe": true, "strobe_duty_cycle": 1}}

You can't make it blink faster or slower, all you can do is adjust the on/off ratio. The frequency is fixed at 1Hz (one cycle per second).

When I use this device for an audible chip an entire second is way too much and there's no way to control the duty cycle or level of the siren, so I quickly (150ms) follow up with another payload to turn it off so it doesn't complete the otherwise minimum 1s cycle. If you're using it to flash the light, there's less need for that, especially since you can control the duty cycle. The only reason I can see to send an interrupting off payload is if for some reason you wanted a blink less than 0.1s, but this method of double-tap payloads is not consistent and sometimes the effect is a little longer than expected so I'd keep it simple and just use the single payload with duty_cycle giving consistent results in 100ms increments.

Overall this little device is so close to being useful but disappointing. The sound levels don't work and it has no other tone or chirp options built in. It could have been a really useful multi-purpose sound and light effect, from doorbells to alarms, but instead we have to use workarounds to get anything more than a crap-your-pants siren out of it.

Any way to light the strobe without the siren sound? I would like to do some sort of light “chirp” (blink) but with no sound.

sesardelaisla commented 1 year ago

Hey! Thank you so much! Works like a charm. And also thank you very much for your detailed explanation. It is clear what the parameters do.

I do agree that it is a pity that this device has not a better Zigbee implementation. Sound is pretty loud and light is enough for the purpose. However, firmware is not very fine tuned so it is a bit challenging to perform very simple tasks.

fredericf73 commented 1 year ago

Yes, this is trivial to do. Just change the payload sent in MQTT.

🔊 with sound but no strobe:

{"warning": {"duration": 1, "mode": "emergency", "level": "low", "strobe": false, "strobe_duty_cycle": 5}}

🚨with strobe but no sound:

{"warning": {"duration": 1, "mode": "off", "level": "low", "strobe": true, "strobe_duty_cycle": 5}}

the variables of duration and _strobe_dutycycle will be useful to adjust the effect. The duty cycle determines amount of time the light is on or off out of a second.

"10" is on the entire duration. "8" is on for 0.8 seconds and off for 0.2s.

"5" will be on for 50% of the time and off for 50% of the time. Extend the duration and you have a steady on/off pulsing light.

{"warning": {"duration": 8, "mode": "off", "level": "low", "strobe": true, "strobe_duty_cycle": 5}}

Shorten the duration to the minimum (1s) and lower the _strobe_dutycycle to "1" and you get a nice blink that is 100ms long.

{"warning": {"duration": 1, "mode": "off", "level": "low", "strobe": true, "strobe_duty_cycle": 1}}

You can't make it blink faster or slower, all you can do is adjust the on/off ratio. The frequency is fixed at 1Hz (one cycle per second).

When I use this device for an audible chip an entire second is way too much and there's no way to control the duty cycle or level of the siren, so I quickly (150ms) follow up with another payload to turn it off so it doesn't complete the otherwise minimum 1s cycle. If you're using it to flash the light, there's less need for that, especially since you can control the duty cycle. The only reason I can see to send an interrupting off payload is if for some reason you wanted a blink less than 0.1s, but this method of double-tap payloads is not consistent and sometimes the effect is a little longer than expected so I'd keep it simple and just use the single payload with duty_cycle giving consistent results in 100ms increments.

Overall this little device is so close to being useful but disappointing. The sound levels don't work and it has no other tone or chirp options built in. It could have been a really useful multi-purpose sound and light effect, from doorbells to alarms, but instead we have to use workarounds to get anything more than a crap-your-pants siren out of it.

Any way to light the strobe without the siren sound? I would like to do some sort of light “chirp” (blink) but with no sound.

I'm trying to do the same thing.

Can you please tell me how can i achieve using zigbee2mqtt? I use HomeSeer

marcgtp commented 1 year ago

I am not sure to well understand the question. Zigbe2mqtt is a way to interface zigbee using mqtt protocol. So you need an active server (message broker), like Mosquitto, and a mqtt client to be able to send and receive data using mqtt protocol. If you want to do the same, the payloads to be sent are described above. I don't know the zigbee devices interface with HomeSeer.

marcgtp commented 1 year ago

I think we can close this issue. The problems remain (limited interest for investigations ?) but at least we know better the limits of this device.

In summary:

The typical payload to be sent is: {"warning": {"duration": 1, "mode": "emergency", "strobe": true, "strobe_duty_cycle": 5}}

What we can control:

What we cannot control:

In conclusion

solarmill commented 1 year ago

I concur. Excellent summarization @marcgtp

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

SamuelCarson commented 9 months ago

not stale

ttrueten commented 8 months ago

not stale

orcad-fr commented 7 months ago

not stale

gvillo commented 7 months ago

this is not stale

ginkel commented 7 months ago

I also just got the HS2WD-E and hit the limitations documented in this issue. I'd be willing to sniff the traffic with the original gateway (that I would have to order first), but am wondering how I'd figure out the network key. Any ideas?

LMQTLV commented 7 months ago

Hello I got 3, none of them are able to work with Z2M :-( Two are in version "18 | 2018-03-21" and the third is "23 | 2021-02-19".

ginkel commented 7 months ago

Hello I got 3, none of them are able to work with Z2M :-( Two are in version "18 | 2018-03-21" and the third is "23 | 2021-02-19".

Did you press the recessed button to start pairing?

LMQTLV commented 7 months ago

Hello I got 3, none of them are able to work with Z2M :-( Two are in version "18 | 2018-03-21" and the third is "23 | 2021-02-19".

Did you press the recessed button to start pairing?

sorry, I expressed myself badly: they are well paired, but I meant that they do not respond to commands, like the other people on this topic

nimrodolev commented 6 months ago

Question for the entire audience here - did any of you ever try running the siren for more than 60 seconds and have it work?

I have one and it seems no matter how long I set the duration, the siren stops after a minute of sounding the alarm, and I'm wondering if it might be a common issue that people just didn't notice because it's freaking loud and people just turn it off quickly...

Wrap it on a big sweatshirt so it's not crazy loud, and hit it with 3 minutes of alarm sound - does it work for you for more than a minute? Is it just mine that's behaving like that?

@ginkel @solarmill, etc.

marcgtp commented 6 months ago

Up to now I didn't observe such problem but with a value lower than 1mn. I will try.

gvillo commented 6 months ago

I ran the siren for 300 seconds and it worked correctly (set up in Z2M). I am facing the same lack of features that everyone here. No melody/volume/sensors.

ginkel commented 5 months ago

I got in touch with Heiman regarding the inability to control sound and volume and they requested a pcap of the Zigbee traffic when activating the alarm. I'll keep you posted...

LouisAugry commented 4 months ago

Hello ! Any news ?

I have another problem with the Alarm. When I reboot Z2M server the alarm ring for 1s, do you have the same thing ?

J-Bot87 commented 4 months ago

Hello ! Any news ?

I have another problem with the Alarm. When I reboot Z2M server the alarm ring for 1s, do you have the same thing ?

Not on my side ! 🙂‍↔️