Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
225 changes: 225 additions & 0 deletions devices/tuya/_TZE200_t1blo2bj_neo_siren.json
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",
Copy link
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
Collaborator

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.

Copy link
Copy Markdown
Collaborator

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.

Copy link
Copy Markdown
Author

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

"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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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 state/alert

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment, not possible to use state/alert for tuya siren.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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 😂

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No It's the same problem for tuya covering.
The DDF core can handle state/on for exemple but not state/open or state/alert.
The problem is not the vendor/manufacturer, but the DDF code. We have already speak about that.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The 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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 2 clusters aren't necessary in the fingerprint

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which one should be remove?

Copy link
Copy Markdown
Collaborator

@Smanar Smanar Jul 8, 2024

Choose a reason for hiding this comment

The 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
},
Comment thread
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"
}
]
}