Tuya Solar Light Sensor Lux Value always 0

Hi!

I found following past thread: Light sensor ZSS-QY-LS-C / TS0222_TZ3000_8uxxzz4b unknown - #14 by Smanar

I have a Tuya Solar Light Sensor from Ali

what I did was editing the above DDF, this works to get the device recognized in Phoscon, but while I see measured Values in deconz, the Lux Value in Phoscon stays at 0.

Can anyone help here? What am I doing wrong?

Thank you!

EDIT: Manuf. ID: _TZ3000_j6adk9id, just in case someone is already searching for it.

This device need the tuya unlock sequence, and it seem it use classic cluster, so nothing special.
Where have you put the DDF ? because of the relative path

        {
          "name": "state/lightlevel",
          "awake": true,
          "parse": {
            "at": "0x0000",
            "cl": "0x0400",
            "ep": 1,
            "script": "../generic/illuminance_cluster/sml_light_level.js"
          }
        },

This device need the tuya unlock sequence

Ok, how I need to unlock it? Do you have a hint?

Where have you put the DDF ? because of the relative path

I use deconz in homeassistant in a docker.
Since I can’t permanently write in the “../device/tuya” folder, I put the ddf into the “/data/.local/share/dresden-elektronik/deCONZ/devices/” path and replaced the relative paths with absolute like “/usr/share/deCONZ/devices/generic/” and “/usr/share/deCONZ/devices/tuya/”.

my DDF:

{
  "schema": "devcap1.schema.json",
  "manufacturername": ["_TZ3000_8uxxzz4b", "_TZ3000_hy6ncvmw", "_TZ3000_9kbbfeho", "_TZ3000_l6rsaipj", "_TZ3000_j6adk9id"],
  "modelid": ["TS0222", "TS0222", "TS0222", "TS0222","TS0222"],
  "vendor": "Tuya",
  "product": "Tuya Luminance sensor",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_LIGHT_LEVEL_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0400"
      ],
      "items": [
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "refresh.interval": 86400,
          "read": {
            "at": "0x0001",
            "cl": "0x0000",
            "ep": 1,
            "fn": "zcl:attr"
          },
          "parse": {
            "at": "0x0001",
            "cl": "0x0000",
            "ep": 1,
            "fn": "zcl:attr",
            "script": "/usr/share/deCONZ/devies/tuya/tuya_swversion.js"
          }
        },
        {
          "name": "config/tuya_unlock"
        },
        {
          "name": "config/battery",
          "parse": {
            "at": "0x0021",
            "cl": "0x0001",
            "ep": 1,
            "eval": "Item.val = Attr.val / 2;",
            "fn": "zcl:attr"
          },
          "default": 0
        },
        {
          "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",
          "awake": true,
          "parse": {
            "at": "0x0000",
            "cl": "0x0400",
            "ep": 1,
            "script": "/usr/share/deCONZ/devies/generic/illuminance_cluster/sml_light_level.js"
          }
        },
        {
          "name": "state/lux"
        }
      ]
    }
  ],
  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 1,
      "dst.ep": 1,
      "cl": "0x0001",
      "report": [
        {
          "at": "0x0021",
          "dt": "0x20",
          "min": 60,
          "max": 3600,
          "change": "0x00000001"
        }
      ]
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0400",
      "report": [
        {
          "at": "0x0000",
          "dt": "0x21",
          "min": 60,
          "max": 600,
          "change": "0x0000FFFF"
        }
      ]
    }
  ]
}

The model ID is not yet known. Could you please open a device request here to add your device to the database?

1 Like

added

the initial ddb file on shared on github worked, i see now the Lux value in phoscon! Maybe the Temp. and Humid. will work too?

You already have it ^^.

        {
          "name": "config/tuya_unlock"
        },

For the rest if I m right, was solved by @mattreim ?
Your DDF was probably good, but you probably had issue because of the relative path, if you try to make another DDF later, try to take a look in logs with the flag “DDF”, you will see the raw value and the “magic” done by deconz, can be usefull.

1 Like

You already have it ^^.

I don’t realy know why to paths didn’t work.. maybe the absolute paths are not valid for phoscon.

For the rest if I m right, was solved by @mattreim ?

Yes! :flexed_biceps: Awesome.. It works like expected now. Thank you very much!

Your DDF was probably good, but you probably had issue because of the relative path, if you try to make another DDF later, try to take a look in logs with the flag “DDF”, you will see the raw value and the “magic” done by deconz, can be usefull.

For sure, my motivation was to give back something to the community and this is fun.. The next step for me will be to understand how ddb files are working :smiley: that seems much more comfortable then coding in docker :sweat_smile:

:warning:For everyone else paring this device just be warned: Somehow you get endpoints for temp. and humid. in deconz, but they always stay at zero. Since there’s no mentioning of a temp. or humid. sensor on the sales page I think this is just a cost factor of using COTS-boards, without the respective hardware sensors.

Can be normal.
Try to press the “read” button on bottom it will read ALL attributes, but better to select an attribute to read only this one. As sensors are lazy, you probably need to awake the device in same time you ask for the attribute.
Yeah, not easy ^^.

I tried all that, and even waited now for some days, but temp. and humid. always stayed at 0.
Now I’m triggered to find out, if the DDF is configured wrongly or the hardware just not exist :smiley:

After checking on Z2M, you are 100% right, sorry.

For everyone else paring this device just be warned: Somehow you get endpoints for temp. and humid. in deconz, but they always stay at zero. Since there’s no mentioning of a temp. or humid. sensor on the sales page I think this is just a cost factor of using COTS-boards, without the respective hardware sensors.

Fair enough! Thank you for your research and reply :wink: