Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZigBee Siren Alarm Tuya neo #3183

Closed
machielw opened this issue Aug 22, 2020 · 206 comments · Fixed by #4379
Closed

ZigBee Siren Alarm Tuya neo #3183

machielw opened this issue Aug 22, 2020 · 206 comments · Fixed by #4379

Comments

@machielw
Copy link

Is this possible to add as a device?

I cannot find the brand. But see the link. No manual.
I Can pair it. But thats about it, for now

Device

  • Product name: None,
  • Device type :
    • Siren

https://szneo.com/en/products/show.php?id=241

https://zigbee.blakadder.com/Neo_NAS-AB02B0.html

Screenshots

5C87E5C1-451C-46A1-83BD-BBC8B8E84E63
A0BB3B10-E5DA-4F61-86A1-79AE1DAC2418
BDC858D4-3D21-4BF0-ACC7-5906AFFA09AC

@Smanar
Copy link
Collaborator

Smanar commented Aug 22, 2020

Tuya again ^^.

I can make a try, I m on tuya atm.

Do you have an Unix machine to test code modification ?

@machielw
Copy link
Author

I run a Rpi3 with the docker image.so testing wil Be difficult, docker dev image?
I dont have a another Unix/Linux machine. I Am not So good with Linux either :(
It Saw Zigbee 3, So I through i give it a try. Maybe another user will respond here

@Smanar
Copy link
Collaborator

Smanar commented Aug 22, 2020

Rpi3 is ok
Docker too
You just need other thing than Hassio.

I have started the code Smanar@959245d

The device will be created, and have as field alarm / temperature / humidity

No setting yet.

@machielw
Copy link
Author

Thanks for your effort! Have been looking around, Found no instructions on how to get this into my docker container. Or do I have to wait untill it is merged? I dont think I Can compile a container myself.

@Smanar
Copy link
Collaborator

Smanar commented Aug 23, 2020

I realy need you test it before continuing, this kind of device is the first one on deconz.
IDK what you have as hardware, but can you make another container with a real OS ?

@machielw
Copy link
Author

I Will try. Not So much time, So Will take a couple of days. I use a Rpi3 with de conbee 2 Usb.
Will this work? download the rpi deconz headless image, install it and use this to boot.
install the development plug-in.
But then I have no Idee how the use your code... Can you give me a hint?

@Smanar
Copy link
Collaborator

Smanar commented Aug 24, 2020

Yep it works on Rpi 3 and with the pre installed image (perhaps it will be not updated, but not a real problem)
To test the code just follow the procedure here https://github.com/dresden-elektronik/deconz-rest-plugin at "Install deCONZ development package (optional, Linux only)"

Just replace the step 1 by
git clone --branch tuya2 https://github.com/Smanar/deconz-rest-plugin.git

After that, just restart deconz, if I m right you can include the device using phoscon ( but the device will not be visible)
And the device will be visible in the API, I need to check the JSON for this device to see missing field.

@machielw
Copy link
Author

Thanks for the reply.
sorry to bother you again...

Knipsel1
Knipsel2

after put it on net power and push read button

Knipsel3
Knipsel4

now it blinks green
so what is next? how to get you the json?

@Smanar
Copy link
Collaborator

Smanar commented Aug 26, 2020

But you have already give this capture ? it miss something ?

If you have followed the procedure, you can now include the device using phoscon (and not deconz).
Or you can do the same thing but with setting phoscon in permit join (add new sensor), it will add your device to the API.

To have a complete list off all your sensor just use this url http://IP:PORT/api/KEY/sensors

IP and PORT are the same than you are using for phoscon, for the key you can find it in your home automation application.

Or you can just see the json direclty in all home automation application.

@Smanar
Copy link
Collaborator

Smanar commented Aug 31, 2020

You have give up ^^ ?

@machielw
Copy link
Author

machielw commented Sep 1, 2020

Every step cost me half a day. So I dont know how to get the api key. I use Home assistant, and have no idea how to get the json you want. So almost gave up.... and your helpfull! But my skills are just not good enought. So how to get it out of hassio? (The easy way, please ;) )

@luub
Copy link

luub commented Sep 2, 2020

I don't have this device (yet), but would like to use it in the future. I saw this code used in zigbee2mqtt:
kirovilya/zigbee-herdsman-converters@ca19123

I have no idea if this helps you @Smanar. I am just a simple user, no experience with coding.

Discussion about the device for zigbee2mqtt can be found here:
Koenkk/zigbee2mqtt#3749

Hopefully it helps someone further here.
Thank you!

@Smanar
Copy link
Collaborator

Smanar commented Sep 2, 2020

Thx for links.

BTW where are you ATM @machielw ? have you succed in compiling the code ? Have you deconz installed on a Unix machine (other than hassio ofc)

@machielw
Copy link
Author

machielw commented Sep 2, 2020

I have it running on a the deconz image with the develop package installed on the RPI.
I use an extra SD card for this. I can add the device in the app.
And it shows up in home assistant (hassio on synology), only as device.
The latest screenshots are from the develop image. I will try again the next couple of days.

@Smanar
Copy link
Collaborator

Smanar commented Sep 3, 2020

You have deconz on a RPI and Hassio connected to it on synologie ?
So it s perfect, I think you can see the device JSON on HA, you need to have 1 temperature sensor + 1 humidity sensor + 1 alamr sensor (with bad value still)

@machielw
Copy link
Author

machielw commented Sep 3, 2020

Ha only sees the device. No sensors. i Added the device in phoscom. But I dont see any sensor.

B20E05BE-26C9-4B86-8067-B1A87B37AD41

@Smanar
Copy link
Collaborator

Smanar commented Sep 3, 2020

It will be invisible in phoscon.

BTW I don't know HA (and I don't speak same language ^^), can you show me the device JSON ?
You have only the alarm one ?

@machielw
Copy link
Author

machielw commented Sep 3, 2020

I only have the alarm one.
I dont know how to get the json out in Ha / deconz?

@Smanar
Copy link
Collaborator

Smanar commented Sep 3, 2020

I don't remember, the api key is not displayed somewhere in the plugin config on HA ?

@machielw
Copy link
Author

machielw commented Sep 4, 2020

http://IP:PORT/api/KEY/sensors gives:
{"1":{"config":{"configured":true,"on":true,"sunriseoffset":30,"sunsetoffset":-30},"etag":"ab2b2b13ce5eea74aec97654cc9fa260","manufacturername":"Philips","modelid":"PHDL00","name":"Daylight","state":{"dark":false,"daylight":true,"lastupdated":"2020-09-04T05:43:37.345","status":160,"sunrise":"2020-09-04T04:58:05","sunset":"2020-09-04T18:23:32"},"swversion":"1.0","type":"Daylight","uniqueid":"00:21:2e:ff:ff:05:a2:bc-01"},"2":{"config":{"on":true,"reachable":true},"ep":1,"etag":"3d188a515fb02f521b3adc49403e9d73","lastseen":"2020-09-04T05:24Z","manufacturername":"_TYST11_d0yu2xgi","modelid":"0yu2xgi","name":"0yu2xgi","state":{"alarm":null,"lastupdated":"none"},"swversion":"20180727","type":"ZHAAlarm","uniqueid":"84:2e:14:ff:fe:db:85:3b-01-ef00"}}

@Smanar
Copy link
Collaborator

Smanar commented Sep 4, 2020

Nice thx ^^.

So the device is reconised fine.
The good sensor is created

        if (modelId == QLatin1String("0yu2xgi"))
        {
            clusterId = TUYA_CLUSTER_ID;
            item = sensorNode.addItem(DataTypeInt16, RStateTemperature);
            item = sensorNode.addItem(DataTypeUInt16, RStateHumidity);
        }

The model id is reconized, because the uniqueid use the tuya cluster.

But the 2 entries (temperature and humidity) are not created ??? Seriously what is the problem ?

Perhaps need to force a value ? I have updated the code to set a "0" value for the 2 field, if you can try it ?
Same url to update now it s faster

cd deconz-rest-plugin
git pull
qmake && make -j2
sudo cp ../libde_rest_plugin.so /usr/share/deCONZ/plugins

And reload deconz.

and the boring thing, a new inclusion or use the inclusion trick (set phoscon in permit join, and read again basic attribute).

@machielw
Copy link
Author

machielw commented Sep 4, 2020

:(

{"1":{"config":{"configured":true,"on":true,"sunriseoffset":30,"sunsetoffset":-30},"etag":"245833ba32f9a63d20cbda0290e81176","manufacturername":"Philips","modelid":"PHDL00","name":"Daylight","state":{"dark":false,"daylight":true,"lastupdated":"2020-09-04T17:11:39.378","status":170,"sunrise":"2020-09-04T04:58:05","sunset":"2020-09-04T18:23:32"},"swversion":"1.0","type":"Daylight","uniqueid":"00:21:2e:ff:ff:05:a2:bc-01"},"2":{"config":{"on":true,"reachable":true},"ep":1,"etag":"b6b12f46513d41b13c57c9cb1f58f917","lastseen":"2020-09-04T17:17Z","manufacturername":"_TYST11_d0yu2xgi","modelid":"0yu2xgi","name":"0yu2xgi","state":{"alarm":null,"lastupdated":"none"},"swversion":"20180727","type":"ZHAAlarm","uniqueid":"84:2e:14:ff:fe:db:85:3b-01-ef00"}}

@Smanar
Copy link
Collaborator

Smanar commented Sep 4, 2020

Lol, sorry, you have missed my last modification by 2 minut > Smanar@1c89cf3

This change is copy paste but in database.cpp file

If this code still not working, I will ask to other devs.

BTW wich one method are you using to test ? real inclusion or deconz trick ?

@machielw
Copy link
Author

machielw commented Sep 4, 2020

for inclusion I use phoscom app

no difference i think

{"1":{"config":{"configured":true,"on":true,"sunriseoffset":30,"sunsetoffset":-30},"etag":"b093d47f629be713a85a4f67b3748151","manufacturername":"Philips","modelid":"PHDL00","name":"Daylight","state":{"dark":false,"daylight":false,"lastupdated":"2020-09-04T18:00:37.391","status":180,"sunrise":"2020-09-04T04:58:05","sunset":"2020-09-04T18:23:32"},"swversion":"1.0","type":"Daylight","uniqueid":"00:21:2e:ff:ff:05:a2:bc-01"},"2":{"config":{"on":true,"reachable":true},"ep":1,"etag":"1c2f7aa137a15dd6cfe08a4b7a53db9d","lastseen":"2020-09-04T18:11Z","manufacturername":"_TYST11_d0yu2xgi","modelid":"0yu2xgi","name":"0yu2xgi","state":{"alarm":null,"lastupdated":"none"},"swversion":"20180727","type":"ZHAAlarm","uniqueid":"84:2e:14:ff:fe:db:85:3b-01-ef00"}}

@machielw
Copy link
Author

machielw commented Sep 4, 2020

change database.cpp file? --> used this from you -->

cd deconz-rest-plugin
git pull
qmake && make -j2
sudo cp ../libde_rest_plugin.so /usr/share/deCONZ/plugins

is that OK?

@Smanar
Copy link
Collaborator

Smanar commented Sep 4, 2020

Don't need to change the file yourself (and not a good idea because github will see it and can prevent you updating the code later).

Just use the same command every time. The code don't use hack for you, so you can use it as it. It will be faster, less file to change mean less file to recompile

cd deconz-rest-plugin
git pull
qmake && make -j2
sudo cp ../libde_rest_plugin.so /usr/share/deCONZ/plugins

I haven't idea from other dev yet, but you can try this code pls.

@machielw
Copy link
Author

machielw commented Sep 4, 2020

Yes, I did this. No change

@Smanar
Copy link
Collaborator

Smanar commented Sep 5, 2020

@ebaauw if during your ninja exploration, you have a tips for me ^^ ?

@ebaauw
Copy link
Collaborator

ebaauw commented Sep 5, 2020

Not really. I don’t use HA nor docker, I don’t know tuya. I stopped trying to support devices that I don’t have myself. It typically takes me at least a dozen iterations of compiling/testing the code before a fairly standard device is fully supported.

@Smanar
Copy link
Collaborator

Smanar commented Jan 21, 2021

But it work on zigbee side too if you send command ? You have return from the device (with "tuya debug") or error message (aps error with timeout) ?

@Smanar
Copy link
Collaborator

Smanar commented Jan 21, 2021

Lol, poor github, so much log.
So you can delete them,

So to resume, for preset

13:50:20:883 Send Tuya Request: Dp_type: 0x01 Dp_ identifier 0x71 Data(1): 00
13:50:20:883 add task 44715 type 41 to 0x842E14FFFEDB853B cluster 0xEF00 req.id 112
13:50:20:883 APS-DATA.request id: 112, addrmode: 0x03, addr: 0x842e14fffedb853b, profile: 0x0104, cluster: 0xEF00, ep: 0x01 -> 0x01 queue: 0 len: 10 tx.options 0x04
13:50:20:884 Send Tuya Request: Dp_type: 0x01 Dp_ identifier 0x72 Data(1): 00
13:50:20:884 add task 44716 type 41 to 0x842E14FFFEDB853B cluster 0xEF00 req.id 113

Not working

13:50:21:980 Send Tuya Request: Dp_type: 0x01 Dp_ identifier 0x71 Data(1): 00
13:50:21:980 add task 44722 type 41 to 0x842E14FFFEDB853B cluster 0xEF00 req.id 121
13:50:21:981 Send Tuya Request: Dp_type: 0x01 Dp_ identifier 0x72 Data(1): 00
13:50:21:982 add task 44723 type 41 to 0x842E14FFFEDB853B cluster 0xEF00 req.id 122

13:50:22:376 Tuya debug 4 : Address 0x842E14FFFEDB853B Payload 00047101000100
13:50:22:381 Tuya debug 5 : Status: 0 Transid: 4 Dp: 369 (0x01,0x71) Fn: 0 Data 0
13:50:25:401 Tuya debug 4 : Address 0x842E14FFFEDB853B Payload 00047201000100
13:50:25:402 Tuya debug 5 : Status: 0 Transid: 4 Dp: 370 (0x01,0x72) Fn: 0 Data 0

100% working but at second try and 5s after.

For humidity

13:51:46:173 Send Tuya Request 2: Dp_type: 0x02 Dp_ identifier 0x6D Data(4): 00000011
13:51:47:204 Send Tuya Request 2: Dp_type: 0x02 Dp_ identifier 0x6D Data(4): 00000011
13:51:47:264 Tuya debug 4 : Address 0x842E14FFFEDB853B Payload 00026d02000400000011
13:51:47:265 Tuya debug 5 : Status: 0 Transid: 2 Dp: 621 (0x02,0x6D) Fn: 0 Data 17

So worked too, but I forget to remove the double command (my bad), so the result is not perfect, but it s ok.

And For temperature.

13:53:21:077 Send Tuya Request: Dp_type: 0x02 Dp_ identifier 0x6B Data(4): 00000011
13:53:21:080 Send Tuya Request: Dp_type: 0x02 Dp_ identifier 0x6C Data(4): 0000004d
13:53:28:403 Tuya debug 4 : Address 0x842E14FFFEDB853B Payload 00026c0200040000004d
13:53:28:404 Tuya debug 5 : Status: 0 Transid: 2 Dp: 620 (0x02,0x6C) Fn: 0 Data 77
13:53:26:381 Tuya debug 4 : Address 0x842E14FFFEDB853B Payload 00026b02000400000011
13:53:26:382 Tuya debug 5 : Status: 0 Transid: 2 Dp: 619 (0x02,0x6B) Fn: 0 Data 17
13:53:28:403 Tuya debug 4 : Address 0x842E14FFFEDB853B Payload 00026c0200040000004d
13:53:28:404 Tuya debug 5 : Status: 0 Transid: 2 Dp: 620 (0x02,0x6C) Fn: 0 Data 77

"temperaturethreshold":"17,77"}

100% perfect, even the json is updated with good value ^^

So I think I can stop to disturb you ^^, I will just correct the double command for humidity but you don't need to test it, it s just copy/paste, so I don't think I will make error.
ATM I waiting for the first tuya PR was merged, then a second one, and to finish this one (but I will make a clean one, too much tries) I need to respect chronology.

I will tell you when this one will be in waiting list, if you want to make a last try.

Just a strange thing in log, for preset and humity, the command was send 2 times in less than 1s, it s something normal ?

13:51:46:173 Send Tuya Request 2: Dp_type: 0x02 Dp_ identifier 0x6D Data(4): 00000011
13:51:47:204 Send Tuya Request 2: Dp_type: 0x02 Dp_ identifier 0x6D Data(4): 00000011

BTW, thx again for your multiples tries.

@machielw
Copy link
Author

Just a strange thing in log, for preset and humity, the command was send 2 times in less than 1s, it s something normal ? —> I did.

@RealKanashii
Copy link

RealKanashii commented Feb 6, 2021

Hi, do you need something? Can I help with info? I'm really interested to support this device and the issue seems blocked by lack of info ("waiting for info" label).

@Smanar
Copy link
Collaborator

Smanar commented Feb 6, 2021

It s normal ^^.
We are waiting for another TUYA PR was merged first (probably this Week End)
This one will be just after.

@Mimiix
Copy link
Collaborator

Mimiix commented Feb 8, 2021

@Smanar Which one?

@Smanar
Copy link
Collaborator

Smanar commented Feb 8, 2021

Done,
I will try to make it tonight.

@Smanar Smanar linked a pull request Feb 8, 2021 that will close this issue
@Smanar
Copy link
Collaborator

Smanar commented Feb 8, 2021

