dresden-elektronik / deconz-rest-plugin

deCONZ REST-API plugin to control ZigBee devices
BSD 3-Clause "New" or "Revised" License
1.9k stars 502 forks source link

Add Tuya Smart Zigbee Thermometer/Humidy reader #7542

Closed KRGT-NL closed 8 months ago

KRGT-NL commented 9 months ago

Is there already an existing issue for this?

Product name

Tuya Smart Zigbee Thermometer

Manufacturer

_TZE200_zl1kmjqx

Model identifier

TS0601

Device type to add

Sensor

Node info

image

Endpoints and clusters

image

Basic

image

Further relevant clusters

Power Configuration

On/Off

Level Control

Color Control

Thermostat

Simple Metering

Electrical Measurement

Any other cluster of relevance/interest

Ordered: https://nl.aliexpress.com/item/1005002836127648.html

KRGT-NL commented 9 months ago

As you can see i do not get enough information from this device to fill in all details...

Mimiix commented 9 months ago

Can you share the list of clusters ?

KRGT-NL commented 9 months ago

Can you share the list of clusters ? Do you mean this one? image

As you can see it is not goodly recognized, as it;s just a sensor in all means, like the Ikea it misses a lot of clusters. image

Mimiix commented 9 months ago

Can you share the list of clusters ? Do you mean this one? image

As you can see it is not goodly recognized, as it;s just a sensor in all means, like the Ikea it misses a lot of clusters. image

Thats often how Tuya works :) no problem there.

They just don't stick to the standard...

github-actions[bot] commented 8 months ago

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.

KRGT-NL commented 8 months ago

No update?

Mimiix commented 8 months ago

@Smanar Can you check in / help out :)?

Smanar commented 8 months ago

It seem this device is a clone and use a previous DDF. Can you try this one ?


{
  "schema": "devcap1.schema.json",
  "manufacturername": ["_TZE200_bjawzodf", "_TZE200_zl1kmjqx"],
  "modelid": ["TS0601", "TS0601"],
  "product": "Tuya multi sensor",
  "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: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/offset",
          "default": 0
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/humidity",
          "parse": {"fn": "tuya", "dpid": 2, "eval": "Item.val = 10 * Attr.val + R.item('config/offset').val;" },
          "read": {"fn": "tuya"},
          "refresh.interval": 84000,
          "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: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/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
        }
      ]
    }
  ]
}
KRGT-NL commented 8 months ago

Let me check how I do this!

Smanar commented 8 months ago

Depend of your OS, easier on real 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/<DECONZUSER>/.local/share/dresden-elektronik/deCONZ/devices) will override the pre-packaged files to allow users to amend and keep their own files if desired.

If you are on the offical docker, you have a persistent folder.

If you are using HA, you have one too, but harder to use.

KRGT-NL commented 8 months ago

You can guess which one I have haha

I will check with Portainer the exact mapping in HassOS and will put the file on Hass with the Samba Share addon :-)

Smanar commented 8 months ago

Lol. you have the short and long procedure here https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839

KRGT-NL commented 8 months ago

image

image

Looks like that it works. :)

Smanar commented 8 months ago

Thx for return. PR done https://github.com/dresden-elektronik/deconz-rest-plugin/pull/7658