dresden-elektronik / deconz-rest-plugin

deCONZ REST-API plugin to control ZigBee devices
BSD 3-Clause "New" or "Revised" License
1.9k stars 498 forks source link

Support Fire Angel Zigbee Module (P-LINE) #7941

Open ebaauw opened 3 days ago

ebaauw commented 3 days ago

This PR does two things:

  1. Expose the Zone Type attribute 0x0001 of IAS Zone cluster 0x0500 for matchexpr, cf. the work done in #7642 for OTA File Version;
  2. Add support for the Fire Angel Smoke Alarm (ST-630-DET) and Carbon Monoxide Alarm (ZBCO-AE-10X-EUR) equipped with the Fire Angel Zigbee Module (P-LINE), see #7938, #6111, #6545.

Ad 1) I changed the following:

Note that I didn't add a hook to reload the DDF when 0x0500/0x0001 is read (and changes value), due to the recent issues with the API ignoring messages from devices after DDFs are re-initialised.

Ad 2) I added DDFs for:

Note the Zigbee module can also be installed in heat alarms, but I don't know what Zone Type these use. Could very well be Fire sensor. On initial pairing, you should get a ZHAAlarm sensors resource; after reading IAS Zone and restarting deCONZ, this changes to a ZHAFire or ZHACarbonMonoxide.

{
  "config": {
    "battery": 91,
    "on": true,
    "pending": [],
    "reachable": true
  },
  "ep": 1,
  "etag": "d790c79357ddb6e33be69053fb9ca957",
  "lastannounced": null,
  "lastseen": "2024-09-25T09:17Z",
  "manufacturername": "Fireangel",
  "modelid": "Alarm_SD_Device",
  "name": "Smoke Alarm",
  "state": {
    "fire": false,
    "lastupdated": "2024-09-25T09:17:22.956",
    "lowbattery": false,
    "tampered": false,
    "test": false
  },
  "swversion": "3.1.8.14",
  "type": "ZHAFire",
  "uniqueid": "00:15:5f:00:dc:c8:ea:77-01-0500"
}

The only differences between the different devices are the type (ZHAAlarm, ZHAFire, ZHACarbonMonoxide) and the state attribute for an alarm (alarm, fire, carbonmonoxide). I'm polling the alarm every 5 minutes for the Zone State, as the module doesn't support Supervision Reports nor attribute reporting for this attribute. This should keep state/lastupdated fairly current, but I need to assess the impact on battey usage. state/tampered is set shortly after the smoke alarm is removed from it's base plate. It takes a couple of seconds before the Zone Status Change Notification is sent. [Note to self: check if CO alarm also supports this]. state/test briefly switches to true when pressing the device button, activating a self-test (cover your ears!). The Zigbee module only reports voltage if its (user replaceable) battery. This should be reported every 12 hours out of the box. config/battery extrapolates the voltage linearly from documented range of 1.9V ... 3.0V to 0% ... 100%. Note that there's no indication for the internal, non-replaceable battery of the sensor. swversion reports the firmware version of the Zigbee module, based on the File Version of the OTAU cluster.

Additionally, there's a Warning Device lights resource.

{
  "capabilities": {
    "alerts": [
      "none",
      "select",
      "lselect"
    ]
  },
  "etag": "4d11a9ea58d1d06dffb73e74c989685f",
  "hascolor": false,
  "lastannounced": null,
  "lastseen": "2024-09-25T09:17Z",
  "manufacturername": "Fireangel",
  "modelid": "Alarm_SD_Device",
  "name": "Smoke Alarm",
  "state": {
    "alert": "none",
    "reachable": true
  },
  "swversion": "3.1.8.14",
  "type": "Warning device",
  "uniqueid": "00:15:5f:00:dc:c8:ea:77-01"
}

state/alert can be used to activate the siren (cover your ears!). Note the module only supports Sqawk, so you only get a short alarm.

github-actions[bot] commented 3 days ago

Hey @ebaauw, thanks for your pull request!

[!TIP] Modified bundles can be downloaded here. Relative expire date

DDB changes

Modified

Validation

[!TIP] Everything is fine !

:clock3: Updated for commit f3e15a19ea3463bbc3c2351b3aa3ede74e2507d4