[Beginner] Heiman smoke detector - start alarm/siren with a command?

Hi guys,

I setup a ‘Heiman ZSDR-850’ smoke detector with Conbee II (2.14.01/6.2.2022; 26720700) on Windows.
The sensor is working fine in openHAB which means smoke is detected and reported by a switch item immediately.

I was now wondering if there is a chance to send e.g. an ‘ON’ command to the ‘fire detected switch’ in order to manually start the alarm (e.g. use the device as alarm siren or link several smoke detectors to each other which means if one detects smoke, all will start their siren)?

In openHAB, smoke detector switches are setup as ‘read-only’. I tried to send ‘ON’ command by a rule, which seems to be working, but the siren did not start at all.

There are several executable alarm options which seem to be interesting in Cluster Info within deCONZ, but no matter what is active, nothing happens when clicking ‘exec’:


Is there any chance to achieve the alarm / siren starting manually with a command?

API:

{
    "config": {
        "battery": 100,
        "enrolled": 1,
        "on": true,
        "pending": [],
        "reachable": true
    },
    "ep": 1,
    "etag": "59c82ed490e536babc63f3fc09f61ff6",
    "lastannounced": null,
    "lastseen": "2022-11-27T11:26Z",
    "manufacturername": "Heiman",
    "modelid": "SmokeSensor-EM",
    "name": "Rauchmelder1",
    "state": {
        "fire": false,
        "lastupdated": "2022-11-12T18:51:38.426",
        "lowbattery": false,
        "tampered": false
    },
    "swversion": "1.1.1",
    "type": "ZHAFire",
    "uniqueid": "bla:blub:-01-0500"
}

Thanks!

1 Like

This device need to create 2 entries, a “ZHAFire” in sensors and a “warning device” in light part.
You haven’t the second one ?

I have a similar device from Heimann. It’s only a Sirene.
Device is only in lights.
Device in sensors is missed.
Which DDF should be in device folder?

{
    "etag": "88cf349afbe35e31cc104d498fcxxxxx",
    "hascolor": false,
    "lastannounced": null,
    "lastseen": "2022-11-27T14:58Z",
    "manufacturername": "HEIMAN",
    "modelid": "WarningDevice-EF-3.0",
    "name": "Wohnzimmer Sirene",
    "state": {
        "alert": "none",
        "reachable": true
    },
    "swversion": "2021.2.19",
    "type": "Warning device",
    "uniqueid": "80:4b:50:ff:fe:1a:4e:xxxxx"
}

Which DDF should be in device folder?

Good question, this device is probably supported only by the legacy code, there is a genreric code for all device starting by “Smoke”.

@Siggi your device is working fine ?

Thanks for the quick response!

No, I do not have warning device but ZHAFire only.
I started the pairing in sensors, should it create both anyway?

The code probably don’t support it totaly, can you try this DDF ?

{
  "schema": "devcap1.schema.json",
  "manufacturername": "Heiman",
  "modelid": "SmokeSensor-EM",
  "vendor": "Heiman",
  "product": "ZSDR-850 smoke detector with siren",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_FIRE_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0500"
      ],
      "fingerprint": {
        "profile": "0x0104",
        "device": "0x0402",
        "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",
          "refresh.interval": 84000,
          "read": {
            "at": "0x8000",
            "cl": "0x0000",
            "ep": 1,
            "mf": "0x1015",
            "fn": "zcl"
          },
          "parse": {
            "at": "0x8000",
            "cl": "0x0000",
            "ep": 1,
            "fn": "zcl",
            "mf": "0x1015",
            "script": "../develco/develco_firmware.js"
          }
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/battery",
          "parse": {
            "at": "0x0020",
            "cl": "0x0001",
            "ep": 1,
            "script": "../develco/develco_battery.js"
          }
        },
        {
          "name": "config/enrolled"
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/pending"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/fire"
        },
        {
          "name": "state/lastupdated"
        },
        {
          "name": "state/lowbattery"
        },
        {
          "name": "state/test"
        }
      ]
    },
    {
      "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",
          "refresh.interval": 84000,
          "read": {
            "at": "0x8000",
            "cl": "0x0000",
            "ep": 1,
            "fn": "zcl",
            "mf": "0x1015"
          },
          "parse": {
            "at": "0x8000",
            "cl": "0x0000",
            "ep": 1,
            "fn": "zcl",
            "mf": "0x1015",
            "script": "../develco/develco_firmware.js"
          }
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/alert"
        },
        {
          "name": "state/reachable"
        }
      ]
    }
  ],
  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0001",
      "report": [
        {
          "at": "0x0020",
          "dt": "0x20",
          "min": 300,
          "max": 43200,
          "change": "0x00000001"
        }
      ]
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0500"
    }
  ]
}

Try to put it in the “devices/heiman” folder, else you will miss the swversion and the battery level, but the device need to work.

Then you can re-include the device.

Remember the device will be not visible in phoscon, to be sure you haven’t it, you can take a look in in phoscon/help/API Information/light

@wosch no, should be checked and possible fixed in DDF

@Smanar yes, and I was wrong.
My Heimann Alarm is ac connected. Then, I think, there is no sensors part.

There is no warning device in API, sorry I did not mention that.

Ok, please double-confirm the required steps as I never did that before:

  1. create a folder “heiman” in devices (not yet available)
  2. create a json (?) which includes above code - what should be the name of the file?
  3. re-include the device, should I just do or remove the existing sensor before?

1- depend of the OS and the folder, you can already have one.
2- yep it’s a text file, called what_you_want.json with this contain
3- you can remove it before the inclusion, will prevent conflict with entry with legacy code and future one with DDF core, generaly a simple re-inclusion is enought, but I have stranges issues ATM, so better to remove the old one.

All DDF provided directly with deCONZ typically reside in /usr/share/deCONZ/devices/ on a Linux system and are loaded first. However, files residing in the home directory of the user running deCONZ (e.g. /home/<DECONZUSER>/.local/share/dresden-elektronik/deCONZ/devices) will override the pre-packaged files to allow users to amend and keep their own files if desired.

For HA How to add/edit a DDF on Home assistant using text editor?

What I did in detail:
created a text file and saved it as “HeimanDDF.json”. Saved the file in a folder ‘Heiman’ in …/Local/deCONZ/devices and …/devices/devices (there are two ‘devices’ folders in Windows). Since the type of the file is still ‘text file’ I also copied an existing json file from another folder re-named it and changed the content to above code in a second step (deleted the text files, copied the json).

After adding the sensor new (both ways, with text file first and later with “real” json-file) there was still no ‘warning device’ in lights in API information but ZHAFire in sensors only.

If I can provide any information which may help to get a hint what may be wrong, please let me know!

Thanks!

Ha ?
IDK for windows, but use the “devices” folder that already contain some DDF deconz-rest-plugin/devices at master · dresden-elektronik/deconz-rest-plugin · GitHub

To be sure it’s the good one. Don’t use both else one will overwrite the second one.

But to test if the DDF is used, just select the node in deconz, and make “edit DDF”, il will open the editor, if you can see the good DDF it’s fine, else we have a problem. You can find in the editor an option “Hot reload” too, usefull.

If the DDF is used, you can enable deconz log, using deconz / help / Debug view, select flag “info” and “ddf” then re-include the device.

Actually, both folders “…/devices” and “…/devices/devices” contain DDFs. I checked xiaomi folders:

“…/devices”:
xiaomiDDF1

“…/devices/devices”:
xiaomiDDF2

Folder “…/devices” contains more sub-folders and it seems also more json files. Anyway, I tried both, now seperately not both together. No matter in which folder the json with above code is stored, “Edit DDF” > “Preview” shows not the correct code! Also Hot reload does not change anything.

P.S.: I deleted the sensor before switching the json file to the other folder and adopted it again.

