Lightsensor Luxmeter Zigbee Tuya
Is there already an existing issue for this?
- [X] I have searched the existing issues and there is none for my device
Product name
Lightsensor Luxmeter Zigbee Tuya
Manufacturer
_TZE200_khx7nnka
Model identifier
TS0601
Device type to add
Sensor
Node info
Endpoints and clusters
Basic
Further relevant clusters
Power Configuration
On/Off
Level Control
Color Control
Thermostat
Simple Metering
Electrical Measurement
Any other cluster of relevance/interest
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.
Noch nicht gelöst
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.
Noch nicht gelöst
@Smanar can you help out :)?
Hello
{
"schema": "devcap1.schema.json",
"manufacturername": ["_TZE200_khx7nnka", "_TZE200_yi4jtqq1"],
"modelid": ["TS0601", "TS0601"],
"product": "Tuya Lightsensor Luxmeter",
"sleeper": false,
"status": "Gold",
"subdevices": [
{
"type": "$TYPE_LIGHT_LEVEL_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0xEF00"
],
"items": [
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion",
"read": {
"at": "0x0001",
"cl": "0x0000",
"ep": 1,
"fn": "zcl:attr"
},
"parse": {
"at": "0x0001",
"cl": "0x0000",
"ep": 1,
"fn": "zcl:attr",
"script": "tuya_swversion.js"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/dark"
},
{
"name": "config/tholddark"
},
{
"name": "config/tholdoffset"
},
{
"name": "state/daylight"
},
{
"name": "state/lightlevel"
},
{
"name": "state/lux",
"read": {
"fn": "none"
},
"parse": {
"dpid": 2,
"script": "../generic/illuminance_cluster/lux_to_lightlevel.js",
"fn": "tuya"
},
"default": 0
}
]
}
]
}
Just some remark:
This device is powered ? because it seem it can work as router ? Have set the "sleeper" mode to false.
To work this DDF NEED to be in the devices/tuya folder, because of relative path "script": "../generic/illuminance_cluster/lux_to_lightlevel.js", if you are on docker, you can edit the path and copy too the file lux_to_lightlevel.js in the same folder
@Smanar
"script": "./lux_to_lightlevel.js",
doens't work...
i've tested also with a complett path, also with "/opt/deCONZ/devices/tuya/lux_to_lightlevel.js" or "/opt/deCONZ/devices/lux_to_lightlevel.js" or "/opt/deCONZ/lux_to_lightlevel.js"
I've tested with removing and also with connected, docker also restartet after change the script
okay, I have found the error. The file must be called json not js
You are using the official docker image ?
So when you make "ls -la" we need to see the *.js file (the script) and the *.json (the DDF) ? And if both files are here you can just use
"script": "lux_to_lightlevel.js",
but now the "lux" wont changed ....
it calls also Temperaturregler?
@Smanar my mistake, I had named the DDF file "lux_to_lightlevel.js" :D and not after the device. I have now adjusted this so that there is no confusion. And yes I use the official Docker image, I just haven't found the "lux_to_lightlevel.js" yet and don't know the path either. I am an absolute newcomer to Deconz.
@Smanar so I stole the "lux_to_lightlevel.js" and "tuya_swversion.js" from a Windows installation, but the device is still listed as a temperature controller and the display does not work. It always remains at 0 lux.
the device is still listed as a temperature controller
This is strange, can you take a look direclty in the API ? usig phoscon/help/API Information/sensors.
It always remains at 0 lux
To make test without script can you use instead
{
"name": "state/lux",
"read": {
"fn": "none"
},
"parse": {
"dpid": 2,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
},
"default": 0
}
You will need to restart deconz after the change (no need to re-include the device)
{ "config": { "on": true, "reachable": true, "tholddark": 12000, "tholdoffset": 7000 }, "etag": "06e57be68d9573ef96c4ed74dc4527e4", "lastannounced": null, "lastseen": "2024-02-16T19:11Z", "manufacturername": "_TZE200_khx7nnka", "modelid": "TS0601", "name": "Lichtsensor", "state": { "dark": false, "daylight": false, "lastupdated": "2024-02-16T19:11:45.128", "lightlevel": 0, "lux": 3 }, "swversion": "1.0.6", "type": "ZHALightLevel", "uniqueid": "a4:c1:38:66:cf:78:e4:b0-01-ef00" }
and Events:
{ "20:11:45:161": { "e": "changed", "id": "35", "r": "sensors", "state": { "dark": false, "daylight": false, "lastupdated": "2024-02-16T19:11:45.128", "lightlevel": 0, "lux": 3 }, "t": "event", "uniqueid": "a4:c1:38:66:cf:78:e4:b0-01-ef00" }, "20:11:59:706": { "e": "changed", "id": "35", "r": "sensors", "state": { "dark": false, "daylight": false, "lastupdated": "2024-02-16T19:11:59.656", "lightlevel": 0, "lux": 3 }, "t": "event", "uniqueid": "a4:c1:38:66:cf:78:e4:b0-01-ef00" }, "20:12:14:253": { "attr": { "id": "35", "lastannounced": null, "lastseen": "2024-02-16T19:12Z", "manufacturername": "_TZE200_khx7nnka", "mode": 1, "modelid": "TS0601", "name": "Lichtsensor", "swversion": "1.0.6", "type": "ZHALightLevel", "uniqueid": "a4:c1:38:66:cf:78:e4:b0-01-ef00" }, "e": "changed", "id": "35", "r": "sensors", "t": "event", "uniqueid": "a4:c1:38:66:cf:78:e4:b0-01-ef00" }, "20:12:14:256": { "e": "changed", "id": "35", "r": "sensors", "state": { "dark": false, "daylight": false, "lastupdated": "2024-02-16T19:12:14.185", "lightlevel": 0, "lux": 3 }, "t": "event", "uniqueid": "a4:c1:38:66:cf:78:e4:b0-01-ef00" }, "20:12:28:787": { "e": "changed", "id": "35", "r": "sensors", "state": { "dark": false, "daylight": false, "lastupdated": "2024-02-16T19:12:28.713", "lightlevel": 0, "lux": 3 }, "t": "event", "uniqueid": "a4:c1:38:66:cf:78:e4:b0-01-ef00" }, "20:12:43:231": { "e": "changed", "id": "35", "r": "sensors", "state": { "dark": false, "daylight": false, "lastupdated": "2024-02-16T19:12:43.241", "lightlevel": 0, "lux": 3 }, "t": "event", "uniqueid": "a4:c1:38:66:cf:78:e4:b0-01-ef00" } }
@Smanar I had adjusted the DDF, but without result, the light is on, so it cannot be 0 lux
@Smanar okay all commands back, it reacts now, although in my opinion with too little, it is displayed at full light 37Lux
@Smanar thank you very much for your support :) the ticket can be closed :) have a nice weekend everyone ;)
Lol, you was too fast for me. On my last try the DDF just take a raw value and display it at lux and no more, so nothing in state/lightlevel for exemple.
Hello @Smanar , can we reopen the ticket ? I've two off this sensor and still see as a plug...
It's same manufacture name ? _TZE200_khx7nnka Else better to open a new issue, or just add the new manufactureName at previous DDF to test if there are clone.
yes, it's exactly the same. As the ddf isn't in a stable version and in view of your last message, I thought the integration wasn't complete.
Oups sorry, my bad, have forget this device. Give me 5mn to restart from clean DDF
So have checked again, the first one need to work, it's a raw value for lux that can be converted for other field
{
"schema": "devcap1.schema.json",
"manufacturername": ["_TZE200_khx7nnka", "_TZE200_yi4jtqq1"],
"modelid": ["TS0601", "TS0601"],
"product": "Tuya Lightsensor Luxmeter",
"sleeper": false,
"status": "Gold",
"subdevices": [
{
"type": "$TYPE_LIGHT_LEVEL_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0xEF00"
],
"items": [
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion",
"read": {
"at": "0x0001",
"cl": "0x0000",
"ep": 1,
"fn": "zcl:attr"
},
"parse": {
"at": "0x0001",
"cl": "0x0000",
"ep": 1,
"fn": "zcl:attr",
"script": "tuya_swversion.js"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/dark"
},
{
"name": "config/tholddark"
},
{
"name": "config/tholdoffset"
},
{
"name": "state/daylight"
},
{
"name": "state/lightlevel"
},
{
"name": "state/lux",
"read": {
"fn": "none"
},
"parse": {
"dpid": 2,
"script": "../generic/illuminance_cluster/lux_to_lightlevel.js",
"fn": "tuya"
},
"default": 0
}
]
}
]
}
With same requirement
To work this DDF NEED to be in the devices/tuya folder, because of relative path "script": "../generic/illuminance_cluster/lux_to_lightlevel.js", if you are on docker, you can edit the path and copy too the file lux_to_lightlevel.js in the same folder
On his last try was just a "hack" to test code", so not good values.
Yes everything is fine ! It works perfectly. Now I have to find how to turn of the bluelight...
Wana make the DDF or want I make it ?
turn of the bluelight
On the device ? I don't see something about that on this device ...
Yes... I put a scotch tape on it 😋
Lool, I was searching zigbee features, there is guys doing same at my work for alarm "indicator light".
BTW do you want to submit the DDF, to have it officialy ?