kamaradclimber / heishamon-homeassistant

An integration for heatpumps handled by heishamon
Apache License 2.0
44 stars 24 forks source link

Exception in message_received when handling msg on 'panasonic_heat_pump/stats' #204

Closed MorVes closed 2 months ago

MorVes commented 4 months ago

Home-Assistant: Core: 2024.5.3 Supervisor: 2024.05.1 Operating System: 12.3

Heishamon Firmware 3.2.3 heishamon-homeassistant version: 1.7.3

I get the following error in my log:

Logger: homeassistant.util.logging
Source: util/logging.py:98
First occurred: 07:02:04 (28 occurrences)
Last logged: 07:13:35

Exception in message_received when handling msg on 'panasonic_heat_pump/stats': '{"uptime":587504732,"voltage":3.39,"free memory":69,"free heap":27200,"wifi":100,"mqtt reconnects":14366,"total reads":117471,"good reads":117410,"bad crc reads":4,"bad header reads":2728,"too short reads":0,"too long reads":10,"timeout reads":47,"v0panasonic_he' 
Traceback (most recent call last): 
File "/config/custom_components/aquarea/sensor.py", line 485, in message_received self._attr_native_value = self.entity_description.state(message.payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
File "/config/custom_components/aquarea/definitions.py", line 1600, in <lambda> state=lambda json_doc: ms_to_secs(read_stats_json("uptime", json_doc)), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
File "/config/custom_components/aquarea/definitions.py", line 1005, in read_stats_json field_value = json.loads(json_doc).get(field_name, None) ^^^^^^^^^^^^^^^^^^^^ 
File "/usr/local/lib/python3.12/json/__init__.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ 
File "/usr/local/lib/python3.12/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
File "/usr/local/lib/python3.12/json/decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) ^^^^^^^^^^^^^^^^^^^^^^ json.decoder.JSONDecodeError: Invalid control character at: line 1 column 251 (char 250)

Exception in message_received when handling msg on 'panasonic_heat_pump/stats': '{"uptime":587504732,"voltage":3.39,"free memory":69,"free heap":27200,"wifi":100,"mqtt reconnects":14366,"total reads":117471,"good reads":117410,"bad crc reads":4,"bad header reads":2728,"too short reads":0,"too long reads":10,"timeout reads":47,"v0panasonic_he' Traceback (most recent call last): File "/config/custom_components/aquarea/update.py", line 113, in message_received field_value = json.loads(message.payload).get("version", None) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/json/__init__.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/json/decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) ^^^^^^^^^^^^^^^^^^^^^^ json.decoder.JSONDecodeError: Invalid control character at: line 1 column 251 (char 250)
Exception in message_received when handling msg on 'panasonic_heat_pump/stats': '{"uptime":588195646,"voltage":3.39,"free memory":64,"free heap":25304,"wifi":100,"mqtt reconnects":14382,"total reads":117609,"good reads":117548,"bad crc reads":4,"bad header reads":2728,"too short reads":0,"too long reads":10,"timeout rea0panasonic_heat_pump/L' Traceback (most recent call last): File "/config/custom_components/aquarea/sensor.py", line 485, in message_received self._attr_native_value = self.entity_description.state(message.payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/aquarea/definitions.py", line 1005, in read_stats_json field_value = json.loads(json_doc).get(field_name, None) ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/json/__init__.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/json/decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) ^^^^^^^^^^^^^^^^^^^^^^ json.decoder.JSONDecodeError: Invalid control character at: line 1 column 242 (char 241)
Exception in message_received when handling msg on 'panasonic_heat_pump/stats': '{"uptime":588195646,"voltage":3.39,"free memory":64,"free heap":25304,"wifi":100,"mqtt reconnects":14382,"total reads":117609,"good reads":117548,"bad crc reads":4,"bad header reads":2728,"too short reads":0,"too long reads":10,"timeout rea0panasonic_heat_pump/L' Traceback (most recent call last): File "/config/custom_components/aquarea/sensor.py", line 485, in message_received self._attr_native_value = self.entity_description.state(message.payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/aquarea/definitions.py", line 1600, in <lambda> state=lambda json_doc: ms_to_secs(read_stats_json("uptime", json_doc)), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/aquarea/definitions.py", line 1005, in read_stats_json field_value = json.loads(json_doc).get(field_name, None) ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/json/__init__.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/json/decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) ^^^^^^^^^^^^^^^^^^^^^^ json.decoder.JSONDecodeError: Invalid control character at: line 1 column 242 (char 241)
Exception in message_received when handling msg on 'panasonic_heat_pump/stats': '{"uptime":588195646,"voltage":3.39,"free memory":64,"free heap":25304,"wifi":100,"mqtt reconnects":14382,"total reads":117609,"good reads":117548,"bad crc reads":4,"bad header reads":2728,"too short reads":0,"too long reads":10,"timeout rea0panasonic_heat_pump/L' Traceback (most recent call last): File "/config/custom_components/aquarea/update.py", line 113, in message_received field_value = json.loads(message.payload).get("version", None) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/json/__init__.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/json/decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) ^^^^^^^^^^^^^^^^^^^^^^ json.decoder.JSONDecodeError: Invalid control character at: line 1 column 242 (char 241)
geduxas commented 4 months ago

Is it possible that in your heishamon config mqtt name has some unusual characters in front?

kamaradclimber commented 4 months ago

With a software like MQTTExplorer, could you look at the messages sent in panasonic_heat_pump/stats and post it here?

MorVes commented 4 months ago

Thank you for your suggestions. I've restarted Heishamon and got this from MQTT-Explorer:

{"uptime":19695689,"voltage":3.39,"free memory":75,"free heap":29432,"wifi":100,"mqtt reconnects":114,"total reads":3941,"good reads":3941,"bad crc reads":0,"bad header reads":0,"too short reads":0,"too long reads":0,"timeout reads":0,"version":"3.2.3"}

kamaradclimber commented 3 months ago

I've opened https://github.com/Egyras/HeishaMon/issues/491 for the same issue (it happens to me as well). I think the issue is upstream but will leave this issue open for the time being.

kamaradclimber commented 2 months ago

I'll close this one in favor of the issue on the main repository. I was able to see those lines directly on the mqtt server so I don't think it is linked to the HA integration.