Done the final PR is submitted, but the code have moved a lot :(

If someone can test it ?


sudo apt install deconz-dev
git clone --branch tuya_siren_clean https://github.com/Smanar/deconz-rest-plugin.git
cd deconz-rest-plugin
qmake && make
sudo cp ../libde_rest_plugin.so /usr/share/deCONZ/plugins

@gio82c
Copy link

gio82c commented Feb 15, 2021

Hi guys,

i have a same problem, i use Home Assistant Operating System with a Conbee 2,
i see the siren as a sensor only, somebody else have this problem?

Cattura
Cattura2

@Mimiix
Copy link
Collaborator

Mimiix commented Feb 15, 2021

@gio82c The PR smanar made is going to add yours. So you have to wait a bit more ;)

@gio82c
Copy link

gio82c commented Feb 15, 2021

@Mimiix @Smanar

Thanks 👍

@kmplngj
Copy link

kmplngj commented Apr 17, 2021

Hi guys,

i have a same problem, i use Home Assistant Operating System with a Conbee 2,
i see the siren as a sensor only, somebody else have this problem?

Was this added in 2.11.0-beta? I have the same issue.

@Smanar
Copy link
Collaborator

Smanar commented Apr 17, 2021

Have you tried making 2 inclusions, without deleting something between both ?

@RealKanashii
Copy link

RealKanashii commented May 10, 2021

I had to delete and add it again but seems the device is only detected as a binary status sensor (alarm: true/dalse). Is not possible to change the status to start the alarm. Anyone?

P.D: I found a new smart plug that is linked to the alarm and launches the alarm.

@Smanar
Copy link
Collaborator

Smanar commented May 10, 2021

You can have some issue too if your manufacture number is 0x1002.

#4844

@gio82c
Copy link

gio82c commented May 10, 2021

Hi guys, i have this model, and dosen't work, no temp sensor no binary sensor, i don't see nothing on HA or Phoscon, only in deconz.
Cattura

@Smanar
Copy link
Collaborator

Smanar commented May 10, 2021

Hello, try to include 2 times the device, without deleting it between.
What is your deconz version ?

@gio82c
Copy link

gio82c commented May 10, 2021

I try to include 2 times, but no changes.
The version is v2.10.4, i use the official add-on of homeassistant

@Smanar
Copy link
Collaborator

Smanar commented May 11, 2021

Ok so you have an old version, there is some new modification since this date, specialy if your manufacture code is 0x1002 (on your version it works only if the manufacture code is 0x0000)

@RealKanashii
Copy link

RealKanashii commented May 11, 2021

Is it possible to launch Deconz commands to change the siren sound, volumen etc... as is explained here:
https://templates.blakadder.com/neo_coolcam_NAS-AB02W.html
Right now the only way to start/stop via Node Red is via Rest petitions. I'm ok with it but I would love to be able to change sounds ( doorbell for some funcitons and siren for alerts) and volumen.

@Smanar
Copy link
Collaborator

Smanar commented May 11, 2021

Yep #4499 (comment)

@RealKanashii
Copy link

RealKanashii commented May 11, 2021

"[{"error":{"address":"/lights/xxxxxxxxxxxxxxxxxxxxx/state","description":"parameter, volume, not available","type":6}}]"
"[{"error":{"address":"/lights/xxxxxxxxxxxxxxxxxxxxx/state","description":"parameter, melody, not available","type":6}}]"

Seems it doesn't work.

"lselect" and "none" works for "alert" parameter.

There's a way to recover the parameters?

via API I only see one parameter:
{
"etag": "daed0a67xxxxxxxxxxx1abd8f21af",
"hascolor": false,
"lastannounced": null,
"lastseen": "2021-05-11T16:25Z",
"manufacturername": "_TZE200_d0yu2xgi",
"modelid": "TS0601",
"name": "Alarma",
"state":{
"alert": "none",
"reachable": true
},
"swversion": null,
"type": "Warning device",
"uniqueid": "xxxxxxxxxxxxxxxxxxxxx"
}

@RealKanashii
Copy link

RealKanashii commented May 11, 2021

I found it. The alarm trigger is no the same "object" that the "alarm configuration object"

You can set the values via CURL/REST but using the alarm "sensor", not the alarm "ligth":

msg.method = "PUT"
msg.url = "http://192.168.2.3/api/B9770929FE/sensors/84:2exxxxxx0500/config" ;

msg.payload = '{ "melody": 6 }';
msg.headers = {};
msg.headers['content-type'] = 'application/json';
return msg;

Response:
"[{"success":{"/sensors/84:2exxxxxx0500/config/melody":6}}]"

I hope it helps others to configure their devices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.