Closed ThorstenDtk closed 1 year ago
Hello, You didn't provide complete screenshot for cluster 0x001 then not easy to see if it's used or if you have to use Tuya cluster (like temp & humidity).
Perhaps you can try this for battery (as suggested in #6535) but perhaps @Smanar would give better support :
{
"name": "config/battery",
"parse": {"fn": "tuya", "dpid": 4, "eval": "Item.val = Attr.val;" },
"read": {"fn": "none"},
"default": 0
},
And BTW this for swversion
{
"name": "attr/swversion",
"refresh.interval": 84000,
"read": {
"at": "0x0001",
"cl": "0x0000",
"ep": 1,
"fn": "zcl"
},
"parse": {
"at": "0x0001",
"cl": "0x0000",
"ep": 1,
"fn": "zcl",
"script": "tuya_swversion.js"
}
},
No, you are right, this device is a clone of this one too https://github.com/dresden-elektronik/deconz-rest-plugin/pull/6543
You can just add the model to the DDF
I took the ddf from #6543, edited manufaturername and modelid, deleted the node and added it back. This is the DDF I used:
{
"schema": "devcap1.schema.json",
"manufacturername": ["_TZE200_znbl8dj5", "_TZE200_qoy0ekbd", "_TZE200_a8sdabtg"],
"modelid": ["TS0601", "TS0601", "TS0601"],
"vendor": "Tuya",
"product": "Temperature Humidity Sensor TS0601",
"sleeper": true,
"status": "Gold",
"subdevices": [
{
"type": "$TYPE_HUMIDITY_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x0405"
],
"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/offset",
"default": 0
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/humidity",
"parse": {"fn": "tuya", "dpid": 2, "eval": "Item.val = (100 * Attr.val) + R.item('config/offset').val;" },
"read": {"fn": "none"},
"default": 0
},
{
"name": "config/battery",
"parse": {"fn": "tuya", "dpid": 4, "eval": "Item.val = Attr.val;" },
"read": {"fn": "none"},
"default": 0
},
{
"name": "state/lastupdated"
}
]
},
{
"type": "$TYPE_TEMPERATURE_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x0402"
],
"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": "none"}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "config/offset",
"default": 0
},
{
"name": "config/battery",
"parse": {"fn": "tuya", "dpid": 4, "eval": "Item.val = Attr.val;" },
"read": {"fn": "none"},
"default": 0
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/temperature",
"parse": {"fn": "tuya", "dpid": 1, "eval": "Item.val = (10 * Attr.val) + R.item('config/offset').val;" },
"read": {"fn": "none"},
"default": 0
}
]
}
]
}
Battery still isn't working, but now the humidity looks ok:
Do I just need to wait longer to get a value for battery?
You won’t see any value in GUI because this device seems to use only Tuya cluster for humidity (that why we use Tuya function in DDF). Then, if it works you’ll see the correct value in phoscon
Yep, have checked again, I m sure it's the dpid 4. Can need to wait a little.
Yep, have checked again, I m sure it's the dpid 4. Can need to wait a little.
You're right, it's working. Thanks a lot!
You won’t see any value in GUI because this device seems to use only Tuya cluster for humidity (that why we use Tuya function in DDF). Then, if it works you’ll see the correct value in phoscon
Are you talking about DeCONZ? I can see it there:
Hu ? Lol, idk how it can be visible on deconz neither ...
I will ask the user to add your manufacture name on his PR
Sorry I'm a noob on this, I have these sensor also but do not what to do exaclty, i do not see it in the Phoscon but in Deconz, and Deconz is not something what I used daily from Home Assistant.
I need to edit the DDF? When I'm in this I see the following:
How can I edit the DDF and copy the text from above?
I think it will be faster to create a DDF in the hidden persistent folder/data/.local/share/dresden-elektronik/deCONZ/devices/
https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839
How can I create this? I can save it from deconz this folder, but how can I edit the JSON file from SSH? When I try to copy the JSON file which has been created by me and located on a location on the Pi:
~ cp ./config/TEMP.json ./root@core-deconz:~/.local/share/dresden-elektronik/deCONZ/devices cp: can't create './root@core-deconz:~/.local/share/dresden-elektronik/deCONZ/devices': No such file or directory ➜ ~
In SSH you can use pico (sudo pico
@ThorstenDtk sorry mate, still not clear for me.
I have created a JSON file with the name TEMP.json. This file is located on my Home Assistant in the /config/ folder. It contains the following code:
{ "schema": "devcap1.schema.json", "manufacturername": ["_TZE200_znbl8dj5", "_TZE200_qoy0ekbd", "_TZE200_a8sdabtg"], "modelid": ["TS0601", "TS0601", "TS0601"], "vendor": "Tuya", "product": "Temperature Humidity Sensor TS0601", "sleeper": true, "status": "Gold", "subdevices": [ { "type": "$TYPE_HUMIDITY_SENSOR", "restapi": "/sensors", "uuid": [ "$address.ext", "0x01", "0x0405" ], "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/offset", "default": 0 }, { "name": "config/on" }, { "name": "config/reachable" }, { "name": "state/humidity", "parse": {"fn": "tuya", "dpid": 2, "eval": "Item.val = (100 Attr.val) + R.item('config/offset').val;" }, "read": {"fn": "none"}, "default": 0 }, { "name": "config/battery", "parse": {"fn": "tuya", "dpid": 4, "eval": "Item.val = Attr.val;" }, "read": {"fn": "none"}, "default": 0 }, { "name": "state/lastupdated" } ] }, { "type": "$TYPE_TEMPERATURE_SENSOR", "restapi": "/sensors", "uuid": [ "$address.ext", "0x01", "0x0402" ], "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": "none"} }, { "name": "attr/type" }, { "name": "attr/uniqueid" }, { "name": "config/offset", "default": 0 }, { "name": "config/battery", "parse": {"fn": "tuya", "dpid": 4, "eval": "Item.val = Attr.val;" }, "read": {"fn": "none"}, "default": 0 }, { "name": "config/on" }, { "name": "config/reachable" }, { "name": "state/lastupdated" }, { "name": "state/temperature", "parse": {"fn": "tuya", "dpid": 1, "eval": "Item.val = (10 Attr.val) + R.item('config/offset').val;" }, "read": {"fn": "none"}, "default": 0 } ] } ] }
Now I need to copy this TEMP.JSON file from /config/ to the Deconz folder, but do not know how. Even when it is copied, I do not know what to do, open DDF and reload?
Ok I was able to edit a file now with Nano and save it this to the data folder of the deconz, however I open the file and can see every thing, I click on hot reload and save.
But when I edit again the DDF of the object, it shows again empty:
What I'm doing wrong?
I'm not an expert. I also saw strange things when editing the DDF through the 'edit DDF' button. So at the end I just created & saved the DDF with pico to the right folder. And after repairing the device(s) it worked.
If the DDF is in the good folder, just just need to restart deconz. It will be used automatically, don't need to load it.
What is the file path ?
on normal OS
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/
/.local/share/dresden-elektronik/deCONZ/devices) will override the pre-packaged files to allow users to amend and keep their own files if desired.
On HA
/data/.local/share/dresden-elektronik/deCONZ/devices/
Ok So I did modify it from the folder: /data/.local/share/dresden-elektronik/deCONZ/devices/ I opened the object in deconz -> Right click -> Edit DDF -> Open file -> /data/.local/share/dresden-elektronik/deCONZ/devices/filname.JSON file selected and all is loaded.
Clicked on save and after that Hot reloaded. Rebooted HA and restarted Deconz but still not visible. What is the correct step exactly...
Now even Deconz doesn't work anymore and shows the alert: Something went wrong, connection is closed
Phoscon still working..
I can see the device from the api:
{
"config": {
"offset": 0,
"on": true,
"reachable": true
},
"etag": "b08a50ae0e3ac2136d3ee225089ba01c",
"lastannounced": null,
"lastseen": "2022-12-17T14:05Z",
"manufacturername": "_TZE200_a8sdabtg",
"modelid": "TS0601",
"name": "Temperature 8",
"state": {
"lastupdated": "none",
"temperature": null
},
"type": "ZHATemperature",
"uniqueid": "a4:c1:38:0c:bc:68:79:80-ff-0402"
}
I removed it from HA, my fault and need to repair it, however I'm not able to remove the device in Deconz, I can remove it but its still visble in the API.
"uniqueid": "a4:c1:38:0c:bc:68:79:80-ff-0402"
wich one deconz version have you ?
You have a "bad" entry, with "FF" endpoint, you need to have "01".
Can you remove it using phoscon ? Then in deconz with "del" key ?
I opened the object in deconz -> Right click -> Edit DDF
Just with making that, you need to see the DDF, you don't need to use "load".
If the file is at good place, just re-include the device, but need to remove the one with endpoint "FF"
I would like to remove the device and start over... right click delete node works, however in the api the device is still visible..
So it must be: "uniqueid": "a4:c1:38:0c:bc:68:79:80-01-0402"? from where I can change this?
Version: 26720700
Don't aks me why and how, but it works finally!! It has also a unique ID right now.
Other question, if I would like to order one more, will there be any conflict?
Other question, if I would like to order one more, will there be any conflict?
No ^^, you have done the harder, one time the DDF is in the good folder, it will be used for all new inclusion. And if you have used an "user" folder, it will be prioritary on the deonz one, so it will be not removed on next deconz update.
I will check if there is a PR for this device.
Edi: So it's already in waiting list https://github.com/dresden-elektronik/deconz-rest-plugin/pull/6543
Thanks! I do see only that the sensor isn't updating anymore...
{
"config": {
"battery": 100,
"offset": 0,
"on": true,
"reachable": true
},
"etag": "bb07b115cffd343132b69a0084196f29",
"lastannounced": null,
"lastseen": "2022-12-18T07:48Z",
"manufacturername": "_TZE200_a8sdabtg",
"modelid": "TS0601",
"name": "Temperature 4",
"state": {
"lastupdated": "2022-12-17T17:12:58.041",
"temperature": 1910
},
"type": "ZHATemperature",
"uniqueid": "a4:c1:38:0c:bc:68:79:80-01-0402"
}
Last seen is showing up well but the lastupdated is still old information...
UPDATE: Removed again the device, cannot scan it anymore to DECONZ, think that the device is broken as the battery doesn't function well..
Yes, it's a a tuya device, so you can't have bind/report issue. Have you try to heat the device ?
The connexion ? can you make a try close to a router/coordinator ? But in this situation you will have a bad lastseen too.
Same issue for humidity ?
as the battery doesn't function well.
Why you are saying that ? This device use the tuya cluster for battery, not the cluster 0x0001
Yeah I started over, but after a reset the device is not detected anymore by deconz. So I think I will stop it for now and will look further.
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.
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.
Device
Screenshots
Basic
Temperature Measurement
Relative Humidity Measurement
Basic
OTAU
I slightly modified the DDF from https://github.com/dresden-elektronik/deconz-rest-plugin/issues/6063 (manufacturer ID, path):
It's almost working, it's just the battery which doesn't get updated:
I turned on logging in the GUI, but there are no log entries starting with 'Tuya debug 4/5'. Not even for the Tuya door contacts. Which log level is required, and which log entries are relevant?
Don't know if it's the device which periodically sends data or when a value changes or if it can be polled.
From PhosCON: