TS0202 - weird

Xiaomi, Ikea TRÅDFRI, Philips Hue and more.

Moderator: leecollings

Post Reply
manjh
Posts: 749
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

TS0202 - weird

Post by manjh »

I just installed a TS0202 PIR sensor for ZIgbee protocol. After some doing, I succeeded in pairing the device into Zigbee2MQTT.
It shows up in the ZIgbee2MQTT dash as model IH012-RT01.
I found 4 devices connected to this sensor in Domoticz, and enabled the "motion".
So far, so good. But after this no signal comes into Domoticz.

I can see activity in the Zigbee2MQTT log:

Code: Select all

2022-12-12 19:56:01MQTT publish: topic 'zigbee2mqtt/Zigbee_sensor_keuken', payload '{"battery_low":false,"keep_time":60,"linkquality":255,"occupancy":false,"sensitivity":"medium","tamper":false}'
When I tap into the mqtt topic in Node-Red, this message comes in:

Code: Select all

"{"battery_low":false,"keep_time":60,"linkquality":255,"occupancy":true,"sensitivity":"medium","tamper":false}"
What am I forgetting? It must be something simple...
Hans
User avatar
waltervl
Posts: 5890
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: TS0202 - weird

Post by waltervl »

How is your integration working? It looks like you are not using MQTT Autodiscover or the zigbee2mqtt plugin?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
manjh
Posts: 749
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: TS0202 - weird

Post by manjh »

waltervl wrote: Monday 12 December 2022 22:38 How is your integration working? It looks like you are not using MQTT Autodiscover or the zigbee2mqtt plugin?
Not sure. I set this up many months ago, with five smoke detectors and two Ikea bulbs. It all works great, so I thought that by adding the PIR sensor it would automatically fold in.
I am using the Zigbee2MQTT plugin, and when I look at the hardware line for that I donot see any autodiscover.... also, I donot see any version info.

As for MQTT, I use Aedes in Node-Red.
Hans
User avatar
waltervl
Posts: 5890
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: TS0202 - weird

Post by waltervl »

So you use the zigbee2MQTT python plugin.
What do you see in Domoticz log (menu Setup-Log) about this plugin? If you switch a Zigbee bulb do you see logging?
If the motion sensor is triggered do you see domoticz logging?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
manjh
Posts: 749
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: TS0202 - weird

Post by manjh »

waltervl wrote: Tuesday 13 December 2022 10:38 So you use the zigbee2MQTT python plugin.
What do you see in Domoticz log (menu Setup-Log) about this plugin? If you switch a Zigbee bulb do you see logging?
If the motion sensor is triggered do you see domoticz logging?
This is what I see when switch a bulb on:

Code: Select all

2022-12-13 15:22:01.044 (Zigbee2MQTT) MQTT message: zigbee2mqtt/bridge/logging {'level': 'info', 'message': 'MQTT publish: topic \'zigbee2mqtt/Zigbee nachtlampje\', payload \'{"brightness":63,"color_mode":"color_temp","color_temp":418,"linkquality":255,"state":"ON","update":{"state":"available"},"update_available":true}\''}
2022-12-13 15:22:01.044 (Zigbee2MQTT) MQTT message: zigbee2mqtt/Zigbee nachtlampje {'brightness': 63, 'color_mode': 'color_temp', 'color_temp': 418, 'linkquality': 255, 'state': 'ON', 'update': {'state': 'available'}, 'update_available': True}
When the PIR sensor is triggered, I see the blue LED come on, and see this coming into Domoticz:

Code: Select all

2022-12-13 15:23:14.409 (Zigbee2MQTT) MQTT message: zigbee2mqtt/bridge/logging {'level': 'info', 'message': 'MQTT publish: topic \'zigbee2mqtt/Zigbee_sensor_keuken\', payload \'{"battery_low":false,"keep_time":60,"linkquality":255,"occupancy":true,"sensitivity":"medium","tamper":false}\''}
2022-12-13 15:23:14.410 (Zigbee2MQTT) MQTT message: zigbee2mqtt/Zigbee_sensor_keuken {'battery_low': False, 'keep_time': 60, 'linkquality': 255, 'occupancy': True, 'sensitivity': 'medium', 'tamper': False}
But the device in Domoticz does not show activity...
Hans
User avatar
waltervl
Posts: 5890
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: TS0202 - weird

Post by waltervl »

Seems OK.
What if you remove the sensor and add it again? As I do not have zigbee2MQTT my knowledge is very limited.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
manjh
Posts: 749
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: TS0202 - weird

Post by manjh »

Akready tried that. Removed all four devices from Domoticz, and deleted the device from the Zigbee2MQTT dash.
As soon as the device triggers, the four devices are added again. But after that: silence...
One thing I noticed: the payload does not contain an idx, only the name!
Hans
User avatar
waltervl
Posts: 5890
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: TS0202 - weird

Post by waltervl »

:P The Zigbee2mqtt plugin should do that idx conversion. So that is why it is important to know how you connected zigbee2mqtt with Domoticz. What instructions did you follow? Do you have a link?

Or can you post a screenshot of the ZIGBEE2MQTT hardware configuration in Domoticz?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
manjh
Posts: 749
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: TS0202 - weird

Post by manjh »

waltervl wrote: Tuesday 13 December 2022 21:46 :P The Zigbee2mqtt plugin should do that idx conversion. So that is why it is important to know how you connected zigbee2mqtt with Domoticz. What instructions did you follow? Do you have a link?

Or can you post a screenshot of the ZIGBEE2MQTT hardware configuration in Domoticz?
Attachments
2022-12-14.png
2022-12-14.png (223.08 KiB) Viewed 1628 times
2022-12-14 (1).png
2022-12-14 (1).png (230.82 KiB) Viewed 1628 times
Hans
User avatar
waltervl
Posts: 5890
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: TS0202 - weird

Post by waltervl »

Did you update the plugin to the latest version?
Are the other devices of this sensor working eg temperature?
Is zigbee2mqtt up-to-date?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
manjh
Posts: 749
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: TS0202 - weird

Post by manjh »

waltervl wrote: Wednesday 14 December 2022 20:32 Did you update the plugin to the latest version?
Are the other devices of this sensor working eg temperature?
Is zigbee2mqtt up-to-date?
Ah, good point. I did update Zigbee2MQTT,because the device was not supported initially, after the update is was.
I will have to look into how to update the plugin... any hints? I can see the initial install steps. But update?
Hans
User avatar
waltervl
Posts: 5890
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: TS0202 - weird

Post by waltervl »

See the update section in the readme of the plugin https://github.com/stas-demydiuk/domoti ... qtt-plugin
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
manjh
Posts: 749
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: TS0202 - weird

Post by manjh »

hmmm.. I did the update, and now get this:

Code: Select all

2022-12-16 17:51:00.464 Error: (Zigbee2MQTT) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/zigbee2mqtt/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'.
2022-12-16 17:51:00.464 Error: (Zigbee2MQTT) Module Import failed, exception: 'ModuleNotFoundError'
2022-12-16 17:51:00.464 Error: (Zigbee2MQTT) Module Import failed: ' Name: DomoticzEx'
2022-12-16 17:51:00.464 Error: (Zigbee2MQTT) Error Line details not available.
Hans
manjh
Posts: 749
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: TS0202 - weird

Post by manjh »

To get things working again, I downgraded following the instructions. After that I get this:

Code: Select all

