domoticz-zigbee2mqtt-plugin: Error in WXKG03LM
Hi
I have this error with last version and Xiaomi Aqara wall switch (WXKG03LM)
2019-01-12 18:34:19.796 (Zigbee2MQTT) MQTT message: zigbee2mqtt/luz_salonb {'battery': 99, 'voltage': 3025, 'linkquality': 39, 'click': 'single'}
2019-01-12 18:34:19.797 Error: (Zigbee2MQTT) 'onMessage' failed 'TypeError':''ZigbeeMessage' object is not subscriptable'.
2019-01-12 18:34:19.797 Error: (Zigbee2MQTT) ----> Line 183 in '/home/pi/domoticz/plugins/zigbee2mqtt/plugin.py', function onMessage
2019-01-12 18:34:19.798 Error: (Zigbee2MQTT) ----> Line 110 in '/home/pi/domoticz/plugins/zigbee2mqtt/plugin.py', function onMessage
2019-01-12 18:34:19.798 Error: (Zigbee2MQTT) ----> Line 134 in '/home/pi/domoticz/plugins/zigbee2mqtt/mqtt.py', function onMessage
2019-01-12 18:34:19.798 Error: (Zigbee2MQTT) ----> Line 156 in '/home/pi/domoticz/plugins/zigbee2mqtt/plugin.py', function onMQTTPublish
2019-01-12 18:34:19.798 Error: (Zigbee2MQTT) ----> Line 18 in '/home/pi/domoticz/plugins/zigbee2mqtt/adapters/base_adapter.py', function handleMqttMessage
2019-01-12 18:34:19.798 Error: (Zigbee2MQTT) ----> Line 16 in '/home/pi/domoticz/plugins/zigbee2mqtt/adapters/lumi/WXKG03LM.py', function convert_message
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15 (5 by maintainers)
Commits related to this issue
- Use the .raw method to access 'click' type Fixes issue #65 reported in parent master branch from stas-demydiuk — committed to coolnovember/domoticz-zigbee2mqtt-plugin by coolnovember 5 years ago
- #65 Fix wrong access key in message object — committed to stas-demydiuk/domoticz-zigbee2mqtt-plugin by stas-demydiuk 5 years ago
I think I found the issue. The ‘click’ field needs to be accessed using the .raw method and not just the message object directly. (I am not a Python expert, so I may be calling these by the wrong terms for Python) and I am not sure why diff is flagging the handle_command call - there are no changes there.
with this fix locally, I no longer get the error message