dresden-elektronik / deconz-rest-plugin

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

HiHome WZB-TRVL (Smart Zigbee Radiator Thermostat) (Tuya) #3922

Closed KPWhiver closed 3 years ago

KPWhiver commented 3 years ago

Device

Screenshots

hihome (Note: this has been taken using this commit: https://github.com/KPWhiver/deconz-rest-plugin/commit/287a874cb026ab8c4d67e1a71141a07bb5deadde, without this commit it gets the name On/Off Light, but all the node/cluster info is the same.)

Further information

This device is made by Tuya. In the zigbee2mqtt project this device is implemented as a whitelabel of the Saswell-SEA802, which is also discussed at the end of this issue: https://github.com/dresden-elektronik/deconz-rest-plugin/issues/3109, and support for which has been added already. Manufacturer: _TYST11_c88teujp Model id: 88teujp As such I tried to implement the HiHome thermostat myself in this commit: https://github.com/KPWhiver/deconz-rest-plugin/commit/287a874cb026ab8c4d67e1a71141a07bb5deadde but although this makes the device recognized as a thermostat in de Phoscon app and in Home Assistant, I can not control the device in Home Assistant nor do I see any temperature readings or other data.

Smanar commented 3 years ago

I have checked the PR, all seem fine, do you have the device JSON ? If you can see it in phoscon or HA, for me it s ok.

KPWhiver commented 3 years ago

Json for one where I already tried to change some settings through Home Assistant:

{  
    "config":{
        "heatsetpoint":1800,
        "locked":null,
        "offset":0,
        "on":true,
        "preset":"manual",
        "reachable":true,
        "schedule":{

        },
        "schedule_on":null,
        "setvalve":null,
        "windowopen_set":null
    },
    "ep":1,
    "etag":"cfbaafa06c6f78decbdb330b2559f397",
    "lastseen":"2020-12-15T19:04Z",
    "manufacturername":"_TYST11_zuhszj9s",
    "modelid":"uhszj9s",
    "name":"Thermostat 25",
    "state":{
        "lastupdated":"none",
        "on":null,
        "temperature":null
    },
    "swversion":"20180727",
    "type":"ZHAThermostat",
    "uniqueid":"60:a4:23:ff:fe:8e:2c:e7-01-0201"
}

Json for a device where did not change anything through Home Assistant:

{
    "config":{
        "heatsetpoint":null,
        "locked":null,
        "offset":0,
        "on":true,
        "preset":null,
        "reachable":true,
        "schedule":{

        },
        "schedule_on":null,
        "setvalve":null,
        "windowopen_set":null
    },
    "ep":1,
    "etag":"92aa8c815644d951279f554b6771a079",
    "lastseen":"2020-12-15T19:04Z",
    "manufacturername":"_TYST11_zuhszj9s",
    "modelid":"uhszj9s",
    "name":"uhszj9s",
    "state":{
        "lastupdated":"none",
        "on":null,
        "temperature":null
    },
    "swversion":"20180727",
    "type":"ZHAThermostat",
    "uniqueid":"60:a4:23:ff:fe:b5:a9:53-01-0201"
}
KPWhiver commented 3 years ago

By the way, even though I set the heatsetpoint through Home Assistant (to 18 degrees), it did not actually change on the thermostat.

KPWhiver commented 3 years ago

Here is an excerpt from the logs concerning the thermostats:

Dec 15 20:42:09 server conmon[29112]: 20:42:09:588 Tuya debug 4 : Address 0x60A423FFFE8E2CE7 Payload 00016501000101
Dec 15 20:42:09 server conmon[29112]: 20:42:09:589 Tuya debug 5 : Status: 0 Transid: 1 Dp: 357 (0x01,0x65) Fn: 0 Data 1
Dec 15 20:42:09 server conmon[29112]: 20:42:09:815 DeviceAnnce of SensorNode: 0x60A423FFFEB5A953 [1]
Dec 15 20:42:12 server conmon[29112]: 20:42:12:383 Tuya debug 4 : Address 0x60A423FFFEB5A953 Payload 00016501000101
Dec 15 20:42:12 server conmon[29112]: 20:42:12:383 Tuya debug 5 : Status: 0 Transid: 1 Dp: 357 (0x01,0x65) Fn: 0 Data 1
Dec 15 20:42:13 server conmon[29112]: 20:42:13:598 Tuya debug 4 : Address 0x60A423FFFE8E2CE7 Payload 00016501000101
Dec 15 20:42:13 server conmon[29112]: 20:42:13:599 Tuya debug 5 : Status: 0 Transid: 1 Dp: 357 (0x01,0x65) Fn: 0 Data 1
Dec 15 20:42:16 server conmon[29112]: 20:42:16:102 Tuya debug 4 : Address 0x60A423FFFEB5A953 Payload 00016501000101
Dec 15 20:42:16 server conmon[29112]: 20:42:16:102 Tuya debug 5 : Status: 0 Transid: 1 Dp: 357 (0x01,0x65) Fn: 0 Data 1
Dec 15 20:42:20 server conmon[29112]: 20:42:20:100 Tuya debug 4 : Address 0x60A423FFFEB5A953 Payload 00016501000101
Dec 15 20:42:20 server conmon[29112]: 20:42:20:101 Tuya debug 5 : Status: 0 Transid: 1 Dp: 357 (0x01,0x65) Fn: 0 Data 1
Dec 15 20:42:20 server conmon[29112]: 20:42:20:309 DeviceAnnce of SensorNode: 0x60A423FFFE8E2CE7 [1]
Dec 15 20:42:22 server conmon[29112]: 20:42:22:880 Tuya debug 4 : Address 0x60A423FFFE8E2CE7 Payload 00016501000101
Dec 15 20:42:22 server conmon[29112]: 20:42:22:880 Tuya debug 5 : Status: 0 Transid: 1 Dp: 357 (0x01,0x65) Fn: 0 Data 1
Dec 15 20:42:24 server conmon[29112]: 20:42:24:101 Tuya debug 4 : Address 0x60A423FFFEB5A953 Payload 00016501000101
Dec 15 20:42:24 server conmon[29112]: 20:42:24:102 Tuya debug 5 : Status: 0 Transid: 1 Dp: 357 (0x01,0x65) Fn: 0 Data 1
Dec 15 20:42:26 server conmon[29112]: 20:42:26:592 Tuya debug 4 : Address 0x60A423FFFE8E2CE7 Payload 00016501000101
Dec 15 20:42:26 server conmon[29112]: 20:42:26:593 Tuya debug 5 : Status: 0 Transid: 1 Dp: 357 (0x01,0x65) Fn: 0 Data 1
Dec 15 20:42:28 server conmon[29112]: 20:42:28:099 Tuya debug 4 : Address 0x60A423FFFEB5A953 Payload 00016501000101
Dec 15 20:42:28 server conmon[29112]: 20:42:28:100 Tuya debug 5 : Status: 0 Transid: 1 Dp: 357 (0x01,0x65) Fn: 0 Data 1
Dec 15 20:42:30 server conmon[29112]: 20:42:30:584 Tuya debug 4 : Address 0x60A423FFFE8E2CE7 Payload 00016501000101
Dec 15 20:42:30 server conmon[29112]: 20:42:30:585 Tuya debug 5 : Status: 0 Transid: 1 Dp: 357 (0x01,0x65) Fn: 0 Data 1
Dec 15 20:42:34 server conmon[29112]: 20:42:34:598 Tuya debug 4 : Address 0x60A423FFFE8E2CE7 Payload 00016501000101
Dec 15 20:42:34 server conmon[29112]: 20:42:34:599 Tuya debug 5 : Status: 0 Transid: 1 Dp: 357 (0x01,0x65) Fn: 0 Data 1
Dec 15 20:42:34 server conmon[29112]: 20:42:34:808 DeviceAnnce of SensorNode: 0x60A423FFFEB5A953 [1]
Dec 15 20:42:37 server conmon[29112]: 20:42:37:388 Tuya debug 4 : Address 0x60A423FFFEB5A953 Payload 00016501000100
Dec 15 20:42:37 server conmon[29112]: 20:42:37:389 Tuya debug 5 : Status: 0 Transid: 1 Dp: 357 (0x01,0x65) Fn: 0 Data 0
Dec 15 20:42:38 server conmon[29112]: 20:42:38:593 Tuya debug 4 : Address 0x60A423FFFE8E2CE7 Payload 00016501000101
Dec 15 20:42:38 server conmon[29112]: 20:42:38:594 Tuya debug 5 : Status: 0 Transid: 1 Dp: 357 (0x01,0x65) Fn: 0 Data 1
Dec 15 20:42:41 server conmon[29112]: 20:42:41:102 Tuya debug 4 : Address 0x60A423FFFEB5A953 Payload 00016501000100
Dec 15 20:42:41 server conmon[29112]: 20:42:41:103 Tuya debug 5 : Status: 0 Transid: 1 Dp: 357 (0x01,0x65) Fn: 0 Data 0
Dec 15 20:42:45 server conmon[29112]: 20:42:45:100 Tuya debug 4 : Address 0x60A423FFFEB5A953 Payload 00016501000100
Dec 15 20:42:45 server conmon[29112]: 20:42:45:101 Tuya debug 5 : Status: 0 Transid: 1 Dp: 357 (0x01,0x65) Fn: 0 Data 0
Dec 15 20:42:45 server conmon[29112]: 20:42:45:390 DeviceAnnce of SensorNode: 0x60A423FFFE8E2CE7 [1]

The Dp: 357 message seems to be whether the thermostat is on or off, if I rotate the button on it to the off position Data becomes 0, whereas otherwise it is 1.

KPWhiver commented 3 years ago

Comparing the zigbee2mqtt implementation with this one, it seems that these "Saswell" devices do use the Tuya cluster, but they use a different set of Dp's than normal Tuya radiator thermostat. I'll try to fix this in my PR and see if that improves things.

Smanar commented 3 years ago

Ha yes right, look at the tuya file

                case 0x0267: // max temperature limit
                {
                    //can be setpoint for some device
                    if (sensorNode->modelId() == QLatin1String("GbxAXL2"))
                    {
                        qint16 temp = (static_cast<qint16>(data & 0xFFFF)) * 10;
                        ResourceItem *item = sensorNode->item(RConfigHeatSetpoint);

                        if (item && item->toNumber() != temp)
                        {
                            item->setValue(temp);
                            Event e(RSensors, RConfigHeatSetpoint, sensorNode->id(), item);
                            enqueueEvent(e);

                        }
                    }
                }
                break;

You can add your device here, but pls use manufacturername isntead of model id

This is the part for setpoint, but it seem your device mimic the GbxAXL2

                if ((sensorNode->modelId() == QLatin1String("GbxAXL2")) ||
                    (sensorNode->manufacturer() == QLatin1String("_TYST11_zuhszj9s")) )
                {
KPWhiver commented 3 years ago

Alright, I have now changed this device to use the same dp's as is done in z2m (basically the same as GbxAXL2): https://github.com/dresden-elektronik/deconz-rest-plugin/compare/master...KPWhiver:master

I can now change the setpoint, change the windowopen mode, change it to auto/manu/off, and change the temperature offset. In all these cases confirmation is sent from the device that the change has been made. However, the device still does not send the local temperature or current setpoint, it only sends the current valve state (dp: 357) every few seconds. Any idea on how to get it to send the temperature?

The only thing I can think of is that (according to the z2m code) this device expects to be send the current time whenever it does a DeviceAnnounce. Perhaps it won't send the temperature/setpoint until the time has been sent? Unfortunately, I have no clue how to implement this in deconz.

Smanar commented 3 years ago

Ha ? It's not because the device is lazy and make few report ? I don't remember there is this kind of issue for GbxAXL2

It s the tuya time command ? I have started the code here, but no one to test it ... https://github.com/dresden-elektronik/deconz-rest-plugin/issues/3304#issuecomment-740215205

If you have a display for time on your device, It can help me to finish this code too .

KPWhiver commented 3 years ago

They have both been connected for days and in that time I only saw the DP: 357 message.

It is indeed the tuya time command you describe in #3304. The device does not have a display for time, but I am willing to test your code and see if it does anything. How can I test your code?

Smanar commented 3 years ago

What have you tried ? I prefer let your last PR clean, but if you want to make test I can make another PR that mix your PR and mine (or if you want to do it on your side ? but on a new one)

With both PR you will have the device working, and I hope the new debug line starting with "Tuya debug 1 : Time sync Request"

Smanar commented 3 years ago

@KPWhiver do you want I make a branch with the 2 PR to test it ?

KPWhiver commented 3 years ago

That would be great

Smanar commented 3 years ago

Done, pls use the branch "tuyaspecial"

git pull
git branch tuyaspecial
git pull

Not sure this code will work, I have never tested on tuya device yet. But you will have usefull log for me.

KPWhiver commented 3 years ago

According to z2m code, this device does not send an time request through a message, but instead expects a time when it does a deviceAnnounce. I let it the code run for a while but never saw a time request arrive. I changed the code to call SendTuyaCommand with the result of getTIme when a deviceAnnounce happens, but although the time is sent, nothing seems to happen, still no temperature data:

Dec 20 22:50:30 server conmon[14273]: 22:50:30:058 Tuya debug 4 : Address 0x60A423FFFEB5A953 Payload 00016501000100
Dec 20 22:50:30 server conmon[14273]: 22:50:30:058 Tuya debug 5 : Status: 0 Transid: 1 Dp: 357 (0x01,0x65) Fn: 0 Data 0
Dec 20 22:50:34 server conmon[14273]: 22:50:34:058 Tuya debug 4 : Address 0x60A423FFFEB5A953 Payload 00016501000100
Dec 20 22:50:34 server conmon[14273]: 22:50:34:058 Tuya debug 5 : Status: 0 Transid: 1 Dp: 357 (0x01,0x65) Fn: 0 Data 0
Dec 20 22:50:38 server conmon[14273]: 22:50:38:058 Tuya debug 4 : Address 0x60A423FFFEB5A953 Payload 00016501000100
Dec 20 22:50:38 server conmon[14273]: 22:50:38:058 Tuya debug 5 : Status: 0 Transid: 1 Dp: 357 (0x01,0x65) Fn: 0 Data 0
Dec 20 22:50:44 server conmon[14273]: 22:50:44:742 DeviceAnnce of SensorNode: 0x60A423FFFEB5A953 [1]
Dec 20 22:50:44 server conmon[14273]: 22:50:44:743 Send Tuya Command 0x24 Data: 277283b4277291c4
Dec 20 22:50:47 server conmon[14273]: 22:50:47:349 Tuya debug 4 : Address 0x60A423FFFEB5A953 Payload 00016501000100
Dec 20 22:50:47 server conmon[14273]: 22:50:47:350 Tuya debug 5 : Status: 0 Transid: 1 Dp: 357 (0x01,0x65) Fn: 0 Data 0
Dec 20 22:50:51 server conmon[14273]: 22:50:51:057 Tuya debug 4 : Address 0x60A423FFFEB5A953 Payload 00016501000100
Dec 20 22:50:51 server conmon[14273]: 22:50:51:058 Tuya debug 5 : Status: 0 Transid: 1 Dp: 357 (0x01,0x65) Fn: 0 Data 0
KPWhiver commented 3 years ago

Just to be sure this device actually supports sending a temperature I ran zigbee2mqtt with my conbee 2 and paired it. Zigbee2mqtt pairs fine and receives temperature data, which means that it is doing something that deconz isn't. For reference, here are the zigbee2mqtt logs:

Zigbee2MQTT:info  2020-12-21 17:33:59: Device '0x60a423fffeb5a953' joined
Zigbee2MQTT:info  2020-12-21 17:33:59: Starting interview of '0x60a423fffeb5a953'
Zigbee2MQTT:error 2020-12-21 17:33:59: Cannot send message: topic: 'zigbee2mqtt/bridge/log', payload: '{"message":{"friendly_name":"0x60a423fffeb5a953"},"type":"device_connected"}
Zigbee2MQTT:error 2020-12-21 17:33:59: Cannot send message: topic: 'zigbee2mqtt/bridge/log', payload: '{"message":"interview_started","meta":{"friendly_name":"0x60a423fffeb5a953"},"type":"pairing"}
Zigbee2MQTT:debug 2020-12-21 17:34:04: Received Zigbee message from '0x60a423fffeb5a953', type 'readResponse', cluster 'genBasic', data '{"modelId":"uhszj9s\u0000"}' from endpoint 1 with groupID null
Zigbee2MQTT:debug 2020-12-21 17:34:04: Skipping message, definition is undefined and still interviewing
Zigbee2MQTT:debug 2020-12-21 17:34:06: Received Zigbee message from '0x60a423fffeb5a953', type 'readResponse', cluster 'genBasic', data '{"manufacturerName":"_TYST11_zuhszj9s"}' from endpoint 1 with groupID null
Zigbee2MQTT:debug 2020-12-21 17:34:08: Received Zigbee message from '0x60a423fffeb5a953', type 'readResponse', cluster 'genBasic', data '{"powerSource":3}' from endpoint 1 with groupID null
Zigbee2MQTT:debug 2020-12-21 17:34:09: Received Zigbee message from '0x60a423fffeb5a953', type 'commandGetData', cluster 'manuSpecificTuya', data '{"data":{"data":[0],"type":"Buffer"},"datatype":1,"dp":101,"fn":0,"status":0,"transid":1}' from endpoint 1 with groupID null
Zigbee2MQTT:error 2020-12-21 17:34:09: Cannot send message: topic: 'zigbee2mqtt/0x60a423fffeb5a953', payload: '{"linkquality":224,"system_mode":"off"}
Zigbee2MQTT:debug 2020-12-21 17:34:13: Received Zigbee message from '0x60a423fffeb5a953', type 'readResponse', cluster 'genBasic', data '{"zclVersion":3}' from endpoint 1 with groupID null
Zigbee2MQTT:debug 2020-12-21 17:34:14: Received Zigbee message from '0x60a423fffeb5a953', type 'commandGetData', cluster 'manuSpecificTuya', data '{"data":{"data":[1],"type":"Buffer"},"datatype":1,"dp":10,"fn":0,"status":0,"transid":23}' from endpoint 1 with groupID null
Zigbee2MQTT:error 2020-12-21 17:34:14: Cannot send message: topic: 'zigbee2mqtt/0x60a423fffeb5a953', payload: '{"frost_detection":"ON","linkquality":224,"system_mode":"off"}
Zigbee2MQTT:debug 2020-12-21 17:34:17: Received Zigbee message from '0x60a423fffeb5a953', type 'readResponse', cluster 'genBasic', data '{"appVersion":73}' from endpoint 1 with groupID null
Zigbee2MQTT:debug 2020-12-21 17:34:18: Received Zigbee message from '0x60a423fffeb5a953', type 'commandGetData', cluster 'manuSpecificTuya', data '{"data":{"data":[1],"type":"Buffer"},"datatype":1,"dp":10,"fn":0,"status":0,"transid":23}' from endpoint 1 with groupID null
Zigbee2MQTT:error 2020-12-21 17:34:18: Cannot send message: topic: 'zigbee2mqtt/0x60a423fffeb5a953', payload: '{"frost_detection":"ON","linkquality":224,"system_mode":"off"}
Zigbee2MQTT:debug 2020-12-21 17:34:21: Received Zigbee message from '0x60a423fffeb5a953', type 'readResponse', cluster 'genBasic', data '{"stackVersion":0}' from endpoint 1 with groupID null
Zigbee2MQTT:debug 2020-12-21 17:34:23: Received Zigbee message from '0x60a423fffeb5a953', type 'commandGetData', cluster 'manuSpecificTuya', data '{"data":{"data":[1],"type":"Buffer"},"datatype":1,"dp":10,"fn":0,"status":0,"transid":23}' from endpoint 1 with groupID null
Zigbee2MQTT:error 2020-12-21 17:34:23: Cannot send message: topic: 'zigbee2mqtt/0x60a423fffeb5a953', payload: '{"frost_detection":"ON","linkquality":224,"system_mode":"off"}
Zigbee2MQTT:debug 2020-12-21 17:34:26: Received Zigbee message from '0x60a423fffeb5a953', type 'commandGetData', cluster 'manuSpecificTuya', data '{"data":{"data":[1],"type":"Buffer"},"datatype":1,"dp":10,"fn":0,"status":0,"transid":23}' from endpoint 1 with groupID null
Zigbee2MQTT:error 2020-12-21 17:34:26: Cannot send message: topic: 'zigbee2mqtt/0x60a423fffeb5a953', payload: '{"frost_detection":"ON","linkquality":225,"system_mode":"off"}
Zigbee2MQTT:debug 2020-12-21 17:34:27: Received Zigbee message from '0x60a423fffeb5a953', type 'readResponse', cluster 'genBasic', data '{"hwVersion":1}' from endpoint 1 with groupID null
Zigbee2MQTT:debug 2020-12-21 17:34:30: Received Zigbee message from '0x60a423fffeb5a953', type 'commandGetData', cluster 'manuSpecificTuya', data '{"data":{"data":[1],"type":"Buffer"},"datatype":1,"dp":10,"fn":0,"status":0,"transid":23}' from endpoint 1 with groupID null
Zigbee2MQTT:error 2020-12-21 17:34:30: Cannot send message: topic: 'zigbee2mqtt/0x60a423fffeb5a953', payload: '{"frost_detection":"ON","linkquality":225,"system_mode":"off"}
Zigbee2MQTT:debug 2020-12-21 17:34:31: Received Zigbee message from '0x60a423fffeb5a953', type 'readResponse', cluster 'genBasic', data '{"dateCode":"20180727"}' from endpoint 1 with groupID null
Zigbee2MQTT:debug 2020-12-21 17:34:34: Received Zigbee message from '0x60a423fffeb5a953', type 'commandGetData', cluster 'manuSpecificTuya', data '{"data":{"data":[1],"type":"Buffer"},"datatype":1,"dp":10,"fn":0,"status":0,"transid":23}' from endpoint 1 with groupID null
Zigbee2MQTT:error 2020-12-21 17:34:34: Cannot send message: topic: 'zigbee2mqtt/0x60a423fffeb5a953', payload: '{"frost_detection":"ON","linkquality":225,"system_mode":"off"}
Zigbee2MQTT:debug 2020-12-21 17:34:35: Received Zigbee message from '0x60a423fffeb5a953', type 'readResponse', cluster 'genBasic', data '{}' from endpoint 1 with groupID null
Zigbee2MQTT:info  2020-12-21 17:34:35: Successfully interviewed '0x60a423fffeb5a953', device has successfully been paired
Zigbee2MQTT:info  2020-12-21 17:34:35: Device '0x60a423fffeb5a953' is supported, identified as: Saswell Thermostatic radiator valve (SEA802-Zigbee)
Zigbee2MQTT:info  2020-12-21 17:34:35: Configuring '0x60a423fffeb5a953'
Zigbee2MQTT:error 2020-12-21 17:34:35: Cannot send message: topic: 'zigbee2mqtt/bridge/log', payload: '{"message":"interview_successful","meta":{"description":"Thermostatic radiator valve","friendly_name":"0x60a423fffeb5a953","model":"SEA802-Zigbee","supported":true,"vendor":"Saswell"},"type":"pairing"}
Zigbee2MQTT:info  2020-12-21 17:34:40: Successfully configured '0x60a423fffeb5a953'
Zigbee2MQTT:debug 2020-12-21 17:34:42: Received Zigbee message from '0x60a423fffeb5a953', type 'commandGetData', cluster 'manuSpecificTuya', data '{"data":{"data":[1],"type":"Buffer"},"datatype":1,"dp":10,"fn":0,"status":0,"transid":23}' from endpoint 1 with groupID null
Zigbee2MQTT:error 2020-12-21 17:34:42: Cannot send message: topic: 'zigbee2mqtt/0x60a423fffeb5a953', payload: '{"frost_detection":"ON","linkquality":225,"system_mode":"off"}
Zigbee2MQTT:debug 2020-12-21 17:34:44: Received Zigbee message from '0x60a423fffeb5a953', type 'commandGetData', cluster 'manuSpecificTuya', data '{"data":{"data":[1],"type":"Buffer"},"datatype":1,"dp":8,"fn":0,"status":0,"transid":24}' from endpoint 1 with groupID null
Zigbee2MQTT:error 2020-12-21 17:34:44: Cannot send message: topic: 'zigbee2mqtt/0x60a423fffeb5a953', payload: '{"frost_detection":"ON","linkquality":225,"system_mode":"off","window_detection":"ON"}
Zigbee2MQTT:debug 2020-12-21 17:34:46: Received Zigbee message from '0x60a423fffeb5a953', type 'commandGetData', cluster 'manuSpecificTuya', data '{"data":{"data":[1],"type":"Buffer"},"datatype":1,"dp":130,"fn":0,"status":0,"transid":25}' from endpoint 1 with groupID null
Zigbee2MQTT:error 2020-12-21 17:34:46: Cannot send message: topic: 'zigbee2mqtt/0x60a423fffeb5a953', payload: '{"anti_scaling":"ON","frost_detection":"ON","linkquality":225,"system_mode":"off","window_detection":"ON"}
Zigbee2MQTT:debug 2020-12-21 17:34:48: Received Zigbee message from '0x60a423fffeb5a953', type 'commandGetData', cluster 'manuSpecificTuya', data '{"data":{"data":[0,0,0,0],"type":"Buffer"},"datatype":2,"dp":27,"fn":0,"status":0,"transid":26}' from endpoint 1 with groupID null
Zigbee2MQTT:error 2020-12-21 17:34:48: Cannot send message: topic: 'zigbee2mqtt/0x60a423fffeb5a953', payload: '{"anti_scaling":"ON","frost_detection":"ON","linkquality":225,"local_temperature_calibration":0,"system_mode":"off","window_detection":"ON"}
Zigbee2MQTT:debug 2020-12-21 17:34:50: Received Zigbee message from '0x60a423fffeb5a953', type 'commandGetData', cluster 'manuSpecificTuya', data '{"data":{"data":[1],"type":"Buffer"},"datatype":1,"dp":40,"fn":0,"status":0,"transid":22}' from endpoint 1 with groupID null
Zigbee2MQTT:error 2020-12-21 17:34:50: Cannot send message: topic: 'zigbee2mqtt/0x60a423fffeb5a953', payload: '{"anti_scaling":"ON","child_lock":"LOCKED","frost_detection":"ON","linkquality":225,"local_temperature_calibration":0,"system_mode":"off","window_detection":"ON"}
Zigbee2MQTT:debug 2020-12-21 17:34:52: Received Zigbee message from '0x60a423fffeb5a953', type 'commandGetData', cluster 'manuSpecificTuya', data '{"data":{"data":[0,0,0,174],"type":"Buffer"},"datatype":2,"dp":102,"fn":0,"status":0,"transid":2}' from endpoint 1 with groupID null
Zigbee2MQTT:error 2020-12-21 17:34:52: Cannot send message: topic: 'zigbee2mqtt/0x60a423fffeb5a953', payload: '{"anti_scaling":"ON","child_lock":"LOCKED","frost_detection":"ON","linkquality":225,"local_temperature":"17.4","local_temperature_calibration":0,"system_mode":"off","window_detection":"ON"}
Zigbee2MQTT:debug 2020-12-21 17:34:55: Received Zigbee message from '0x60a423fffeb5a953', type 'commandGetData', cluster 'manuSpecificTuya', data '{"data":{"data":[0,0,0,50],"type":"Buffer"},"datatype":2,"dp":103,"fn":0,"status":0,"transid":3}' from endpoint 1 with groupID null
Zigbee2MQTT:error 2020-12-21 17:34:55: Cannot send message: topic: 'zigbee2mqtt/0x60a423fffeb5a953', payload: '{"anti_scaling":"ON","child_lock":"LOCKED","current_heating_setpoint":"5.0","frost_detection":"ON","linkquality":225,"local_temperature":"17.4","local_temperature_calibration":0,"system_mode":"off","window_detection":"ON"}
Zigbee2MQTT:debug 2020-12-21 17:34:57: Received Zigbee message from '0x60a423fffeb5a953', type 'commandGetData', cluster 'manuSpecificTuya', data '{"data":{"data":[0],"type":"Buffer"},"datatype":5,"dp":105,"fn":0,"status":0,"transid":4}' from endpoint 1 with groupID null
Zigbee2MQTT:error 2020-12-21 17:34:57: Cannot send message: topic: 'zigbee2mqtt/0x60a423fffeb5a953', payload: '{"anti_scaling":"ON","battery_low":"false","child_lock":"LOCKED","current_heating_setpoint":"5.0","frost_detection":"ON","linkquality":225,"local_temperature":"17.4","local_temperature_calibration":0,"system_mode":"off","window_detection":"ON"}
Zigbee2MQTT:debug 2020-12-21 17:34:59: Received Zigbee message from '0x60a423fffeb5a953', type 'commandGetData', cluster 'manuSpecificTuya', data '{"data":{"data":[0],"type":"Buffer"},"datatype":1,"dp":106,"fn":0,"status":0,"transid":5}' from endpoint 1 with groupID null
Zigbee2MQTT:error 2020-12-21 17:34:59: Cannot send message: topic: 'zigbee2mqtt/0x60a423fffeb5a953', payload: '{"anti_scaling":"ON","away_mode":"OFF","battery_low":"false","child_lock":"LOCKED","current_heating_setpoint":"5.0","frost_detection":"ON","linkquality":225,"local_temperature":"17.4","local_temperature_calibration":0,"system_mode":"off","window_detection":"ON"}
Zigbee2MQTT:debug 2020-12-21 17:35:01: Received Zigbee message from '0x60a423fffeb5a953', type 'commandGetData', cluster 'manuSpecificTuya', data '{"data":{"data":[0],"type":"Buffer"},"datatype":1,"dp":108,"fn":0,"status":0,"transid":7}' from endpoint 1 with groupID null
Zigbee2MQTT:error 2020-12-21 17:35:01: Cannot send message: topic: 'zigbee2mqtt/0x60a423fffeb5a953', payload: '{"anti_scaling":"ON","away_mode":"OFF","battery_low":"false","child_lock":"LOCKED","current_heating_setpoint":"5.0","frost_detection":"ON","linkquality":225,"local_temperature":"17.4","local_temperature_calibration":0,"preset_mode":"none","system_mode":"off","window_detection":"ON"}
Smanar commented 3 years ago

But there is only "Cannot send message" and "Received Zigbee message" so it don't send more request.

Do you have the link about this device on z2m ?

KPWhiver commented 3 years ago

The device is defined here: https://github.com/Koenkk/zigbee-herdsman-converters/blob/4ec1778b372ab3cd9063140ad1d26d181324ff5a/devices.js#L12813, I'll see if I can get some logging of the outgoing messages z2m sends. However, I do notice that the device starts sending values as soon as the configuring is done. The configuring in z2m consists mostly of binding the 'genBasic' cluster, which is done here: https://github.com/Koenkk/zigbee-herdsman/blob/71e8c1663cbc41cf53a32ca5861355d58e60325c/src/adapter/deconz/adapter/deconzAdapter.ts#L654 . Perhaps this is not done correctly in deconz?

Smanar commented 3 years ago

Binding for the basic cluster ? And for a tuya device ?

Its something easy to do with deconz, using the bind dropbox, but not sure it will change something, do you know hw to use it ?

I m seeing 2 special options in their code, ignore_tuya_set_time and ignore_basic_report

ignore_tuya_set_time ignore the command 0x24 on Tuya cluster. So that would mean, this device don't use this command ?

BTW (probably for other device) from here https://git.koehlerweb.org/frodovdr/Sonoff-Tasmota/src/commit/ecf5ad023261a991835553a271e0fca8951c077b/tasmota/xdrv_16_tuyamcu.ino#L804 , they are using another code, different than this one


#define TUYA_CMD_SET_TIME      0x1C

#ifdef USE_TUYA_TIME
void TuyaSetTime(void) {
  if (!RtcTime.valid) { return; }

  uint16_t payload_len = 8;
  uint8_t payload_buffer[8];
  payload_buffer[0] = 0x01;
  payload_buffer[1] = (uint8_t)RtcTime.year;
  payload_buffer[2] = RtcTime.month;
  payload_buffer[3] = RtcTime.day_of_month;
  payload_buffer[4] = RtcTime.hour;
  payload_buffer[5] = RtcTime.minute;
  payload_buffer[6] = RtcTime.second;
  payload_buffer[7] = RtcTime.day_of_week;

  TuyaSendCmd(TUYA_CMD_SET_TIME, payload_buffer, payload_len);
}
#endif //USE_TUYA_TIME

Edit: It was disabled from incoming request but not for even, so for me it s the same result, so this device use this command for sure, sorry.

KPWhiver commented 3 years ago

Looking at the z2m logs again I notice that before it binds it already receives messages with a Dp of 10, which never happens with deconz (only DP 101 (357 in deconz)). I removed the z2m database and paired again and this time it even already sent a local temperature before the cluster was bound, so I now doubt this is actually necessary. Here is a log of messages that are send and received by z2m during the pairing: (apologies for the size)

controller:log Device announce '0x60a423fffeb5a953'
controller:log Device announce is from unknown device '0x60a423fffeb5a953'
controller:log Received 'zcl' data '{"frame":{"Header":{"frameControl":{"frameType":1,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":false,"reservedBits":0},"transactionSequenceNumber":3,"manufacturerCode":null,"commandIdentifier":1},"Payload":{"status":0,"transid":1,"dp":101,"datatype":1,"fn":0,"data":{"type":"Buffer","data":[0]}}},"address":63383,"endpoint":1,"linkquality":36,"groupID":null}'
controller:log 'zcl' data is from unknown device with address '63383', skipping...
controller:log Received 'zcl' data '{"frame":{"Header":{"frameControl":{"frameType":1,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":false,"reservedBits":0},"transactionSequenceNumber":4,"manufacturerCode":null,"commandIdentifier":1},"Payload":{"status":0,"transid":1,"dp":101,"datatype":1,"fn":0,"data":{"type":"Buffer","data":[0]}}},"address":63383,"endpoint":1,"linkquality":36,"groupID":null}'
controller:log 'zcl' data is from unknown device with address '63383', skipping...
controller:log Device '0x60a423fffe8e2ce7' joined
controller:log Device '0x60a423fffe8e2ce7' accepted by handler
controller:log New device '0x60a423fffe8e2ce7' joined
controller:log Creating device '0x60a423fffe8e2ce7'
controller:log Interview '0x60a423fffe8e2ce7' start
controller:device:log Interview - start device '0x60a423fffe8e2ce7'
controller:endpoint Read 0x60a423fffe8e2ce7/1 genBasic(["modelId"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null})
controller:log Received 'zcl' data '{"frame":{"Header":{"frameControl":{"frameType":0,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":true,"reservedBits":0},"transactionSequenceNumber":3,"manufacturerCode":null,"commandIdentifier":1},"Payload":[{"attrId":5,"status":0,"dataType":66,"attrData":"uhszj9s\u0000"}]},"address":63383,"endpoint":1,"linkquality":36,"groupID":null}'
controller:endpoint Read 0x60a423fffe8e2ce7/1 genBasic(["manufacturerName"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null})
controller:log Received 'zcl' data '{"frame":{"Header":{"frameControl":{"frameType":1,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":false,"reservedBits":0},"transactionSequenceNumber":0,"manufacturerCode":null,"commandIdentifier":1},"Payload":{"status":0,"transid":1,"dp":101,"datatype":1,"fn":0,"data":{"type":"Buffer","data":[0]}}},"address":63383,"endpoint":1,"linkquality":36,"groupID":null}'
controller:endpoint DefaultResponse 0x60a423fffe8e2ce7/1 61184(1, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":1,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null})
controller:log Received 'zcl' data '{"frame":{"Header":{"frameControl":{"frameType":0,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":true,"reservedBits":0},"transactionSequenceNumber":4,"manufacturerCode":null,"commandIdentifier":1},"Payload":[{"attrId":4,"status":0,"dataType":66,"attrData":"_TYST11_zuhszj9s"}]},"address":63383,"endpoint":1,"linkquality":36,"groupID":null}'
controller:endpoint Read 0x60a423fffe8e2ce7/1 genBasic(["powerSource"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null})
controller:log Received 'zcl' data '{"frame":{"Header":{"frameControl":{"frameType":0,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":true,"reservedBits":0},"transactionSequenceNumber":5,"manufacturerCode":null,"commandIdentifier":1},"Payload":[{"attrId":7,"status":0,"dataType":48,"attrData":3}]},"address":63383,"endpoint":1,"linkquality":36,"groupID":null}'
controller:endpoint Read 0x60a423fffe8e2ce7/1 genBasic(["zclVersion"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null})
controller:log Received 'zcl' data '{"frame":{"Header":{"frameControl":{"frameType":1,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":false,"reservedBits":0},"transactionSequenceNumber":1,"manufacturerCode":null,"commandIdentifier":1},"Payload":{"status":0,"transid":23,"dp":10,"datatype":1,"fn":0,"data":{"type":"Buffer","data":[1]}}},"address":63383,"endpoint":1,"linkquality":36,"groupID":null}'
controller:endpoint DefaultResponse 0x60a423fffe8e2ce7/1 61184(1, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":1,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null})
controller:log Received 'zcl' data '{"frame":{"Header":{"frameControl":{"frameType":0,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":true,"reservedBits":0},"transactionSequenceNumber":6,"manufacturerCode":null,"commandIdentifier":1},"Payload":[{"attrId":0,"status":0,"dataType":32,"attrData":3}]},"address":63383,"endpoint":1,"linkquality":36,"groupID":null}'
controller:endpoint Read 0x60a423fffe8e2ce7/1 genBasic(["appVersion"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null})
controller:log Received 'zcl' data '{"frame":{"Header":{"frameControl":{"frameType":1,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":false,"reservedBits":0},"transactionSequenceNumber":2,"manufacturerCode":null,"commandIdentifier":1},"Payload":{"status":0,"transid":24,"dp":8,"datatype":1,"fn":0,"data":{"type":"Buffer","data":[1]}}},"address":63383,"endpoint":1,"linkquality":36,"groupID":null}'
controller:endpoint DefaultResponse 0x60a423fffe8e2ce7/1 61184(1, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":1,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null})
controller:log Received 'zcl' data '{"frame":{"Header":{"frameControl":{"frameType":0,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":true,"reservedBits":0},"transactionSequenceNumber":7,"manufacturerCode":null,"commandIdentifier":1},"Payload":[{"attrId":1,"status":0,"dataType":32,"attrData":73}]},"address":63383,"endpoint":1,"linkquality":36,"groupID":null}'
controller:endpoint Read 0x60a423fffe8e2ce7/1 genBasic(["stackVersion"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null})
controller:log Received 'zcl' data '{"frame":{"Header":{"frameControl":{"frameType":1,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":false,"reservedBits":0},"transactionSequenceNumber":3,"manufacturerCode":null,"commandIdentifier":1},"Payload":{"status":0,"transid":25,"dp":130,"datatype":1,"fn":0,"data":{"type":"Buffer","data":[1]}}},"address":63383,"endpoint":1,"linkquality":36,"groupID":null}'
controller:endpoint DefaultResponse 0x60a423fffe8e2ce7/1 61184(1, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":1,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null})
controller:log Received 'zcl' data '{"frame":{"Header":{"frameControl":{"frameType":0,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":true,"reservedBits":0},"transactionSequenceNumber":8,"manufacturerCode":null,"commandIdentifier":1},"Payload":[{"attrId":2,"status":0,"dataType":32,"attrData":0}]},"address":63383,"endpoint":1,"linkquality":36,"groupID":null}'
controller:endpoint Read 0x60a423fffe8e2ce7/1 genBasic(["hwVersion"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null})
controller:log Received 'zcl' data '{"frame":{"Header":{"frameControl":{"frameType":1,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":false,"reservedBits":0},"transactionSequenceNumber":4,"manufacturerCode":null,"commandIdentifier":1},"Payload":{"status":0,"transid":26,"dp":27,"datatype":2,"fn":0,"data":{"type":"Buffer","data":[0,0,0,0]}}},"address":63383,"endpoint":1,"linkquality":36,"groupID":null}'
controller:endpoint DefaultResponse 0x60a423fffe8e2ce7/1 61184(1, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":1,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null})
controller:log Received 'zcl' data '{"frame":{"Header":{"frameControl":{"frameType":0,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":true,"reservedBits":0},"transactionSequenceNumber":9,"manufacturerCode":null,"commandIdentifier":1},"Payload":[{"attrId":3,"status":0,"dataType":32,"attrData":1}]},"address":63383,"endpoint":1,"linkquality":36,"groupID":null}'
controller:endpoint Read 0x60a423fffe8e2ce7/1 genBasic(["dateCode"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null})
controller:log Received 'zcl' data '{"frame":{"Header":{"frameControl":{"frameType":1,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":false,"reservedBits":0},"transactionSequenceNumber":5,"manufacturerCode":null,"commandIdentifier":1},"Payload":{"status":0,"transid":22,"dp":40,"datatype":1,"fn":0,"data":{"type":"Buffer","data":[1]}}},"address":63383,"endpoint":1,"linkquality":36,"groupID":null}'
controller:endpoint DefaultResponse 0x60a423fffe8e2ce7/1 61184(1, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":1,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null})
controller:log Received 'zcl' data '{"frame":{"Header":{"frameControl":{"frameType":0,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":true,"reservedBits":0},"transactionSequenceNumber":10,"manufacturerCode":null,"commandIdentifier":1},"Payload":[{"attrId":6,"status":0,"dataType":66,"attrData":"20180727"}]},"address":63383,"endpoint":1,"linkquality":36,"groupID":null}'
controller:endpoint Read 0x60a423fffe8e2ce7/1 genBasic(["swBuildId"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null})
controller:log Received 'zcl' data '{"frame":{"Header":{"frameControl":{"frameType":1,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":false,"reservedBits":0},"transactionSequenceNumber":6,"manufacturerCode":null,"commandIdentifier":1},"Payload":{"status":0,"transid":2,"dp":102,"datatype":2,"fn":0,"data":{"type":"Buffer","data":[0,0,0,116]}}},"address":63383,"endpoint":1,"linkquality":36,"groupID":null}'
controller:endpoint DefaultResponse 0x60a423fffe8e2ce7/1 61184(1, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":1,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null})
controller:log Received 'zcl' data '{"frame":{"Header":{"frameControl":{"frameType":0,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":true,"reservedBits":0},"transactionSequenceNumber":11,"manufacturerCode":null,"commandIdentifier":1},"Payload":[{"attrId":16384,"status":134}]},"address":63383,"endpoint":1,"linkquality":36,"groupID":null}'
controller:endpoint Read 0x60a423fffe8e2ce7/1 genBasic(["swBuildId"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null}) failed (Status 'UNSUPPORTED_ATTRIBUTE')
controller:device:log Failed to read attribute 'softwareBuildID' from endpoint '1' (Error: Read 0x60a423fffe8e2ce7/1 genBasic(["swBuildId"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null}) failed (Status 'UNSUPPORTED_ATTRIBUTE'))
controller:device:log Interview - completed for device '0x60a423fffe8e2ce7'
controller:log Succesfully interviewed '0x60a423fffe8e2ce7'
controller:endpoint Bind 0x60a423fffe8e2ce7/1 genBasic from '0x00212effff05412d/1'
controller:log Received 'zcl' data '{"frame":{"Header":{"frameControl":{"frameType":1,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":false,"reservedBits":0},"transactionSequenceNumber":7,"manufacturerCode":null,"commandIdentifier":1},"Payload":{"status":0,"transid":3,"dp":103,"datatype":2,"fn":0,"data":{"type":"Buffer","data":[0,0,0,75]}}},"address":63383,"endpoint":1,"linkquality":36,"groupID":null}'
controller:endpoint DefaultResponse 0x60a423fffe8e2ce7/1 61184(1, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":1,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null})
controller:log Received 'zcl' data '{"frame":{"Header":{"frameControl":{"frameType":1,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":false,"reservedBits":0},"transactionSequenceNumber":8,"manufacturerCode":null,"commandIdentifier":1},"Payload":{"status":0,"transid":4,"dp":105,"datatype":5,"fn":0,"data":{"type":"Buffer","data":[0]}}},"address":63383,"endpoint":1,"linkquality":36,"groupID":null}'
controller:endpoint DefaultResponse 0x60a423fffe8e2ce7/1 61184(1, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":1,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null})
controller:log Received 'zcl' data '{"frame":{"Header":{"frameControl":{"frameType":1,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":false,"reservedBits":0},"transactionSequenceNumber":9,"manufacturerCode":null,"commandIdentifier":1},"Payload":{"status":0,"transid":5,"dp":106,"datatype":1,"fn":0,"data":{"type":"Buffer","data":[0]}}},"address":63383,"endpoint":1,"linkquality":36,"groupID":null}'
controller:endpoint DefaultResponse 0x60a423fffe8e2ce7/1 61184(1, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":1,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null})

In the logs you can see that the device starts to send messages with a Dp other than 101 as soon as the ZCL version parameter is read, this is also the case in the previous log I showed. Reading this value manually in the deconz app does not do anything.

Smanar commented 3 years ago

0x0101 is the on/off mode. And deconz is not configured to use this command for this device (the only one using this command is "_TZE200_aoclfnxz", perhaps a way to explore.

But it seem z2m is only asking for basic cluster attribute, I don't see how it can unlock something ....

And it seem it do nothing with the time command yet, before the first temperature return.

No one have a sniffer ?

KPWhiver commented 3 years ago

101 is actually in decimal (z2m prints them as decimal), and only the first byte of the Dp, so this would correspond to 0x65, which (together with 0x01) in deconz is 357.

I can give you the full zigbee2mqtt log, very long, but it includes logs from the deconz adapter driver in z2m.

Going through the logs and z2m code myself I see that this is the order of the messages send and received:

HiHome -> DeviceAnnounce
HiHome -> Dp 101
HiHome -> Dp 101
-- PermitJoin on
HiHome -> DeviceAnnounce
HiHome <- RequestNodeDescriptor
HiHome -> NodeDescriptor
HiHome <- RequestSimpleDescriptor
HiHome -> SimpleDescriptor
HiHome <- Read modelId
HiHome -> modelId
HiHome <- Read manufacturerName
HiHome -> Dp 101
HiHome -> manufacturerName
HiHome <- Read powerSource
HiHome -> powerSource
HiHome <- Read zclVersion
HiHome -> Dp 10
HiHome -> zclVersion
HiHome <- Read appVersion
HiHome -> Dp 8
HiHome -> appVersion
HiHome <- Read stackVersion
HiHome -> Dp 130
HiHome -> stackVersion
HiHome <- Read hwVersion
HiHome -> Dp 27
HiHome -> hwVersion
HiHome <- Read dateCode
HiHome -> Dp 40
HiHome -> dateCode
HiHome <- ReadswBuildId
HiHome -> Dp 102
HiHome -> swBuildId unsupported
HiHome <- Bind cluster 0
HiHome -> Bind succeeded
-- Lots more Dp messages from HiHome

Perhaps this device is just really fussy about the 0x0000 clusters values being read before it considers itself to be completely paired?

Smanar commented 3 years ago

Ha yes right to check "dp":101,"datatype":1, so 0x01 0x65 and we use it too. But I don't see something special before the

HiHome -> Dp 102

On deconz do you have the "debug tuya" list just after the inclusion ?

But use this change first pls https://github.com/Smanar/deconz-rest-plugin/commit/6a9e7a4d6c81defd8a0426d7aaf0098afa87821a

I think this change will prevent device spam.

Smanar commented 3 years ago

Ha ? it s an option for some tuya device ?

Local temperature #

If you’d like to force device to send local_temperature you can use this mqtt command:

topic: zigbee2mqtt/FRIENDLY_NAME/set/local_temperature_calibration
payload: YOUR_CURRENT_CALIBRATION_VALUE

YOUR_CURRENT_CALIBRATION_VALUE can be 0, but if you calibrated temperature for this device send current value. After this command thermostat responds with two messages. One for calibration change confirmation, and other with current local_temperature.

KPWhiver commented 3 years ago

I already tried this actually by sending the temperature offset to the device through the REST API. Unfortunately, all I got back was confirmation that the temperature offset had been changed. (I also send all the other values that deconz supports, such as locked, with only a confirmation as result.)

I added code to my copy of deconz to explicitly read all the Basic cluster values when the device is added, will test tonight or tomorrow.

Smanar commented 3 years ago

Never trust confirmations from API, they just mean the request is correct and send to the device, it don't mean the device received it or support it.

It seem the calibration for this device use dp = saswellTempCalibration = 27 = 0x1B, and I don't see it in tuya.cpp file.

But on your log the device don't use this command (don't receive it, even it send info), and the temperature is working so I don't think it s the problem.

You have tried the previous change ? https://github.com/Smanar/deconz-rest-plugin/commit/6a9e7a4d6c81defd8a0426d7aaf0098afa87821a

KPWhiver commented 3 years ago

Progress! Your change: https://github.com/Smanar/deconz-rest-plugin/commit/6a9e7a4d6c81defd8a0426d7aaf0098afa87821a works, I now get messages other than the on/off state (such as temperatures). The problem now is that the device sends all its messages with commandId 0x01, which means that a default response is send after every message, after which it is discarded due to the else if:

  }
    else if (//isXmasLightStrip(lightNode) &&
             zclFrame.commandId() == 0x01 &&
             !(zclFrame.frameControl() & deCONZ::ZclFCDisableDefaultResponse))
    {
        sendZclDefaultResponse(ind, zclFrame, deCONZ::ZclSuccessStatus);
        DBG_Printf(DBG_INFO, "Tuya debug 42 : Sending default response to 0x%016llX\n" , ind.srcAddress().ext());
    }
    else if ( (zclFrame.commandId() == 0x01) || (zclFrame.commandId() == 0x02) )
    {

I changed the second else if into an if, this fixes the issue. The next issue is that the temperature is only send when pairing, instead on some kind of regular interval. Edit: on closer inspection it seems that it only reports temperatures when it has changed by 0.6 degrees, I'll see if I can somehow trigger it to send termperature data.

Smanar commented 3 years ago

Ha yes, sorry, have edited the code again, cleaner method.

But so now it s working ?

KPWhiver commented 3 years ago

Yes, just need to make sure it gets a proper name and manufacturer when paired, I'll fix that and make a PR.

Smanar commented 3 years ago

ok So I don't make it on my side ?

Take care I have changed a little the defaut response part.

Smanar commented 3 years ago

@KPWhiver , hello, do you wana make the PR ? Want to add some chnage on the schedule.

And BTW happy new year ^^

KPWhiver commented 3 years ago

Thanks, you too! Have been busy the last couple of days, will make it tomorrow.

Smanar commented 3 years ago

Nice thx, I will probable on PR on your for schedule. The next stable is the 8th, and as this code is a corrective, it will be probably in this version.

Smanar commented 3 years ago

@KPWhiver if you can add this code too to the PR https://github.com/Smanar/deconz-rest-plugin/commit/d051020cf05e2ef8df123948374b4b2b02deb2e7 pls ?

It will prevent 00 value in schedule, and start the code for the daily schedule.

Smanar commented 3 years ago

And this code too https://github.com/Smanar/deconz-rest-plugin/commit/7a820b8cc1b1c0a5d583713aa3c4a6c16b3ba96a

For this issue https://github.com/dresden-elektronik/deconz-rest-plugin/pull/3730#issuecomment-753523109

He can test the code is needed (he know the method)

KPWhiver commented 3 years ago

The entire tuyaspecial branch or just those two commits?

Smanar commented 3 years ago

IDK, I don't see your PR on your account, but the last working code + thoses 2 add. If you want to use all the "tuyaspecial" I can make the PR myself

KPWhiver commented 3 years ago

I'm adding just those two, just removing some compile errors then I\ll create the PR

Smanar commented 3 years ago

Nice thx ^^. Just 2 comments.

const QDateTime epoch = QDateTime(QDate(2000, 1, 1), QTime(0, 0), Qt::UTC);

This line is better in time.cpp than tuya.cpp

And the more important part

    else if (//isXmasLightStrip(lightNode) &&
             zclFrame.commandId() == 0x01 &&
             !(zclFrame.frameControl() & deCONZ::ZclFCDisableDefaultResponse))
    {
        sendZclDefaultResponse(ind, zclFrame, deCONZ::ZclSuccessStatus);
    }

I think it s cleaner to put it inside the if ( (zclFrame.commandId() == 0x01) || (zclFrame.commandId() == 0x02) ) loop

    else if ( (zclFrame.commandId() == 0x01) || (zclFrame.commandId() == 0x02) )
    {
        // 0x01 Used to inform of changes in its state.
        // 0x02 Send after receiving a 0x00 command.

        // Send defaut response
        if ((zclFrame.commandId() == 0x01) && !(zclFrame.frameControl() & deCONZ::ZclFCDisableDefaultResponse))
        {
            sendZclDefaultResponse(ind, zclFrame, deCONZ::ZclSuccessStatus);
        }
Smanar commented 3 years ago

Nice, better than my code.

stale[bot] commented 3 years ago

As there hasn't been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.

KPWhiver commented 3 years ago

Still waiting on the relevant PR to be merged