TZE200_locansqn TS0601 Temp / Humi / Clock

Hi everybody,
My Tuya devices has no entities/controls in home assistant. It´s Zigbee Tuya Temp & Humi Display with integr. Clock.
Thanks in advance for the support.

Log.txt

Additiional Information:
022-01-15 20:45:22 DEBUG (MainThread) [zigpy.appdb] [0x62e0:1:0x0001] Attribute id: 32 value: 31.1
2022-01-15 20:45:22 DEBUG (MainThread) [zigpy.appdb] [0x62e0:1:0x0001] Attribute id: 33 value: 200
2022-01-15 20:45:22 DEBUG (MainThread) [zigpy.appdb] [0xfb52:1:0x0001] Attribute id: 32 value: 28
2022-01-15 20:45:22 DEBUG (MainThread) [zigpy.appdb] [0xf2c7:1:0x0001] Attribute id: 33 value: 94
2022-01-15 20:45:22 DEBUG (MainThread) [zigpy.appdb] [0x106c:1:0x0006] Attribute id: 0 value: 0
2022-01-15 20:45:22 DEBUG (MainThread) [zigpy.appdb] [0x106c:1:0x0008] Attribute id: 0 value: 254
2022-01-15 20:45:22 DEBUG (MainThread) [zigpy.appdb] [0x4f93:1:0x0000] Attribute id: 4 value: _TZE200_locansqn
2022-01-15 20:45:22 DEBUG (MainThread) [zigpy.appdb] [0x4f93:1:0x0000] Attribute id: 5 value: TS0601
2022-01-15 20:45:22 DEBUG (MainThread) [zigpy.appdb] [0x4f93:1:0x0001] Attribute id: 49 value: 3
2022-01-15 20:45:22 DEBUG (MainThread) [zigpy.appdb] [0x4f93:1:0x0001] Attribute id: 51 value: 2
2022-01-15 20:45:22 DEBUG (MainThread) [zigpy.appdb] [0x4f93:1:0x0000] Attribute id: 1 value: 67
2022-01-15 20:45:22 DEBUG (MainThread) [zigpy.appdb] [0x4f93:1:0x0000] Attribute id: 65506 value: 49
2022-01-15 20:45:22 DEBUG (MainThread) [zigpy.appdb] [0x4f93:1:0x0000] Attribute id: 65508 value: 0
2022-01-15 20:45:22 DEBUG (MainThread) [zigpy.appdb] [0x4f93:1:0xef00] Attribute id: 513 value: 217
2022-01-15 20:45:22 DEBUG (MainThread) [zigpy.appdb] [0x4f93:1:0xef00] Attribute id: 514 value: 60
2022-01-15 20:45:22 DEBUG (MainThread) [zigpy.appdb] [0x4f93:1:0xef00] Attribute id: 516 value: 100
2022-01-15 20:45:22 DEBUG (MainThread) [zigpy.appdb] [0x4f93:1:0x0001] Attribute id: 33 value: 200
2022-01-15 20:45:22 DEBUG (MainThread) [zigpy.appdb] [0x4f93:1:0x0000] Attribute id: 65503 value: h�u)o�u)ep�u)

Attr:  513  Temp /10
Attr: 514 Humidity
Attr: 516 Batterie

now i need a little help . The Values don´t appear on HA.
I dont know how to change the Programm.
I modified this
ts0601_temperature.py.txt

Some Log...
2022-01-17 22:09:41 INFO (MainThread) [ts0601_temperature] toy3375 514, 56
2022-01-17 22:09:41 INFO (MainThread) [ts0601_temperature] toy3375 humid, 56
2022-01-17 22:09:41 ERROR (MainThread) [zigpy_deconz.uart] Unexpected error handling the frame: 'measured_value'
2022-01-17 22:09:42 DEBUG (MainThread) [zhaquirks.tuya] [0x77f3:1:0xef00] Received value [2] for attribute 0x040e (command 0x0002)
2022-01-17 22:09:42 DEBUG (MainThread) [zhaquirks.tuya] [0x77f3:1:0xef00] Received value [0, 0, 0, 100] for attribute 0x0204 (command 0x0002)
2022-01-17 22:09:42 INFO (MainThread) [ts0601_temperature] toy3375 516, 100
2022-01-17 22:09:42 INFO (MainThread) [ts0601_temperature] toy3375 batt, 100

Enable debug logs - if you didn't that already:
logger:
  default: info
  logs:
    homeassistant.components.zha: debug
    zigpy: debug
    zhaquirks: debug

Place that file in zha_custom_quirks
ts0601_temperature.py.zip
Restart HA.
Remove and pair device.
Try, and if have errors attach here whole, I mean WHOLE, HA log as a file.

Whole_Log.txt

@toy3375
unk_model means that device wasn't properly initialized. You need to remove it and add again. Maybe after HA restart.
Your device sends those attributes:
2022-01-21 19:19:08 DEBUG (MainThread) [zhaquirks.tuya] [0xc1f7:1:0xef00] Received value [0] for attribute 0x0409 (command 0x0002)
2022-01-21 19:19:08 DEBUG (MainThread) [zhaquirks.tuya] [0xc1f7:1:0xef00] Received value [0, 0, 1, 134] for attribute 0x020a (command 0x0002)
2022-01-21 19:19:08 DEBUG (MainThread) [zhaquirks.tuya] [0xc1f7:1:0xef00] Received value [0, 0, 0, 0] for attribute 0x020b (command 0x0002)
2022-01-21 19:19:08 DEBUG (MainThread) [zhaquirks.tuya] [0xc1f7:1:0xef00] Received value [0, 0, 0, 60] for attribute 0x020c (command 0x0002)
2022-01-21 19:19:08 DEBUG (MainThread) [zhaquirks.tuya] [0xc1f7:1:0xef00] Received value [0, 0, 0, 20] for attribute 0x020d (command 0x0002)
2022-01-21 19:19:08 DEBUG (MainThread) [zhaquirks.tuya] [0xc1f7:1:0xef00] Received value [0, 0, 0, 120] for attribute 0x0211 (command 0x0002)
2022-01-21 19:19:08 DEBUG (MainThread) [zhaquirks.tuya] [0xc1f7:1:0xef00] Received value [0, 0, 0, 120] for attribute 0x0212 (command 0x0002)
2022-01-21 19:19:08 DEBUG (MainThread) [zhaquirks.tuya] [0xc1f7:1:0xef00] Received value [0, 0, 0, 6] for attribute 0x0213 (command 0x0002)
2022-01-21 19:19:09 DEBUG (MainThread) [zhaquirks.tuya] [0xc1f7:1:0xef00] Received value [0, 0, 0, 6] for attribute 0x0214 (command 0x0002)
2022-01-21 19:19:19 DEBUG (MainThread) [zhaquirks.tuya] [0xc1f7:1:0xef00] Received value [0, 0, 0, 214] for attribute 0x0201 (command 0x0002)
2022-01-21 19:19:19 ERROR (MainThread) [zigpy_deconz.uart] Unexpected error handling the frame: 'measured_value'
2022-01-21 19:19:19 DEBUG (MainThread) [zhaquirks.tuya] [0xc1f7:1:0xef00] Received value [0, 0, 0, 51] for attribute 0x0202 (command 0x0002)
2022-01-21 19:19:19 ERROR (MainThread) [zigpy_deconz.uart] Unexpected error handling the frame: 'measured_value'
2022-01-21 19:19:19 DEBUG (MainThread) [zhaquirks.tuya] [0xc1f7:1:0xef00] Received value [0, 0, 0, 100] for attribute 0x0204 (command 0x0002)

0x0204 look like battery
0x0201 temperature
0x0202 humidity
It should work for 99.9%
That error for "measured_value" is strange. Which HA version do you use??
First repair it since quirk wasn't properly loaded.

Ok.
At first i deleted the Device then i restarted HA.
After few minutes i added Device again.  Now i see the battery stats and on ZigBeee  device the Wifi Signal is on.
But i don´t see Temp and Humi.
here some photos and Log file.

Whole_Log_20220123_103800.txt

i found in the Log:
2022-01-23 09:59:17 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.zha entity: sensor.tze200_locansqn_ts0601_23e48c55_power
2022-01-23 09:59:17 DEBUG (MainThread) [zigpy.appdb] Error handling '_unsupported_attribute_added' event with (a4:c1:38:92:55:8c:e4:23, 1, 1029, 0) params: FOREIGN KEY constraint failed
2022-01-23 09:59:17 DEBUG (MainThread) [zigpy.appdb] Error handling '_unsupported_attribute_added' event with (a4:c1:38:92:55:8c:e4:23, 1, 1026, 0) params: FOREIGN KEY constraint failed
2022-01-23 09:59:17 DEBUG (MainThread) [zigpy_deconz.uart] Frame received: 0x1c4c000c00050002f310ffc3
2022-01-23 09:59:17 DEBUG (MainThread) [zigpy.appdb] Error handling '_unsupported_attribute_added' event with (a4:c1:38:92:55:8c:e4:23, 1, 1, 32) params: FOREIGN KEY constraint failed
2022-01-23 09:59:17 DEBUG (MainThread) [zigpy.appdb] Error handling '_unsupported_attribute_added' event with (a4:c1:38:92:55:8c:e4:23, 1, 1, 33) params: FOREIGN KEY constraint failed
2022-01-23 09:59:24 DEBUG (MainThread) [zigpy.zcl] [0x10f3:1:0xef00] ZCL request 0x0002: [Command(status=0, tsn=199, command_id=514, function=0, data=[4, 0, 0, 0, 67])]
2022-01-23 09:59:24 DEBUG (MainThread) [zhaquirks.tuya] [0x10f3:1:0xef00] Received value [0, 0, 0, 67] for attribute 0x0202 (command 0x0002)
2022-01-23 09:59:24 ERROR (MainThread) [zigpy_deconz.uart] Unexpected error handling the frame: 'measured_value'
address_mode=ADDRESS_MODE.NWK address=0x10f3>, 1, 260, 61184, b'\t.\x02\x00\xc6\x01\x02\x00\x04\x00\x00\x00\xdb', 0, 175, 215, 26, 166, 7, 0, -67]
2022-01-23 09:59:24 DEBUG (MainThread) [zigpy.zcl] [0x10f3:1:0xef00] ZCL deserialize: <ZCLHeader frame_control= manufacturer=None tsn=46 command_id=2>
2022-01-23 09:59:24 DEBUG (MainThread) [zigpy.zcl] [0x10f3:1:0xef00] ZCL request 0x0002: [Command(status=0, tsn=198, command_id=513, function=0, data=[4, 0, 0, 0, 219])]
2022-01-23 09:59:24 DEBUG (MainThread) [zhaquirks.tuya] [0x10f3:1:0xef00] Received value [0, 0, 0, 219] for attribute 0x0201 (command 0x0002)
2022-01-23 09:59:24 ERROR (MainThread) [zigpy_deconz.uart] Unexpected error handling the frame: 'measured_value'

After reload ZHA , it founds Temp and Humi without values.

That code was written for the device, and it worked - it should work for you too.
It was written with new approach, but that should not be a problem here, since you have newest HA version.
Nevertheless here's same code rewritten in the older approach.
Replace and test it.
HA restart it's a minimum - best is to re-pair device.
ts0601_temperature.py.zip

YEAH.. looks good

Remove Tuya Device
Replace File
Repair Device ( only Battery shown )
Reload Intergration ( Temp & Humi avaible )

and now the Bonus-Level. Any Idea for the Clock ( Time ) ? :)

and now the Bonus-Level. Any Idea for the Clock ( Time ) ? :)

You think you will ever wanna to get that from the device?
Here's a list of your attributes. You need to check which is what, then everything is possible.
https://github.com/zigpy/zha-device-handlers/issues/1286#issuecomment-1019375279
BTW once paired device should sync wireless with HA time.

Try version below.
Time offset wasn't sent, but I see that your device is making a request for time update.
Device MUST ask for time update - there's no possibility to force it.
Replace, Restart, Re-pair
ts0601_temperature.py.zip

There´s a new error in the Log:
2022-01-24 18:04:51 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:04:52 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:04:53 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:03 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:03 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:03 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:14 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:14 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Received value [2] for attribute 0x040f (command 0x0002)
2022-01-24 18:05:14 ERROR (MainThread) [zigpy.device] Failed to parse message (b'098402003901') on cluster 61184, because Data is too short to contain 2 bytes
2022-01-24 18:05:25 ERROR (MainThread) [zigpy.device] Failed to parse message (b'098502005b01') on cluster 61184, because Data is too short to contain 2 bytes
2022-01-24 18:05:35 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:35 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:35 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:35 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:35 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:36 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:36 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:36 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:36 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:36 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:36 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:36 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:37 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:37 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:47 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:47 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:48 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:48 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:48 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:48 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:48 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:48 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:48 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:48 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:49 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:49 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:49 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:05:50 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:06:10 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Received value [0] for attribute 0x0409 (command 0x0002)
2022-01-24 18:06:11 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Received value [0, 0, 1, 134] for attribute 0x020a (command 0x0002)
2022-01-24 18:06:11 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Received value [0, 0, 0, 0] for attribute 0x020b (command 0x0002)
2022-01-24 18:06:11 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Received value [0, 0, 0, 60] for attribute 0x020c (command 0x0002)
2022-01-24 18:06:11 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Received value [0, 0, 0, 20] for attribute 0x020d (command 0x0002)
2022-01-24 18:06:11 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Received value [0, 0, 0, 120] for attribute 0x0211 (command 0x0002)
2022-01-24 18:06:11 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Received value [0, 0, 0, 120] for attribute 0x0212 (command 0x0002)
2022-01-24 18:06:11 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Received value [0, 0, 0, 6] for attribute 0x0213 (command 0x0002)
2022-01-24 18:06:11 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Received value [0, 0, 0, 6] for attribute 0x0214 (command 0x0002)
2022-01-24 18:06:12 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:06:12 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Received value [0, 0, 0, 220] for attribute 0x0201 (command 0x0002)
2022-01-24 18:06:12 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Received value [0, 0, 0, 58] for attribute 0x0202 (command 0x0002)
2022-01-24 18:06:13 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:06:13 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:06:13 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:06:14 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:06:15 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:06:16 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:06:18 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:06:19 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:06:20 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:06:21 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:07:24 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Received value [0] for attribute 0x0409 (command 0x0002)
2022-01-24 18:07:24 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Received value [0, 0, 1, 134] for attribute 0x020a (command 0x0002)
2022-01-24 18:07:24 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Received value [0, 0, 0, 0] for attribute 0x020b (command 0x0002)
2022-01-24 18:07:24 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Received value [0, 0, 0, 60] for attribute 0x020c (command 0x0002)
2022-01-24 18:07:24 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Received value [0, 0, 0, 20] for attribute 0x020d (command 0x0002)
2022-01-24 18:07:24 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Received value [0, 0, 0, 120] for attribute 0x0211 (command 0x0002)
2022-01-24 18:07:24 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Received value [0, 0, 0, 120] for attribute 0x0212 (command 0x0002)
2022-01-24 18:07:24 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Received value [0, 0, 0, 6] for attribute 0x0213 (command 0x0002)
2022-01-24 18:07:25 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Received value [0, 0, 0, 6] for attribute 0x0214 (command 0x0002)
2022-01-24 18:07:25 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:07:25 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Received value [0, 0, 0, 222] for attribute 0x0201 (command 0x0002)
2022-01-24 18:07:35 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Received value [0, 0, 0, 57] for attribute 0x0202 (command 0x0002)
2022-01-24 18:07:46 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:07:46 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:07:46 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:07:46 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:07:46 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:07:46 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:07:46 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:07:57 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:07:57 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)
2022-01-24 18:07:57 DEBUG (MainThread) [zhaquirks.tuya] [0x0c76:1:0xef00] Got set time request (command 0x0024)

First, @jacekk015 thatnks for all the work here, i just got one of these devices and thought i was out of luck.  I have the same results as @toy3375.  I am wondering if could be possible to change the temperature units on the device itself to F.  The limited documentation said it could be done though their hub but im not seeing a way via HA

@jbmfg

could be possible to change the temperature units on the device itself to F

Probably yes. You just need to tell me which attribute is responsible for the unit change.

These are the attributes i see for the temperature sensor:
state_class: measurement
unit_of_measurement: °F
device_class: temperature
The units are F in the HA UI but on the device itself theyre still C

@jbmfg
I mean Zigbee attribute from the DEBUG logs.

Well , I try set some to F or to 1 in HA UI , but I don't know how to set attributes.
Time cluster don't send Value too..
Tomorrow I will receive a TUYA Gateway. I will try to get some data from there..

yesterday i received my Tuya Mini Gateway.
i paired the Device with it .
It sets the time correctly and activates the Temp and Humi Sensor .
In Tuya Smart App you can change the Temp from C to F:
My Workaround for now:  (Maybe for @jbmfg too )

Pair device to Tuya Gateway
set Device to C or F , wait for current Time.
then pair back to ZHA

here some Log Data after the workaround
Log after Workaround.txt
.

a big Thank you for your help , @jacekk015 .

Not sure what you did, but there's an attribute that changes value.
2022-01-28 07:45:39 DEBUG (MainThread) [zhaquirks.tuya] [0x7dd0:1:0xef00] Received value [1] for attribute 0x040f (command 0x0002)
2022-01-28 08:08:15 DEBUG (MainThread) [zhaquirks.tuya] [0x492a:1:0xef00] Received value [2] for attribute 0x040f (command 0x0002)

It's possible that 0x040f is responsible for the C/F setting.
Later I will modify the code and add that attribute, so you will have the possibility to check it.
Time setting is strange. Actually we never need to do anything in code because Tuya code in ZHA managaes Time request itself.

Here were are:
i did some research with the TUYA Gateway. i found most attributes but the Time is still not working in ZHA. The Workaround is semigood . The Device Clock doesnt Sync after repairing to ZHA. Time after few hours begin to "running away"...
Here the results :
Received value [0, 0, 0, 87] for attribute 0x0204 (command 0x0002) // Current Battery power , Value = 87% battery capacity
Received value [0, 0, 0, 250] for attribute 0x0201 (command 0x0002) // Current Temp in C° , Value / 10 = 25,0 C°
Received value [0, 0, 0, 54] for attribute 0x0202 (command 0x0002) // Current Humidity in % , Value = 54%
Received value [0, 0, 0, 254] for attribute 0x020a (command 0x0002) // Max. Temp Alarm , Value / 10 = 25,4 C° , After override Attribute 201 change to: Received value [1] for attribute 0x040e (command 0x0002) , see below
Received value [0, 0, 0, 154] for attribute 0x020b (command 0x0002) // Min. Temp Alarm , Value / 10 = 15,4 C° , After underride Attribute 40E change to: Received value [0] for attribute 0x040e (command 0x0002) , see below
Received value [0, 0, 0, 61] for attribute 0x020c (command 0x0002) // max. Humidity Alarm , Value = 61% max. Humidity
Received value [0, 0, 0, 21] for attribute 0x020d (command 0x0002) // min. Humidity Alarm , Vakue = 21% min. Humidity
Received value [0, 0, 0, 6] for attribute 0x0213 (command 0x0002) // Sensitivity temp , Value = 6 / 2 = 3 C° ( Settings Tuya default 3C°  )
Received value [0, 0, 0, 3] for attribute 0x0214 (command 0x0002) // Sensitivity humidity , Value = 3% ( Settings Tuya default 3%  )
Received value [0, 0, 0, 120] for attribute 0x0211 (command 0x0002) // Report Temperature , Value = 120 min ( Settings Tuya default 120 Min. )
Received value [0, 0, 0, 120] for attribute 0x0212 (command 0x0002) // Report Humidity , Value = 120 min ( Settings Tuya default 120 Min. )
Received value [1] for attribute 0x0409 (command 0x0002) //  change C to F  0=C 1=F
Received value [1] for attribute 0x040E (command 0x0002) // alarm Temp 0 = underride , 1 = overide , 2 = all is fine :)
Received value [1] for attribute 0x040F (command 0x0002) // alarm Humidity 0 = underride , 1 = overide , 2 = all is fine :)

This device should be very similar (if not the same) as _TZE200_lve3dvpy
The clock synchronization should happen on Tuya request command 0x24, same way as for Tuya thermostats and TRVs

yes , i see the time request @0x24 but it doesnt work...
2022-01-28 20:34:21 DEBUG (MainThread) [zhaquirks.tuya] [0x5215:1:0xef00] Received value [0, 0, 0, 45] for attribute 0x0202 (command 0x0002)
2022-01-28 20:34:21 DEBUG (MainThread) [zhaquirks.tuya] [0x5215:1:0xef00] Got set time request (command 0x0024)
2022-01-28 20:34:27 DEBUG (MainThread) [zhaquirks.tuya] [0x5215:1:0xef00] Got set time request (command 0x0024)
2022-01-28 20:34:27 DEBUG (MainThread) [zhaquirks.tuya] [0x5215:1:0xef00] Got set time request (command 0x0024)
2022-01-28 20:34:27 DEBUG (MainThread) [zhaquirks.tuya] [0x5215:1:0xef00] Got set time request (command 0x0024)
2022-01-28 20:34:27 DEBUG (MainThread) [zhaquirks.tuya] [0x5215:1:0xef00] Got set time request (command 0x0024)
2022-01-28 20:34:27 DEBUG (MainThread) [zhaquirks.tuya] [0x5215:1:0xef00] Got set time request (command 0x0024)
2022-01-28 20:34:27 DEBUG (MainThread) [zhaquirks.tuya] [0x5215:1:0xef00] Got set time request (command 0x0024)
2022-01-28 20:34:28 DEBUG (MainThread) [zhaquirks.tuya] [0x5215:1:0xef00] Got set time request (command 0x0024)

i set in quirks:
set_time_offset = 1970
and i try
set_time_offset = 2000
but still not working

If you remember I've changed code to old type methods, a bus, instead of direct cluster name call.
Till this time that approach always worked, but for you not.
I see that you use Deconz - it's strange, because I have ZBBridge from Sonoff and 10pcs of Zigbee TRVs and all of them sync the time without problems.

ok . do you think i can put the mini Tuya gateway in HA as a device  ? How do use ZBBridge an HA ?

ok.. i google it. it's not possible.

i give up... :smile: maybe tomorow :crossed_fingers:

Logger: zigpy.device
Source: /usr/local/lib/python3.9/site-packages/zigpy/device.py:320
First occurred: 22:19:25 (6 occurrences)
Last logged: 22:19:30
Failed to parse message (b'09d00200bc00') on cluster 61184, because Data is too short to contain 2 bytes
Failed to parse message (b'09d10200bd00') on cluster 61184, because Data is too short to contain 2 bytes
Failed to parse message (b'09d20200be00') on cluster 61184, because Data is too short to contain 2 bytes
Failed to parse message (b'09d30200bf00') on cluster 61184, because Data is too short to contain 2 bytes
Failed to parse message (b'09d40200c000') on cluster 61184, because Data is too short to contain 2 bytes
is this the Time Cluster ?

Need bigger log. 61184 is hex 0xef00 - so it's a Tuya cluster.
Probably not set time command
https://www.rapidtables.com/convert/number/hex-to-decimal.html?x=0xef00

LOG20220128.txt
Here the LOG...

Replace the quirk file and restart HA.
Then remove and re-pair device.
ts0601_temperature.py.zip

Replace the quirk file and restart HA. Then remove and re-pair device. ts0601_temperature.py.zip

There is an error loading:
2022-01-28 21:50:12 DEBUG (MainThread) [zhaquirks] Loading custom quirks module ts0601_temperature
2022-01-28 21:50:12 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry socket://<IP_ADDRESS>:8888 for zha
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 313, in async_setup
result = await component.async_setup_entry(hass, self)  # type: ignore
File "/usr/src/homeassistant/homeassistant/components/zha/init.py", line 99, in async_setup_entry
setup_quirks(config)
File "/usr/local/lib/python3.9/site-packages/zhaquirks/init.py", line 403, in setup
importer.find_module(modname).load_module(modname)
File "", line 529, in _check_name_wrapper
File "", line 1029, in load_module
File "", line 854, in load_module
File "", line 274, in _load_module_shim
File "", line 711, in _load
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/config/zha_custom_quirks/ts0601_temperature.py", line 49, in
class CustomTuyaOnOff(LocalDataCluster, OnOff):
NameError: name 'OnOff' is not defined

NoNameError: name 'OnOff' is not defined
^^same error here

Yes , i confirm. Error on Startup.
File "/usr/local/lib/python3.9/site-packages/zhaquirks/init.py", line 403, in setup
importer.find_module(modname).load_module(modname)
File "", line 529, in _check_name_wrapper
File "", line 1029, in load_module
File "", line 854, in load_module
File "", line 274, in _load_module_shim
File "", line 711, in _load
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/config/quirks/ts0601_temperature.py", line 49, in
class CustomTuyaOnOff(LocalDataCluster, OnOff):
NameError: name 'OnOff' is not defined

i add @Imports "OnOff," in Line 21.
Now i see a lot of Functions 😃 ... i will try a little bit..
here the modificated File
ts0601_temperature.zip

after reload ZHA intergration i see Temp and Humidity on HA.
The communication works only in one way direction. From Device to HA looks good and Values on HA will synced.
But if i change a value and i force a sync ( press Button on device ). It change to old value ( it displays the value from device ).
I hope you understand 😄

here Logfile . I seems after changing a value , there´s a error more  in Log File
LogFilewith some Errors.txt

Here's corrected quirk.
ts0601_temperature.py.zip
There's no need to press anything on the Device. If the device sends data it overwrites HA data.
Do one thing in a time.
Change one value, if it's edit field hit Enter, after few seconds it should be sent to device.
Write here what value you've changed and post logs.
All errors in the log are connected with Time sync:
Got set time request (command 0x0024)

Here's corrected quirk. ts0601_temperature.py.zip
There's no need to press anything on the Device. If the device sends data it overwrites HA data.
Do one thing in a time. Change one value, if it's edit field hit Enter, after few seconds it should be sent to device. Write here what value you've changed and post logs.
All errors in the log are connected with Time sync:
Got set time request (command 0x0024)

Here I changed the temperature reporting time value to 60:
2022-01-29 18:35:30 DEBUG (MainThread) [zigpy.zcl] [0xab4b:1:0xef00] ZCL deserialize: <ZCLHeader frame_control= manufacturer=None tsn=40 command_id=Command.Default_Response>
2022-01-29 18:35:30 DEBUG (MainThread) [zigpy.zcl] [0xab4b:1:0xef00] ZCL request 0x000b: [0, <Status.UNSUP_MANUF_CLUSTER_COMMAND: 131>]

Here's corrected quirk. ts0601_temperature.py.zip
There's no need to press anything on the Device. If the device sends data it overwrites HA data.
Do one thing in a time. Change one value, if it's edit field hit Enter, after few seconds it should be sent to device. Write here what value you've changed and post logs.
All errors in the log are connected with Time sync:
Got set time request (command 0x0024)

Here I changed the temperature sensitivity to 1:
2022-01-29 18:38:55 DEBUG (MainThread) [zigpy.zcl] [0xab4b:1:0xef00] ZCL deserialize: <ZCLHeader frame_control= manufacturer=None tsn=44 command_id=Command.Default_Response>
2022-01-29 18:38:55 DEBUG (MainThread) [zigpy.zcl] [0xab4b:1:0xef00] ZCL request 0x000b: [0, <Status.UNSUP_MANUF_CLUSTER_COMMAND: 131>]

The battery percentage is also no longer showing in this new version. It's showing up as unknown.

Full logs:
home-assistant.log

Here I changed the temperature sensitivity to 1:
2022-01-29 18:38:55 DEBUG (MainThread) [zigpy.zcl] [0xab4b:1:0xef00] ZCL deserialize: <ZCLHeader frame_control= manufacturer=None tsn=44 command_id=Command.Default_Response>
2022-01-29 18:38:55 DEBUG (MainThread) [zigpy.zcl] [0xab4b:1:0xef00] ZCL request 0x000b: [0, <Status.UNSUP_MANUF_CLUSTER_COMMAND: 131>]

And the logs start from
2022-01-29 18:47:24

Only errors I see are for 0x55be eWeLink MS01

This last log was after an HA reset and a command to change a device parameter. I was hoping it might be useful. The eWeLink MS01 is currently turned off. And even after almost an hour, the battery percentage is still unknown.

Now I removed the device, took out its 3 AAA batteries, restarted the HA, added the device again and recharged the ZHA, otherwise the temperature, humidity values do not appear. Now the values of the configurable attributes did not appear. The battery percentage is back. I hope it helps.
home-assistant.log

After Changing a value (ex. Humidity Alarm ) it will jump back to old value after a while ( at same time LOG Files receive Value from Device with old Value )
It seems that Value will not transmit to Device. Can you put some debug String in LOG after Sending or Polling a Value ?
Thank you for your patience :+1:

I made value change at 11:34 and 11:35
2022-01-30 11:33:06 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0] for attribute 0x0409 (command 0x0002)
2022-01-30 11:33:06 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 1, 14] for attribute 0x020a (command 0x0002)
2022-01-30 11:33:06 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 100] for attribute 0x020b (command 0x0002)
2022-01-30 11:33:17 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 70] for attribute 0x020c (command 0x0002)
2022-01-30 11:33:17 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 30] for attribute 0x020d (command 0x0002)
2022-01-30 11:33:22 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 20] for attribute 0x0211 (command 0x0002)
2022-01-30 11:33:22 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 20] for attribute 0x0212 (command 0x0002)
2022-01-30 11:33:27 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 6] for attribute 0x0213 (command 0x0002)
2022-01-30 11:33:28 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 6] for attribute 0x0214 (command 0x0002)
2022-01-30 11:33:33 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Got set time request (command 0x0024)
2022-01-30 11:33:33 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [1] for attribute 0x040f (command 0x0002)
2022-01-30 11:33:38 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 222] for attribute 0x0201 (command 0x0002)
2022-01-30 11:33:39 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 83] for attribute 0x0202 (command 0x0002)
2022-01-30 11:33:39 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Got set time request (command 0x0024)
2022-01-30 11:33:39 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Got set time request (command 0x0024)
2022-01-30 11:33:39 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Got set time request (command 0x0024)
2022-01-30 11:33:39 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0] for attribute 0x0409 (command 0x0002)
2022-01-30 11:33:39 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Got set time request (command 0x0024)
2022-01-30 11:33:40 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Got set time request (command 0x0024)
2022-01-30 11:33:40 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Got set time request (command 0x0024)
2022-01-30 11:33:43 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0] for attribute 0x0409 (command 0x0002)
2022-01-30 11:33:43 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 1, 14] for attribute 0x020a (command 0x0002)
2022-01-30 11:33:43 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 100] for attribute 0x020b (command 0x0002)
2022-01-30 11:33:48 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 70] for attribute 0x020c (command 0x0002)
2022-01-30 11:33:49 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 30] for attribute 0x020d (command 0x0002)
2022-01-30 11:33:49 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 20] for attribute 0x0211 (command 0x0002)
2022-01-30 11:33:54 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 20] for attribute 0x0212 (command 0x0002)
2022-01-30 11:33:55 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 6] for attribute 0x0213 (command 0x0002)
2022-01-30 11:33:55 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 6] for attribute 0x0214 (command 0x0002)
2022-01-30 11:34:00 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Got set time request (command 0x0024)
2022-01-30 11:34:00 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 222] for attribute 0x0201 (command 0x0002)
2022-01-30 11:34:05 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 81] for attribute 0x0202 (command 0x0002)
2022-01-30 11:34:16 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Got set time request (command 0x0024)
2022-01-30 11:34:16 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Got set time request (command 0x0024)
2022-01-30 11:34:16 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Got set time request (command 0x0024)
2022-01-30 11:34:16 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Got set time request (command 0x0024)
2022-01-30 11:34:16 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Got set time request (command 0x0024)
2022-01-30 11:34:16 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Got set time request (command 0x0024)
2022-01-30 11:34:16 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0] for attribute 0x0409 (command 0x0002)
2022-01-30 11:34:17 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 1, 14] for attribute 0x020a (command 0x0002)
2022-01-30 11:34:22 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 100] for attribute 0x020b (command 0x0002)
2022-01-30 11:34:22 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Got set time request (command 0x0024)
2022-01-30 11:34:22 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Got set time request (command 0x0024)
2022-01-30 11:34:22 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Got set time request (command 0x0024)
2022-01-30 11:34:32 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0] for attribute 0x0409 (command 0x0002)
2022-01-30 11:34:32 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 1, 14] for attribute 0x020a (command 0x0002)
2022-01-30 11:34:38 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 100] for attribute 0x020b (command 0x0002)
2022-01-30 11:34:38 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 70] for attribute 0x020c (command 0x0002)
2022-01-30 11:34:43 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 30] for attribute 0x020d (command 0x0002)
2022-01-30 11:34:43 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 20] for attribute 0x0211 (command 0x0002)
2022-01-30 11:34:54 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 20] for attribute 0x0212 (command 0x0002)
2022-01-30 11:34:54 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 6] for attribute 0x0213 (command 0x0002)
2022-01-30 11:34:54 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 6] for attribute 0x0214 (command 0x0002)
2022-01-30 11:34:59 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Got set time request (command 0x0024)
2022-01-30 11:34:59 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [2] for attribute 0x040f (command 0x0002)
2022-01-30 11:35:10 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 223] for attribute 0x0201 (command 0x0002)
2022-01-30 11:35:20 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 69] for attribute 0x0202 (command 0x0002)
2022-01-30 11:35:21 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Got set time request (command 0x0024)
2022-01-30 11:35:21 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Got set time request (command 0x0024)
2022-01-30 11:35:21 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Got set time request (command 0x0024)
2022-01-30 11:35:21 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0] for attribute 0x0409 (command 0x0002)
2022-01-30 11:35:22 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 1, 14] for attribute 0x020a (command 0x0002)
2022-01-30 11:35:27 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 100] for attribute 0x020b (command 0x0002)
2022-01-30 11:35:27 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 70] for attribute 0x020c (command 0x0002)
2022-01-30 11:35:32 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 30] for attribute 0x020d (command 0x0002)
2022-01-30 11:35:32 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 20] for attribute 0x0211 (command 0x0002)
2022-01-30 11:35:43 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 20] for attribute 0x0212 (command 0x0002)
2022-01-30 11:35:43 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 6] for attribute 0x0213 (command 0x0002)
2022-01-30 11:35:48 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 6] for attribute 0x0214 (command 0x0002)
2022-01-30 11:35:48 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Got set time request (command 0x0024)
2022-01-30 11:35:49 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 223] for attribute 0x0201 (command 0x0002)
2022-01-30 11:35:49 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Received value [0, 0, 0, 66] for attribute 0x0202 (command 0x0002)
2022-01-30 11:35:54 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Got set time request (command 0x0024)
2022-01-30 11:35:54 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Got set time request (command 0x0024)
2022-01-30 11:35:54 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Got set time request (command 0x0024)
2022-01-30 11:35:54 DEBUG (MainThread) [zhaquirks.tuya] [0x4629:1:0xef00] Got set time request (command 0x0024)
2022-01-30 11:36:28 DEBUG (MainThread) [zhaquirks.tuya] [0x4f42:1:0xef00] Received value [0] for attribute 0x0409 (command 0x0002)
2022-01-30 11:36:28 DEBUG (MainThread) [zhaquirks.tuya] [0x4f42:1:0xef00] Received value [0, 0, 1, 4] for attribute 0x020a (command 0x0002)
2022-01-30 11:36:34 DEBUG (MainThread) [zhaquirks.tuya] [0x4f42:1:0xef00] Received value [0, 0, 0, 190] for attribute 0x020b (command 0x0002)
2022-01-30 11:36:34 DE

Maybe useful information.
In TUYA Smartlife APP the value will change after next wake-up. I can force it , when I blow a little bit in to the device.

From what I could see, the attributes are being updated correctly. Here's the log after setting the temperature reporting time to 60:
2022-01-30 09:40:56 DEBUG (MainThread) [zigpy.zcl] [0x1985:1:0xef00] ZCL deserialize: <ZCLHeader frame_control= manufacturer=None tsn=236 command_id=Command.Default_Response>
2022-01-30 09:40:56 DEBUG (MainThread) [zigpy.zcl] [0x1985:1:0xef00] ZCL request 0x000b: [0, <Status.UNSUP_MANUF_CLUSTER_COMMAND: 131>]

Here the log after reading the attribute via the Manage Clusters panel:
2022-01-30 09:45:06 DEBUG (MainThread) [homeassistant.components.zha.api] Get bindable devices: source_ieee: [a4:c1:38:ce:dc:e0:24:35], bindable devices: [[{'ieee': '80:4b:50:ff:fe:0e:a4:6e', 'nwk': 0x0000, 'manufacturer': 'Silicon Labs', 'model': 'EZSP', 'name': 'Silicon Labs EZSP', 'quirk_applied': True, 'quirk_class': 'bellows.zigbee.application.EZSPCoordinator', 'manufacturer_code': 43981, 'power_source': 'Mains', 'lqi': 255, 'rssi': 0, 'last_seen': '2022-01-30T07:34:56', 'available': False, 'device_type': 'Coordinator', 'signature': {'node_descriptor': 'NodeDescriptor(logical_type=<LogicalType.Coordinator: 0>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress|RxOnWhenIdle|MainsPowered|FullFunctionDevice|AlternatePanCoordinator: 143>, manufacturer_code=43981, maximum_buffer_size=82, maximum_incoming_transfer_size=128, server_mask=11329, maximum_outgoing_transfer_size=128, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=True, *is_coordinator=True, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=False, *is_security_capable=False)', 'endpoints': {1: {'profile_id': 260, 'device_type': '0xbeef', 'in_clusters': [], 'out_clusters': []}}}, 'entities': [], 'neighbors': [{'device_type': 'EndDevice', 'rx_on_when_idle': 'Off', 'relationship': 'Child', 'extended_pan_id': 'cc:cc:cc:cc:9d:a8:cc:84', 'ieee': 'a4:c1:38:76:9f:6f:a2:a3', 'nwk': '0xF757', 'permit_joining': 'NotAccepting', 'depth': '1', 'lqi': '181'}, {'device_type': 'EndDevice', 'rx_on_when_idle': 'Off', 'relationship': 'Child', 'extended_pan_id': 'cc:cc:cc:cc:9d:a8:cc:84', 'ieee': '00:12:4b:00:22:cf:90:04', 'nwk': '0x82D1', 'permit_joining': 'NotAccepting', 'depth': '1', 'lqi': '112'}, {'device_type': 'EndDevice', 'rx_on_when_idle': 'Off', 'relationship': 'Child', 'extended_pan_id': 'cc:cc:cc:cc:9d:a8:cc:84', 'ieee': '00:12:4b:00:23:96:ae:96', 'nwk': '0x5CA2', 'permit_joining': 'NotAccepting', 'depth': '1', 'lqi': '108'}, {'device_type': 'EndDevice', 'rx_on_when_idle': 'Off', 'relationship': 'Child', 'extended_pan_id': 'cc:cc:cc:cc:9d:a8:cc:84', 'ieee': 'a4:c1:38:ce:dc:e0:24:35', 'nwk': '0x1985', 'permit_joining': 'NotAccepting', 'depth': '1', 'lqi': '139'}, {'device_type': 'EndDevice', 'rx_on_when_idle': 'Off', 'relationship': 'Child', 'extended_pan_id': 'cc:cc:cc:cc:9d:a8:cc:84', 'ieee': '00:12:4b:00:23:ad:5b:b3', 'nwk': '0x58A0', 'permit_joining': 'NotAccepting', 'depth': '1', 'lqi': '233'}], 'endpoint_names': [{'name': 'undefined_0xbeef'}], 'user_given_name': None, 'device_reg_id': 'f883394d03a3d2da871821f400ab4581', 'area_id': 'sala_de_estar'}]]
2022-01-30 09:45:06 DEBUG (MainThread) [homeassistant.components.zha.api] Requested attributes for: cluster_id: 13, cluster_type: 'in', endpoint_id: 12, response: [{'id': 28, 'name': 'description'}, {'id': 65, 'name': 'max_present_value'}, {'id': 69, 'name': 'min_present_value'}, {'id': 81, 'name': 'out_of_service'}, {'id': 85, 'name': 'present_value'}, {'id': 103, 'name': 'reliability'}, {'id': 104, 'name': 'relinquish_default'}, {'id': 106, 'name': 'resolution'}, {'id': 111, 'name': 'status_flags'}, {'id': 117, 'name': 'engineering_units'}, {'id': 256, 'name': 'application_type'}]
2022-01-30 09:45:06 DEBUG (MainThread) [homeassistant.components.zha.api] Requested commands for: cluster_id: 13, cluster_type: 'in', endpoint_id: 12, response: []
2022-01-30 09:45:19 DEBUG (MainThread) [homeassistant.components.zha.api] Requested attributes for: cluster_id: 13, cluster_type: 'in', endpoint_id: 12, response: [{'id': 28, 'name': 'description'}, {'id': 65, 'name': 'max_present_value'}, {'id': 69, 'name': 'min_present_value'}, {'id': 81, 'name': 'out_of_service'}, {'id': 85, 'name': 'present_value'}, {'id': 103, 'name': 'reliability'}, {'id': 104, 'name': 'relinquish_default'}, {'id': 106, 'name': 'resolution'}, {'id': 111, 'name': 'status_flags'}, {'id': 117, 'name': 'engineering_units'}, {'id': 256, 'name': 'application_type'}]
2022-01-30 09:45:19 DEBUG (MainThread) [homeassistant.components.zha.api] Requested commands for: cluster_id: 13, cluster_type: 'in', endpoint_id: 12, response: []
2022-01-30 09:45:32 DEBUG (MainThread) [homeassistant.components.zha.api] Read attribute for: cluster_id: [13] cluster_type: [in] endpoint_id: [12] attribute: [85] manufacturer: [None] response: [60.0] failure: [{}],

Here the log after changing the attribute to 30 via the panel:
2022-01-30 09:48:26 DEBUG (MainThread) [zigpy.zcl] [0x1985:1:0xef00] ZCL deserialize: <ZCLHeader frame_control= manufacturer=None tsn=240 command_id=Command.Default_Response>
2022-01-30 09:48:26 DEBUG (MainThread) [homeassistant.components.zha.core.device] 0x1985: set: 30 for attr: 85 to cluster: 13 for ept: 12 - res: ([WriteAttributesStatusRecord(status=<Status.SUCCESS: 0>)],)
2022-01-30 09:48:26 DEBUG (MainThread) [homeassistant.components.zha.api] Set attribute for: cluster_id: [13] cluster_type: [in] endpoint_id: [12] attribute: [85] value: [30] manufacturer: [None] response: [([WriteAttributesStatusRecord(status=<Status.SUCCESS: 0>)],)]

But update date and time on the device still doesn't work.

@mrctorres I'm getting lost here.
Some say it works, other it doesn't.
Works through HA or only Manage Clusters??
It should work either way.

Time never works...
Jacek Kończewski @.***> schrieb am So., 30. Jan. 2022,
14:00:

@mrctorres https://github.com/mrctorres I'm getting lost here.
Some say it works, other it doesn't.
Works through HA or only Manage Clusters??
It should work either way.
—
Reply to this email directly, view it on GitHub
https://github.com/zigpy/zha-device-handlers/issues/1286#issuecomment-1025138517,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ARNNXMZBCTZYWJWHC3ZXTM3UYUY73ANCNFSM5MA4XE2A
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you were mentioned.Message ID:
@.***>

@mrctorres I'm getting lost here. Some say it works, other it doesn't.
Works through HA or only Manage Clusters?? It should work either way.

After last night when I removed the batteries from the device, removed it from the HA, re-added it and re-charged the ZHA twice, it looks like it is accepting commands in both modes but the date and time update continues without work.

