zigbeefordomoticz / Domoticz-Zigbee

Zigbee plugin for Domoticz. Allow to connect various zigbee controllers like Zigate but also Texas Instrument CC2531, CC13x2, CC26x2 ; Silicon-Labs; deConz based chipset to be connected to Domoticz
GNU General Public License v3.0
99 stars 43 forks source link

[Model Certification] - temperature and humidity sensor with digital display #1561

Closed Bartras closed 1 year ago

Bartras commented 1 year ago
  1. It is a temperature and humidity sensor. With digital display. Zigbee for domoticz model name is TS0601.

  2. Article link on aliexpress

  3. {"PluginInfos":{"HardwareID":2,"HomeFolder":"/home/pi/domoticz/plugins/Domoticz-Zigbee/","StartupFolder":"/home/pi/domoticz/","UserDataFolder":"/home/pi/domoticz/","WebRoot":"","Database":"/home/pi/domoticz/domoticz.db","Language":"fr","Version":"6.3","Author":"pipiche38","Name":"ZigbeeForDomoticz","Address":"0.0.0.0","Port":"9999","SerialPort":"/dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_c4e39f672f1aec11b0b37fe5f01c6278-if00-port0","Username":"","Password":"","Key":"Zigate","Mode1":"ZigpyZNP","Mode2":"USB","Mode3":"False","Mode4":"9440","Mode5":"http://toto:titi@192.168.1.101:8080","Mode6":"2","DomoticzVersion":"2023.1","DomoticzHash":"f9b9ac774","DomoticzBuildTime":"2023-02-14 15:06:40","PluginBranch":"stable6","PluginVersion":"6.3.010","TimeStamp":1678366305,"available":0,"available-firmMajor":0,"available-firmMinor":0,"FirmwareVersion":"Z-Stack 3.30+ (build 20210708)","FirmwareUpdate":false,"PluginUpdate":false,"LogLevel":7,"Zigpy":true,"CoordinatorModel":"CC1352/CC2652, Z-Stack 3.30+ (znp)","CoordinatorFirmwareVersion":"Z-Stack 3.30+ (build 20210708)","DisplayFirmwareVersion":"Znp - Z-Stack 3.30+ (build 20210708)","CoordinatorIEEE":"00124b00258d4a55","NetworkSize":"Total: 23 | Routers: 14 | End Devices: 9","NetworkDevices":{"1002":{"_TZ3000_npzfdcof":["TS0001"],"_TZ3000_rmjr4ufz":["TS0001"],"_TZE200_nklqjk62":["TS0601-_TZE200_nklqjk62"],"_TZ3000_dowj6gyi":["TS0201"],"_TZE200_znbl8dj5":["TS0601"]},"1141":{"_TZ3000_gvn91tmx":["TS011F-plug"]},"1286":{"SONOFF":["01MINIZB"]}}},"Analytics":1,"Device":{"Version":"3","ZDeviceName":"T°C séjour num.","Status":"inDB","SQN":"1f","Ep":{"01":{"0000":{"0004":"_TZE200_znbl8dj5","0005":"TS0601","0000":"3","0001":"66","0002":"0","0003":"1","0007":"3"},"0004":{},"ef00":{},"000a":{},"0019":{"0001":"ffffffff","0002":"00000042","0003":"0002","0004":"ffffffff","0005":"ffff","0006":"00","0007":"1141","0008":"ffff","0009":"0000"},"Type":"Temp/ThermoSetpoint/ThermoMode_2","ClusterType":{"50":"Temp","51":"ThermoSetpoint","52":"ThermoMode_2"}}},"Heartbeat":"28492","RIA":"1","LQI":144,"Battery":{},"Model":"TS0601","ForceAckCommands":[],"MacCapa":"80","IEEE":"a4c138e0409d7976","Type":"Temp/ThermoSetpoint/ThermoMode_2","ProfileID":"0104","ZDeviceID":"0302","App Version":"66","Attributes List":{},"DeviceType":"RFD","HW Version":"1","Last Cmds":[],"LogicalType":"End Device","Manufacturer":"1002","Manufacturer Name":"_TZE200_znbl8dj5","NbEp":"1","PowerSource":"Battery","ReadAttributes":{"Ep":{"01":{"0000":{"TimeStamp":1670670765,"iSQN":{"0000":"03","0001":"03","0002":"03","0003":"03","0004":"03","0005":"04","0007":"04"},"Attributes":{"0000":"00","0001":"00","0002":"00","0003":"00","0004":"00","0005":"00","0007":"00"},"ZigateRequest":{}},"0019":{"TimeStamp":1670670763,"iSQN":{"0001":"01","0002":"01","0003":"01","0004":"01","0005":"01","0006":"02","0007":"02","0008":"02","0009":"02","000a":"02"},"Attributes":{"0001":"00","0002":"00","0003":"00","0004":"00","0005":"00","0006":"00","0007":"00","0008":"00","0009":"00","000a":"86"},"ZigateRequest":{}}}}},"ReceiveOnIdle":"","Stack Version":"0","Stamp":{"time":1678363748.5484324,"Time":"2023-03-09 13:09:08","MsgType":"8011","LastSeen":1678363748},"ZCL Version":"3","Health":"Live","WriteAttributes":{"Ep":{"01":{"0000":{"TimeStamp":1670670759,"iSQN":{"ffde":"05"},"Attributes":{"ffde":"00"},"ZigateRequest":{"ffde":{"Status":"fullfilled","DataType":"20","EPin":"01","EPout":"01","manuf_id":"0000","manuf_spec":"00","data":"13","ackIsDisabled":false}}},"0004":{"TimeStamp":0,"iSQN":{},"Attributes":{},"ZigateRequest":{}},"ef00":{"TimeStamp":0,"iSQN":{},"Attributes":{},"ZigateRequest":{}},"000a":{"TimeStamp":0,"iSQN":{},"Attributes":{},"ZigateRequest":{}},"0019":{"TimeStamp":0,"iSQN":{},"Attributes":{},"ZigateRequest":{}}}}},"CertifiedDevice":false,"BindingTable":{"SQN":0,"Status":"Success","TimeStamp":1670670761.1468773,"BindingTableSize":2,"Devices":[{"a4c138e0409d7976":{"sourceEp":"01","Cluster":"0019","targetIEEE":"00124b00258d4a55","targetNickName":"Zigbee Coordinator","targetEp":"01"}},{"a4c138e0409d7976":{"sourceEp":"01","Cluster":"ef00","targetIEEE":"00124b00258d4a55","targetNickName":"Zigbee Coordinator","targetEp":"01"}}]},"Bind":{"01":{"0019":{"Target":"0000","Stamp":1670670760,"Phase":"binded","Status":"00","i_sqn":"03"},"ef00":{"Target":"0000","Stamp":1670670760,"Phase":"binded","Status":"00","i_sqn":"04"}}},"Epv2":{"01":{"ClusterIn":{"0001":{},"0402":{},"0405":{},"0000":{}},"ClusterOut":{"0019":{},"000a":{}},"ProfileID":"0104","ZDeviceID":"0302"}},"Param":{},"Capability":["Reduced-Function Device","Standard security","NwkAddr should be allocated"],"ConfigSource":"DeviceConf","Tuya":{"Valve 0x01":"000000b6"},"Log_UnknowDeviceFlag":1675245995.3966224,"ConsistencyCheck":"ok","ZCL-IN-SQN":{"ef00":"1f","000a":"1a"},"RollingLQI":[135,135,144,144,144,147,147,147,144,144,144],"SQN_000a":"1a","MapLQI":{"0f56":106},"CheckParam":false}}

pipiche38 commented 1 year ago

Could you kindly switch to the develop branch and check if it works

git checkout develop
git pull

remove all Domotciz widgets which have been created for this device restart the plugin

then redo the pairing

Bartras commented 1 year ago

I tried but its failed. Here below the log:

{"PluginInfos":{"HardwareID":2,"HomeFolder":"/home/pi/domoticz/plugins/Domoticz-Zigbee/","StartupFolder":"/home/pi/domoticz/","UserDataFolder":"/home/pi/domoticz/","WebRoot":"","Database":"/home/pi/domoticz/domoticz.db","Language":"fr","Version":"6.3","Author":"pipiche38","Name":"ZigbeeForDomoticz","Address":"0.0.0.0","Port":"9999","SerialPort":"/dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_c4e39f672f1aec11b0b37fe5f01c6278-if00-port0","Username":"","Password":"","Key":"Zigate","Mode1":"ZigpyZNP","Mode2":"USB","Mode3":"False","Mode4":"9440","Mode5":"http://toto:titi@192.168.1.101:8080","Mode6":"2","DomoticzVersion":"2023.1","DomoticzHash":"f9b9ac774","DomoticzBuildTime":"2023-02-14 15:06:40","PluginBranch":"stable6","PluginVersion":"6.3.010","TimeStamp":1678643225,"available":"6.3.011","available-firmMajor":0,"available-firmMinor":0,"FirmwareVersion":"Z-Stack 3.30+ (build 20210708)","FirmwareUpdate":false,"PluginUpdate":true,"LogLevel":7,"Zigpy":true,"CoordinatorModel":"CC1352/CC2652, Z-Stack 3.30+ (znp)","CoordinatorFirmwareVersion":"Z-Stack 3.30+ (build 20210708)","DisplayFirmwareVersion":"Znp - Z-Stack 3.30+ (build 20210708)","CoordinatorIEEE":"00124b00258d4a55","NetworkSize":"Total: 23 | Routers: 14 | End Devices: 9","NetworkDevices":{"1002":{"_TZ3000_npzfdcof":["TS0001"],"_TZ3000_rmjr4ufz":["TS0001"],"_TZE200_nklqjk62":["TS0601-_TZE200_nklqjk62"],"_TZ3000_dowj6gyi":["TS0201"],"_TZE200_znbl8dj5":["TS0601"]},"1141":{"_TZ3000_gvn91tmx":["TS011F-plug"]},"1286":{"SONOFF":["01MINIZB"]}}},"Analytics":1,"Device":{"Version":"3","ZDeviceName":"","Status":"UNKNOW","SQN":"01","Ep":{"01":{"0000":{"0004":"_TZE200_znbl8dj5","0000":"3","0001":"66","0005":"TS0601","0007":"3","fffe":"0"}}},"Heartbeat":"5","RIA":"6","LQI":141,"Battery":{},"Model":"TS0601","ForceAckCommands":[],"MacCapa":"80","IEEE":"a4c138e0409d7976","Type":{},"ProfileID":{},"ZDeviceID":{},"App Version":"66","Attributes List":{},"DeviceType":"RFD","HW Version":"","Last Cmds":[],"LogicalType":"End Device","Manufacturer":"","Manufacturer Name":"_TZE200_znbl8dj5","NbEp":"1","PowerSource":"","ReadAttributes":{"Ep":{"01":{"0000":{"TimeStamp":1678643171,"iSQN":{"0004":"00","0000":"00","0001":"00","0005":"00","0007":"00","fffe":"00"},"Attributes":{"0004":"00","0000":"00","0001":"00","0005":"00","0007":"00","fffe":"00"},"ZigateRequest":{}}}}},"ReceiveOnIdle":"","Stack Version":"","Stamp":{"time":1678643171.5182602,"Time":"2023-03-12 18:46:11","MsgType":"8011","LastSeen":1678643171},"ZCL Version":"3","Health":"Live","Capability":["Reduced-Function Device","Standard security","NwkAddr should be allocated"],"ZCLSQN":"00","ZDPSQN":"01","RollingLQI":[141,141,141],"WriteAttributes":{"Ep":{"01":{"0000":{"TimeStamp":0,"iSQN":{},"Attributes":{},"ZigateRequest":{}}}}},"Epv2":{"01":{"ClusterIn":{},"ClusterOut":{},"ProfileID":{},"ZDeviceID":{}}},"PairingInProgress":true,"ConsistencyCheck":"Bad Pairing"}}

Bartras commented 1 year ago

In fact, I am not sure to be on develop branch. I tried again but when I switched, the plugin doesn't start correctly. See the domoticz log:

2023-03-12 19:20:20.520 Error: ZigbeeForDomoticz: (Zigate) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/Domoticz-Zigbee/:/usr/lib/python39.zip:/usr/lib/python3.9:/usr/lib/python3.9/lib-dynload:/usr/local/lib/python3.9/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.9/dist-packages'. 2023-03-12 19:20:20.526 Error: ZigbeeForDomoticz: Traceback (most recent call last): 2023-03-12 19:20:20.526 Error: ZigbeeForDomoticz: File "/home/pi/domoticz/plugins/Domoticz-Zigbee/plugin.py", line 98, in <module> 2023-03-12 19:20:20.526 Error: ZigbeeForDomoticz: import z4d_certified_devices 2023-03-12 19:20:20.526 Error: ZigbeeForDomoticz: ModuleNotFoundError: No module named 'z4d_certified_devices'

SylvainPer commented 1 year ago

Previous message from Pipiche on kaybase if you can try: IMPORTANT If you are on 'develop' branch, it is key that when upgrading you are doing it via the WebUI > plugin > Upgrade In case you are unable to do that. It is CRUCIAL to do git pull sudo python3 -m pip install -r requirements.txt --upgrade

Bartras commented 1 year ago

Hello thank you for the information. It is working. However, in domoticz, there is no temp&hum device. It is anoying to have two different devices (one for temp and one for hum). Here the new log of device:

{"PluginInfos":{"HardwareID":2,"HomeFolder":"/home/pi/domoticz/plugins/Domoticz-Zigbee/","StartupFolder":"/home/pi/domoticz/","UserDataFolder":"/home/pi/domoticz/","WebRoot":"","Database":"/home/pi/domoticz/domoticz.db","Language":"fr","Version":"6.4","Author":"pipiche38","Name":"ZigbeeForDomoticz","Address":"0.0.0.0","Port":"9999","SerialPort":"/dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_c4e39f672f1aec11b0b37fe5f01c6278-if00-port0","Key":"Zigate","Mode1":"ZigpyZNP","Mode2":"USB","Mode3":"False","Mode4":"9440","Mode6":"2","DomoticzVersion":"2023.1","DomoticzHash":"f9b9ac774","DomoticzBuildTime":"2023-02-14 15:06:40","PluginBranch":"beta6","PluginVersion":"6.4.314","CertifiedDbVersion":"1.13","TimeStamp":1678778648,"available":"6.4.314","available-firmMajor":0,"available-firmMinor":0,"FirmwareVersion":"Z-Stack 3.30+ (build 20210708)","FirmwareUpdate":false,"PluginUpdate":false,"LogLevel":7,"Zigpy":true,"CoordinatorModel":"CC1352/CC2652, Z-Stack 3.30+ (znp)","CoordinatorFirmwareVersion":"Z-Stack 3.30+ (build 20210708)","DisplayFirmwareVersion":"Znp - Z-Stack 3.30+ (build 20210708)","CoordinatorIEEE":"00124b00258d4a55","NetworkSize":"Total: 23 | Routers: 14 | End Devices: 9","NetworkDevices":{"1002":{"_TZ3000_npzfdcof":["TS0001"],"_TZ3000_rmjr4ufz":["TS0001"],"_TZE200_nklqjk62":["TS0601-_TZE200_nklqjk62"],"_TZ3000_dowj6gyi":["TS0201"]},"1141":{"_TZ3000_gvn91tmx":["TS011F-plug"],"_TZE200_dwcarsat":["TS0601-SmartAir"],"_TZ3000_rmjr4ufz":["TS0001"],"_TZE200_nklqjk62":["TS0601-_TZE200_nklqjk62"]},"1286":{"SONOFF":["01MINIZB"]}}},"Analytics":1,"Device":{"Version":"3","ZDeviceName":"Tuya num.","Status":"inDB","SQN":"30","Heartbeat":"18","RIA":"0","LQI":144,"Battery":1,"Model":"TS0601-temphumi-2","ForceAckCommands":[],"MacCapa":"80","IEEE":"a4c138e0409d7976","Type":"Temp/Humi","ProfileID":{},"ZDeviceID":{},"App Version":66,"Attributes List":{},"DeviceType":"RFD","HW Version":"","Last Cmds":[],"LogicalType":"End Device","Manufacturer":"1141","Manufacturer Name":"_TZE200_znbl8dj5","NbEp":"1","PowerSource":"Battery","ReadAttributes":{"Ep":{"01":{"0000":{"TimeStamp":1678778564,"iSQN":{"0004":"01","0000":"01","0001":"01","0005":"01","0007":"01","fffe":"01"},"Attributes":{"0004":"00","0000":"00","0001":"00","0005":"00","0007":"00","fffe":"00","ffe2":"00","ffe4":"00"},"ZigateRequest":{}}}}},"ReceiveOnIdle":"","Stack Version":"","Stamp":{"time":1678778599.4731998,"Time":"2023-03-14 08:23:19","MsgType":"8011","LastSeen":1678778599},"ZCL Version":3,"Health":"Live","Capability":["Reduced-Function Device","Standard security","NwkAddr should be allocated"],"ZCLSQN":"01","ZDPSQN":"05","RollingLQI":[141,141,141,141,141,144,144,144,144,144,144],"Param":{},"ConfigSource":"DeviceConf","Ep":{"01":{"0000":{"0004":"_TZE200_znbl8dj5","0000":3,"0001":66,"0005":"TS0601","0007":3,"fffe":0,"ffe2":"34","ffe4":"1"},"0004":{},"0005":{},"0019":{},"Type":"Temp/Humi","ClusterType":{"73":"Temp","74":"Humi"},"0001":{"0000":1},"0402":{"0000":21}}},"WriteAttributes":{"Ep":{"01":{"0000":{"TimeStamp":0,"iSQN":{},"Attributes":{},"ZigateRequest":{}},"0004":{"TimeStamp":0,"iSQN":{},"Attributes":{},"ZigateRequest":{}},"0005":{"TimeStamp":0,"iSQN":{},"Attributes":{},"ZigateRequest":{}},"0019":{"TimeStamp":0,"iSQN":{},"Attributes":{},"ZigateRequest":{}},"0001":{"TimeStamp":0,"iSQN":{},"Attributes":{},"ZigateRequest":{}},"0402":{"TimeStamp":0,"iSQN":{},"Attributes":{},"ZigateRequest":{}}}}},"Epv2":{"01":{"ClusterIn":{},"ClusterOut":{},"ProfileID":{},"ZDeviceID":{}}},"PairingInProgress":false,"PairingTime":1678778558.1608562,"Bind":{"01":{"0000":{"Target":"0000","Stamp":1678778558,"Phase":"binded","Status":"00","i_sqn":"03"}}},"BindingTable":{"SQN":0,"Status":"Success","TimeStamp":1678778559.5739522,"BindingTableSize":1,"Devices":[{"a4c138e0409d7976":{"sourceEp":"01","Cluster":"0000","targetIEEE":"00124b00258d4a55","targetNickName":"Zigbee Coordinator","targetEp":"01"}}]},"CheckParam":false,"CertifiedDevice":true,"_rawNodeDescriptor":"1141004200422a000080424002","Max Buffer Size":"42","Max Rx":"0042","Max Tx":"0042","macapa":"80","bitfield":"4002","server_mask":"2a00","descriptor_capability":"00","ZCL-IN-SQN":{"ef00":"30","0000":"25","000a":"26"},"Tuya":{"Battery":1,"BatteryStatus":1,"Temp":21,"Humi":50,"temperature_unit":"00","temperature_calibration":"00000000","humidity_calibration":"00000000"},"SQN_000a":"26"}}

pipiche38 commented 1 year ago

I'll investigate. It could be a bug in the plugin code as it should have created Temp, humi and temp+humi

pipiche38 commented 1 year ago

Problem found and fixed. Just retrieve the latest develop version via

git pull

You can them go to WebUI> Admin > Provisioning and use the sub-menu Re-Create Widgets and select the device. It will recreate all widgets so you will have some duplicates ( Temp and Humi), but Temp+Humi should be created

Bartras commented 1 year ago

It is ok, the temp+hum device has been created. But the temp value is blocked at 0°C and humidity at 50%.

pipiche38 commented 1 year ago

You have to enable debug Tuya before , leave it like that during 15 minutes, try to put some heat and humidity to the sensor, then get the Logs/PluginZigbee-xx.log

Bartras commented 1 year ago

Done, here the log file. _PluginZigbee_02.log

pipiche38 commented 1 year ago

From the log, you have errors related to a wrong setup in the Domoticz Api/Json

http://192.168.1.101:8080/json.htm?type=devices&rid=73 rejected. Error: HTTP Error 401: Unauthorized

You need to fix it, and I guess you are on the Domoticz 2023.1 and in case you need to Enable

Screenshot 2023-03-16 at 19 45 58

Bartras commented 1 year ago

I have done it. No more errors in my log. The new file. _PluginZigbee_02.log

pipiche38 commented 1 year ago

I do not see any issue in the log, the temperature is correctly provided 21° can you please get the latest version

git pull sudo python3 -m pip install -r requirements.txt --upgrade

restart the plugin

if the Temperature is still not coming, please enable debug Widget

Bartras commented 1 year ago

Thanks a lot. It is working. I had to remove and make a new pairing after your recommandations.