Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

with latest heishamon3.x errors in plugin #12

Open
balans911 opened this issue Jun 23, 2022 · 4 comments
Open

with latest heishamon3.x errors in plugin #12

balans911 opened this issue Jun 23, 2022 · 4 comments

Comments

@balans911
Copy link

i love the plugin use it for almost a year now without problems a big thnx 4 that!,
but i now have this error in domoticz. it started with the latest released Heishamon

https://github.com/IgorYbema/HeishaMon/tree/v3.0/binaries

2022-06-23 18:38:11.343 Error: heishamon: Call to function 'onMessage' failed, exception details:
2022-06-23 18:38:11.344 Error: heishamon: Traceback (most recent call last):
2022-06-23 18:38:11.344 Error: heishamon: File "/home/pi/domoticz/plugins/HeishamonMQTT/plugin.py", line 613, in onMessage
2022-06-23 18:38:11.344 Error: heishamon: _plugin.onMessage(Connection, Data)
2022-06-23 18:38:11.344 Error: heishamon: File "/home/pi/domoticz/plugins/HeishamonMQTT/plugin.py", line 293, in onMessage
2022-06-23 18:38:11.344 Error: heishamon: self.mqttClient.onMessage(Connection, Data)
2022-06-23 18:38:11.344 Error: heishamon: File "/home/pi/domoticz/plugins/HeishamonMQTT/mqtt.py", line 157, in onMessage
2022-06-23 18:38:11.344 Error: heishamon: payload = Data['Payload'].decode('utf8') if 'Payload' in Data else ''
2022-06-23 18:38:11.344 Error: heishamon: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc8 in position 1: invalid continuation byte

when i drop back to a previous 2.2-x it disappears ,so just a hint for upcoming releases
I and probably others would loved this fixed.

Thnx in advance

@CrazyICT
Copy link

CrazyICT commented Sep 26, 2022

I got the same issue since V3:

2022-09-26 13:43:38.117 Error: Heishamon MQTT: ----> Line 613 in '/home/pi/domoticz/plugins/HeishamonMQTT/plugin.py', function onMessage
2022-09-26 13:43:38.117 Error: Heishamon MQTT: ----> Line 293 in '/home/pi/domoticz/plugins/HeishamonMQTT/plugin.py', function onMessage
2022-09-26 13:43:38.117 Error: Heishamon MQTT: ----> Line 157 in '/home/pi/domoticz/plugins/HeishamonMQTT/mqtt.py', function onMessage
2022-09-26 13:43:40.384 Error: Heishamon MQTT: 'onMessage' failed 'UnicodeDecodeError':''utf-8' codec can't decode byte 0xc8 in position 1: invalid continuation byte'.

@MikeyMan83
Copy link

Same here. No clue what's causing it. First error line is less than helpful.

@MikeyMan83
Copy link

MikeyMan83 commented Oct 3, 2022

Fixed it.

In MQTT.py:

Line 156 and beyond:

        topic = Data['Topic'] if 'Topic' in Data else ''
#        payload =  Data['Payload'].decode('utf8') if 'Payload' in Data else ''
        payload =  Data['Payload'].decode('latin-1') if 'Payload' in Data else ''

Changed decoding from utf8 to latin-1.

@balans911
Copy link
Author

great find, this fixed it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants