Heiman HS2WD-E siren: state.alert always remains at "none"

If I make a DDF to use for this device (to try with the DDF core), are you able to put it on your machine ?

I’ve got one of this device, would be please to test a DDF :wink:

No need ^^.
I have finaly see all is normal. state/alert is write only.
So you can use it to send value, to trigger a siren, but you will have no API update and no websocket return.

Is there a way to get the battery state without DDF ?

Arf, right.
Have checked the code, nothing for battery, so need to try with a DDF, and there is some specific code in the legacy code for this device .

But it’s a siren with battery ? The battery can’t stay alive long time …

And as this device is a “light” entry, need to create a ZHABattery to have it …

Yes it’s a siren with a battery backup that can stay alive up to 4 hours (dixit manufacturer).

If you could test the DDF and add what’s required, if anything, that would be brilliant…

Many thanks. But when using DDF editor and looking at the clusters from this device, here is the DDF I propose.But before applying it I wish to have some feedback, especially regarding the bindings part and the fact that I had to add manually ZHAAlarm because there is none of this in DDF editor.

{
  "schema": "devcap1.schema.json",
  "manufacturername": ["Heiman", "HEIMAN"],
  "modelid": ["WarningDevice", "WarningDevice-EF-3.0"],
  "vendor": "Heiman",
  "product": "Smart siren HS2WD-E",
  "sleeper": false,
  "status": "Silver",
  "subdevices": [
    {
      "type": "$TYPE_WARNING_DEVICE",
      "restapi": "/lights",
      "uuid": [
        "$address.ext",
        "0x01"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/alert",
          "default": "none"
        },
        {
          "name": "state/reachable"
        }
      ]
    },
    {
      "type": "$TYPE_BATTERY_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0001"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/battery",
          "refresh.interval": 3600
        },
        {
          "name": "state/lastupdated"
        }
      ]
    },
    {
      "type": "ZHAAlarm",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0500"
      ],
      "fingerprint": {
        "profile": "0x0104",
        "device": "0x0403",
        "endpoint": "0x01",
        "in": [
          "0x0000",
          "0x0001",
          "0x0500"
        ]
      },
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/battery"
        },
        {
          "name": "config/enrolled"
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/pending"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/alarm"
        },
        {
          "name": "state/lastupdated"
        },
        {
          "name": "state/lowbattery"
        }
      ]
    }
  ],
  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0001",
      "report": [
        {
          "at": "0x0021",
          "dt": "0x20",
          "min": 30,
          "max": 120,
          "change": "0x00000001"
        }
      ]
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0500",
      "report": [
        {
          "at": "0x0000",
          "dt": "0x30",
          "min": 0,
          "max": 0
        }
      ]
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0502",
      "report": [
        {
          "at": "0x0000",
          "dt": "0x21",
          "min": 0,
          "max": 0
        }
      ]
    }
  ]
}

Here are the clusters for that device
image


image
image





I had to add manually ZHAAlarm because there is none of this in DDF editor.

Ha yes right, have just added it DDF: Add ZHAAlamr json by Smanar · Pull Request #6397 · dresden-elektronik/deconz-rest-plugin · GitHub

About binding, I m using bigger value for battery, no need too much report.
You have min=max = 0 for the cluster 0x0502
And for the cluster 0x0500, it s special, it realy depend of device. You can completely skip it, some device have native report for this one. The more used is just

    {
      "bind": "unicast",
      "src.ep": 1,
      "dst.ep": 1,
      "cl": "0x0500"
    }

To set a binding but without report.

And some device need to set a report too (I know only 1)

In your PR battery is state/battery but in @Swoop proposed DDF it’s config/battery.
Which one is the appropriate approach ?