Time sync is out of my control.
It's managed by the already uploaded code, not the quirk.
Exact that part of the code manages time sync when the device sends 0x0024 - which is set_time_request
https://github.com/zigpy/zha-device-handlers/blob/dev/zhaquirks/tuya/__init__.py#L337
That message in the logs you see comes from here:
https://github.com/zigpy/zha-device-handlers/blob/dev/zhaquirks/tuya/__init__.py#L347

Got set time request

So actually it enters in that part of the code and it should work.
That command line is responsible for transmitting time back to the device:
https://github.com/zigpy/zha-device-handlers/blob/dev/zhaquirks/tuya/__init__.py#L372
Line 153 of the quirk file ts0601_temperature.py contains:
set_time_offset = 1970

You can play with these and try 2000, or even replace or add a line:
set_time_local_offset = 1970

or = 2000
Here's the comment:

Some devices need the timestamp in seconds from 1/1/1970 and others in seconds from 1/1/2000.
Also, there is devices which uses both timestamps variants (probably bug). Use set_time_local_offset var in this cases.

https://github.com/zigpy/zha-device-handlers/blob/dev/zhaquirks/tuya/__init__.py#L295
I don't see any other possibilities here. Maybe admins can suggest something.
Those Chineese device sometimes doesn't use standards.
Also if someone has a gate - maybe try to check if there's no new firmware available.

I noticed that the time request is no longer appearing in the log. What could be happening?

I noticed that the time request is no longer appearing in the log. What could be happening?

Make the device to loose the time/date and check. Maybe it needs more time.
Those Chinese devices lives with their own live.
And they are battery operated - so they are lazy as possible.
I don't own it. Can't guess anything without logs.

Please excuse my ignorance, but is there a way for me to manually send the time information to the device in the format below?
Payload for 0x24 - Time Synchronisation:
Device -> Host 0xef00 Command 0x24 Payload 0x0008
Host -> Device 0xef00 Command 0x24 Payload 0x0008 600d8029 600d8e39  <-- ***** THIS DATA *****
The synopsis is like :

Device send a Time synchronisation request with a uint16 as payload
Host will respond with a payload equal to the same unint16 followed by the UTC time and the local time, for exemple

Would it be possible to insert an attribute like TUYA_TIME in Cluster 0xef00 (TuyaSensorManufCluster ?) to be able to manually send the time information to the device for testing?

I think I got it, but it returns an error:
2022-01-30 12:40:12 DEBUG (MainThread) [zigpy.zcl] [0x1985:1:0xef00] ZCL request 0x000b: [36, <Status.UNSUP_MANUF_CLUSTER_COMMAND: 131>]
I think this device is out of spec

You can't send time if the device doesn't request it.
You got that info in the code mentioned:
https://github.com/zigpy/zha-device-handlers/blob/dev/zhaquirks/tuya/__init__.py#L297

NOTE: You need to wait for time request before setting it. You can't set time without request.
It has to be a response to the request. That's why it's handled by the Tuya code there - not the quirk.

I removed and replaced the batteries and it returned in the log "No handler for cluster command 36":
2022-01-30 12:54:19 DEBUG (MainThread) [zigpy.zcl] [0x1985:1:0xef00] ZCL deserialize: <ZCLHeader frame_control= manufacturer=None tsn=91 command_id=36>
2022-01-30 12:54:19 DEBUG (MainThread) [zigpy.zcl] [0x1985:1:0xef00] ZCL request 0x0024: [[112, 0]]
2022-01-30 12:54:19 DEBUG (MainThread) [zigpy.zcl] [0x1985:1:0xef00] No handler for cluster command 36

That should be totally transparent to the user.
On of my TRV restarted.
2022-01-30 17:02:46 DEBUG (MainThread) [zigpy.zcl] [0x09ec:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=7 command_id=36>
2022-01-30 17:02:46 DEBUG (MainThread) [zigpy.zcl] [0x09ec:1:0xef00] ZCL request 0x0024: [[0, 4]]
2022-01-30 17:02:46 DEBUG (MainThread) [zhaquirks.tuya] [0x09ec:1:0xef00] Got set time request (command 0x0024)
2022-01-30 17:02:46 DEBUG (MainThread) [zigpy.zcl] [0x09ec:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=True is_reply=True disable_default_response=False> manufacturer=4098 tsn=113 command_id=Command.Default_Response>

@mrctorres If you really wanna play with it here's a special version for you.
ts0601_temperature_special.py.zip
Between lines 176 and 211 you've got 0x0024[set_time_reuqest] code, modified that way so it should run it from there.
If you wanna log something just put there:
_LOGGER.info("test")

That's Python - so you need to keep indentation correct.

set_time_offset = 1970

Actually I had removed this line for testing and forgot to put it back.
Putting it back the log was "UNSUP_MANUF_CLUSTER_COMMAND: 131":
2022-01-30 13:57:19 DEBUG (MainThread) [zigpy.zcl] [0x1985:1:0xef00] ZCL request 0x0024: [[37, 0]]
2022-01-30 13:57:19 DEBUG (MainThread) [zhaquirks.tuya] [0x1985:1:0xef00] Got set time request (command 0x0024)
2022-01-30 13:57:25 DEBUG (MainThread) [zigpy.zcl] [0x1985:1:0xef00] ZCL deserialize: <ZCLHeader frame_control= manufacturer=None tsn=59 command_id=Command.Default_Response>
2022-01-30 13:57:25 DEBUG (MainThread) [zigpy.zcl] [0x1985:1:0xef00] ZCL request 0x000b: [36, <Status.UNSUP_MANUF_CLUSTER_COMMAND: 131>]

That's nothing good - from what I see:
https://docs.bosch-iot-suite.com/gateway-software/API/modules/com.prosyst.mbs.zigbee.driver.api/com/prosyst/mbs/services/zigbee/metadata/provider/ZCLStatusEnumeration.html#UNSUP_MANUF_CLUSTER_COMMAND

A manufacturer specific unicast, cluster specific command was received with an unknown manufacturer code, or the manufacturer code was recognized but the command is not supported.

For Tuya manufacturer code is known - it's 4098.
That's how my response is send
2022-01-30 17:02:46 DEBUG (MainThread) [zigpy.zcl] [0x09ec:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=True is_reply=True disable_default_response=False> manufacturer=4098 tsn=113 command_id=Command.Default_Response>

You have:
2022-01-30 13:57:25 DEBUG (MainThread) [zigpy.zcl] [0x1985:1:0xef00] ZCL deserialize: <ZCLHeader frame_control= manufacturer=None tsn=59 command_id=Command.Default_Response>

manufacturer=None - that's strange.
You are using newest, updated HA version??

Your devices are:
2022-01-23 09:59:16 INFO (MainThread) [zigpy.device] [0x10f3] Got Node Descriptor: NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)

manufacturer_code=4417
It's not really Tuya code id
You can check it clicking on Zigbee Device Signature and move the window to the left.
It's in the first line.

Manufacture code 4098 = 0x1002 = Ember [0x1002] (from Silabs SDK).
Can you posting the device signature or if its not in it repairing the device and looking in the log for device and simple description, one of them shall showing the device manufacturer code.
Very likely have some doing the coding and missed changing it in the SDK then its standard Ember [0x1002] if not changing it.

This is what I have:
"NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)",

i have the same manufacturer code
"node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)",
"endpoints": {
"1": {
"profile_id": 260,
"device_type": "0x0302",

Inside no information about manufacture..

@kkossev My TRVs have manufacturer_code=0 = dont need tagging messages with manufacture code.
Perhaps way the device is not responding to commands sent to it then the Zigbee module is ignoring the zigbee commands (ala Zigbee standard) if the manufacturing code is not the same if not doing special code for it, but with 0 is shall normally being OK but its no ZCL commands from no ZCL cluster commands so tuya can have doing different things.
Have some doing some sniffing with tuya ZBGW that can being looked at from the device ?

i got a mini Zigbee Gateway.... when somehow explains me how i,m doing that.

ZCL V8 is linked here if like reading how its working (very heavy reading)
https://github.com/zigpy/zigpy/discussions/595#discussioncomment-1656808.
You need one device that can sniffing and sniffer firmware in it like TI CC-2531 and other TI, Cornbee II with sniff firmware or one EZSP coordinator with normal NCP firmware that all can doing sniffing.
Also if you have some old IKEA devices and one device for flashing (ESP Rpi and so on) you can using the module / chip from them and flashing one EZSP firmware on them (I have them as coordinator).

Little sniffing links if not all is broken https://github.com/zigpy/zigpy/wiki/Sniffing-Zigbee-traffic.
This can being way LIDL / parkside water valve is not reacting on more than ON commands (ZCL standard) but no more commands / options is working with the device but devs have looking in sniffs and not finding the tuyya magic.

@mrctorres

You are using newest, updated HA version??

You received response:
<Status.UNSUP_MANUF_CLUSTER_COMMAND: 131>

By the Bosch docs[above] it means:

A manufacturer specific unicast, cluster specific command was received with an unknown manufacturer code, or the manufacturer code was recognized but the command is not supported.
So there are two options.

You are using newest, updated HA version??

Home Assistant 2021.12.10

Little sniffing links if not all is broken https://github.com/zigpy/zigpy/wiki/Sniffing-Zigbee-traffic.
This can being way LIDL / parkside water valve is not reacting on more than ON commands (ZCL standard) but no more commands / options is working with the device but devs have looking in sniffs and not finding the tuyya magic.

Thx... but that´s too much for my old brain 😄  maybe next weekend with more time

New log´s for "special" version file:
home-assistant.log

I found the Manufacturer. Maybe helpful .

https://szwlx.en.alibaba.com/product/1600436170409-902386022/2022_New_Year_Promotion_Tuya_Zigbee_Temperature_and_Humidity_Sensor_with_Long_Battery_Life.html?spm=a2700.shop_index.94.12.e02847a3E5Pycl

@mrctorres My mistake - didn't put else to if
Added some debug comments that should be shown in logs
ts0601_temperature_special.py.zip

My TRVs have manufacturer_code=0 = dont need tagging messages with manufacture code.

I don't think the manufacturer code is the reason for the time synchronization problems. I have confirmation from a mate down under that this device works OK (including the time sync) with my Hubitat driver.
One difference is that I cast a Tuya Black Magic spell towards the device during the initialization :)
Try the same approach as with the TS004F :
await ep.basic.read_attributes(["manufacturer", "zcl_version", "app_version", "model", "power_source", 0xFFFE])

@mrctorres My mistake - didn't put else to if Added some debug comments that should be shown in logs ts0601_temperature_special.py.zip

New logs.
I noticed that new errors are appearing in the log.
The device also appears to be resetting itself frequently.
And I can't change the attribute values anymore.
home-assistant.log

I try special edition , too.
All Values from device to ZHA works fine.  (exc. battery - display "none" )
From ZHA to Device - none (incl. time )
it´s really hard challenge :)
2022-01-31 19:33:36 ERROR (MainThread) [homeassistant.components.zha.core.channels.base] [0xADA4:13:0x000d]: Could not set value: [0xada4:1:0xef00]: Message send failure
LOG20220131.txt

I don't see any possibilities here. @toy3375 logs shows that the request 0x0024 is served by code response:
2022-01-31 19:32:04 INFO (MainThread) [ts0601_temperature_special] TEST sending time response: [97, 248, 43, 36, 97, 248, 57, 52]

So there's need to be a bug elsewhere. Maybe device doesn't follow standards.
Without it in my hands it's hard to debug it that way.
Probably communication sniffing is needed to see messages going to gateway and back.
Since the older version works with attributes, and there's a workaround with date/time setting
I don't see any options to go forward.

I got a Tuya Hub and it syncs the date and time. I bought a CC2531 USB to try to use as a Sniffer as shown in https://www.zigbee2mqtt.io/advanced/zigbee/04_sniff_zigbee_traffic.html#with-cc2531, but it doesn't capture packets, even changing the channel and updating the firmware. Any light?

I got a Tuya Hub and it syncs the date and time

It would be strange if it didn't do it ;-)
Network encryption key is crucial here. Did you set it properly??

@mrctorres Flash the firmware by instruction and downloading the ZBOSS sniffer and wireshark and starting the sniffer program and wireshark.
I using EZSP and com.zsmartsystems.zigbee.sniffer with CLI so i dont have the GUI for setting up the sniffer.
You also need knowing the channel your tuya ZBGW is on but is normally on one standard 11,15,20 and 25 but is not 110%. Then the sniffer is running and try getting the device sending some commands also sending command to it shall see "somthing" in wireshark that  is in sync with what you is sending.
You must have adding the "default well known zigbee key" for decrypting message plus your network key. The first is in the instruction (3.1) and then you is paring one Zigbee device is using the default key and the system is sending the network key to your device and you can finding it in wireshark after the device have joining the network (3.2).
By posting one sniff with pairing one device = your network key for that network can being extracted from all ho downloading it and have the knowledge.

I followed all the instructions, but I can't sniff out any Zigbee packages, neither from ZHA, on channel 15, nor from Tuya, which according to the app, is on channel 25.

I also tried using TI Packet Sniffer, but it doesn't even recognize the dongle, unlike Zboss, which does, but doesn't seem to find packets to send to WireShark

@mrctorres caan you asking @Tropaion hi was setting up one CC-2531 and have sniffing tuya ZBGW for some hours ago perhaps hi is knowing how to getting it working.
https://github.com/zigpy/zha-device-handlers/issues/1302#issuecomment-1027216533

Now I  capture packets with Texas Instrument firmware and Texas Instrument Smart RF Packet Sniffer vs1 software, but it doesn't work with Wireshark. Generated this file when I turned on the child device and I stopped capturing when updated the clock.
TS0601.zip

@mrctorres Under windows I'm just using this sniffer with WireShark, works perfectly fine: https://dsr-iot.com/downloads
Here a tutorial: https://community.oh-lalabs.com/t/guide-build-a-zigbee-cc2531-sniffer-how-to-use-it/469

Here first packets
Device Power ON until Date and Time Update.zip

Add Device.zip

You need to set key properly in Wireshark.
https://www.youtube.com/watch?v=4vG4CVNAm_A
Attached file has payload encrypted

@jacekk015 I think this device is needing the same treatment as the TS004F that i need sending attributes to then its joining but its looks it dont need being in INIT more do tuya ia not kicking it for rejoining.
First they is reading some attribute of cluster both known and unknown ones:
Frame 33: 60 bytes on wire (480 bits), 58 bytes captured (464 bits) on interface \\.\pipe\zboss_sniffer_COM10, id 0
IEEE 802.15.4 Data, Dst: 0x083a, Src: 0x0000
ZigBee Network Layer Data, Dst: 0x083a, Src: 0x0000
    Frame Control Field: 0x0208, Frame Type: Data, Discover Route: Suppress, Security Data
        .... .... .... ..00 = Frame Type: Data (0x0)
        .... .... ..00 10.. = Protocol Version: 2
        .... .... 00.. .... = Discover Route: Suppress (0x0)
        .... ...0 .... .... = Multicast: False
        .... ..1. .... .... = Security: True
        .... .0.. .... .... = Source Route: False
        .... 0... .... .... = Destination: False
        ...0 .... .... .... = Extended Source: False
        ..0. .... .... .... = End Device Initiator: False
    Destination: 0x083a
    Source: 0x0000
    Radius: 30
    Sequence Number: 207
    [Extended Source: SiliconL_ff:fe:eb:6d:9f (80:4b:50:ff:fe:eb:6d:9f)]
    [Origin: 1]
    ZigBee Security Header
ZigBee Application Support Layer Data, Dst Endpt: 255, Src Endpt: 1
    Frame Control Field: Data (0x40)
        .... ..00 = Frame Type: Data (0x0)
        .... 00.. = Delivery Mode: Unicast (0x0)
        ..0. .... = Security: False
        .1.. .... = Acknowledgement Request: True
        0... .... = Extended Header: False
    Destination Endpoint: 255
    Cluster: Basic (0x0000)
    Profile: Home Automation (0x0104)
    Source Endpoint: 1
    Counter: 62
ZigBee Cluster Library Frame, Command: Read Attributes, Seq: 44
    Frame Control Field: Profile-wide (0x10)
        .... ..00 = Frame Type: Profile-wide (0x0)
        .... .0.. = Manufacturer Specific: False
        .... 0... = Direction: Client to Server
        ...1 .... = Disable Default Response: True
    Sequence Number: 44
    Command: Read Attributes (0x00)
    Attribute: Manufacturer Name (0x0004)
    Attribute: ZCL Version (0x0000)
    Attribute: Application Version (0x0001)
    Attribute: Model Identifier (0x0005)
    Attribute: Power Source (0x0007)
    Attribute: Unknown (0xfffe)

Then writing to attribute 0xffde on the basic cluster with data Uint8: 19 (0x13).
1. .... .... = Security: True
        .... .0.. .... .... = Source Route: False
        .... 0... .... .... = Destination: False
        ...0 .... .... .... = Extended Source: False
        ..0. .... .... .... = End Device Initiator: False
    Destination: 0x083a
    Source: 0x0000
    Radius: 30
    Sequence Number: 219
    [Extended Source: SiliconL_ff:fe:eb:6d:9f (80:4b:50:ff:fe:eb:6d:9f)]
    [Origin: 1]
    ZigBee Security Header
ZigBee Application Support Layer Data, Dst Endpt: 1, Src Endpt: 1
    Frame Control Field: Data (0x00)
        .... ..00 = Frame Type: Data (0x0)
        .... 00.. = Delivery Mode: Unicast (0x0)
        ..0. .... = Security: False
        .0.. .... = Acknowledgement Request: False
        0... .... = Extended Header: False
    Destination Endpoint: 1
    Cluster: Basic (0x0000)
    Profile: Home Automation (0x0104)
    Source Endpoint: 1
    Counter: 66
ZigBee Cluster Library Frame, Command: Write Attributes, Seq: 45
    Frame Control Field: Profile-wide (0x10)
        .... ..00 = Frame Type: Profile-wide (0x0)
        .... .0.. = Manufacturer Specific: False
        .... 0... = Direction: Client to Server
        ...1 .... = Disable Default Response: True
    Sequence Number: 45
    Command: Write Attributes (0x02)
    Attribute Field, Uint8: 19
        Attribute: Unknown (0xffde)
        Data Type: 8-Bit Unsigned Integer (0x20)
        Uint8: 19 (0x13)

Its made 2 times with the same information.
Then reading the Node Descriptor  and they using  Silabs manufacture code in it Manufacturer Code: 0x1002`. (Frame 104:)
Then writing one unknown command to basic cluster Unknown (0xf0).
Frame 185: 48 bytes on wire (384 bits), 46 bytes captured (368 bits) on interface \\.\pipe\zboss_sniffer_COM10, id 0
IEEE 802.15.4 Data, Dst: 0x083a, Src: 0x0000
ZigBee Network Layer Data, Dst: 0x083a, Src: 0x0000
    Frame Control Field: 0x0208, Frame Type: Data, Discover Route: Suppress, Security Data
        .... .... .... ..00 = Frame Type: Data (0x0)
        .... .... ..00 10.. = Protocol Version: 2
        .... .... 00.. .... = Discover Route: Suppress (0x0)
        .... ...0 .... .... = Multicast: False
        .... ..1. .... .... = Security: True
        .... .0.. .... .... = Source Route: False
        .... 0... .... .... = Destination: False
        ...0 .... .... .... = Extended Source: False
        ..0. .... .... .... = End Device Initiator: False
    Destination: 0x083a
    Source: 0x0000
    Radius: 30
    Sequence Number: 232
    [Extended Source: SiliconL_ff:fe:eb:6d:9f (80:4b:50:ff:fe:eb:6d:9f)]
    [Origin: 1]
    ZigBee Security Header
ZigBee Application Support Layer Data, Dst Endpt: 1, Src Endpt: 1
    Frame Control Field: Data (0x40)
        .... ..00 = Frame Type: Data (0x0)
        .... 00.. = Delivery Mode: Unicast (0x0)
        ..0. .... = Security: False
        .1.. .... = Acknowledgement Request: True
        0... .... = Extended Header: False
    Destination Endpoint: 1
    Cluster: Basic (0x0000)
    Profile: Home Automation (0x0104)
    Source Endpoint: 1
    Counter: 71
ZigBee Cluster Library Frame
    Frame Control Field: Cluster-specific (0x11)
        .... ..01 = Frame Type: Cluster-specific (0x1)
        .... .0.. = Manufacturer Specific: False
        .... 0... = Direction: Client to Server
        ...1 .... = Disable Default Response: True
    Sequence Number: 47
    Command: Unknown (0xf0)

After that the device is start sending "normal tuya DP commands":
Frame 193: 48 bytes on wire (384 bits), 46 bytes captured (368 bits) on interface \\.\pipe\zboss_sniffer_COM10, id 0
IEEE 802.15.4 Data, Dst: 0x083a, Src: 0x0000
ZigBee Network Layer Data, Dst: 0x083a, Src: 0x0000
    Frame Control Field: 0x0208, Frame Type: Data, Discover Route: Suppress, Security Data
        .... .... .... ..00 = Frame Type: Data (0x0)
        .... .... ..00 10.. = Protocol Version: 2
        .... .... 00.. .... = Discover Route: Suppress (0x0)
        .... ...0 .... .... = Multicast: False
        .... ..1. .... .... = Security: True
        .... .0.. .... .... = Source Route: False
        .... 0... .... .... = Destination: False
        ...0 .... .... .... = Extended Source: False
        ..0. .... .... .... = End Device Initiator: False
    Destination: 0x083a
    Source: 0x0000
    Radius: 30
    Sequence Number: 234
    [Extended Source: SiliconL_ff:fe:eb:6d:9f (80:4b:50:ff:fe:eb:6d:9f)]
    [Origin: 1]
    ZigBee Security Header
ZigBee Application Support Layer Data, Dst Endpt: 1, Src Endpt: 1
    Frame Control Field: Data (0x00)
        .... ..00 = Frame Type: Data (0x0)
        .... 00.. = Delivery Mode: Unicast (0x0)
        ..0. .... = Security: False
        .0.. .... = Acknowledgement Request: False
        0... .... = Extended Header: False
    Destination Endpoint: 1
    Cluster: Unknown (0xef00)
    Profile: Home Automation (0x0104)
    Source Endpoint: 1
    Counter: 72
ZigBee Cluster Library Frame
    Frame Control Field: Cluster-specific (0x11)
        .... ..01 = Frame Type: Cluster-specific (0x1)
        .... .0.. = Manufacturer Specific: False
        .... 0... = Direction: Client to Server
        ...1 .... = Disable Default Response: True
    Sequence Number: 48
    Command: Unknown (0x03)

Frame 197: 48 bytes on wire (384 bits), 46 bytes captured (368 bits) on interface \\.\pipe\zboss_sniffer_COM10, id 0
IEEE 802.15.4 Data, Dst: 0x083a, Src: 0x0000
ZigBee Network Layer Data, Dst: 0x083a, Src: 0x0000
    Frame Control Field: 0x0208, Frame Type: Data, Discover Route: Suppress, Security Data
        .... .... .... ..00 = Frame Type: Data (0x0)
        .... .... ..00 10.. = Protocol Version: 2
        .... .... 00.. .... = Discover Route: Suppress (0x0)
        .... ...0 .... .... = Multicast: False
        .... ..1. .... .... = Security: True
        .... .0.. .... .... = Source Route: False
        .... 0... .... .... = Destination: False
        ...0 .... .... .... = Extended Source: False
        ..0. .... .... .... = End Device Initiator: False
    Destination: 0x083a
    Source: 0x0000
    Radius: 30
    Sequence Number: 236
    [Extended Source: SiliconL_ff:fe:eb:6d:9f (80:4b:50:ff:fe:eb:6d:9f)]
    [Origin: 1]
    ZigBee Security Header
ZigBee Application Support Layer Data, Dst Endpt: 1, Src Endpt: 1
    Frame Control Field: Data (0x00)
        .... ..00 = Frame Type: Data (0x0)
        .... 00.. = Delivery Mode: Unicast (0x0)
        ..0. .... = Security: False
        .0.. .... = Acknowledgement Request: False
        0... .... = Extended Header: False
    Destination Endpoint: 1
    Cluster: Unknown (0xef00)
    Profile: Home Automation (0x0104)
    Source Endpoint: 1
    Counter: 73
ZigBee Cluster Library Frame
    Frame Control Field: Cluster-specific (0x11)
        .... ..01 = Frame Type: Cluster-specific (0x1)
        .... .0.. = Manufacturer Specific: False
        .... 0... = Direction: Client to Server
        ...1 .... = Disable Default Response: True
    Sequence Number: 49
    Command: Unknown (0x03)

I have not looking on the DP command then i cant decoding them but it can being that they is sending somthing interesting in this 2 then starting initiating the device.
The first frame send to DP cluster is not flagged manufacturer specific .... .0.. = Manufacturer Specific: False.
If like looking on the DP command sequences please do so.
I think its worth trying getting the quirk reading and sending attribute on initiating the device and also sending command to it and see if its behaving better.
Also finding then the device is doing on time request with DP commands and how they is handshaking it with DP commands.
Pleas more feedback and if i shall looking more for "normal" zigbee things in the sniffs.

I think this device is needing the same treatment as the TS004F that i need sending attributes to then its joining but its looks it dont need being in INIT more do tuya ia not kicking it for rejoining.

I can confirm the above. Sending the multi-attribute read command :
    Command: Read Attributes (0x00)     Attribute: Manufacturer Name (0x0004)     Attribute: ZCL Version (0x0000)     Attribute: Application Version (0x0001)     Attribute: Model Identifier (0x0005)     Attribute: Power Source (0x0007)     Attribute: Unknown (0xfffe)
at any time (not neccesery during the pairing process as for TS004F!) was enough for successful date/time setup.

More tuya magic for implanting in Hubitat !!
This is number 2 @kkossev have pinpointing and verified working (the first was TS004F).
Thanks for verifying it working !!
I only hope i getting help implanting sending attributes and commands from quirks in ZHA and i can getting my TS004F working also for normal users.

The unknown attribute is known but not implanted in wireshark and most system then its one global attribute.
<IP_ADDRESS> Global Attributes in ZCL R8 https://github.com/zigpy/zigpy/discussions/595#discussioncomment-1656808

So where does this stand now?  Which quirk is the best one to use?

I is knowing how the command need being implanted for the devices but i cant doing the coding for getting it working.
For the moment we is having 4 tuya / LIDL devices that is needs the "tuya magic" for working OK or at all in our systems.

@jacekk015 I think then we can getting sending the reading attributes from quirks we shall testing if more tuya TS0602 is needing it / working better.
Its looks like many "normal" tuya Zigbee devices is needing this then Z2M have finding 2 and we is having 3 (2 with help of @kkossev) and i think is more is coming.

Is there anything else I can do to help with the sniffer or on the device itself?

I think this device is needing the same treatment as the TS004F that i need sending attributes to then its joining but its looks it dont need being in INIT more do tuya ia not kicking it for rejoining.

I can confirm the above. Sending the multi-attribute read command :  Command: Read Attributes (0x00) Attribute: Manufacturer Name (0x0004) Attribute: ZCL Version (0x0000) Attribute: Application Version (0x0001) Attribute: Model Identifier (0x0005) Attribute: Power Source (0x0007) Attribute: Unknown (0xfffe) at any time (not neccesery during the pairing process as for TS004F!) was enough for successful date/time setup.

Any example line code?

Puddly have making one example python code version of @kkossev code but i cant getting it  working then i have not enough knowledge implanting it in one quirk https://github.com/zigpy/zha-device-handlers/pull/969#issuecomment-1006935550.
The TS004f is needed being kicked (leave with rejoining) or having very tight timing for populating the 3 extra EPs but it shall being possible fixing then have get read and writing attributes from the quirk.

@MattWestb it may turn out that the Basic Cluster attributes read sequence has an effect only when is sent during the pairing process only... same as TS004F.
I had a user whose device didn't work (no reporting at all!) until I added the Manufacturer ID to the list of fingerprints and the device was then excluded and re-paired again to the Zigbee concentrator.

Thanks for information @kkossev !!
Then i can getting the read and writing i can doing the testing of your timing and also kicking if needed for the normal dimmer.
And likely devices is working OK if being pared with tuya ZBGW until battery is being removed as we have seen before :-)

@kkossev One more device that i have on the list for "tuya magic" is more or less confirmed https://github.com/dresden-elektronik/deconz-rest-plugin/issues/5493#issuecomment-1034174883 and we is have many Portuguese user that the device is only using one endpoint.

I dont really follow the last few comments.  Is there anything more to be done here?  Would like to be able to change to Fahrenheit plus have reliable datetime settings.

The only way to change Fahrenheit is first to pair to a TUYA Gateway.
Change settings to Fahrenheit. Then pairing to ZHA again.
Time/Date sync when paired with TUYA. After pairing to ZHA , the Time wont
sync anymore and the Time slides away..
James Benjamin Goff @.***> schrieb am Sa., 19. Feb.
2022, 20:11:

I dont really follow the last few comments. Is there anything more to be
done here? Would like to be able to change to Fahrenheit plus have reliable
datetime settings.
—
Reply to this email directly, view it on GitHub
https://github.com/zigpy/zha-device-handlers/issues/1286#issuecomment-1046086022,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ARNNXMZWKYJV5QUQQYMVIRTU37TOXANCNFSM5MA4XE2A
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you were mentioned.Message ID:
@.***>

Yes that's it! Thanks

Hi, do you currently have a custom working quirk for this device?
If so, it would be nice if you could PR the changes to this repo or just send the latest quirk file here, so someone else can do it. Then, a custom quirk wouldn't be needed in the future anymore.
Thanks!

Hi,
These is the extensive version with all the entities as described earlier. However updating the values (frequency, date/time etc) does not work and generate errors. But as far as I can tell there has not been a working version for that
ts0601_temperature.py.zip
.

This is the version with only three entities (temperature, humidity and power). This version works without any errors.
Date/time is not updated.
ts0601_temperature.py.zip

The device is more then likely need "tuya magic spell" being casted on it then paring it for getting the reporting and clock setting working.
We have implanting one working version for one device that can being tested if some like to so it.
The code looks lik this and is implanted in the device class so its being run then the quirk is loaded but then restart HA its doing it but the network is not online so its only being casted then doing new joining of device.
https://github.com/zigpy/zha-device-handlers/blob/16f298e9ce293d241592f86573e909f9c32809d0/zhaquirks/tuya/ts004f.py#L180-L195

I managed to get clock updates with this quirk:
https://github.com/zigpy/zha-device-handlers/issues/1702#issuecomment-1238612059
(slightly modified by adding ("_TZE200_3towulqd", "TS0601") to the Models_info)

I managed to get clock updates with this quirk: #1702 (comment)
(slightly modified by adding ("_TZE200_3towulqd", "TS0601") to the Models_info)

Worked for me also.  Here is my revised code...
"""Tuya temp and humidity sensor with screen."""

from typing import Dict

################## clean this up
import zigpy.types as t
from zigpy.zcl import foundation
from zhaquirks.tuya import TuyaTimePayload, TuyaCommand
import datetime
from typing import Tuple, Optional, Union
##################

from zigpy.profiles import zha
from zigpy.quirks import CustomDevice
from zigpy.zcl.clusters.general import Basic, Groups, Ota, Scenes, Time, AnalogOutput
from zigpy.zcl.clusters.measurement import RelativeHumidity, TemperatureMeasurement

from zhaquirks.const import (
    DEVICE_TYPE,
    ENDPOINTS,
    INPUT_CLUSTERS,
    MODELS_INFO,
    OUTPUT_CLUSTERS,
    PROFILE_ID,
    SKIP_CONFIGURATION,
)
from zhaquirks.tuya import TuyaLocalCluster, TuyaPowerConfigurationCluster2AAA
from zhaquirks.tuya.mcu import DPToAttributeMapping, TuyaDPType, TuyaMCUCluster

TUYA_SET_TIME = 0x24

# NOTES:
# The data comes in as a string on cluster, if there is nothing set up you may see these lines in the logs:
# Unknown message (b'19830100a40102000400000118') on cluster 61184: unknown endpoint or cluster id: 'No cluster ID 0xef00 on (a4:c1:38:d0:18:8b:64:aa, 1)'
#                                          28.0 degrees
# Unknown message (b'19840100a5020200040000022c') on cluster 61184: unknown endpoint or cluster id: 'No cluster ID 0xef00 on (a4:c1:38:d0:18:8b:64:aa, 1)'
#                                          55.6% humid
# Unknown message (b'19850100a60402000400000064') on cluster 61184: unknown endpoint or cluster id: 'No cluster ID 0xef00 on (a4:c1:38:d0:18:8b:64:aa, 1)'
#                                          100% battery

class TemperatureUnitConvert(t.enum8):
    """Tuya Temp unit convert enum."""

    Celsius = 0x00
    Fahrenheit = 0x01

class TuyaTemperatureMeasurement(TemperatureMeasurement, TuyaLocalCluster):
    """Tuya local TemperatureMeasurement cluster."""

    attributes = TemperatureMeasurement.attributes.copy()
    attributes.update(
        {
            0x8001: ("temp_unit_convert", t.enum8),
            0x8002: ("alarm_max_temperature", t.Single),
            0x8003: ("alarm_min_temperature", t.Single),
            0x8004: ("temperature_sensitivity", t.Single),
        }
    )

class TuyaRelativeHumidity(RelativeHumidity, TuyaLocalCluster):
    """Tuya local RelativeHumidity cluster."""

class TemperatureHumidityManufCluster(TuyaMCUCluster):
    """Tuya Manufacturer Cluster with Temperature and Humidity data points."""

    dp_to_attribute: Dict[int, DPToAttributeMapping] = {
        1: DPToAttributeMapping(
            TuyaTemperatureMeasurement.ep_attribute,
            "measured_value",
            dp_type=TuyaDPType.VALUE,
            converter=lambda x: x * 10,  # decidegree to centidegree
        ),
        2: DPToAttributeMapping(
            TuyaRelativeHumidity.ep_attribute,
            "measured_value",
            dp_type=TuyaDPType.VALUE,
            converter=lambda x: x * 100,  # 0.01 to 1.0
        ),
        4: DPToAttributeMapping(
            TuyaPowerConfigurationCluster2AAA.ep_attribute,
            "battery_percentage_remaining",
            dp_type=TuyaDPType.VALUE,
            converter=lambda x: x * 2,  # reported percentage is doubled
        ),
        9: DPToAttributeMapping(
            TuyaTemperatureMeasurement.ep_attribute,
            "temp_unit_convert",
            dp_type=TuyaDPType.ENUM,
            converter=lambda x: TemperatureUnitConvert(x)
        ),
        10: DPToAttributeMapping(
            TuyaTemperatureMeasurement.ep_attribute,
            "alarm_max_temperature",
            dp_type=TuyaDPType.VALUE,
            converter=lambda x: x / 10
        ),
        11: DPToAttributeMapping(
            TuyaTemperatureMeasurement.ep_attribute,
            "alarm_min_temperature",
            dp_type=TuyaDPType.VALUE,
            converter=lambda x: x / 10
        ),
        19: DPToAttributeMapping(
            TuyaTemperatureMeasurement.ep_attribute,
            "temperature_sensitivity",
            dp_type=TuyaDPType.VALUE,
            converter=lambda x: x / 10
        )
    }

    set_time_offset = 1970
    set_time_local_offset = 1970

    data_point_handlers = {
        1: "_dp_2_attr_update",
        2: "_dp_2_attr_update",
        4: "_dp_2_attr_update",
        9: "_dp_2_attr_update",
        10: "_dp_2_attr_update",
        11: "_dp_2_attr_update",
        19: "_dp_2_attr_update",
    }

    def handle_set_time_request(self, sequence_number: t.uint16_t) -> foundation.Status:
        payload = TuyaTimePayload()

        utc_now = datetime.datetime.utcnow()
        now = datetime.datetime.now()

        offset_time = datetime.datetime(self.set_time_offset, 1, 1)
        offset_time_local = datetime.datetime(self.set_time_local_offset, 1, 1)

        utc_timestamp = int((utc_now - offset_time).total_seconds())
        local_timestamp = int((now - offset_time).total_seconds())

        payload.extend(utc_timestamp.to_bytes(4, "big", signed=False))
        payload.extend(local_timestamp.to_bytes(4, "big", signed=False))

        self.create_catching_task(
            self.command(TUYA_SET_TIME, payload, manufacturer=foundation.ZCLHeader.NO_MANUFACTURER_ID, expect_reply=False)
        )

        return foundation.Status.SUCCESS

class TuyaNousE6TempHumiditySensor(CustomDevice):
    """Custom device representing tuya temp and humidity sensor with a screen (NOUS E6)."""

    signature = {
        # <SimpleDescriptor endpoint=1, profile=260, device_type=81
        # device_version=1
        # input_clusters=[4, 5, 61184, 0]
        # output_clusters=[25, 10]>
        MODELS_INFO: [
            ("_TZE200_bq5c8xfe", "TS0601"),
            ("_TZE200_locansqn", "TS0601"),
            ("_TZE200_nnrfa68v", "TS0601")
            ],
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.SMART_PLUG, # this is how the device reports itself
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    TemperatureHumidityManufCluster.cluster_id,
                ],
                OUTPUT_CLUSTERS: [Ota.cluster_id, Time.cluster_id],
            }
        },
    }

    replacement = {
        SKIP_CONFIGURATION: True,
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.TEMPERATURE_SENSOR,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    TemperatureHumidityManufCluster,  # Single bus for temp, humidity, and battery
                    TuyaTemperatureMeasurement,
                    TuyaRelativeHumidity,
                    TuyaPowerConfigurationCluster2AAA,
                ],
                OUTPUT_CLUSTERS: [Ota.cluster_id, Time.cluster_id],
            }
        },
    }

Confirm. On my 3  Devices the Time and Date is updated and Devices transmite Temp and Humidity , Batterie as aspected.  Thank you all Gesendet von Mail für Windows Von: JeffPixelSplashGesendet: Freitag, 23. Dezember 2022 20:06An: zigpy/zha-device-handlersCc: toy3375; MentionBetreff: Re: [zigpy/zha-device-handlers] TZE200_locansqn TS0601 Temp / Humi / Clock (Issue #1286) I managed to get clock updates with this quirk: #1702 (comment)(slightly modified by adding ("_TZE200_3towulqd", "TS0601") to the Models_info)Worked for me also. Here is my revised code..."""Tuya temp and humidity sensor with screen.""" from typing import Dict ################## clean this upimport zigpy.types as tfrom zigpy.zcl import foundationfrom zhaquirks.tuya import TuyaTimePayload, TuyaCommandimport datetimefrom typing import Tuple, Optional, Union################## from zigpy.profiles import zhafrom zigpy.quirks import CustomDevicefrom zigpy.zcl.clusters.general import Basic, Groups, Ota, Scenes, Time, AnalogOutputfrom zigpy.zcl.clusters.measurement import RelativeHumidity, TemperatureMeasurement from zhaquirks.const import (    DEVICE_TYPE,    ENDPOINTS,    INPUT_CLUSTERS,    MODELS_INFO,    OUTPUT_CLUSTERS,    PROFILE_ID,    SKIP_CONFIGURATION,)from zhaquirks.tuya import TuyaLocalCluster, TuyaPowerConfigurationCluster2AAAfrom zhaquirks.tuya.mcu import DPToAttributeMapping, TuyaDPType, TuyaMCUCluster TUYA_SET_TIME = 0x24 # NOTES:# The data comes in as a string on cluster, if there is nothing set up you may see these lines in the logs:# Unknown message (b'19830100a40102000400000118') on cluster 61184: unknown endpoint or cluster id: 'No cluster ID 0xef00 on (a4:c1:38:d0:18:8b:64:aa, 1)'#                                          28.0 degrees# Unknown message (b'19840100a5020200040000022c') on cluster 61184: unknown endpoint or cluster id: 'No cluster ID 0xef00 on (a4:c1:38:d0:18:8b:64:aa, 1)'#                                          55.6% humid# Unknown message (b'19850100a60402000400000064') on cluster 61184: unknown endpoint or cluster id: 'No cluster ID 0xef00 on (a4:c1:38:d0:18:8b:64:aa, 1)'#                                          100% battery class TemperatureUnitConvert(t.enum8):    """Tuya Temp unit convert enum."""     Celsius = 0x00    Fahrenheit = 0x01  class TuyaTemperatureMeasurement(TemperatureMeasurement, TuyaLocalCluster):    """Tuya local TemperatureMeasurement cluster."""     attributes = TemperatureMeasurement.attributes.copy()    attributes.update(        {            0x8001: ("temp_unit_convert", t.enum8),            0x8002: ("alarm_max_temperature", t.Single),            0x8003: ("alarm_min_temperature", t.Single),            0x8004: ("temperature_sensitivity", t.Single),        }    )  class TuyaRelativeHumidity(RelativeHumidity, TuyaLocalCluster):    """Tuya local RelativeHumidity cluster."""  class TemperatureHumidityManufCluster(TuyaMCUCluster):    """Tuya Manufacturer Cluster with Temperature and Humidity data points."""        dp_to_attribute: Dict[int, DPToAttributeMapping] = {        1: DPToAttributeMapping(            TuyaTemperatureMeasurement.ep_attribute,            "measured_value",            dp_type=TuyaDPType.VALUE,            converter=lambda x: x * 10,  # decidegree to centidegree        ),        2: DPToAttributeMapping(            TuyaRelativeHumidity.ep_attribute,            "measured_value",            dp_type=TuyaDPType.VALUE,            converter=lambda x: x * 100,  # 0.01 to 1.0        ),        4: DPToAttributeMapping(            TuyaPowerConfigurationCluster2AAA.ep_attribute,            "battery_percentage_remaining",            dp_type=TuyaDPType.VALUE,            converter=lambda x: x * 2,  # reported percentage is doubled        ),        9: DPToAttributeMapping(            TuyaTemperatureMeasurement.ep_attribute,            "temp_unit_convert",            dp_type=TuyaDPType.ENUM,            converter=lambda x: TemperatureUnitConvert(x)        ),        10: DPToAttributeMapping(            TuyaTemperatureMeasurement.ep_attribute,            "alarm_max_temperature",            dp_type=TuyaDPType.VALUE,            converter=lambda x: x / 10        ),        11: DPToAttributeMapping(            TuyaTemperatureMeasurement.ep_attribute,            "alarm_min_temperature",            dp_type=TuyaDPType.VALUE,            converter=lambda x: x / 10        ),        19: DPToAttributeMapping(            TuyaTemperatureMeasurement.ep_attribute,            "temperature_sensitivity",            dp_type=TuyaDPType.VALUE,            converter=lambda x: x / 10        )    }        set_time_offset = 1970    set_time_local_offset = 1970     data_point_handlers = {        1: "_dp_2_attr_update",        2: "_dp_2_attr_update",        4: "_dp_2_attr_update",        9: "_dp_2_attr_update",        10: "_dp_2_attr_update",        11: "_dp_2_attr_update",        19: "_dp_2_attr_update",    }     def handle_set_time_request(self, sequence_number: t.uint16_t) -> foundation.Status:        payload = TuyaTimePayload()         utc_now = datetime.datetime.utcnow()        now = datetime.datetime.now()         offset_time = datetime.datetime(self.set_time_offset, 1, 1)        offset_time_local = datetime.datetime(self.set_time_local_offset, 1, 1)                utc_timestamp = int((utc_now - offset_time).total_seconds())        local_timestamp = int((now - offset_time).total_seconds())                payload.extend(utc_timestamp.to_bytes(4, "big", signed=False))        payload.extend(local_timestamp.to_bytes(4, "big", signed=False))         self.create_catching_task(            self.command(TUYA_SET_TIME, payload, manufacturer=foundation.ZCLHeader.NO_MANUFACTURER_ID, expect_reply=False)        )         return foundation.Status.SUCCESS class TuyaNousE6TempHumiditySensor(CustomDevice):    """Custom device representing tuya temp and humidity sensor with a screen (NOUS E6)."""     signature = {        #         MODELS_INFO: [            ("_TZE200_bq5c8xfe", "TS0601"),            ("_TZE200_locansqn", "TS0601"),            ("_TZE200_nnrfa68v", "TS0601")            ],        ENDPOINTS: {            1: {                PROFILE_ID: zha.PROFILE_ID,                DEVICE_TYPE: zha.DeviceType.SMART_PLUG, # this is how the device reports itself                INPUT_CLUSTERS: [                    Basic.cluster_id,                    Groups.cluster_id,                    Scenes.cluster_id,                    TemperatureHumidityManufCluster.cluster_id,                ],                OUTPUT_CLUSTERS: [Ota.cluster_id, Time.cluster_id],            }        },    }     replacement = {        SKIP_CONFIGURATION: True,        ENDPOINTS: {            1: {                PROFILE_ID: zha.PROFILE_ID,                DEVICE_TYPE: zha.DeviceType.TEMPERATURE_SENSOR,                INPUT_CLUSTERS: [                    Basic.cluster_id,                    TemperatureHumidityManufCluster,  # Single bus for temp, humidity, and battery                    TuyaTemperatureMeasurement,                    TuyaRelativeHumidity,                    TuyaPowerConfigurationCluster2AAA,                ],                OUTPUT_CLUSTERS: [Ota.cluster_id, Time.cluster_id],            }        },    }—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID<EMAIL_ADDRESS>
Hey @toy3375 Pleas reformat the log with starting on one blank line with ``` anf the same after on one blank line so its can being red without loosing formatting.
Frohe . . .

@MattWestb : My mistake . I replyed to the E-Mail.  i fixed it .

Quirk corrected, now using EnchantedDevice class, which sends multi-attribute read.
Worth of trying if date/time is in sync now.
ts0601_temperature.py.zip

Using this seemingly off-spec sensor; and finding this quirk (thanks for all the work on this!). I get this init issue with fully latest HA, and SkyConnect, ZHA.
Any ideas? I'm totally new to ZHA and quicks I'm afraid,
Logger: homeassistant.config_entries
Source: custom_zha_quirks/ts0601_temperature.py:145
First occurred: 9:25:39 AM (2 occurrences)
Last logged: 9:27:39 AM

Error setting up entry SkyConnect v1.0 for zha
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 382, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/zha/__init__.py", line 100, in async_setup_entry
    setup_quirks(config)
  File "/usr/local/lib/python3.10/site-packages/zhaquirks/__init__.py", line 409, in setup
    importer.find_module(modname).load_module(modname)
  File "<frozen importlib._bootstrap_external>", line 548, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 1063, in load_module
  File "<frozen importlib._bootstrap_external>", line 888, in load_module
  File "<frozen importlib._bootstrap>", line 290, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 719, in _load
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_zha_quirks/ts0601_temperature.py", line 145, in <module>
    class TuyaSensorManufCluster(TuyaManufClusterAttributes):
  File "/usr/local/lib/python3.10/site-packages/zigpy/zcl/__init__.py", line 84, in __init_subclass__
    raise TypeError(
TypeError: `manufacturer_attributes` is deprecated. Copy the parent class's `attributes` dictionary and update it with your manufacturer-specific `attributes`. Make sure to specify that it is manufacturer-specific through the  appropriate constructor or tuple!

--

@relighted
Use ts0601_temperature.py file from
https://github.com/jacekk015/zha_quirks

Referring to @JeffPixelSplash 's solution including the time and date.
With the latest HomeAssitant update it seems to be broken.
My solution, maybe crude:
(An sorry, for not the bad formatting here works...New here:)
Change this:
from`` zhaquirks.tuya import TuyaLocalCluster, TuyaPowerConfigurationCluster2AAA
#` old: from zhaquirks.tuya.mcu import DPToAttributeMapping, TuyaDPType, TuyaMCUCluster

Change all of them to explicit type conversion:
   19: DPToAttributeMapping(
            TuyaTemperatureMeasurement.ep_attribute,
            "temperature_sensitivity",
            #dp_type=TuyaDPType.VALUE,
            converter=lambda x: float(x / 10)

The whole file like it works for my _TZE200_locansqn
"""Tuya temp and humidity sensor with screen."""

from typing import Dict

################## clean this up
import zigpy.types as t
from zigpy.zcl import foundation
from zhaquirks.tuya import TuyaTimePayload, TuyaCommand
import datetime
from typing import Tuple, Optional, Union
##################

from zigpy.profiles import zha
from zigpy.quirks import CustomDevice
from zigpy.zcl.clusters.general import Basic, Groups, Ota, Scenes, Time, AnalogOutput
from zigpy.zcl.clusters.measurement import RelativeHumidity, TemperatureMeasurement

from zhaquirks.const import (
    DEVICE_TYPE,
    ENDPOINTS,
    INPUT_CLUSTERS,
    MODELS_INFO,
    OUTPUT_CLUSTERS,
    PROFILE_ID,
    SKIP_CONFIGURATION,
)
from zhaquirks.tuya import TuyaLocalCluster, TuyaPowerConfigurationCluster2AAA
# old: from zhaquirks.tuya.mcu import DPToAttributeMapping, TuyaDPType, TuyaMCUCluster
from zhaquirks.tuya.mcu import DPToAttributeMapping, TuyaMCUCluster

TUYA_SET_TIME = 0x24

# NOTES:
# The data comes in as a string on cluster, if there is nothing set up you may see these lines in the logs:
# Unknown message (b'19830100a40102000400000118') on cluster 61184: unknown endpoint or cluster id: 'No cluster ID 0xef00 on (a4:c1:38:d0:18:8b:64:aa, 1)'
#                                          28.0 degrees
# Unknown message (b'19840100a5020200040000022c') on cluster 61184: unknown endpoint or cluster id: 'No cluster ID 0xef00 on (a4:c1:38:d0:18:8b:64:aa, 1)'
#                                          55.6% humid
# Unknown message (b'19850100a60402000400000064') on cluster 61184: unknown endpoint or cluster id: 'No cluster ID 0xef00 on (a4:c1:38:d0:18:8b:64:aa, 1)'
#                                          100% battery

class TemperatureUnitConvert(t.enum8):
    """Tuya Temp unit convert enum."""

    Celsius = 0x00
    Fahrenheit = 0x01

class TuyaTemperatureMeasurement(TemperatureMeasurement, TuyaLocalCluster):
    """Tuya local TemperatureMeasurement cluster."""

    attributes = TemperatureMeasurement.attributes.copy()
    attributes.update(
        {
            0x8001: ("temp_unit_convert", t.enum8),
            0x8002: ("alarm_max_temperature", t.Single),
            0x8003: ("alarm_min_temperature", t.Single),
            0x8004: ("temperature_sensitivity", t.Single),
        }
    )

class TuyaRelativeHumidity(RelativeHumidity, TuyaLocalCluster):
    """Tuya local RelativeHumidity cluster."""

class TemperatureHumidityManufCluster(TuyaMCUCluster):
    """Tuya Manufacturer Cluster with Temperature and Humidity data points."""

    dp_to_attribute: Dict[int, DPToAttributeMapping] = {
        1: DPToAttributeMapping(
            TuyaTemperatureMeasurement.ep_attribute,
            "measured_value",
            #dp_type=TuyaDPType.VALUE,
            converter=lambda x: float(x * 10),  # decidegree to centidegree
        ),
        2: DPToAttributeMapping(
            TuyaRelativeHumidity.ep_attribute,
            "measured_value",
            #dp_type=TuyaDPType.VALUE,
            converter=lambda x: float(x * 100),  # 0.01 to 1.0
        ),
        4: DPToAttributeMapping(
            TuyaPowerConfigurationCluster2AAA.ep_attribute,
            "battery_percentage_remaining",
            #dp_type=TuyaDPType.VALUE,
            converter=lambda x: float(x * 2),  # reported percentage is doubled
        ),
        9: DPToAttributeMapping(
            TuyaTemperatureMeasurement.ep_attribute,
            "temp_unit_convert",
            #dp_type=TuyaDPType.ENUM,
            converter=lambda x: TemperatureUnitConvert(x)
        ),
        10: DPToAttributeMapping(
            TuyaTemperatureMeasurement.ep_attribute,
            "alarm_max_temperature",
            #dp_type=TuyaDPType.VALUE,
            converter=lambda x: float(x / 10)
        ),
        11: DPToAttributeMapping(
            TuyaTemperatureMeasurement.ep_attribute,
            "alarm_min_temperature",
            #dp_type=TuyaDPType.VALUE,
            converter=lambda x: float(x / 10)
        ),
        19: DPToAttributeMapping(
            TuyaTemperatureMeasurement.ep_attribute,
            "temperature_sensitivity",
            #dp_type=TuyaDPType.VALUE,
            converter=lambda x: float(x / 10)
        )
    }

    set_time_offset = 1970
    set_time_local_offset = 1970

    data_point_handlers = {
        1: "_dp_2_attr_update",
        2: "_dp_2_attr_update",
        4: "_dp_2_attr_update",
        9: "_dp_2_attr_update",
        10: "_dp_2_attr_update",
        11: "_dp_2_attr_update",
        19: "_dp_2_attr_update",
    }

    def handle_set_time_request(self, sequence_number: t.uint16_t) -> foundation.Status:
        payload = TuyaTimePayload()

        utc_now = datetime.datetime.utcnow()
        now = datetime.datetime.now()

        offset_time = datetime.datetime(self.set_time_offset, 1, 1)
        offset_time_local = datetime.datetime(self.set_time_local_offset, 1, 1)

        utc_timestamp = int((utc_now - offset_time).total_seconds())
        local_timestamp = int((now - offset_time).total_seconds())

        payload.extend(utc_timestamp.to_bytes(4, "big", signed=False))
        payload.extend(local_timestamp.to_bytes(4, "big", signed=False))

        self.create_catching_task(
            self.command(TUYA_SET_TIME, payload, manufacturer=foundation.ZCLHeader.NO_MANUFACTURER_ID, expect_reply=False)
        )

        return foundation.Status.SUCCESS

class TuyaNousE6TempHumiditySensor(CustomDevice):
    """Custom device representing tuya temp and humidity sensor with a screen (NOUS E6)."""

    signature = {
        # <SimpleDescriptor endpoint=1, profile=260, device_type=81
        # device_version=1
        # input_clusters=[4, 5, 61184, 0]
        # output_clusters=[25, 10]>
        MODELS_INFO: [
            ("_TZE200_bq5c8xfe", "TS0601"),
            ("_TZE200_locansqn", "TS0601"),
            ("_TZE200_nnrfa68v", "TS0601")
            ],
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.SMART_PLUG, # this is how the device reports itself
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    TemperatureHumidityManufCluster.cluster_id,
                ],
                OUTPUT_CLUSTERS: [Ota.cluster_id, Time.cluster_id],
            }
        },
    }

    replacement = {
        SKIP_CONFIGURATION: True,
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.TEMPERATURE_SENSOR,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    TemperatureHumidityManufCluster,  # Single bus for temp, humidity, and battery
                    TuyaTemperatureMeasurement,
                    TuyaRelativeHumidity,
                    TuyaPowerConfigurationCluster2AAA,
                ],
                OUTPUT_CLUSTERS: [Ota.cluster_id, Time.cluster_id],
            }
        },
    }

I managed to get clock updates with this quirk: #1702 (comment)
(slightly modified by adding ("_TZE200_3towulqd", "TS0601") to the Models_info)

Worked for me also. Here is my revised code...
"""Tuya temp and humidity sensor with screen."""

from typing import Dict

################## clean this up
import zigpy.types as t
from zigpy.zcl import foundation
from zhaquirks.tuya import TuyaTimePayload, TuyaCommand
import datetime
from typing import Tuple, Optional, Union
##################

from zigpy.profiles import zha
from zigpy.quirks import CustomDevice
from zigpy.zcl.clusters.general import Basic, Groups, Ota, Scenes, Time, AnalogOutput
from zigpy.zcl.clusters.measurement import RelativeHumidity, TemperatureMeasurement

from zhaquirks.const import (
    DEVICE_TYPE,
    ENDPOINTS,
    INPUT_CLUSTERS,
    MODELS_INFO,
    OUTPUT_CLUSTERS,
    PROFILE_ID,
    SKIP_CONFIGURATION,
)
from zhaquirks.tuya import TuyaLocalCluster, TuyaPowerConfigurationCluster2AAA
from zhaquirks.tuya.mcu import DPToAttributeMapping, TuyaDPType, TuyaMCUCluster

TUYA_SET_TIME = 0x24

# NOTES:
# The data comes in as a string on cluster, if there is nothing set up you may see these lines in the logs:
# Unknown message (b'19830100a40102000400000118') on cluster 61184: unknown endpoint or cluster id: 'No cluster ID 0xef00 on (a4:c1:38:d0:18:8b:64:aa, 1)'
#                                          28.0 degrees
# Unknown message (b'19840100a5020200040000022c') on cluster 61184: unknown endpoint or cluster id: 'No cluster ID 0xef00 on (a4:c1:38:d0:18:8b:64:aa, 1)'
#                                          55.6% humid
# Unknown message (b'19850100a60402000400000064') on cluster 61184: unknown endpoint or cluster id: 'No cluster ID 0xef00 on (a4:c1:38:d0:18:8b:64:aa, 1)'
#                                          100% battery

class TemperatureUnitConvert(t.enum8):
    """Tuya Temp unit convert enum."""

    Celsius = 0x00
    Fahrenheit = 0x01

class TuyaTemperatureMeasurement(TemperatureMeasurement, TuyaLocalCluster):
    """Tuya local TemperatureMeasurement cluster."""

    attributes = TemperatureMeasurement.attributes.copy()
    attributes.update(
        {
            0x8001: ("temp_unit_convert", t.enum8),
            0x8002: ("alarm_max_temperature", t.Single),
            0x8003: ("alarm_min_temperature", t.Single),
            0x8004: ("temperature_sensitivity", t.Single),
        }
    )

class TuyaRelativeHumidity(RelativeHumidity, TuyaLocalCluster):
    """Tuya local RelativeHumidity cluster."""

class TemperatureHumidityManufCluster(TuyaMCUCluster):
    """Tuya Manufacturer Cluster with Temperature and Humidity data points."""

    dp_to_attribute: Dict[int, DPToAttributeMapping] = {
        1: DPToAttributeMapping(
            TuyaTemperatureMeasurement.ep_attribute,
            "measured_value",
            dp_type=TuyaDPType.VALUE,
            converter=lambda x: x * 10,  # decidegree to centidegree
        ),
        2: DPToAttributeMapping(
            TuyaRelativeHumidity.ep_attribute,
            "measured_value",
            dp_type=TuyaDPType.VALUE,
            converter=lambda x: x * 100,  # 0.01 to 1.0
        ),
        4: DPToAttributeMapping(
            TuyaPowerConfigurationCluster2AAA.ep_attribute,
            "battery_percentage_remaining",
            dp_type=TuyaDPType.VALUE,
            converter=lambda x: x * 2,  # reported percentage is doubled
        ),
        9: DPToAttributeMapping(
            TuyaTemperatureMeasurement.ep_attribute,
            "temp_unit_convert",
            dp_type=TuyaDPType.ENUM,
            converter=lambda x: TemperatureUnitConvert(x)
        ),
        10: DPToAttributeMapping(
            TuyaTemperatureMeasurement.ep_attribute,
            "alarm_max_temperature",
            dp_type=TuyaDPType.VALUE,
            converter=lambda x: x / 10
        ),
        11: DPToAttributeMapping(
            TuyaTemperatureMeasurement.ep_attribute,
            "alarm_min_temperature",
            dp_type=TuyaDPType.VALUE,
            converter=lambda x: x / 10
        ),
        19: DPToAttributeMapping(
            TuyaTemperatureMeasurement.ep_attribute,
            "temperature_sensitivity",
            dp_type=TuyaDPType.VALUE,
            converter=lambda x: x / 10
        )
    }

    set_time_offset = 1970
    set_time_local_offset = 1970

    data_point_handlers = {
        1: "_dp_2_attr_update",
        2: "_dp_2_attr_update",
        4: "_dp_2_attr_update",
        9: "_dp_2_attr_update",
        10: "_dp_2_attr_update",
        11: "_dp_2_attr_update",
        19: "_dp_2_attr_update",
    }

    def handle_set_time_request(self, sequence_number: t.uint16_t) -> foundation.Status:
        payload = TuyaTimePayload()

        utc_now = datetime.datetime.utcnow()
        now = datetime.datetime.now()

        offset_time = datetime.datetime(self.set_time_offset, 1, 1)
        offset_time_local = datetime.datetime(self.set_time_local_offset, 1, 1)

        utc_timestamp = int((utc_now - offset_time).total_seconds())
        local_timestamp = int((now - offset_time).total_seconds())

        payload.extend(utc_timestamp.to_bytes(4, "big", signed=False))
        payload.extend(local_timestamp.to_bytes(4, "big", signed=False))

        self.create_catching_task(
            self.command(TUYA_SET_TIME, payload, manufacturer=foundation.ZCLHeader.NO_MANUFACTURER_ID, expect_reply=False)
        )

        return foundation.Status.SUCCESS

class TuyaNousE6TempHumiditySensor(CustomDevice):
    """Custom device representing tuya temp and humidity sensor with a screen (NOUS E6)."""

    signature = {
        # <SimpleDescriptor endpoint=1, profile=260, device_type=81
        # device_version=1
        # input_clusters=[4, 5, 61184, 0]
        # output_clusters=[25, 10]>
        MODELS_INFO: [
            ("_TZE200_bq5c8xfe", "TS0601"),
            ("_TZE200_locansqn", "TS0601"),
            ("_TZE200_nnrfa68v", "TS0601")
            ],
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.SMART_PLUG, # this is how the device reports itself
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    TemperatureHumidityManufCluster.cluster_id,
                ],
                OUTPUT_CLUSTERS: [Ota.cluster_id, Time.cluster_id],
            }
        },
    }

    replacement = {
        SKIP_CONFIGURATION: True,
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.TEMPERATURE_SENSOR,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    TemperatureHumidityManufCluster,  # Single bus for temp, humidity, and battery
                    TuyaTemperatureMeasurement,
                    TuyaRelativeHumidity,
                    TuyaPowerConfigurationCluster2AAA,
                ],
                OUTPUT_CLUSTERS: [Ota.cluster_id, Time.cluster_id],
            }
        },
    }

Thanks! This solutions works for me as well. I only had to adapt the quirk file and restart home assistant. No need to remove and re-add the device.

I'm having trouble with this.  I get an error....
ImportError: cannot import name 'TuyaDPType' from 'zhaquirks.tuya.mcu'
does anyone have any suggestions?

Did you use the updated quirk at the top of the post off @adrianschneider1977
He quoted the old version as well, that might be a bit confusing.
If you updated your file manualy, make sure that you're not only replacing the include on top, but also remove the line "dp_type=TuyaDPType.VALUE" on the other 7 locations.

... or you can just use ready to work version from:
https://github.com/jacekk015/zha_quirks/blob/main/ts0601_temperature.py

Awesome community! The two devices I have finally started to behave somewhat icw the HA sky Connect.
However only one of the two returns the temp en humidity in HA as sensors. I removed and re-added multiple times.
Any magic option I missed?

Awesome community! The two devices I have finally started to behave somewhat icw the HA sky Connect. However only one of the two returns the temp en humidity in HA as sensors. I removed and re-added multiple times. Any magic option I missed?

It only worked for me when I restarted Home Assistant. Even reloading the integration and pairing again did not show the temperature and humidity.

@relighted @mrctorres
Which file did you both use??
From my repository??
https://github.com/jacekk015/zha_quirks/blob/main/ts0601_temperature.py
Below user successfully used my quirk.
https://github.com/jacekk015/zha_quirks/issues/6

For getting the device you working OK you need deleting it and waiting one minute and then adding it new after the quirk have being installed or the tuya magic is not working.

Yes I used the one mentioned here
https://github.com/zigpy/zha-device-handlers/issues/1286#issuecomment-1463798600
I have one device working ok with temp & hum HA sensors as output in HA.
The other one, which I deleted, powered off 2 hours, now re-added also is well detected but simply does not show these 2 as sensors, only 4 binary states, and the settings options.
Could be they have different tuya FW on them?

Do you use latest version from:
https://github.com/jacekk015/zha_quirks
???
Use latest version quirk file.
Enable debug logging
https://github.com/jacekk015/zha_quirks#in-case-of-errors-or-to-support-new-function
Restart HA
Remove that non working device, and pair like a new.
After pairing wait at least 10 minutes.
Post full HA logs here. Don't cut out anything.

I have it working after a bit of a voodoo dance...
My steps were:

Got rid of the old quirks I had (added .bad to the end).
Added quirk from jacekk015's repository.
Added device (failed)
Restarted Home Assitant core
Added device (succeeded but no temp/humidity sensors)
Reloaded ZHA

At this point it is functioning correctly.  The only anomaly is the 4 unidentified Binaryinput sensors and the "switch" control.  I wonder what they all do?
What'd be awesome is some way to set the display to F rather than C.

I have it working after a bit of a voodoo dance...
My steps were:

Got rid of the old quirks I had (added .bad to the end).
Added quirk from jacekk015's repository.
Added device (failed)
Restarted Home Assitant core
Added device (succeeded but no temp/humidity sensors)
Reloaded ZHA

At this point it is functioning correctly. The only anomaly is the 4 unidentified Binaryinput sensors and the "switch" control. I wonder what they all do?
What'd be awesome is some way to set the display to F rather than C.

Ahh, awesome!
The reloading did the trick here. Steps 1-5 in effect were done before.
It also occurred to me that the devices were added with the entityID Same name. So I also renamed nr1, before now adding nr2.
I tried setting a trigger value, hoping for effect on the binary sensors, but no Go unfortunately on that.

Search the code for BinaryInput on my repo. There's description there. Switch is to change Celsius/Fahrenheit

I have it working after a bit of a voodoo dance...
My steps were:

Got rid of the old quirks I had (added .bad to the end).
Added quirk from jacekk015's repository.
Added device (failed)
Restarted Home Assitant core
Added device (succeeded but no temp/humidity sensors)
Reloaded ZHA

At this point it is functioning correctly. The only anomaly is the 4 unidentified Binaryinput sensors and the "switch" control. I wonder what they all do?
What'd be awesome is some way to set the display to F rather than C.

Ahh, awesome! The reloading did the trick here. Steps 1-5 in effect were done before.
It also occurred to me that the devices were added with the entityID Same name. So I also renamed nr1, before now adding nr2. I tried setting a trigger value, hoping for effect on the binary sensors, but no Go unfortunately on that.

Worked for me without reconnecting devices.
Thank You!

I, too, have my own quirk for this issue - and it addresses also #1702.
I have compressed all essential changes to a single standalone script that can be used for testing: https://github.com/Any-berg/zha-device-handlers/blob/standalone/zhaquirks/nous/ts0601.py
My actual fork relies on some changes and additions to Tuya scripts: https://github.com/Any-berg/zha-device-handlers
Based on my own testing, there are no remaining problems to fix. Time synchronization and device configuration through attributes works well after TuyaMCUCluster is made to work with NoManufacturerCluster, and all datapoints including the alarms are accessible. Even battery status always shows up after some waiting (and the reported number of AAA batteries is 3).

@Any-berg
_TZE200_locansqn is supported by ts0601_temperature.py custom quirk
https://github.com/jacekk015/zha_quirks

I am a bit confused: is it possible set the TUYA_TEMP_UNIT to Fahrenheit ON THE DEVICE SCREEN via HA?  I have the display in F on HA, but short of buying a Tuya gateway to do this, I’m hoping it’s possible to make this change through HA.  Anyone?

@davids777 my quirk version has switch for unit change
https://github.com/jacekk015/zha_quirks/blob/main/ts0601_temperature.py

@jacekk015 thanks.  I had previously tried that switch as mentioned earlier in the thread, but it hadn't changed the display.  As also suggested elsewhere in the thread, I tried removing and re-adding the device and it finally updated.  Again, I really appreciate the work you've done on this quirk.  Thank you.

@davids777 Since we you have TZE200_locansqn
Do you also have UTC/local time problem like user below?
https://github.com/jacekk015/zha_quirks/issues/9#issuecomment-1584237418

@davids777 If you click the physical button on top of the device right before changing temperature unit (or anything else in the configurations) your change should take effect in a couple of seconds. Without this click it may never happen. It is the same after pairing the device and waiting for the time to synchronize.

@jacekk015 I tried your quirk - it looks good and it also gave me some ideas for my other quirks. Seems that we're closer to getting this device "officially" supported.
The reported battery size and quantity are wrong for _TZE200_locansqn. At least my model has 3xAAA which translates to BATTERY_SIZES: 4, BATTERY_QUANTITY: 3. Also, I am having difficulty finding any actual Temperature and Humidity reports from HA, and the unnamed Binary Inputs (which I assume to be the 4 possible alerts) are difficult to tell apart:

@Any-berg since you've read the code then you should see BinaryInput elements
TuyaAlarmTempUnder
TuyaAlarmTempOver
TuyaAlarmHumidityUnder
TuyaAlarmHumidityOver

Also, I am having difficulty finding any actual Temperature and Humidity reports from HA
Aren't you using some old HA version?? Binary inputs should be on different Group area called: Sensors
Temperature and Humidity readings should be also there.
Like here:
https://github.com/zigpy/zha-device-handlers/issues/1286#issuecomment-1019970671

@jacekk015 Neither the latest iPhone application nor login via computer browser shows me any temperature or humidity readings. The picture I attached was from the dashboard where controls and sensors are grouped together. Here is what I see from the device itself:

For the time being, my HA version should be up to date:

Did you use the updated quirk at the top of the post off @adrianschneider1977 He quoted the old version as well, that might be a bit confusing.
If you updated your file manualy, make sure that you're not only replacing the include on top, but also remove the line "dp_type=TuyaDPType.VALUE" on the other 7 locations.
Attached the updated version with all modifications. ts0601_temperature.zip

Thank you. Finally it works :)

@Any-berg You should remove and pair it like a new.
If that doesn't work you need to provide debug level logs, using quirk from my repository.

Just jumping in here to note that this quirk works for this version of the device as well: https://www.aliexpress.us/item/3256804825779670.html
Install the quirk as normal but then you must add ("_TZE200_whkgqxse", "TS0601") to the MODELS_INFO in the signature to get it to work. Then the typical: remove the device, restart home assistant, readd the device, and wait a few minutes for the entities to show up.
It's working great now! Although this devices doesn't seem to have as many entities exposed as others. All you get is temperature, humidity, and battery.

@jgkawell To be sure - you're talking about quirk:
ts0601_temperature.py
from
https://github.com/jacekk015/zha_quirks/
??
If yes, I will add this signature _TZE200_whkgqxse to the quirk for future users.
Thx!

@jacekk015 Sorry, forgot to quote the comment with the solution I used. It was the link by @joos81: ts0601_temperature.zip
I tried the one in your repo but that didn't seem to work at all even though it provided more sensors and switches. Though it's possible I did something wrong setting up your implementation and it does work fine haha

@davids777 If you click the physical button on top of the device right before changing temperature unit (or anything else in the configurations) your change should take effect in a couple of seconds. Without this click it may never happen. It is the same after pairing the device and waiting for the time to synchronize.

Try as I might, I can't get this to work. It worked when I first set up the device, as I was able to use the switch entity to change from °C to °F. But now, whenever I try to change the temperature sensitivity and reporting time, they reset back to 14.5° and 29 minutes - no matter how long I leave the device for, how often I press the button, etc. I've tried deleting and re-adding the device (actually, before doing this the temperature sensitivity and reporting time were showing as 74.5° and 85 minutes, which I assume was an error), restarting HA and restarting ZHA, but still no luck. Anybody have a fix?

Hello everyone,
Thank you for this integration, I used your python script and everything worked well, I had the humidity and battery temperature raised to 100% and the device is on time 👍
My problem is that this morning I passed the HA update in 2023.08.2 and since then I have the battery which indicates 146%...
I have also never had the setting of the alarm sliders and adjustment as on the iphone capture of any-betc

Hello everyone, Thank you for this integration, I used your python script and everything worked well, I had the humidity and battery temperature raised to 100% and the device is on time 👍 My problem is that this morning I passed the HA update in 2023.08.2 and since then I have the battery which indicates 146%... I have also never had the setting of the alarm sliders and adjustment as on the iphone capture of any-betc

Have you tried this one? https://github.com/jacekk015/zha_quirks/blob/main/ts0601_temperature.py?rgh-link-date=2023-03-10T13%3A22%3A59Z

So I just tested, I have a lot of options that I didn't have before (the Control field), but the battery is still at 132%.
Too bad I'm going to do with it, it doesn't matter in itself

So I just tested, I have a lot of options that I didn't have before (the Control field), but the battery is still at 132%.
Too bad I'm going to do with it, it doesn't matter in itself