Hu …
I think there is a problem on the windows install, it s the “user” folder no ? I don’t see officals DDF inside, so you can clean it without danger.

I think the folder “devices” inside the “devices” is useless. If you have same files in both, you can delete one.

I tried both, now seperately not both together. No matter in which folder the json with above code is stored, “Edit DDF” > “Preview” shows not the correct code! Also Hot reload does not change anything

2 things to try:

  • Make “edit DDF” and try to save the auto generated one, you will see the folder used by deconz (and use the same for this one.
  • You can too load a DDF, you can try to load it and see if there is a loading error, but I have checked the json, no error inside.

Can too compare with your device If I haven’t make a typo

  "manufacturername": "Heiman",
  "modelid": "SmokeSensor-EM",

I am on a business trip abroad until end of the week. I will check when I am back.

You are right, it’s within the “user” folder.
Did I get this correctly: there are the options within “edit DDF” to save and load a DDF? I did not see this or at least I do not remember. This way, I should see the correct folder where to copy the json.

Another idea: you mentioned that my Screenshot does not show an official DDF - what’s a file name of an official one which is defintely available? I could also search this file then.

The names are correct, no typo.

Yep, there is, but you can have others issues ^^, it s for that I say (Oups, I forget to say that) to use the defaut folder choose by deconz.

what’s a file name of an official one which is defintely available

I don’t know the windows installation but on others OS , the “devices” folder in “user section” is empty (or contain your own DDF), the second one in the “deconz section” contain thoses one deconz-rest-plugin/devices at master · dresden-elektronik/deconz-rest-plugin · GitHub

But the “user folder” is prioritary on the “deconz folder”. So need to delete the DDF in the first one to use the second one.

Hi @Smanar! Back from Slovakia, I checked the path in “edit DDF” and found out that the correct path is
…/local/dresden-elektronik/deCONZ/devices"
instead of:
…/local/deCONZ/devices"

I was struggling with the dresden-elektronik path since the devices folder is completely empty - no sub-folder, no *.json. However, since I put the DDF file in there, “edit DDF” shows the correct code you provided. In API information, there is now also a “warning device”.

What do I need to do now to manually start the alarm? The exec options in the starting post, are still not working. In openHAB the alarm channel of the warning device is just a String. I guess send a command to it, will lead to no action. Surely there is an binding maintainer which can implement a switch item instead (or additionally), but I am wondering if this will fire the siren as the exec commands in Phoscon do not.

You can test with cURL request to trigger the alarm

curl -X PUT 'http://IP:PORT/api/YOUR_APIKEY/lights/ID/state' --data '{"alert": "lselect"}'

IP and PORT are the same used by phoscon.
ID is the device ID of the warning device (in “light”)

Perhaps need to use { "alert": "lselect", "ontime": 10 }

I tried the above command in several different approaches (with the help of Google regarding the syntax in windows), but no success since I do not know what I am doing - just to be honest:

C:\Users\wosch>curl -X PUT 'http://PHOSCON-IP:8090/api/MY-API/lights/27/state' --data '{ "alert": "lselect", "ontime": 2 }
curl: (3) URL using bad/illegal format or missing URL
curl: (3) URL using bad/illegal format or missing URL
curl: (6) Could not resolve host: lselect,
curl: (3) URL using bad/illegal format or missing URL
curl: (7) Failed to connect to 0.0.0.2 port 80 after 0 ms: Network unreachable
curl: (3) unmatched close brace/bracket in URL position 1:
}
 ^

C:\Users\wosch>curl -X PUT 'http://PHOSCON-IP:8090/api/MY-API/lights/27/state' --data '{"alert": "lselect", "ontime": 2}
curl: (3) URL using bad/illegal format or missing URL
curl: (6) Could not resolve host: lselect,
curl: (3) URL using bad/illegal format or missing URL
curl: (3) unmatched close brace/bracket in URL position 2:
2}
 ^

C:\Users\wosch>curl -X PUT 'http://PHOSCON-IP:8090/api/MY-API/lights/27/state' --data '{"alert": "lselect"}
curl: (3) URL using bad/illegal format or missing URL
curl: (3) unmatched close brace/bracket in URL position 8:
lselect}
       ^

C:\Users\wosch>curl -X PUT --data '{"alert": "lselect", "ontime": 2} http://PHOSCON-IP:8090/api/MY-API/lights/27/state
curl: (6) Could not resolve host: lselect,
curl: (3) URL using bad/illegal format or missing URL
curl: (3) unmatched close brace/bracket in URL position 2:
2}
 ^

C:\Users\wosch>curl -X PUT 'http://PHOSCON-IP:8090/api/MY-API/lights/27/state' --data '{"alert": "lselect", "ontime": 2}'
curl: (3) URL using bad/illegal format or missing URL
curl: (6) Could not resolve host: lselect,
curl: (3) URL using bad/illegal format or missing URL
curl: (3) unmatched close brace/bracket in URL position 2:
2}'
 ^

C:\Users\wosch>curl -X PUT http://PHOSCON-IP:8090/api/MY-API/lights/27/state --data '{"alert": "lselect", "ontime": 2}'
[{"error":{"address":"/lights/27/state","description":"body contains invalid JSON","type":2}}]curl: (6) Could not resolve host: lselect,
curl: (3) URL using bad/illegal format or missing URL
curl: (3) unmatched close brace/bracket in URL position 2:
2}'
 ^

C:\Users\wosch>curl -X PUT http://PHOSCON-IP:8090/api/MY-API/lights/27/state --data {"alert": "lselect", "ontime": 2}
[{"error":{"address":"/lights/27/state","description":"body contains invalid JSON","type":2}}]curl: (6) Could not resolve host: lselect,
curl: (3) URL using bad/illegal format or missing URL
curl: (3) unmatched close brace/bracket in URL position 2:
2}
 ^

C:\Users\wosch>curl -X PUT http://PHOSCON-IP:8090/api/MY-API/lights/27/state --data "alert": "lselect", "ontime": 2
[{"error":{"address":"/lights/27/state","description":"body contains invalid JSON","type":2}}]curl: (6) Could not resolve host: lselect,
curl: (3) URL using bad/illegal format or missing URL
curl: (7) Failed to connect to 0.0.0.2 port 80 after 0 ms: Network unreachable

This is the output of the address itself in a browser:

{"etag":"25972e8283200248748dfc8d99de906f","hascolor":false,"lastannounced":null,"lastseen":"2022-12-10T09:38Z","manufacturername":"Heiman","modelid":"SmokeSensor-EM","name":"Warning device 27","state":{"alert":"none","reachable":true},"swversion":"0x00000015","type":"Warning device","uniqueid":"BLA:BLUB:BLA"}

So, API and ID seems to be correct.

Not possible making PUT request using a browser without plugin like Getting Started - deCONZ REST-API

On windows the command is

curl -X PUT http://IP:8090/api/YOUR_APIKEY/lights/27/state -d '{ "alert": "lselect", "ontime": 10 }'

The above output at the end of my post is just the adress in order to confirm API and ID is correct. Since I get the sensor’s data, there is no typo.

The new command is also not working:

C:\Users\wosch>curl -X PUT http://MY-IP:8090/api/MY-API/lights/27/state -d '{ "alert": "lselect", "ontime": 10 }'
[{"error":{"address":"/lights/27/state","description":"body contains invalid JSON","type":2}}]
curl: (3) URL using bad/illegal format or missing URL
curl: (6) Could not resolve host: lselect,
curl: (3) URL using bad/illegal format or missing URL
curl: (7) Failed to connect to 0.0.0.10 port 80 after 0 ms: Network unreachable
curl: (3) unmatched close brace/bracket in URL position 1:
}'

P.S.: Thanks for your patience!! :slight_smile: