mqtt_vacuum_camera: Obstacle View not working
Checklist
- I have updated the integration to the latest version available
- I have checked if the problem is already reported
The problem
Obstacle View not showing any obstacle images, just a “confirmed” popup but actually not doing anything. Using it with the Xiaomi Vacuum Map Card.
What version of an integration has described problem?
v2025.03.0
What was the last working version of an integration?
No response
What vacuum model do you have problems with?
Dreame L40 Ultra
Please firmware installed on your Vacuum.
Valetudo
What type of platform you use?
Intel NUC (or generic x86_64)
What version of Home Assistant do you use?
core-2025.5.2
What type of installation are you running?
Home Assistant Supervised
Logs or Errors shown in the HA snapshots (please enable the Debug Mode) text will be auto formatted to code.
2025-05-19 18:16:08.563 DEBUG (MainThread) [custom_components.mqtt_vacuum_camera] Obstacle view for camera.dreame_l40_camera
2025-05-19 18:16:08.563 DEBUG (MainThread) [custom_components.mqtt_vacuum_camera] Firing event to search and view obstacle at coordinates 3590, 2914
2025-05-19 18:16:08.563 DEBUG (MainThread) [custom_components.mqtt_vacuum_camera] dreamel40: Received event: mqtt_vacuum_camera_obstacle_coordinates, Data: {'entity_id': 'camera.dreame_l40_camera', 'coordinates': {'x': 3590, 'y': 2914}}
2025-05-19 18:16:08.635 DEBUG (MainThread) [custom_components.mqtt_vacuum_camera] dreamel40: Restoring the backup image.
2025-05-19 18:16:13.297 DEBUG (MainThread) [custom_components.mqtt_vacuum_camera] Obstacle view for camera.dreame_l40_camera
2025-05-19 18:16:13.297 DEBUG (MainThread) [custom_components.mqtt_vacuum_camera] Firing event to search and view obstacle at coordinates 3492, 2765
2025-05-19 18:16:13.297 DEBUG (MainThread) [custom_components.mqtt_vacuum_camera] dreamel40: Received event: mqtt_vacuum_camera_obstacle_coordinates, Data: {'entity_id': 'camera.dreame_l40_camera', 'coordinates': {'x': 3492, 'y': 2765}}
2025-05-19 18:16:13.323 DEBUG (MainThread) [custom_components.mqtt_vacuum_camera] dreamel40: Restoring the backup image.
2025-05-19 18:16:15.230 DEBUG (MainThread) [custom_components.mqtt_vacuum_camera] Obstacle view for camera.dreame_l40_camera
2025-05-19 18:16:15.230 DEBUG (MainThread) [custom_components.mqtt_vacuum_camera] Firing event to search and view obstacle at coordinates 3397, 2680
2025-05-19 18:16:15.230 DEBUG (MainThread) [custom_components.mqtt_vacuum_camera] dreamel40: Received event: mqtt_vacuum_camera_obstacle_coordinates, Data: {'entity_id': 'camera.dreame_l40_camera', 'coordinates': {'x': 3397, 'y': 2680}}
2025-05-19 18:16:15.255 DEBUG (MainThread) [custom_components.mqtt_vacuum_camera] dreamel40: Restoring the backup image.
2025-05-19 18:16:17.631 DEBUG (MainThread) [custom_components.mqtt_vacuum_camera] Obstacle view for camera.dreame_l40_camera
2025-05-19 18:16:17.631 DEBUG (MainThread) [custom_components.mqtt_vacuum_camera] Firing event to search and view obstacle at coordinates 3318, 2678
2025-05-19 18:16:17.631 DEBUG (MainThread) [custom_components.mqtt_vacuum_camera] dreamel40: Received event: mqtt_vacuum_camera_obstacle_coordinates, Data: {'entity_id': 'camera.dreame_l40_camera', 'coordinates': {'x': 3318, 'y': 2678}}
2025-05-19 18:16:17.661 DEBUG (MainThread) [custom_components.mqtt_vacuum_camera] dreamel40: Restoring the backup image.
2025-05-19 18:16:23.096 DEBUG (MainThread) [custom_components.mqtt_vacuum_camera] Obstacle view for camera.dreame_l40_camera
2025-05-19 18:16:23.097 DEBUG (MainThread) [custom_components.mqtt_vacuum_camera] Firing event to search and view obstacle at coordinates 3182, 3560
2025-05-19 18:16:23.097 DEBUG (MainThread) [custom_components.mqtt_vacuum_camera] dreamel40: Received event: mqtt_vacuum_camera_obstacle_coordinates, Data: {'entity_id': 'camera.dreame_l40_camera', 'coordinates': {'x': 3182, 'y': 3560}}
2025-05-19 18:16:23.122 DEBUG (MainThread) [custom_components.mqtt_vacuum_camera] dreamel40: Restoring the backup image.
2025-05-19 18:16:30.297 DEBUG (MainThread) [custom_components.mqtt_vacuum_camera] Obstacle view for camera.dreame_l40_camera
2025-05-19 18:16:30.297 DEBUG (MainThread) [custom_components.mqtt_vacuum_camera] Firing event to search and view obstacle at coordinates 3903, 3158
2025-05-19 18:16:30.298 DEBUG (MainThread) [custom_components.mqtt_vacuum_camera] dreamel40: Received event: mqtt_vacuum_camera_obstacle_coordinates, Data: {'entity_id': 'camera.dreame_l40_camera', 'coordinates': {'x': 3903, 'y': 3158}}
2025-05-19 18:16:30.325 DEBUG (MainThread) [custom_components.mqtt_vacuum_camera] dreamel40: Restoring the backup image.
Function, that in your opinion is creating the issue.
Not sure / none of the above.
Additional information
Here is the card config:
type: custom:xiaomi-vacuum-map-card
map_source:
camera: camera.dreame_l40_camera
calibration_source:
camera: true
entity: vacuum.valetudo_dreamel40
vacuum_platform: Hypfer/Valetudo
internal_variables:
topic: valetudo/DreameL40
icons: []
tiles: []
map_modes:
- template: vacuum_clean_zone
max_repeats: 4
- template: vacuum_goto
- name: Obstacles View
icon: mdi:map-marker
run_immediately: false
coordinates_rounding: true
coordinates_to_meters_divider: 100
selection_type: MANUAL_POINT
max_selections: 999
repeats_type: NONE
max_repeats: 1
service_call_schema:
service: mqtt_vacuum_camera.obstacle_view
service_data:
coordinates_x: "[[point_x]]"
coordinates_y: "[[point_y]]"
target:
entity_id: camera.dreame_l40_camera
variables: {}
map_locked: false
two_finger_pan: true
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 1
- Comments: 25 (15 by maintainers)
The problem with the no json is on the list 😉 but I will also correct the no obstacle found… thanks once again 😃
@MattiaBasso it looks like I used a quite old version of this part of the code thanks again for the data really valuables… I need to sort out the priorities and I guess the 2025.05.0b7 was the best release for this function would you confirm please?
Changing the aspect ratio to 1:1 got me a much smoother experience. Sometimes the obstacles are not loading, don’t understand why. Integration reload is needed. Everything else seems fine to me.
@MattiaBasso please would you confirm the 2025.06.0b0 I hope I didn’t brake anything with the last changes and honestly I didn’t test it… as I need to recode the test mode.
@MattiaBasso I just released the new beta number 7 this should fix the issues you faced. Please give it a test and let me know if anything else happens.
@MattiaBasso glad to know that this worked, I will change the time out on the final version. to summarise:
I do not have yet a vacuum with this capability this is why I trust on your and others feedbacks to make it work (as shown on the video in the docs).
If you like this work, consider to star the project this helps and is my pleasure to help here.
No log needed, everything is working as expected. Changing the ratio did the trick.
Sometimes I have this error but reloading the integration fixes it:
Anyway Thanks for the effort you put in this project. Awesome work.
@MattiaBasso se hai un momento… so in conclusion, the aspect ratio of your camera looks to be not setup. This it why of this error if you set an aspect ratio should not error anymore can you please confirm/test it under this conditions, try I don’t know 1:1 or 16:9 (this is cool for the most). If this error goes away and we still have no images hostly I think you should try one of the links in the attributes to see if the image open or not.
@MattiaBasso thank you… strange I didn’t got this errors during my tests at line 217 there is maybe to add an await there that I removed because of a lint error…
Tested the 2025.05.0b6 and it did not work 😦 . But there are some new insights:
This log is from two obstacle events. I redacted the links to the images.
@MattiaBasso Sorry stil working on this issue but the good news is that probably tomorrow the fix will be available as a beta release. I had to modify some code and I still need to clean it up. I tested it and now it seams working again 😉
@MattiaBasso I found the problem we can fix it 😉 the attributes of the camera wasn’t updated as per I switched to the library the shared data… apparently an easy fix but please wait for the next beta release and let’s test it. Note that this will use the ip of the vacuum and it will work only if the vacuum is in the local network.