deconz-rest-plugin icon indicating copy to clipboard operation
deconz-rest-plugin copied to clipboard

Tuya Temp/Humi Sensor with Screen TS0601

Open Ltek opened this issue 2 years ago • 69 comments

This looks like a common Tuya sensor, with screen, under multiple different 'brands' and different shells/cases. Anyone had a DDF for it? thx

Screenshots of what I have is included.

  • Product name: Tuya Temperature and Humidity Sensor with Screen
  • Manufacturer: _TZE200_qoy0ekbd
  • Model identifier: TS0601
  • Device type: Temperature and Humidity Sensor

screenshots...

ConbeeTS0601_node ConbeeTS0601_ClusterEF00 ConbeeTS0601_Cluster0402 ConbeeTS0601_Cluster0001 Capture_ConbeeTS0601_basic

Ltek avatar May 17 '22 13:05 Ltek

Please add all sccreenshots in this post (not external link).

And make sure to stick with the template.

Mimiix avatar May 17 '22 13:05 Mimiix

BTW this device have Humidity/temperature cluster AND the tuya cluster.

From that I m reading on Z2m only the tuya cluster is working, but can't be sure. So it s probably the same working mode than this one https://github.com/dresden-elektronik/deconz-rest-plugin/issues/5927

Can try this DDF

{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TZE200_qoy0ekbd",
  "modelid": "TS0601",
  "product": "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"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/offset",
          "description": "Relative offset to the main measured value.",
          "default": 0
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/humidity",
          "description": "The current relative humidity in percent.",
          "parse": {"fn": "tuya", "dpid": 2, "eval": "Item.val = Attr.val;" },
          "read": {"fn": "tuya"},
          "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"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/offset",
          "description": "Relative offset to the main measured value.",
          "default": 0
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/lastupdated"
        },
        {
          "name": "state/temperature",
          "parse": {"fn": "tuya", "dpid": 1, "eval": "Item.val = Attr.val;" },
          "read": {"fn": "none"},
          "default": 0
        }
      ]
    }
  ]
}

Oups, and still need captures, sorry.

Smanar avatar May 17 '22 14:05 Smanar

@Smanar thx for the help. I created JSON the using Windows Notepad and put in the folder… C:\Program Files (x86)\deCONZ\devices\tuya

But while its showing in deCONZ UI, its not showing in Phoscon?

Ltek avatar May 18 '22 04:05 Ltek

@Smanar we require screenshots for a reason. Please only proceed when they are correctly attached.

Mimiix avatar May 18 '22 05:05 Mimiix

@Smanar we require screenshots for a reason. Please only proceed when they are correctly attached.

attached to first post. thx for the help

Ltek avatar May 18 '22 15:05 Ltek

How look the node on top of your capture, the name is something like "0xXXXX" or something like "temperature 10" ? When you make "edit DDF" on the editor title you can see the file path of the DDF ? Nothing more if you select "hot reload" in the menu ?

Can you make a "Hot reload" but with enabling debug flag " info" and "info_l2" (logs are in help / debug view)

Smanar avatar May 18 '22 15:05 Smanar

How look the node on top of your capture, the name is something like "0xXXXX" or something like "temperature 10" ? When you make "edit DDF" on the editor title you can see the file path of the DDF ? Nothing more if you select "hot reload" in the menu ?

Can you make a "Hot reload" but with enabling debug flag " info" and "info_l2" (logs are in help / debug view)

Attached Debug with 'hot reload'

all 3 devices I paired - multiple times (one TS0201 & two TS0601) node are named "0xXXXX" ... of course, the prior 20+ devices which worked fine have real word names as you pointed out. screenshot attached (I removed/paired them again last night)

Capture Debug.txt

Ltek avatar May 18 '22 17:05 Ltek

(one TS0201 & two TS0601)

The code can work only on this one

  "manufacturername": "_TZE200_qoy0ekbd",
  "modelid": "TS0601",

11:32:18:038 DEV found DDF for 0xA4C13889735D4D20, path: C:/Program Files (x86)/deCONZ/devices/tuya/_TZ3000_yd2e749y.json

This device is not the same one (if the device is realy a _TZ3000_yd2e749y), but I don't see why the DDF is not used for this one, perhaps with flags "error" and "error _l2"

  "manufacturername": "_TZ3000_yd2e749y",
  "modelid": "TS0201",

There is already a DDF for this one that need to work, and no the same file name too https://github.com/dresden-elektronik/deconz-rest-plugin/blob/master/devices/tuya/_TZ3000_yd2e749y_temp_hum_sensor.json

Smanar avatar May 18 '22 20:05 Smanar

Please see the screenshot, you can see all the DDFs (attached) in the Tuya folder. Are both devices (TS0201 and TS0601) using the wrong DDF the one that comes in the install, not the ones associated with proper manufacturer name?

Conbee_TuyaFolder

_TZE200_qoy0ekbd.json.txt _TZ3000_yd2e749y.json.txt ?

Ltek avatar May 18 '22 23:05 Ltek

Debug file attached for hot reload of the TS0201 using Error logging Debug.txt

Ltek avatar May 18 '22 23:05 Ltek

You have phoscon in permit join when you make your tests ? "add new sensor" ? As the device is not included at all, have you try to make a new inclusion now the DDF is loaded ?

Smanar avatar May 19 '22 14:05 Smanar

You have phoscon in permit join when you make your tests? "add new sensor" ? As the device is not included at all, have you try to make a new inclusion now the DDF is loaded ?

I use Phoscon to add the sensor -- and it adds to deCONZ, thats the only way I know how to add it. I dont understand you comment..."device is not included at all". How is it not 'included' if it shows up in deCONZ?

I think we are seeing a bug...

I have 3 devices (2 different models) currently paired: one TZE200_qoy0ekbd and two TZ3000_yd2e749y

both correct DDFs are in the Tuya folder

BUT... ALL 3 devices ONLY use the _TZ3000_yd2e749y.json --- two of the devices should be using _TZE200_qoy0ekbd.json, but they do not

If I remove the _TZ3000_yd2e749y.json from the folder (_TZE200_qoy0ekbd.json still in the folder)... NONE of the devices pull in _TZE200_qoy0ekbd.json even though 2 of the currently paired devices match that manufacture.

Ltek avatar May 19 '22 15:05 Ltek

Perhaps a typo in the DDF, I will check on others zigbee project, easier with copy paste than looking in a picture ^^ But I don't understand why all 3 are using the same DDF

You can see DEV found DDF for device_mac_adress, path: C:/Program Files (x86)/deCONZ/devices/tuya/_TZ3000_yd2e749y.json

For all 3 devices ?

I dont understand you comment..."device is not included at all". How is it not 'included' if it shows up in deCONZ?

Deconz include all zigbee devices, it s a zigbee application. But inluded in deconz, don't mean included in the API. When the device have the name 0xXXXX, it s the zigbee network adress, mean the device is included in the zigbee network. When the API reconise it it use a "API friendly name" like temperature 7. And when making a "hot reload" it just update the API, so I think it do nothing if the device is not already in the API, it s for that I ask you if you have tried to re-include it with all DDF in place.

Edit: So for the _TZ3000_yd2e749y I can't find it on other zigbee project but have checked again the picture and seem ok https://github.com/dresden-elektronik/deconz-rest-plugin/issues/6034 The second one have same model id and manufacture name on other zigbee project.

Can you share a log when rying to include one of the not working device ? with "info", "info_l2" and "ddf" ?

Smanar avatar May 19 '22 15:05 Smanar

I removed the devices and re-paired one of each device model... They each seem to be grabbing the correct DDF now. BUT they are still showing the 0xXXXX name style.

Any way to turn on debug during deCONZ load? Would be nice since there is not clear button on Debug window (really need one). Its a lot more text to copy since it even persists across close/open of the window.

Ltek avatar May 19 '22 16:05 Ltek

They each seem to be grabbing the correct DDF now. BUT they are still showing the 0xXXXX name style

Mean they are not reconised by deconz, even with DDF ...

You can send logs to a file too, but need to run deconz with command line. I just need logs during the pairing so

  • start log with "DDF' (few logs) and "info" (realy talkative) and "info_l2"
  • in phoscon select add new sensor
  • make the reset procedure on the device
  • wait 30s
  • stop logs.

You can too just take a look yourself and copy paster only the part you found usefull.

You can try just with only "error" and "error_l2", just to take a look, no need to copy/paste.

Smanar avatar May 19 '22 16:05 Smanar

I removed both sensors and re-paired them. The DDFs were in the Tuya folder at the same time. Debug log attached DEBUG.txt

Ltek avatar May 19 '22 21:05 Ltek

Both are reconised this time


15:47:35:395 DEV found DDF for 0xA4C1380395605A60, path: C:/Program Files (x86)/deCONZ/devices/tuya/_TZE200_qoy0ekbd.json
10:15:33:056 DEV found DDF for 0xA4C13889735D4D20, path: C:/Program Files (x86)/deCONZ/devices/tuya/_TZ3000_yd2e749y.json

both have made announce

15:49:17:297 device announce 0xA4C13889735D4D20 (0x83F5) mac capabilities 0x80
15:46:43:422 device announce 0xA4C1380395605A60 (0x4E2E) mac capabilities 0x80

And the 0xa4c1380395605a60 have start a complete inclusion procedure, but was not included ...

I will ask others devs for tips because all seem fine. The device have make a rejoin just after the last step on the inclusion procedure, you have make 2 times the reset ?

And if you try only with "error" and "error_l2" nothing special ?

Smanar avatar May 20 '22 16:05 Smanar

@Ltek sorry what is your deconz version ?

Smanar avatar May 20 '22 17:05 Smanar

@Ltek sorry what is your deconz version ?

I was on 2.15.3 and then tried 2.16.0 beta...went back to 15.3

The device have make a rejoin just after the last step on the inclusion procedure, you have make 2 times the reset ?

Not sure what you are asking. I have deleted and re-paired these devices many times (at least 5 or 6 times each device)

I removed and re-paired the TS0201, there's the DDF & Error debug...

16:28:26:954 void zmController::onApsdeDataIndication(const deCONZ::ApsDataIndication&),3950: assertion 'node' failed 16:28:27:788 a4:c1:38:89:73:5d:4d:20/attr/manufacturername expression: Item.val = Attr.val --> _TZ3000_yd2e749y 16:28:28:685 a4:c1:38:89:73:5d:4d:20/attr/modelid expression: Item.val = Attr.val --> TS0201

then I did a Hot Reload on it... 16:30:36:921 update ddf TS0201 index 66

Ltek avatar May 20 '22 22:05 Ltek

Not sure what you are asking. I have deleted and re-paired these devices many times (at least 5 or 6 times each device)

The inclusion procedure take lot of step

15:46:44:407 [1] get node descriptor for 0xa4c1380395605a60
15:48:54:238 [2] get active endpoints for 0xa4c1380395605a60
15:47:08:900 [3] get simple descriptor 0x01 for 0xa4c1380395605a60
15:47:10:736 [4.1] Get manufacturer code
15:47:10:736 [4.2] get basic cluster attr 0x0004 for 0xa4c1380395605a60

And it the last step, the next one is the addition in the database, but instead we can see the device join again, but with a new network id,

I was on 2.15.3 and then tried 2.16.0 beta...went back to 15.3

You have issue with it ? Because you miss some improvement

  • Fix processing rules referencing DDF devices
  • Improve loading DDF sensor data from legacy DB tables
  • Improve detection NWK address changes and ZDP discovery

Can't make a fast try with this version ?

Smanar avatar May 21 '22 12:05 Smanar

I was on 2.15.3 and then tried 2.16.0 beta...went back to 15.3

You have issue with it ? Because you miss some improvement

  • Fix processing rules referencing DDF devices
  • Improve loading DDF sensor data from legacy DB tables
  • Improve detection NWK address changes and ZDP discovery

Can't make a fast try with this version ?

Yes... 16.0 -- usually requires two tries (device resets) to pair -- does not pull in all the data -- does not associate the DDF ever -- after reboot (restart deCONZ) ALL cluster information is gone, the device still shows on the UI ---- does not read the device at all even when using Read button: no Error or DDF in debug log at all.

15.3 -- pairs on first try, appears in UI in 2 or 3 seconds -- pulls in more data from device on pairing -- associates the DDF immediately ---- installed 15.3 directly over 16.0, deleted the device and re-paired... worked paired immediately, pulling in all info, and associated with DDF (Debug_15.3_pair log attached)

DEBUG_16.0beta.txt DEBUG_15.3pair.txt

Ltek avatar May 21 '22 14:05 Ltek

Asked @manup to check in.

Mimiix avatar May 23 '22 14:05 Mimiix

@manup any ideas on this? I cant imagine these are different internally than any of the other Tuya devices?

Ltek avatar May 25 '22 02:05 Ltek

@manup -- I tried 2.16.1 and its the same as 15.3 ... adds the devices but not adding them properly so Phoscon shows them

Ltek avatar May 27 '22 22:05 Ltek

Phoscon won't show them in the first place as it needs seperate support. The rest api should.

I've asked manup again to check

Mimiix avatar May 27 '22 23:05 Mimiix

Hmm the temperature and humidity sensors should be shown generically in the Phoscon App when it's in the REST-API. Do you see the respective sensors in the API information tool?

"Phoscon App > Menu > Help > API Information > Sensors"

Is there a product page or Amazon link for this sensor?

manup avatar May 28 '22 00:05 manup

I've added and removed them at least 20 times each (and tried different physical devices, I have 6 of them). Neither sensor model shows in Phoscon -- I attached the Phoscon info you asked for.

links to both models... https://www.aliexpress.com/item/3256802176456322.html https://www.aliexpress.com/item/3256803451172448.html

Phoscon_API_Sensors.txt

Ltek avatar May 28 '22 04:05 Ltek

@manup ?

Ltek avatar May 29 '22 18:05 Ltek

@Ltek you can't expect an reply within an day, especially in the weekend 😅

Mimiix avatar May 29 '22 19:05 Mimiix

I'm sure he's busy. I'm just bumping it, it has been 2 days, not 1 ;-) I'm eager to get it done, its been 2 weeks since I posted and I feel like I'm banging my head against a wall without progress. Thanks for the help!

Ltek avatar May 29 '22 19:05 Ltek