Control Climatisation causes exception in on_message - eGolf #237
Unanswered
roquestrongo
asked this question in
Q&A
Replies: 1 comment
-
Oh, this is a bug, I need to fix this! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey there im figuring out weconnect-mqtt with my eGolf,
so far i can sucessfully start / stop charging via the /controls/charging_writetopic however if i try to enable Climatisation via /controls/climatisation_writetopic [start / stop / 0.0 Value] i can see a Error in the commndline:
`
2023-07-16T12:56:31+0200:ERROR:client:Caught exception in on_message: Object of type HeaterSource is not JSON serializable
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.8/dist-packages/paho/mqtt/client.py", line 3591, in _thread_main
self.loop_forever(retry_first_connection=True)
File "/usr/local/lib/python3.8/dist-packages/paho/mqtt/client.py", line 1756, in loop_forever
rc = self._loop(timeout)
File "/usr/local/lib/python3.8/dist-packages/paho/mqtt/client.py", line 1164, in _loop
rc = self.loop_read()
File "/usr/local/lib/python3.8/dist-packages/paho/mqtt/client.py", line 1556, in loop_read
rc = self._packet_read()
File "/usr/local/lib/python3.8/dist-packages/paho/mqtt/client.py", line 2439, in _packet_read
rc = self._packet_handle()
File "/usr/local/lib/python3.8/dist-packages/paho/mqtt/client.py", line 3033, in _packet_handle
return self._handle_publish()
File "/usr/local/lib/python3.8/dist-packages/paho/mqtt/client.py", line 3327, in _handle_publish
self._handle_on_message(message)
File "/usr/local/lib/python3.8/dist-packages/paho/mqtt/client.py", line 3570, in _handle_on_message
on_message(self, self._userdata, message)
File "/usr/local/lib/python3.8/dist-packages/weconnect_mqtt/weconnect_mqtt_base.py", line 843, in on_message_callback
attribute.value = msg.payload.decode()
File "/usr/local/lib/python3.8/dist-packages/weconnect/addressable.py", line 420, in value
self.valueSetter(newValue)
File "/usr/local/lib/python3.8/dist-packages/weconnect/elements/controls.py", line 123, in __setClimatizationControlChange
data = json.dumps(settingsDict)
File "/usr/lib/python3.8/json/init.py", line 231, in dumps
return _default_encoder.encode(obj)
File "/usr/lib/python3.8/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python3.8/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/usr/lib/python3.8/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.class.name} '
TypeError: Object of type HeaterSource is not JSON serializable
`
Then after weconnect-mqtt seems to exit, and the conenction shows disconnected "weconnect/mqtt/weconnectConnected = false".
Any Idea what i´m doing wrong? It works fine on the Android App.
Regards
Roque
Beta Was this translation helpful? Give feedback.
All reactions