Tried this DDF
{ "schema": "devcap1.schema.json", "manufacturername": [ "Heiman", "HEIMAN" ], "modelid": [ "WarningDevice", "WarningDevice-EF-3.0" ], "vendor": "Heiman", "product": "Smart siren HS2WD-E", "sleeper": false, "status": "Silver", "path": "/devices/HS2WD-E.json", "subdevices": [ { "type": "$TYPE_WARNING_DEVICE", "restapi": "/lights", "uuid": [ "$address.ext", "0x01" ], "items": [ { "name": "attr/id" }, { "name": "attr/lastannounced" }, { "name": "attr/lastseen" }, { "name": "attr/manufacturername" }, { "name": "attr/modelid" }, { "name": "attr/name" }, { "name": "attr/swversion" }, { "name": "attr/type" }, { "name": "attr/uniqueid" }, { "name": "state/alert", "default": "none" }, { "name": "state/reachable" } ] }, { "type": "$TYPE_BATTERY_SENSOR", "restapi": "/sensors", "uuid": [ "$address.ext", "0x01", "0x0001" ], "items": [ { "name": "attr/id" }, { "name": "attr/lastannounced" }, { "name": "attr/lastseen" }, { "name": "attr/manufacturername" }, { "name": "attr/modelid" }, { "name": "attr/name" }, { "name": "attr/swversion" }, { "name": "attr/type" }, { "name": "attr/uniqueid" }, { "name": "config/on" }, { "name": "config/reachable" }, { "name": "state/battery", "refresh.interval": 3600 }, { "name": "state/lastupdated" } ] }, { "type": "ZHAAlarm", "restapi": "/sensors", "uuid": [ "$address.ext", "0x01", "0x0500" ], "fingerprint": { "profile": "0x0104", "device": "0x0403", "endpoint": "0x01", "in": [ "0x0000", "0x0001", "0x0500" ] }, "items": [ { "name": "attr/id" }, { "name": "attr/lastannounced" }, { "name": "attr/lastseen" }, { "name": "attr/manufacturername" }, { "name": "attr/modelid" }, { "name": "attr/name" }, { "name": "attr/swversion" }, { "name": "attr/type" }, { "name": "attr/uniqueid" }, { "name": "config/enrolled", "public": false }, { "name": "config/on" }, { "name": "config/pending" }, { "name": "config/reachable" }, { "name": "state/alarm" }, { "name": "state/battery", "refresh.interval": 3600 }, { "name": "state/lastupdated" }, { "name": "state/lowbattery" } ] } ], "bindings": [ { "bind": "unicast", "src.ep": 1, "cl": "0x0001", "report": [ { "at": "0x0021", "dt": "0x20", "min": 60, "max": 360, "change": "0x00000001" } ] }, { "bind": "unicast", "src.ep": 1, "dst.ep": 1, "cl": "0x0500" }, { "bind": "unicast", "src.ep": 1, "cl": "0x0502", "report": [ { "at": "0x0000", "dt": "0x21", "min": 30, "max": 120 } ] } ] }
but could not see new states, even after a hot reload.

{
    "etag": "e606f3d4147b44354c8ce4aee28be9cb",
    "hascolor": false,
    "lastannounced": "2022-09-28T17:40:05Z",
    "lastseen": "2022-10-06T19:05Z",
    "manufacturername": "HEIMAN",
    "modelid": "WarningDevice-EF-3.0",
    "name": "Sirene bureau",
    "state": {
        "alert": "none",
        "reachable": true
    },
    "swversion": "2021.2.19",
    "type": "Warning device",
    "uniqueid": "84:71:27:ff:fe:fe:ab:08-01"
}


After restarting deConz-GUI (by mistake :wink: I got two new sensors Battery
{ "config": { "on": true, "reachable": true }, "etag": "97058d4183cb93728d0d019032448ab0", "lastannounced": null, "lastseen": "2022-10-06T20:30Z", "manufacturername": "HEIMAN", "modelid": "WarningDevice-EF-3.0", "name": "Battery 35", "state": { "battery": 87, "lastupdated": "2022-10-06T20:28:47.671" }, "type": "ZHABattery", "uniqueid": "84:71:27:ff:fe:fe:ab:08-01-0001", "id": "35", "deviceclass": "sensors" } and Alarm

{
  "config": {
    "on": true,
    "pending": [],
    "reachable": true
  },
  "ep": 1,
  "etag": "5cc88be475cb7f8c235990694e49487c",
  "lastannounced": null,
  "lastseen": "2022-10-06T20:30Z",
  "manufacturername": "HEIMAN",
  "modelid": "WarningDevice-EF-3.0",
  "name": "Alarm 36",
  "state": {
    "alarm": null,
    "battery": 87,
    "lastupdated": "2022-10-06T20:28:47.673",
    "lowbattery": null
  },
  "type": "ZHAAlarm",
  "uniqueid": "84:71:27:ff:fe:fe:ab:08-01-0500",
  "id": "36",
  "deviceclass": "sensors"
}

I guess that I can may be delete the $TYPE_BATTERY_SENSOR from the DDF as I got the information in the ZHAAlarm part as a state.

Oups right, have corrected the battery field, thx.

I guess that I can may be delete the $TYPE_BATTERY_SENSOR from the DDF as I got the information in the ZHAAlarm part as a state

Yes, we are using the ZHAbattery for “light” device that have not sensor, but if there is a ZHAAlam, can use this one.

But I have a doubt, this device don’t need enrollement ? And he can’t trigger alarm, so the only usefull field in the ZHAAlarm is the state/tampered ? If yes for me better to use a ZHABattery instead of the ZHAAlarm ?

I’m clearly not familiar with alarm management in Zigbee environment. I used DDF proposed by @Swoop related to issue https://forum.phoscon.de/t/heiman-warningdevice-ef-3-0-siren-no-battery-and-tampered-status/2346 opened by @monpelaud. I just added ZHABattery as a suggestion because the specific cluster 0001 has attributes for that purpose.

Well, correcting it in DDF lead me to another issue. config/battery is set to 0 where state/battery was with a right value

{
  "config": {
    "battery": 0,
    "on": true,
    "pending": [],
    "reachable": true
  },
  "ep": 1,
  "etag": "090140dfffed16e5e1129a711c762381",
  "lastannounced": null,
  "lastseen": "2022-10-07T17:07Z",
  "manufacturername": "HEIMAN",
  "modelid": "WarningDevice-EF-3.0",
  "name": "Sirene bureau alarme",
  "state": {
    "alarm": null,
    "lastupdated": "2022-10-06T21:35:13.264",
    "lowbattery": null
  },
  "type": "ZHAAlarm",
  "uniqueid": "84:71:27:ff:fe:fe:ab:08-01-0500",
  "id": "36",
  "deviceclass": "sensors"
}
{
  "config": {
    "battery": 0,
    "on": true,
    "pending": [],
    "reachable": true
  },
  "ep": 1,
  "etag": "3f0218f94f714dae82c54182ee0143f8",
  "lastannounced": null,
  "lastseen": "2022-10-07T17:13Z",
  "manufacturername": "HEIMAN",
  "modelid": "WarningDevice-EF-3.0",
  "name": "Sirene bureau alarme",
  "state": {
    "alarm": null,
    "battery": 87,
    "lastupdated": "2022-10-07T17:13:21.354",
    "lowbattery": null
  },
  "type": "ZHAAlarm",
  "uniqueid": "84:71:27:ff:fe:fe:ab:08-01-0500",
  "id": "36",
  "deviceclass": "sensors"
}

Try with removing state/battery and using

        {
          "name": "config/battery",
          "refresh.interval": 3600,
          "parse": {
            "at": "0x0021",
            "cl": "0x0001",
            "ep": 1,
            "eval": "Item.val = Attr.val / 2",
            "fn": "zcl"
          }
        },

To force it.

I don’t understand why should I configure the read-only attribute for this device to config/battery as the state/battery also exists and works ?

State/battery is reserved to the sensor ZHABattery.
Light device don’t have “config” but don’t have battery, so we use the ZHABattery for battery covering for exemple.
And sensor use config/battery, never state/battery.

That’s what I initialy did that did not work.
But after changing config/battery by state/battery in the DDF make the item apearing with a value (87 in my example above).

Here is the DDF :

{
  "schema": "devcap1.schema.json",
  "manufacturername": [
    "Heiman",
    "HEIMAN"
  ],
  "modelid": [
    "WarningDevice",
    "WarningDevice-EF-3.0"
  ],
  "vendor": "Heiman",
  "product": "Smart siren HS2WD-E",
  "sleeper": false,
  "status": "Silver",
  "path": "/devices/HS2WD-E.json",
  "subdevices": [
    {
      "type": "$TYPE_WARNING_DEVICE",
      "restapi": "/lights",
      "uuid": [
        "$address.ext",
        "0x01"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/alert",
          "default": "none"
        },
        {
          "name": "state/reachable"
        }
      ]
    },
    {
      "type": "ZHAAlarm",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0500"
      ],
      "fingerprint": {
        "profile": "0x0104",
        "device": "0x0403",
        "endpoint": "0x01",
        "in": [
          "0x0000",
          "0x0001",
          "0x0500"
        ]
      },
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/battery",
          "parse": {
            "at": "0x0021",
            "cl": "0x0001",
            "ep": 1,
            "eval": "Item.val = Attr.val / 2",
            "fn": "zcl"
          },
          "default": 0
        },
        {
          "name": "config/enrolled",
          "public": false
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/pending"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/alarm"
        },
        {
          "name": "state/lastupdated"
        },
        {
          "name": "state/lowbattery"
        }
      ]
    }
  ],
  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0001",
      "report": [
        {
          "at": "0x0021",
          "dt": "0x20",
          "min": 120,
          "max": 3600,
          "change": "0x00000001"
        }
      ]
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "dst.ep": 1,
      "cl": "0x0500"
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0502",
      "report": [
        {
          "at": "0x0000",
          "dt": "0x21",
          "min": 30,
          "max": 120
        }
      ]
    }
  ]
}

and the resulting json :

{
  "config": {
    "battery": 0,
    "on": true,
    "pending": [],
    "reachable": true
  },
  "ep": 1,
  "etag": "712a292a7d2d5d82abd71445319ed49c",
  "lastannounced": null,
  "lastseen": "2022-10-11T16:23Z",
  "manufacturername": "HEIMAN",
  "modelid": "WarningDevice-EF-3.0",
  "name": "Sirene bureau alarme",
  "state": {
    "alarm": null,
    "lastupdated": "2022-10-11T14:46:02.369",
    "lowbattery": null
  },
  "type": "ZHAAlarm",
  "uniqueid": "84:71:27:ff:fe:fe:ab:08-01-0500",
  "id": "36",
  "deviceclass": "sensors"
}

That’s a bit weird because in the log I got the retreiving of the data :

12:42:02:934 50:0b:91:40:00:02:ca:1c-01-0201/config/heatsetpoint expression: Item.val = Attr.val; --> 1800
**12:42:03:434 84:71:27:ff:fe:fe:ab:08-01-0500/config/battery expression: Item.val = Attr.val / 2 --> 86.5**
12:42:04:069 50:0b:91:40:00:02:ca:1c-01-0201/config/heatsetpoint expression: Item.val = Attr.val; --> 1800
**12:42:05:779 84:71:27:ff:fe:fe:ab:08-01-0500/config/battery expression: Item.val = Attr.val / 2 --> 86.5**

Seriously, every day a new problem …
What is your deconz version ?

Just for the fun, can you try using “/ 3” in the DDF instead of using " / 2" to check if the DDF is realy used.
Or removing the “defaut” : 0

No line that set the “0” value just after in logs ?

I guess there is no trouble with the “defaut” : 0 because the value has been updated when the percentage rise from 86.5 to 87.

Tried to put the calculation with /3 instead of /2 and the DDF is used

15:48:40:752 84:71:27:ff:fe:fe:ab:08-01-0500/config/battery expression: Item.val = Attr.val / 3 --> 57.666666666666664

But no value transmitted in the json … it keeps 87

{
  "config": {
    "battery": 87,
    "on": true,
    "pending": [],
    "reachable": true
  },
  "ep": 1,
  "etag": "98b96a8001ec29fd4d389cea0791f31e",
  "lastannounced": null,
  "lastseen": "2022-10-11T19:23Z",
  "manufacturername": "HEIMAN",
  "modelid": "WarningDevice-EF-3.0",
  "name": "Sirene bureau alarme",
  "state": {
    "alarm": null,
    "lastupdated": "2022-10-11T14:46:02.369",
    "lowbattery": null
  },
  "type": "ZHAAlarm",
  "uniqueid": "84:71:27:ff:fe:fe:ab:08-01-0500",
  "id": "36",
  "deviceclass": "sensors"
}

Could it be a rounded issue ? Should this value be an integer to be used ?