stas-demydiuk / domoticz-zigbee2mqtt-plugin

zigbee2mqtt plugin for domoticz
MIT License
136 stars 98 forks source link

Plugin crash with Valueerror 12 not in list. #867

Closed brjhaverkamp closed 9 months ago

brjhaverkamp commented 11 months ago

Issue description The plugin crashes when I go to the zigbee2mqtt settings page in domoticz (top bar -> Custom -> Zigbee2mqtt Hope you can help find the cause.

Additional information Zigbee2MQTT version: 21.33.0 Python version: 3.9.2 Domoticz version:2023.3 Plugin version: 3.1 beta and 3.2.0-beta

Logs 2023-10-19 14:57:00.235 Status: Zigbee2MQTT: Exiting work loop. 2023-10-19 14:57:00.288 Status: Zigbee2MQTT: Stopping threads. 2023-10-19 14:57:00.288 Status: Zigbee2MQTT: Stopped. 2023-10-19 14:57:41.860 Status: Zigbee2MQTT: Started. 2023-10-19 14:57:41.864 Status: Zigbee2MQTT: Entering work loop. 2023-10-19 14:57:50.365 Status: Zigbee2MQTT: Initialized version 3.2.0-beta 2023-10-19 14:59:49.892 Error: Zigbee2MQTT: Call to function 'onMessage' failed, exception details: 2023-10-19 14:59:49.915 Error: Zigbee2MQTT: Traceback (most recent call last): 2023-10-19 14:59:49.915 Error: Zigbee2MQTT: File "/var/www/domoticz/plugins/zigbee2mqtt/devices/switch/selector_switch.py", line 41, in get_string_value 2023-10-19 14:59:49.915 Error: Zigbee2MQTT: index = self.level_values.index(value) 2023-10-19 14:59:49.915 Error: Zigbee2MQTT: ValueError: 12 is not in list 2023-10-19 14:59:49.915 Error: Zigbee2MQTT: 2023-10-19 14:59:49.916 Error: Zigbee2MQTT: During handling of the above exception, another exception occurred: 2023-10-19 14:59:49.916 Error: Zigbee2MQTT: 2023-10-19 14:59:49.916 Error: Zigbee2MQTT: Traceback (most recent call last): 2023-10-19 14:59:49.916 Error: Zigbee2MQTT: File "/var/www/domoticz/plugins/zigbee2mqtt/devices/device.py", line 194, in handle_message 2023-10-19 14:59:49.916 Error: Zigbee2MQTT: }, **self.get_device_args(value, device, message)) 2023-10-19 14:59:49.916 Error: Zigbee2MQTT: File "/var/www/domoticz/plugins/zigbee2mqtt/devices/device.py", line 171, in get_device_args 2023-10-19 14:59:49.916 Error: Zigbee2MQTT: 'nValue': self.get_numeric_value(value, device), 2023-10-19 14:59:49.916 Error: Zigbee2MQTT: File "/var/www/domoticz/plugins/zigbee2mqtt/devices/switch/selector_switch.py", line 37, in get_numeric_value 2023-10-19 14:59:49.916 Error: Zigbee2MQTT: return 1 if self.get_string_value(value, device) != '0' else 0 2023-10-19 14:59:49.916 Error: Zigbee2MQTT: File "/var/www/domoticz/plugins/zigbee2mqtt/devices/switch/selector_switch.py", line 43, in get_string_value 2023-10-19 14:59:49.916 Error: Zigbee2MQTT: domoticz.debug('Unable to find selector switch level for value "' + value + '", device: ' + device.Name) 2023-10-19 14:59:49.916 Error: Zigbee2MQTT: TypeError: can only concatenate str (not "int") to str 2023-10-19 14:59:49.916 Error: Zigbee2MQTT: 2023-10-19 14:59:49.916 Error: Zigbee2MQTT: During handling of the above exception, another exception occurred: 2023-10-19 14:59:49.917 Error: Zigbee2MQTT: 2023-10-19 14:59:49.917 Error: Zigbee2MQTT: Traceback (most recent call last): 2023-10-19 14:59:49.917 Error: Zigbee2MQTT: File "/var/www/domoticz/plugins/zigbee2mqtt/plugin.py", line 299, in onMessage 2023-10-19 14:59:49.917 Error: Zigbee2MQTT: _plugin.onMessage(Connection, Data) 2023-10-19 14:59:49.917 Error: Zigbee2MQTT: File "/var/www/domoticz/plugins/zigbee2mqtt/plugin.py", line 137, in onMessage 2023-10-19 14:59:49.917 Error: Zigbee2MQTT: self.mqttClient.onMessage(Connection, Data) 2023-10-19 14:59:49.917 Error: Zigbee2MQTT: File "/var/www/domoticz/plugins/zigbee2mqtt/mqtt.py", line 167, in onMessage 2023-10-19 14:59:49.917 Error: Zigbee2MQTT: self.on_mqtt_message_cb(topic, message) 2023-10-19 14:59:49.917 Error: Zigbee2MQTT: File "/var/www/domoticz/plugins/zigbee2mqtt/plugin.py", line 215, in onMQTTPublish 2023-10-19 14:59:49.917 Error: Zigbee2MQTT: self.devices_manager.handle_mqtt_message(topic, message) 2023-10-19 14:59:49.917 Error: Zigbee2MQTT: File "/var/www/domoticz/plugins/zigbee2mqtt/devices_manager.py", line 61, in handle_mqtt_message 2023-10-19 14:59:49.917 Error: Zigbee2MQTT: adapter.handle_mqtt_message(zigbee_message) 2023-10-19 14:59:49.917 Error: Zigbee2MQTT: File "/var/www/domoticz/plugins/zigbee2mqtt/adapters/base_adapter.py", line 64, in handle_mqtt_message 2023-10-19 14:59:49.917 Error: Zigbee2MQTT: device.handle_message(device_data, converted_message) 2023-10-19 14:59:49.918 Error: Zigbee2MQTT: File "/var/www/domoticz/plugins/zigbee2mqtt/devices/device.py", line 196, in handle_message 2023-10-19 14:59:49.918 Error: Zigbee2MQTT: domoticz.error('Can\'t calculate the value for device ' + device.ID + ' from raw value "' + str(value) + '"') 2023-10-19 14:59:49.918 Error: Zigbee2MQTT: TypeError: can only concatenate str (not "int") to str

stas-demydiuk commented 9 months ago

Could you please update the plugin and check, there should be no crash anymore

brjhaverkamp commented 9 months ago

Thanks. i have upgraded and will keep an eye on the log!

brjhaverkamp commented 9 months ago

Hi, Today I added a zigbee device to the network. It was nicely picked up he plugin and added to domoticz. All is fine. This issue can bel closed