2022-12-16 18:04:20.561 Error: (Zigbee2MQTT) Zigbee nachtlampje: can not process numeric item "color_temp_startup"
2022-12-16 18:04:20.562 Error: (Zigbee2MQTT) lampje openhaard 1: can not process numeric item "color_temp_startup"
2022-12-16 18:04:20.563 Error: (Zigbee2MQTT) lampje openhaard 2: can not process numeric item "color_temp_startup"
2022-12-16 18:04:20.563 Error: (Zigbee2MQTT) 'onMessage' failed 'TypeError':'sequence item 1: expected str instance, int found'.
2022-12-16 18:04:20.563 Error: (Zigbee2MQTT) ----> Line 287 in '/home/pi/domoticz/plugins/zigbee2mqtt/plugin.py', function onMessage
2022-12-16 18:04:20.563 Error: (Zigbee2MQTT) ----> Line 137 in '/home/pi/domoticz/plugins/zigbee2mqtt/plugin.py', function onMessage
2022-12-16 18:04:20.563 Error: (Zigbee2MQTT) ----> Line 167 in '/home/pi/domoticz/plugins/zigbee2mqtt/mqtt.py', function onMessage
2022-12-16 18:04:20.563 Error: (Zigbee2MQTT) ----> Line 166 in '/home/pi/domoticz/plugins/zigbee2mqtt/plugin.py', function onMQTTPublish
2022-12-16 18:04:20.563 Error: (Zigbee2MQTT) ----> Line 44 in '/home/pi/domoticz/plugins/zigbee2mqtt/devices_manager.py', function set_devices
2022-12-16 18:04:20.563 Error: (Zigbee2MQTT) ----> Line 45 in '/home/pi/domoticz/plugins/zigbee2mqtt/adapter.py', function __init__
2022-12-16 18:04:20.563 Error: (Zigbee2MQTT) ----> Line 33 in '/home/pi/domoticz/plugins/zigbee2mqtt/adapters/base_adapter.py', function register
2022-12-16 18:04:20.563 Error: (Zigbee2MQTT) ----> Line 81 in '/home/pi/domoticz/plugins/zigbee2mqtt/devices/device.py', function register
2022-12-16 18:04:20.563 Error: (Zigbee2MQTT) ----> Line 47 in '/home/pi/domoticz/plugins/zigbee2mqtt/devices/device.py', function _create_device
2022-12-16 18:04:20.563 Error: (Zigbee2MQTT) ----> Line 30 in '/home/pi/domoticz/plugins/zigbee2mqtt/devices/switch/selector_switch.py', function create_device
Hans
manjh
Posts: 749
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: TS0202 - weird

Post by manjh »

This is not right. In the new version (Beta 3.2.0) I get errors, when I downgrade I also get errors. How do I make this work again...
Hans
manjh
Posts: 749
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: TS0202 - weird

Post by manjh »

Last night I ran through an avalanche of problems... updated just about everything: ZIgbee2MQTT, the Zigbee2MQTT plugin, Domoticz.
Then everything seemed to work again, except for the fact that my Pi reboots every 5 minutes. Switching off Monit helped. I guess I'll have to look into that later.
But my motion detector shows up again after I removed it.
I enabled all four devices in the "devices" tab in Domoticz.
After that, when I trigger the device, I can see an entry in the log of the Zigbee2MQTT log. But it does not show up as change in the Domoticz devices. So I guess I am back to where I was!
Hans
manjh
Posts: 749
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: TS0202 - weird

Post by manjh »

OK, more info. On the hardware page entry for the plugin, I changed the debug level to "verbose".
Now when I trigger the motion sensor, I can see this info on the Domoticz log:

Code: Select all

2022-12-17 10:08:49.937 Zigbee2MQTT: Received 207 bytes of data
2022-12-17 10:08:49.938 Zigbee2MQTT: 30 cc 01 00 1a 7a 69 67 62 65 65 32 6d 71 74 74 2f 62 72 69 0̮..zigbee2mqtt/bri
2022-12-17 10:08:49.938 Zigbee2MQTT: 64 67 65 2f 6c 6f 67 67 69 6e 67 7b 22 6c 65 76 65 6c 22 3a dge/logging{"level":
2022-12-17 10:08:49.938 Zigbee2MQTT: 22 69 6e 66 6f 22 2c 22 6d 65 73 73 61 67 65 22 3a 22 4d 51 "info","message":"MQ
2022-12-17 10:08:49.938 Zigbee2MQTT: 54 54 20 70 75 62 6c 69 73 68 3a 20 74 6f 70 69 63 20 27 7a TT.publish:.topic.'z
2022-12-17 10:08:49.938 Zigbee2MQTT: 69 67 62 65 65 32 6d 71 74 74 2f 5a 69 67 62 65 65 20 6d 6f igbee2mqtt/Zigbee.mo
2022-12-17 10:08:49.938 Zigbee2MQTT: 74 69 6f 6e 20 73 65 6e 73 6f 72 20 31 27 2c 20 70 61 79 6c tion.sensor.1',.payl
2022-12-17 10:08:49.938 Zigbee2MQTT: 6f 61 64 20 27 7b 5c 22 62 61 74 74 65 72 79 5f 6c 6f 77 5c oad.'{\"battery_low\
2022-12-17 10:08:49.938 Zigbee2MQTT: 22 3a 66 61 6c 73 65 2c 5c 22 6c 69 6e 6b 71 75 61 6c 69 74 ":false,\"linkqualit
2022-12-17 10:08:49.938 Zigbee2MQTT: 79 5c 22 3a 32 32 30 2c 5c 22 6f 63 63 75 70 61 6e 63 79 5c y\":220,\"occupancy\
2022-12-17 10:08:49.938 Zigbee2MQTT: 22 3a 74 72 75 65 2c 5c 22 74 61 6d 70 65 72 5c 22 3a 66 61 ":true,\"tamper\":fa
2022-12-17 10:08:49.938 Zigbee2MQTT: 6c 73 65 7d 27 22 7d .. .. .. .. .. .. .. .. .. .. .. .. .. lse}'"}
2022-12-17 10:08:49.938 Zigbee2MQTT: Received 109 bytes of data
2022-12-17 10:08:49.938 Zigbee2MQTT: 30 6b 00 22 7a 69 67 62 65 65 32 6d 71 74 74 2f 5a 69 67 62 0k."zigbee2mqtt/Zigb
2022-12-17 10:08:49.938 Zigbee2MQTT: 65 65 20 6d 6f 74 69 6f 6e 20 73 65 6e 73 6f 72 20 31 7b 22 ee.motion.sensor.1{"
2022-12-17 10:08:49.938 Zigbee2MQTT: 62 61 74 74 65 72 79 5f 6c 6f 77 22 3a 66 61 6c 73 65 2c 22 battery_low":false,"
2022-12-17 10:08:49.938 Zigbee2MQTT: 6c 69 6e 6b 71 75 61 6c 69 74 79 22 3a 32 32 30 2c 22 6f 63 linkquality":220,"oc
2022-12-17 10:08:49.938 Zigbee2MQTT: 63 75 70 61 6e 63 79 22 3a 74 72 75 65 2c 22 74 61 6d 70 65 cupancy":true,"tampe
2022-12-17 10:08:49.938 Zigbee2MQTT: 72 22 3a 66 61 6c 73 65 7d .. .. .. .. .. .. .. .. .. .. .. r":false}
2022-12-17 10:08:50.942 Zigbee2MQTT: Received 207 bytes of data
2022-12-17 10:08:50.942 Zigbee2MQTT: 30 cc 01 00 1a 7a 69 67 62 65 65 32 6d 71 74 74 2f 62 72 69 0̮..zigbee2mqtt/bri
2022-12-17 10:08:50.942 Zigbee2MQTT: 64 67 65 2f 6c 6f 67 67 69 6e 67 7b 22 6c 65 76 65 6c 22 3a dge/logging{"level":
2022-12-17 10:08:50.942 Zigbee2MQTT: 22 69 6e 66 6f 22 2c 22 6d 65 73 73 61 67 65 22 3a 22 4d 51 "info","message":"MQ
2022-12-17 10:08:50.942 Zigbee2MQTT: 54 54 20 70 75 62 6c 69 73 68 3a 20 74 6f 70 69 63 20 27 7a TT.publish:.topic.'z
2022-12-17 10:08:50.942 Zigbee2MQTT: 69 67 62 65 65 32 6d 71 74 74 2f 5a 69 67 62 65 65 20 6d 6f igbee2mqtt/Zigbee.mo
2022-12-17 10:08:50.942 Zigbee2MQTT: 74 69 6f 6e 20 73 65 6e 73 6f 72 20 31 27 2c 20 70 61 79 6c tion.sensor.1',.payl
2022-12-17 10:08:50.942 Zigbee2MQTT: 6f 61 64 20 27 7b 5c 22 62 61 74 74 65 72 79 5f 6c 6f 77 5c oad.'{\"battery_low\
2022-12-17 10:08:50.942 Zigbee2MQTT: 22 3a 66 61 6c 73 65 2c 5c 22 6c 69 6e 6b 71 75 61 6c 69 74 ":false,\"linkqualit
2022-12-17 10:08:50.942 Zigbee2MQTT: 79 5c 22 3a 32 35 35 2c 5c 22 6f 63 63 75 70 61 6e 63 79 5c y\":255,\"occupancy\
2022-12-17 10:08:50.942 Zigbee2MQTT: 22 3a 74 72 75 65 2c 5c 22 74 61 6d 70 65 72 5c 22 3a 66 61 ":true,\"tamper\":fa
2022-12-17 10:08:50.942 Zigbee2MQTT: 6c 73 65 7d 27 22 7d .. .. .. .. .. .. .. .. .. .. .. .. .. lse}'"}
2022-12-17 10:08:50.942 Zigbee2MQTT: Received 109 bytes of data
2022-12-17 10:08:50.942 Zigbee2MQTT: 30 6b 00 22 7a 69 67 62 65 65 32 6d 71 74 74 2f 5a 69 67 62 0k."zigbee2mqtt/Zigb
2022-12-17 10:08:50.942 Zigbee2MQTT: 65 65 20 6d 6f 74 69 6f 6e 20 73 65 6e 73 6f 72 20 31 7b 22 ee.motion.sensor.1{"
2022-12-17 10:08:50.942 Zigbee2MQTT: 62 61 74 74 65 72 79 5f 6c 6f 77 22 3a 66 61 6c 73 65 2c 22 battery_low":false,"
2022-12-17 10:08:50.942 Zigbee2MQTT: 6c 69 6e 6b 71 75 61 6c 69 74 79 22 3a 32 35 35 2c 22 6f 63 linkquality":255,"oc
2022-12-17 10:08:50.943 Zigbee2MQTT: 63 75 70 61 6e 63 79 22 3a 74 72 75 65 2c 22 74 61 6d 70 65 cupancy":true,"tampe
2022-12-17 10:08:50.943 Zigbee2MQTT: 72 22 3a 66 61 6c 73 65 7d .. .. .. .. .. .. .. .. .. .. .. r":false}
So the info is definitely reaching the plugin, but the device in Domoticz is not updated.
After I changed the log level back to "true", the plugin restarts intself and I noticed these lines in the log:

Code: Select all

2022-12-17 10:13:45.358 Zigbee2MQTT: Trying to get legacy device 0xa4c138bee718fbf5(keep_)
2022-12-17 10:13:45.358 Zigbee2MQTT: No such device found
2022-12-17 10:13:45.359 Zigbee2MQTT: Creating domoticz device to handle "keep_time" key for device with ieeeAddr 0xa4c138bee718fbf5
Hans
manjh
Posts: 749
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: TS0202 - weird

Post by manjh »

This problem was solved by moving away from the regular plugin, and installing the AutoDiscover plugin.
Since then everything works ok.
SO: not sure what was wrong with the regular plugin, could have been a setting or a bug. We'll never know.
Hans
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest