-
Notifications
You must be signed in to change notification settings - Fork 528
DDF add support for Neo TS0601 #7832
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
base: master
Are you sure you want to change the base?
Changes from all commits
732f567
6de0852
3899af7
ace9ce9
e89f68b
84492a2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,225 @@ | ||
| { | ||
| "schema": "devcap1.schema.json", | ||
| "uuid": "78685bfe-85cf-462a-bff9-059a876ffbb0", | ||
| "manufacturername": [ | ||
| "_TZE200_t1blo2bj", | ||
| "_TZE204_t1blo2bj" | ||
| ], | ||
| "modelid": [ | ||
| "TS0601", | ||
| "TS0601" | ||
| ], | ||
| "product": "Neo (Tuya) smart siren", | ||
| "sleeper": false, | ||
| "status": "Gold", | ||
| "subdevices": [ | ||
| { | ||
| "type": "$TYPE_ON_OFF_LIGHT", | ||
| "restapi": "/lights", | ||
| "uuid": [ | ||
| "$address.ext", | ||
| "0x01", | ||
| "0xEF00" | ||
| ], | ||
| "items": [ | ||
| { | ||
| "name": "attr/id" | ||
| }, | ||
| { | ||
| "name": "attr/lastannounced" | ||
| }, | ||
| { | ||
| "name": "attr/lastseen" | ||
| }, | ||
| { | ||
| "name": "attr/manufacturername" | ||
| }, | ||
| { | ||
| "name": "attr/modelid" | ||
| }, | ||
| { | ||
| "name": "attr/name" | ||
| }, | ||
| { | ||
| "name": "attr/swversion", | ||
| "refresh.interval": 86400, | ||
| "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/tuya_unlock", | ||
| "public": false, | ||
| "refresh.interval": 86400, | ||
| "default": false | ||
| }, | ||
| { | ||
| "name": "state/alert", | ||
| "default": "none" | ||
| }, | ||
| { | ||
| "name": "state/on", | ||
| "write": { | ||
| "dpid": 13, | ||
| "dt": "0x10", | ||
| "eval": "Item.val == 1 ? 1 : 0;", | ||
| "fn": "tuya" | ||
| }, | ||
| "parse": { | ||
| "dpid": 13, | ||
| "eval": "Item.val == 1 ? 0 : 1;", | ||
| "fn": "tuya" | ||
| }, | ||
| "default": false | ||
| }, | ||
|
Comment on lines
+76
to
+90
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. None of the sirens/warning devices has this attribute and we should stay consistent as much as possible. I'd rather see the functions move up to
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment, not possible to use state/alert for tuya siren.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resource item usage is not (or should not be) limited to a vendor/manufacturer, but generally usable. Therefore, the 3 possible functions define what needs to be done with sent/received data. If that cannot be ensured in this case, we might want to change the (legacy) code to allow this in future. This shouldn't be anything heretic 😂
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No It's the same problem for tuya covering.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the workround. I was not able to get it work as a warning device. |
||
| { | ||
| "name": "state/reachable" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "type": "$TYPE_ALARM_SENSOR", | ||
| "restapi": "/sensors", | ||
| "uuid": [ | ||
| "$address.ext", | ||
| "0x01" | ||
| ], | ||
| "fingerprint": { | ||
| "profile": "0x0104", | ||
| "device": "0x0051", | ||
| "endpoint": "0x01", | ||
| "in": [ | ||
| "0x0000", | ||
| "0x0004", | ||
| "0x0005", | ||
|
Comment on lines
+109
to
+110
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The 2 clusters aren't necessary in the fingerprint
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which one should be remove?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't worry, can remove both. |
||
| "0xEF00" | ||
| ] | ||
| }, | ||
| "items": [ | ||
| { | ||
| "name": "attr/id" | ||
| }, | ||
| { | ||
| "name": "attr/lastannounced" | ||
| }, | ||
| { | ||
| "name": "attr/lastseen" | ||
| }, | ||
| { | ||
| "name": "attr/manufacturername" | ||
| }, | ||
| { | ||
| "name": "attr/modelid" | ||
| }, | ||
| { | ||
| "name": "attr/name" | ||
| }, | ||
| { | ||
| "name": "attr/swversion", | ||
| "refresh.interval": 86400, | ||
| "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": { | ||
| "dpid": 15, | ||
| "eval": "Item.val = Attr.val;", | ||
| "fn": "tuya" | ||
| }, | ||
| "default": 0 | ||
| }, | ||
|
ThiemeNL marked this conversation as resolved.
|
||
| { | ||
| "name": "config/duration", | ||
| "write": { | ||
| "dpid": 7, | ||
| "dt": "0x2b", | ||
| "eval": "Attr.val = Item.val;", | ||
| "fn": "tuya" | ||
| }, | ||
| "parse": { | ||
| "dpid": 7, | ||
| "eval": "Item.val = Attr.val;", | ||
| "fn": "tuya" | ||
| } | ||
| }, | ||
| { | ||
| "name": "config/melody", | ||
| "write": { | ||
| "dpid": 21, | ||
| "dt": "0x30", | ||
| "eval": "Attr.val = Item.val;", | ||
| "fn": "tuya" | ||
| }, | ||
| "parse": { | ||
| "dpid": 21, | ||
| "eval": "Item.val = Attr.val;", | ||
| "fn": "tuya" | ||
| }, | ||
| "default": 0 | ||
| }, | ||
| { | ||
| "name": "config/reachable" | ||
| }, | ||
| { | ||
| "name": "config/volume", | ||
| "write": { | ||
| "dpid": 5, | ||
| "dt": "0x30", | ||
| "eval": "Attr.val = Item.val;", | ||
| "fn": "tuya" | ||
| }, | ||
| "parse": { | ||
| "dpid": 5, | ||
| "eval": "Item.val = Attr.val;", | ||
| "fn": "tuya" | ||
| }, | ||
| "default": 0 | ||
| }, | ||
| { | ||
| "name": "state/lastupdated" | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "bindings": [ | ||
| { | ||
| "bind": "unicast", | ||
| "src.ep": 1, | ||
| "cl": "0xEF00" | ||
| } | ||
| ] | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type warning device would be more appropriate here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The c++ code block tuya siren (they are not using the WD IAS cluster), not possible to use warning device type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid I have to disagree here, at least partially. With a DDF supported device, the DDF defines what type of device it is, not the device itself anymore (meaning it's changable to your liking). So, if you make a warning device out of it, this generally allows following the expected code paths. Tuya is not blocked here per se.
In case the siren is still not able to sound up, it is more a matter of what you pass over for processing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not able to make it work as a warning device. Changing it to a light was a fix for me. More info at #6112