Closed gmitch64 closed 1 year ago
How does the device appears from REST-API point of view ?
In the REST-API there is only one device
But i don't see it in the "lights" in phoscon
And when i open "plugs" tab - it is empty I am not sure, but think this happened after adding siren
As deconz shows it in this way there is a DDF file for this siren in device folder, am i right? But i can't find it
In Phoscon it looks like this:
In IOBroker I see the device in objects. However, I can't control the device by setting the values.
What does REST-API see ? Into Phoscon choose help and API nformation
there is a DDF file for this siren in device folder, am i right? But i can't find it Did you put the proposed DDF into your system ? Into which folder ? https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/DDF-cheat-sheet
Did you put the proposed DDF into your system ? Into which folder ? https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/DDF-cheat-sheet
No, i didn't. I thought that if deconz defined and signed it "correctly" (i mean the meaningful name, not the letter/digit sequence, the plug surely isn't the right definition)), then the file is already available in the system and there is no need to add anything else. I tried to find it in /usr/share/deCONZ/devices but unsuccessfully. I'll try to add DDF you are proposing and write about the result little later
Yep. Deconz reconize the device as plug by defaut. You need the DDF for it will be reconized as "warning device"
"type:"Smart Plug"
After adding proposed DDF Phoscon sees it like this
{
"config": {
"battery": 0,
"duration": null,
"melody": 0,
"on": true,
"pending": [],
"reachable": true,
"volume": 0
},
"ep": 1,
"etag": "f2bdaf2c6f9c88299026b42daf6d02f4",
"lastannounced": null,
"lastseen": "2023-08-25T07:41Z",
"manufacturername": "_TZE204_t1blo2bj",
"modelid": "TS0601",
"name": "Alarm 23",
"state": {
"alarm": null,
"lastupdated": "none"
},
"type": "ZHAAlarm",
"uniqueid": "a4:c1:38:94:b6:1b:e4:04-01-0500"
}
{
"capabilities": {
"alerts": [
"none",
"select",
"lselect"
]
},
"config": {
"groups": [
"0"
]
},
"etag": "1c8e4c70f36e1f60cf2425b85c37e6e0",
"hascolor": false,
"lastannounced": null,
"lastseen": "2023-08-25T07:51Z",
"manufacturername": "_TZE204_t1blo2bj",
"modelid": "TS0601",
"name": "Smart plug 9",
"state": {
"alert": "none",
"reachable": true
},
"swversion": null,
"type": "Warning device",
"uniqueid": "a4:c1:38:94:b6:1b:e4:04-01"
}
I added siren to openhab as 2 "things", but i can't control it. I can't figure out where the failure occurs
Am i right, that there should be some way of control via deconz? For now i don't see any control opportunities. Groups Scenes Tuya specific Basic OTAU Time Green Power
Please use the rest api to control it.
Please use the rest api to control it.
i can change config parametrs using the rest api, but can't change its state
{
"config": {
"battery": 0,
"duration": 10,
"melody": 7,
"on": true,
"pending": [],
"reachable": true,
"volume": 1
},
"ep": 1,
"etag": "0a6c2b58c4e06f6918e940719a6a3eb3",
"lastannounced": null,
"lastseen": "2023-08-25T11:18Z",
"manufacturername": "_TZE204_t1blo2bj",
"modelid": "TS0601",
"name": "Сирена",
"state": {
"alarm": null,
"lastupdated": "none"
},
"type": "ZHAAlarm",
"uniqueid": "a4:c1:38:94:b6:1b:e4:04-01-0500"
}
As i understand state "alarm" should be "false", not "null" What am i doing wrong? (sorry if this is offtopic)
State/alarm
could be true
, false
ornull
depending of an alarm trigger, ... into Zigbee standard
Here we are in presence of a Tuya base siren, then standard Zigbee logic is a bit disturbed.
Have you try config/on
item ?
Have you try
config/on
item ?
I've tried - the only thing what happens is that i can't read attributes in basic cluster
It's not possible to trigger a tuya siren with the actual DDF core. At least not with "name": "state/alert",, but possible with "name": "state/on",
With another clone (https://github.com/dresden-elektronik/deconz-rest-plugin/issues/6941#issuecomment-1535313094) seems that one could make it to scream using a combination of melody
et state/alert
but thta was another proposal of DDF.
Other project considers them as clone, if we could make one to work, we could may be made both into the same DDF ;-)
I have a similar issue _TZE204_t1blo2bj TS0601 Neo Smart Siren. I have the DDF loaded but still not able to management it via HA and Deconz. The Siren is recognized by Deconz as Light, but show a Smart Plug. Was you able to manage it via HA or REST API? Is there any update?
Did anybody get this device (_TZE204_t1blo2bj) to work with the Rest API or through Phoscon or homebridge? I tried all parameters on the REST API, but I was unable to switch it on or change the state. I have used the DDF as provided before, so it is shown as Alarm device in the API and phoscon
Hello, it's not possible to use Siren using DDF.
You mean Tuya siren ? Because non Tuya are working with DDF https://github.com/dresden-elektronik/deconz-rest-plugin/blob/e2413b85ba4c487bd457e9c5ceb720962e5c5538/devices/heiman/hs2wd-e_smart_siren.json#L4
Yep, it's because "state/alert" can't be "customised" to work with tuya device, it can work only natively, so only for normal device. Have same problem for covering.
Somehow they were able to get this working
Tuya Smart Zigbee Siren Alarm Waterproof Outdoor With Solar (_TZE200_nlrfgpny) https://github.com/dresden-elektronik/deconz-rest-plugin/issues/6941#issuecomment-1535313094
Probably because on this DDF, they are using state/on, but to avoid issue, siren need to use state/alert. You can use state/on as workaround, but the DDF will be never valided by deconz.
Probably because on this DDF, they are using state/on, but to avoid issue, siren need to use state/alert. You can use state/on as workaround, but the DDF will be never valided by deconz.
So there is not solution to get this work with Deconz you say? With REST-API is not working with standard state/alert (atleast I dont get it to work) and state/on via DDF modification is also not working. Any one got it work with Deconz at all of Ziggbee2MQTT is the only option?
please reopen this device request
I can, but will be useless, for the moment not possible having an official support for it, so you can just use the actual DDF.
I wasn't able to pair my device, how to use the DDF ?
Depend of OS, to make short you need to create a text file with the DDF contain in a file called whatyouwant.json in a "devices" folder.
But what is the correct & working DDF file? And works this in combination with Home Assistant, even with or without API? Did anyone get it to work with Deconz for the _TZE204_t1blo2bj? Cause some say that it is working with DDF and other say it never going to work because of the state/alert -state/on difference.
Both are right, you can use it only for return, not to send state. HA use only deconz API Try the last DDF in this issue.
To add a DDF in HA https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839
Both are right, you can use it only for return, not to send state. HA use only deconz API Try the last DDF in this issue.
To add a DDF in HA https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839
@Smanar Tx for your reply. Which one you referring to? Because the last full DDF was not working for me. Posted by BabaIsYou.
Your device have the same modelID and same Manufacture name ? Nothing appear in the API ? Visilbe in Phoscon/help/API Information/sensor.
_TZE204_t1blo2bj?
Yes (model ID _TZE204_t1blo2bj). Phoscon see siren as a bulb and sensor with siren type. Deconz sees the model (also tried several times to read the node (simple) descriptors. But maybe the DDF is not correct. Can you share again?
It seem fine, you need to have a ZHAAlarm in sensor and a "Warning device" in light but this one can't work. Ony the ZHAAlarm can work
It seem fine, you need to have a ZHAAlarm in sensor and a "Warning device" in light but this one can't work. Ony the ZHAAlarm can work
How you able to change this then? Can you share DDF then if needed?
Used:
{ "schema": "devcap1.schema.json", "manufacturername": [ "_TZE200_t1blo2bj", "_TZE204_t1blo2bj" ], "modelid": [ "TS0601", "TS0601" ], "product": "Neo Smart siren", "sleeper": true, "status": "Gold", "subdevices": [{ "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", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "tuya_swversion.js" }, "read": { "fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001" } }, { "name": "attr/type" }, { "name": "attr/uniqueid" }, { "name": "state/alert", "default": "none" }, { "name": "state/reachable" } ] }, { "type": "ZHAAlarm", "restapi": "/sensors", "uuid": [ "$address.ext", "0x01", "0x0500" ], "fingerprint": { "profile": "0x0104", "device": "0x0403", "endpoint": "0x01", "in": [ "0x0000", "0x0004", "0x0005", "0xEF00" ] }, "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", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "tuya_swversion.js" }, "read": { "fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001" } }, { "name": "attr/type" }, { "name": "attr/uniqueid" }, { "name": "config/enrolled", "public": false }, { "name": "config/on", "description": "On/Off Alarm", "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": 0 }, { "name": "config/pending" }, { "name": "config/reachable" }, { "name": "state/alarm" }, { "name": "config/battery", "parse": { "fn": "tuya", "dpid": 15, "eval": "Item.val = Attr.val;" }, "read": { "fn": "tuya" }, "default": 0 }, { "name": "config/duration", "description": "Alarm duration in seconds", "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", "description": "Melody used by siren (between 1 to 18)", "range": [0, 18], "write": { "dpid": 21, "dt": "0x30", "eval": "Attr.val = Item.val;", "fn": "tuya" }, "parse": { "dpid": 21, "eval": "Item.val = Attr.val;", "fn": "tuya" } }, { "name": "config/volume", "description": "Volume of the siren, 0:low, 1:medium, 2:High", "range": [0, 2], "write": { "dpid": 5, "dt": "0x30", "eval": "Attr.val = Item.val;", "fn": "tuya" }, "parse": { "dpid": 5, "eval": "Item.val = Attr.val;", "fn": "tuya" } }, { "name": "state/lastupdated" } ] } ], "bindings": [{ "bind": "unicast", "src.ep": 1, "cl": "0xEF00" }] }
HA sees only siren.
When you try to switch in HA, it does work. Is the DDF ok? And how you control it via HA in this case (for example as part of automation).
a "Warning device" in light but this one can't work.
Both are right, you can use it only for return, not to send state.
And like I have said before, it's NOT possible yet.
@Smanar when do you think it will be possible?
I loaded the DDF from the comment above. Now I have 2 'devices', a Warning device
and a ZHAAlarm
. I can succesfully change the config of the ZHAAlarm
. For example update the melody field.
But I'm not able to update the state/alarm
to true
for the ZHAAlarm
or state/alert
to select
for the Warning device
. How can I trigger the alarm to go on?
hello, "state/alert" can't work for tuya device, its for that it's not possible to use DDF for tuya siren. "state/alarm" is read only. Can make a "hacky" DDF with state/on with using the DPID 0x13
Hi @Smanar, Thanks,
I added the state/on
in the DDF, on the warning device and ZHAAlarm:
Snippet:
{
"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
},
But the alarm won't get triggered.
I also tried to send a data request directly:
It seems to be possible with zigbee2mqtt: https://github.com/Koenkk/zigbee2mqtt/discussions/17325#discussioncomment-5772907 What are we missing?
This dpid is type Enum (not raw) so tuya 0x04 and for deconz dt = 0x30.
Edit: Have checked the Z2M code and they are using "bool" type. So with dt = 0x10 it need to work ...
And if you add the tuya unlock sequence ? (and re-include the device)
{
"name": "config/tuya_unlock"
}
Hi @Smanar the config/tuya_unlock
was indeed missing. I added it to the DFF and re-paired the devices.
{
"schema": "devcap1.schema.json",
"manufacturername": [
"_TZE200_t1blo2bj",
"_TZE204_t1blo2bj"
],
"modelid": [
"TS0601",
"TS0601"
],
"product": "Neo Smart siren",
"sleeper": true,
"status": "Gold",
"path": "/devices/TS0601_NEO-Sirenv2.json",
"subdevices": [
{
"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"
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "config/tuya_unlock",
"public": false,
"description": "Tuya sequence to unlock some device.",
"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
},
{
"name": "state/reachable"
}
]
},
{
"type": "ZHAAlarm",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x0500"
],
"fingerprint": {
"profile": "0x0104",
"device": "0x0403",
"endpoint": "0x01",
"in": [
"0x0000",
"0x0004",
"0x0005",
"0xEF00"
]
},
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion"
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "config/battery",
"read": {
"fn": "tuya"
},
"parse": {
"dpid": 15,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
},
"default": 0
},
{
"name": "config/duration",
"description": "Alarm duration in seconds",
"write": {
"dpid": 7,
"dt": "0x2b",
"eval": "Attr.val = Item.val;",
"fn": "tuya"
},
"parse": {
"dpid": 7,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
}
},
{
"name": "config/enrolled",
"public": false
},
{
"name": "config/melody",
"description": "Melody used by siren (between 1 to 18)",
"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/pending"
},
{
"name": "config/reachable"
},
{
"name": "config/tuya_unlock",
"public": false,
"description": "Tuya sequence to unlock some device.",
"refresh.interval": 86400,
"default": false
},
{
"name": "config/volume",
"description": "Volume of the siren, 0:low, 1:medium, 2:High",
"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/alarm"
},
{
"name": "state/lastupdated"
},
{
"name": "state/on",
"description": "On/Off Alarm",
"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
}
]
}
],
"bindings": [
{
"bind": "unicast",
"src.ep": 1,
"cl": "0xEF00"
}
]
}
One thing I noticed is state the state/on throws an error when call the api:
Request /api/key/lights/64/state
{"on": true }
[
{
"error": {
"address": "/lights/64/state",
"description": "parameter, on, not available",
"type": 6
}
}
]
You are sure the device id = 64 is the light ? Can you share the device json ? from phoscon/help/API Information/light
{
"name": "config/tuya_unlock"
}
Is enought.
Edit: I m seing so much stuff to remove state/on for warning device, can you try with a different type than $TYPE_WARNING_DEVICE, a simple $TYPE_ON_OFF_LIGHT for exemple
I got it working with $TYPE_ON_OFF_LIGHT. The extra tuya unlock items are added automatically by the DDF editor.
This is my working version of the DDF:
{
"schema": "devcap1.schema.json",
"manufacturername": [
"_TZE200_t1blo2bj",
"_TZE204_t1blo2bj"
],
"modelid": [
"TS0601",
"TS0601"
],
"product": "Neo Smart siren",
"sleeper": true,
"status": "Gold",
"path": "/devices/TS0601_NEO-Sirenv2.json",
"subdevices": [
{
"type": "$TYPE_ON_OFF_LIGHT",
"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"
},
{
"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",
"refresh.interval": 5,
"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
},
{
"name": "state/reachable"
}
]
},
{
"type": "ZHAAlarm",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x0500"
],
"fingerprint": {
"profile": "0x0104",
"device": "0x0403",
"endpoint": "0x01",
"in": [
"0x0000",
"0x0004",
"0x0005",
"0xEF00"
]
},
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion"
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "config/battery",
"read": {
"fn": "tuya"
},
"parse": {
"dpid": 15,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
},
"default": 0
},
{
"name": "config/duration",
"description": "Alarm duration in seconds",
"write": {
"dpid": 7,
"dt": "0x2b",
"eval": "Attr.val = Item.val;",
"fn": "tuya"
},
"parse": {
"dpid": 7,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
}
},
{
"name": "config/enrolled",
"public": false
},
{
"name": "config/melody",
"description": "Melody used by siren (between 1 to 18)",
"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/pending"
},
{
"name": "config/reachable"
},
{
"name": "config/tuya_unlock",
"public": false,
"refresh.interval": 86400,
"default": false
},
{
"name": "config/volume",
"description": "Volume of the siren, 0:low, 1:medium, 2:High",
"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/alarm"
},
{
"name": "state/lastupdated"
}
]
}
],
"bindings": [
{
"bind": "unicast",
"src.ep": 1,
"cl": "0xEF00"
}
]
}
Thank you for your quick support!
Do you want me to create a pull request somewhere? Or do you thing this is too buggie?
Not "buggie" but "hackie" ^^. By security siren never have state/on, to prevent "trouble" if the device was included in a light group.
IDK if others devs will be happy with it. But you can create a PR, it's free, if they don't like, will be not a problem.
Just some comments. Tuya device have generaly issue with "attr/swversion", so we are using
{
"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"
}
},
and ofc the DDF need to be in the "tuyaé folder, because of the path "script": "tuya_swversion.js"
You can remove the "refresh.interval": 5,
in "state/on", tuya device don't support poll.
Can remove too
"read": {
"fn": "tuya"
},
To prevent the device be spammed.
Can remove too config/pending and config/enrolled, not used by tuya device (need the cluster 0x0500)
Need only one "config/tuya_unlock" (only 1 request is usefull, deconz do it at inclusion and every 24h)
Device
Screenshots
Basic
Identify
Alarms
Device Temperature
Groups
Scenes
On/Off
Level Control
Color Control
Simple Metering
Diagnostics
Other clusters that are not mentioned above