You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you configure an MQTT camera with encoding: b64 then you cannot provide an availability_topic. If you do when the integration attempts to read messages from the availability topic then you receive errors like this:
Logger: homeassistant
Source: components/mqtt/client.py:586
First occurred: 6:21:14 PM (14 occurrences)
Last logged: 6:21:29 PM
Error doing job: Exception in callback MQTT._mqtt_handle_message(<paho.mqtt.cl...xffff8bc5ef80>)
Error doing job: Exception in callback MQTT._mqtt_handle_message(<paho.mqtt.cl...xffff8bc5f060>)
Error doing job: Exception in callback MQTT._mqtt_handle_message(<paho.mqtt.cl...xffff8bc5f300>)
Error doing job: Exception in callback MQTT._mqtt_handle_message(<paho.mqtt.cl...xffff87f78040>)
Error doing job: Exception in callback MQTT._mqtt_handle_message(<paho.mqtt.cl...xffff8d381690>)
Traceback (most recent call last):
File "/usr/local/lib/python3.10/asyncio/events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "/usr/src/homeassistant/homeassistant/components/mqtt/client.py", line 586, in _mqtt_handle_message
payload = msg.payload.decode(subscription.encoding)
LookupError: unknown encoding: b64
As you can see it tries to provide that value to paho mqtt which does not understand it. Removing the availability_topic fixes it because this config option is handled correctly for normal messages to the cameras topic here:
Hey there @emontnemery, mind taking a look at this issue as it has been labeled with an integration (mqtt) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)
The problem is that the encoding parameter is used in two ways. For availability it should be utf-8 which is the default.
The linked PR will introduce a new image_encoding parameter to set the image encoding.
Setting encoding to b64 will work too with this fix, but is deprecated and will give a warning message in the log.
The problem
If you configure an MQTT camera with
encoding: b64
then you cannot provide anavailability_topic
. If you do when the integration attempts to read messages from the availability topic then you receive errors like this:As you can see it tries to provide that value to paho mqtt which does not understand it. Removing the
availability_topic
fixes it because this config option is handled correctly for normal messages to the cameras topic here:core/homeassistant/components/mqtt/camera.py
Lines 127 to 128 in 04c6b9c
What version of Home Assistant Core has the issue?
core-2022.7.6
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
camera.mqtt
Link to integration documentation on our website
https://www.home-assistant.io/integrations/camera.mqtt/
Diagnostics information
No response
Example YAML snippet
Anything in the logs that might be useful for us?
Logger: homeassistant Source: components/mqtt/client.py:586 First occurred: 6:21:14 PM (14 occurrences) Last logged: 6:21:29 PM Error doing job: Exception in callback MQTT._mqtt_handle_message(<paho.mqtt.cl...xffff8bc5ef80>) Error doing job: Exception in callback MQTT._mqtt_handle_message(<paho.mqtt.cl...xffff8bc5f060>) Error doing job: Exception in callback MQTT._mqtt_handle_message(<paho.mqtt.cl...xffff8bc5f300>) Error doing job: Exception in callback MQTT._mqtt_handle_message(<paho.mqtt.cl...xffff87f78040>) Error doing job: Exception in callback MQTT._mqtt_handle_message(<paho.mqtt.cl...xffff8d381690>) Traceback (most recent call last): File "/usr/local/lib/python3.10/asyncio/events.py", line 80, in _run self._context.run(self._callback, *self._args) File "/usr/src/homeassistant/homeassistant/components/mqtt/client.py", line 586, in _mqtt_handle_message payload = msg.payload.decode(subscription.encoding) LookupError: unknown encoding: b64
Additional information
No response
The text was updated successfully, but these errors were encountered: