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

nedis zigbee smoke detector zbds10wt #7812

Closed ltspicer closed 2 months ago

ltspicer commented 3 months ago

Is there already an existing issue for this?

Product name

Nedis zigbee smoke detector zbds10wt

Manufacturer

Nedis

Model identifier

zbds10wt

Device type to add

Sensor

Node info

Auswahl_003

Endpoints and clusters

Auswahl_004

Auswahl_001

Identify: Auswahl_002

IAS zone: Auswahl_003

IAS WD: Auswahl_004

Basic

Auswahl_001 Auswahl_002

Further relevant clusters

Auswahl_001

Mimiix commented 3 months ago

Please make sure you clicked "read" on the clusters. Also, add all screenshots.

ltspicer commented 3 months ago

Please make sure you clicked "read" on the clusters. Also, add all screenshots.

Ist das so ok?

Smanar commented 3 months ago

Hello, you can try this part for the detection

{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TYZB01_wqcac7lo",
  "modelid": "TS0205",
  "vendor": "Tuya",
  "product": "Smoke Sensor",
  "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",
          "parse": {"fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "tuya_swversion.js"},
          "read": {"fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001"}
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/battery",
          "parse": {
            "at": "0x0021",
            "cl": "0x0001",
            "ep": 1,
            "eval": "Item.val = Attr.val / 2",
            "fn": "zcl:attr"
          }
        },
        {
          "name": "config/enrolled"
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/pending"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/fire"
        },
        {
          "name": "state/lastupdated"
        },
        {
          "name": "state/lowbattery"
        },
        {
          "name": "state/test"
        }
      ]
    }
  ],
  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0001",
      "report": [
        {
          "at": "0x0021",
          "dt": "0x20",
          "min": 600,
          "max": 43200,
          "change": "0x00000001"
        }
      ]
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0500"
    }
  ]
}

But your device have too a siren ?

ltspicer commented 3 months ago

Hello, you can try this part for the detection

{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TYZB01_wqcac7lo",
  "modelid": "TS0205",
  "vendor": "Tuya",
  "product": "Smoke Sensor",
  "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",
          "parse": {"fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "tuya_swversion.js"},
          "read": {"fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001"}
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/battery",
          "parse": {
            "at": "0x0021",
            "cl": "0x0001",
            "ep": 1,
            "eval": "Item.val = Attr.val / 2",
            "fn": "zcl:attr"
          }
        },
        {
          "name": "config/enrolled"
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/pending"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/fire"
        },
        {
          "name": "state/lastupdated"
        },
        {
          "name": "state/lowbattery"
        },
        {
          "name": "state/test"
        }
      ]
    }
  ],
  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0001",
      "report": [
        {
          "at": "0x0021",
          "dt": "0x20",
          "min": 600,
          "max": 43200,
          "change": "0x00000001"
        }
      ]
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0500"
    }
  ]
}

But your device have too a siren ?

How should I do this part?

Device has a siren.

Smanar commented 3 months ago

How should I do this part?

Depend of your OS, on classic OS, just need to create a text file called what_you_want.json with this contain in a "devices" folder, then restart deconz.

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.

ltspicer commented 3 months ago

I have the deconz adapter in ioBroker. Just restart this adapter after creation of the json? Or restart in the console? How doing in the console?

ltspicer commented 3 months ago

$ sudo systemctl status deconz ● deconz.service - deCONZ: ZigBee gateway -- REST API Loaded: loaded (/lib/systemd/system/deconz.service; disabled; vendor preset: enabled) Active: inactive (dead)

But deCONZ-RaspBee is running...

Smanar commented 3 months ago

I don't remember for ioBroker, but from my memory they don't use dockers ?* Wich one "devices" folder have you used ? it was empty ?

You can restart using the console I think sudo systemctl restart deconz For the headless sudo systemctl restart deconz-gui For the desktop

But restarting the "adaptater" is perhaps faster ? (if it don't re-install something)

ltspicer commented 3 months ago

I inserted your code in this file:

Auswahl_001

The GUI shows the device:

Auswahl_002

But the DDF looks like this:

Auswahl_003

ioBroker and the Zigbee gateway (RaspBee) is on the same Raspberry.

ltspicer commented 3 months ago

Now it is online ^^ I push the test button on device (otherwise it sleeps).

Auswahl_001

Auswahl_002

Phoscon app:

Auswahl_003

Now I'm searching for the datapoint in ioBroker.

Smanar commented 3 months ago

Nice, so new version with the siren


{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TYZB01_wqcac7lo",
  "modelid": "TS0205",
  "vendor": "Tuya",
  "product": "Smoke Sensor",
  "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",
          "parse": {"fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "tuya_swversion.js"},
          "read": {"fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001"}
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/battery",
          "parse": {
            "at": "0x0021",
            "cl": "0x0001",
            "ep": 1,
            "eval": "Item.val = Attr.val / 2",
            "fn": "zcl:attr"
          }
        },
        {
          "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": "$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",
          "parse": {"fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "tuya_swversion.js"},
          "read": {"fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001"}
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/alert"
        },
        {
          "name": "state/reachable"
        }
      ]
    }
  ],
  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0001",
      "report": [
        {
          "at": "0x0021",
          "dt": "0x20",
          "min": 600,
          "max": 43200,
          "change": "0x00000001"
        }
      ]
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0500"
    }
  ]
}

Do you know how to use the siren ? By security you can't use state/on, but need to use state/alert

for information I can miss in the DDF a bind for the siren

    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0502",
      "report": [
        {
          "at": "0x0000",
          "dt": "0x21",
          "min": 30,
          "max": 120
        }
      ]
    }

Have not used it, because some device can wrk without it.

And btw, to full working the DDF need to be in the tuya folder, becuase of this line

"parse": {"fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "tuya_swversion.js"}, Or you can clone the tuya_swversion.js file too.

ltspicer commented 3 months ago

It works!! Thank you.

Auswahl_004

What's the difference between your 1st and 2nd version? I see in Meld:

Auswahl_001

ltspicer commented 3 months ago

"Or you can clone the tuya_swversion.js file too." What/what content to clone to where?

ATM in the tuya_swversion.js file is: var v = Attr.val; Item.val = String((v & 192) >> 6) + '.' + String((v & 48) >> 4) + '.' + String(v & 15);

... sorry, my english is terrible.

Smanar commented 3 months ago

Can just copy the file tuya_swversion.js in the same folder than your DDF (the "nedis" folder). The difference with the previous DDF,now the DDF create 2 entries, a "sensor" for return and a "light" for the siren.

ltspicer commented 3 months ago

I use the version 1. It is easier and give the right states. I will use v1. Thx for support ;)

ltspicer commented 3 months ago

OK?

Auswahl_001

ltspicer commented 3 months ago

Info for dev: Can you pls integrate this DDL (v1) and then close this issue? Thx

nedis_zbds10wt.json

Smanar commented 3 months ago

Strange you haven't more file in your "nedis" folder, you need to have at least 2 files https://github.com/dresden-elektronik/deconz-rest-plugin/tree/master/devices/nedis

I can make the PR to suport this device as it, but you don't want to test the siren stuff ?

ltspicer commented 3 months ago

I had 2 more files. I deleted them myself. I didn't understand the siren stuff. The smoke detector works great with the v1. It already has an integrated 83dB buzzer (sirene).

ltspicer commented 3 months ago

If there's anything I can test for you, let me know. But please express yourself precisely (and without abbreviations)! I use the DeepL translator ;) My mother tongue is Swiss German (I understand German).

Smanar commented 3 months ago

I didn't understand the siren stuff.

No problem, it's for you, if you don't need it, we can stay like that. I don't know the device, perhaps the siren is managed internaly and can't be used using zigbee request.

But with the second DDF, you are able to see a new entry in your "light" devices, a "Warning device" that can be used to trigger the siren. You can too make test using the GUI, it's on the cluster 0x0502 "IAS WD".

PR submitted here https://github.com/dresden-elektronik/deconz-rest-plugin/pull/7815

ltspicer commented 3 months ago

With V2 I see only "Warning device". The real device I can not see. I use V1 ;)

Smanar commented 3 months ago

With V2 I see only "Warning device"

HA ? So something is bad, you need to have 2 entries with the V2, 1 in "sensor" and 1 in "light", they are not at same pplace, IDK how your third app manage them.

The PR is with the V1, so no problem for the moment.

ltspicer commented 3 months ago

Strange you haven't more file in your "nedis" folder, you need to have at least 2 files https://github.com/dresden-elektronik/deconz-rest-plugin/tree/master/devices/nedis

I can make the PR to suport this device as it, but you don't want to test the siren stuff ?

I restored the 2 files ^^

ltspicer commented 3 months ago

Is everything ok for you at the moment? Or do you need more data for a clean implementation?

Smanar commented 3 months ago

It's for you, not for me ^^, I haven't the device. For me it's enought to submit a PR for the sensor part, the V1, thx.

If you want to use the siren, can try with the V2 and search where can be the "light entry", can be visible in phoscon/help/API Information/light. But if you are happy with the V1, no problem for me.

ltspicer commented 3 months ago

I will upgrade my old fire-alarm system. I will connect the old with the new (Zigbee) system ^^

old schematic: scan-mc362-20240615170601.pdf

bmz2

I think, I work with Shelly Plus i4 DC as incoming alarm interface (the old sensors are without ZigBee but with potential-free contacts).

Smanar commented 3 months ago

Ha nice, you are "mixing" radio and wired devices ?

ltspicer commented 3 months ago

Yes. I have a system from 1998 and now I have to add new ZigBee devices ^^ I want connect wired system with radio system :D

ltspicer commented 3 months ago

Here you can see the old fire alarm control panel with my interface PCB (left). In the meantime, I have registered a second Nedis detector. It works perfectly.

bmz3

Smanar commented 3 months ago

with my interface PCB (left).

It's DIY stuff ?

ltspicer commented 3 months ago

Yes. Schematic and PCB is made by my self. Also the old relay circuit (1998).

Smanar commented 3 months ago

Lol, I don't have enought skill, realy profoessionnal, what are you using for PCB support ? the green "thing" compatible with DIN support

ltspicer commented 3 months ago

I milled the PCB with my small CNC milling machine. The PCB is 2-layer. The profile for the DIN rail is from there:

https://de.aliexpress.com/item/1005005574681794.html

bmz_zusatz_pcb_SCH pcb pcb2 pcb3

github-actions[bot] commented 2 months ago

As there has not been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.

github-actions[bot] commented 2 months ago

As there has not been any response in 28 days, this issue will be closed. @ OP: If this issue is solved post what fixed it for you. If it is not solved, request to get this opened again.