Core: MQTT camera not working on 0.87

Created on 8 Feb 2019  路  27Comments  路  Source: home-assistant/core

Home Assistant release with the issue:
0.87

Last working Home Assistant release (if known):

0.86.4

Operating environment (Hass.io/Docker/Windows/etc.):

NUC running ubuntu 18.04 with ha in a virtualenv

Component/platform:

mqtt camera

Description of problem:

Since 0.87 motion snapshot camera from the dafang_hacked Xiaomi Dafang camera no longer works. This is an mqtt camera which is auto discovered thru mqtt discovery. There is an error in homeassistant.log.

2019-02-08 19:29:31 WARNING (MainThread) [homeassistant.components.mqtt] Can't decode payload b'\xff\xd8\xff\xdb\ (long string of similar stuff) \xd9' on myhome/dafang/motion/snapshot with encoding utf-8

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):


Traceback (if applicable):


Additional information:

All 27 comments

[I'm not the OP, but here's my config. I'm also using autodiscovery]
MQTT message:

homeassistant/camera/dafang2/motion_snapshot/config {"name": "dafang2 motion snapshot", "unique_id": "7811dc74e776-motion-snapshot", "device": {"identifiers": "7811dc74e776", "connections": [["mac", "78:11:dc:74:e7:76"]], "manufacturer": "Xiaomi", "model": "Dafang", "name": "Xiaomi Dafang", "sw_version": "Dafang Hacks"}, "topic": "myhome/dafang2/motion/
"}

HA Logs:

Feb 08 11:13:13 raspberrypi hass[29079]: 2019-02-08 11:13:13 INFO (MainThread) [homeassistant.components.mqtt.discovery] Component has already been discovered: camera dafang2 motion_snapshot, sending update
Feb 08 11:13:13 raspberrypi hass[29079]: 2019-02-08 11:13:13 INFO (MainThread) [homeassistant.components.mqtt] Got update for entity with hash: ('camera', 'dafang2 motion_snapshot') '{'platform': 'mqtt', 'name': 'dafang2 motion snapshot', 'state_topic': 'homeassistant/camera/dafang2/motion_snapshot/state', 'topic': 'myhome/dafang2/motion/snapshot', 'device': {'sw_version': 'Dafang Hacks', 'name': 'Xiaomi Dafang', 'connections': [['mac', '78:11:dc:74:e7:76']], 'model': 'Dafang', 'identifiers': '7811dc74e776', 'manufacturer': 'Xiaomi'}, 'unique_id': '7811dc74e776-motion-snapshot', 'discovery_hash': ('camera', 'dafang2 motion_snapshot')}'

In addition to the log, the snapshot isn't shown in the UI (lovelace, picture-entity, showing camera.dafang2_motion_snapshot)

Support to skip decoding was added in #20292 , however, the payload should imho never be read if there is not an automation triggering on the event.

Even if there's no automation, what about if the entity is being displayed?

True, that would be a good place to look at.

I too have this problem, snapshots don't work anymore

as mentioned here: https://github.com/home-assistant/home-assistant.io/pull/8247#issuecomment-461583578

I have a mqtt camera, I added:

camera:
  - name: Porch
    platform: mqtt
    topic: camera/porch
+   payload: 'on'
+   encoding: ''

but I still get the whole payload and error in my logs.

[homeassistant.components.mqtt] Can't decode payload b'\.... <payload>.....' on camera/porch with encoding utf-8

I only started receiving this with my 0.87 upgrade.

I feel the default decoding for a camera should have the utf-8 off..... :)

The encoding: ''seems to relate to automations, not to the mqtt camera component. See https://www.home-assistant.io/docs/automation/trigger/#mqtt-trigger

ok, well why do we have an encoding error? My camera is dead.

Well not exactly dead, you still have camera via the generic component, like

- platform: generic still_image_url: https://[email protected]/cgi-bin/currentpic.cgi name: cam1 verify_ssl: false authentication: digest

And you still have a motion detection sensor via mqtt.

There was a big change in mqtt components and I suspect something got dragged along.

Can you please paste a log with the error message?

@emontnemery it is very long, are you sure?

Also do you need just the error line, or a whole log? If so I'll restart HA and get you the whole thing.

PS the log message (minus man many lines of escaped binary) is in the first post.

@emontnemery , here's a sample log showing one snapshot arriving via MQTT
mqtt_snapshot_decode_error.log

Or if this is more accessible

http://paste.ubuntu.com/p/SnyKChD5h2/

But really it shows no a lot more than what I showed in my original post.

Thanks for the logs and more details, very helpful. I'll get this fixed within the next couple of days.

Thanks. Happy to help with testing if you need

@mikeage Please try the change in #20932

Will do; I'll be home in ~7 hours and will check then

I guess it's a bit late for me to say so, but this works. Thanks :-)

Yeah it works, thank you all concerned.

is this in 0.87.1?

no, targeted for 0.87.2

is there going to be a 0.87.2 rls'd?.... or we just waiting for 0.88.0.

I have similar problem in 0.88.1:

2019-02-22 20:45:30 WARNING (MainThread) [homeassistant.components.mqtt] Can't decode payload b'\x10\x11\xca\x01\x00\x00\x00\x00 |\xc9\x01\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00@\x05\xca\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' on homeassistant/sensor/test1/outside_temperature/config with encoding utf-8

@adrianmihalko What firmware is your sensor running?

I am running EspEasy.

@adrianmihalko that looks like corrupted retained message, maybe caused by this bug eclipse/mosquitto#1161
You can try to reset your mosquitto database

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Konstigt picture Konstigt  路  3Comments

TheZoker picture TheZoker  路  3Comments

MartinHjelmare picture MartinHjelmare  路  3Comments

arangates picture arangates  路  3Comments

moskovskiy82 picture moskovskiy82  路  3Comments