mqtt_vacuum_camera: Update for camera.valetudo_vacuum_camera fails
Checklist
- I have updated the integration to the latest version available
- I have checked if the problem is already reported
The problem
Update for camera.valetudo_vacuum_camera fails.
The entity does not show an image, nor does it with with the Xiaomi Lovelace Vacuum Card.
Configuration has been set up as per instructions and confirmed working with I Can’t Believe It’s Not Valetudo.
Logs from HA:
2023-07-07 20:21:29.631 DEBUG (Thread-6 (_thread_main)) [custom_components.valetudo_vacuum_camera.valetudo.connector] Connected to MQTT broker. 2023-07-07 20:21:29.632 DEBUG (Thread-6 (_thread_main)) [custom_components.valetudo_vacuum_camera.valetudo.connector] Received data from MQTT 2023-07-07 20:21:34.624 INFO (SyncWorker_4) [custom_components.valetudo_vacuum_camera.camera] camera image update process: True 2023-07-07 20:21:34.624 DEBUG (SyncWorker_4) [custom_components.valetudo_vacuum_camera.valetudo.connector] Processing data from MQTT 2023-07-07 20:21:34.624 DEBUG (SyncWorker_4) [custom_components.valetudo_vacuum_camera.utils.valetudo_jdata] Decoding PNG to JSON 2023-07-07 20:21:34.624 DEBUG (SyncWorker_4) [custom_components.valetudo_vacuum_camera.utils.valetudo_jdata] data grabbed 2023-07-07 20:21:34.624 DEBUG (SyncWorker_4) [custom_components.valetudo_vacuum_camera.utils.valetudo_jdata] Extracting JSON 2023-07-07 20:21:34.903 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.valetudo_vacuum_camera fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 695, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 942, in async_device_update await hass.async_add_executor_job(self.update) File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/valetudo_vacuum_camera/camera.py", line 184, in update pil_img = self._map_handler.get_image_from_json(parsed_json) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/valetudo_vacuum_camera/valetudo/image_handler.py", line 344, in get_image_from_json img_np_array = self.draw_zone_clean( ^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/valetudo_vacuum_camera/valetudo/image_handler.py", line 229, in draw_zone_clean tot_zones = len(coordinates) - 1 ^^^^^^^^^^^^^^^^ TypeError: object of type 'NoneType' has no len()
What version of an integration has described problem?
1.1.4
What was the last working version of an integration?
No response
What vacuum model do you have problems with?
Dreame D9, Valetudo Flashed
Please firmware installed on your Vacuum.
Dreame FW: 1132, Valetudo: DreameD9ValetudoRobot 2023.05.0
What version of Home Assistant do you use?
2023.7.1
What type of installation are you running?
Home Assistant OS
Camera’s configuration
I have anonymised my configuration, but you should get the idea.
camera:
- platform: valetudo_vacuum_camera
vacuum_entity: "vacuum.VACUUM_NAME"
vacuum_map: "valetudo/VACUUM_NAME_TOPIC"
borker_User: "MQTT USER"
broker_Password: "MQTT PASSWORD"
scan_interval:
seconds: 5
Logs or Errors shown in the HA logs (please enable the Debug Mode)
2023-07-07 20:21:29.631 DEBUG (Thread-6 (_thread_main)) [custom_components.valetudo_vacuum_camera.valetudo.connector] Connected to MQTT broker. 2023-07-07 20:21:29.632 DEBUG (Thread-6 (_thread_main)) [custom_components.valetudo_vacuum_camera.valetudo.connector] Received data from MQTT 2023-07-07 20:21:34.624 INFO (SyncWorker_4) [custom_components.valetudo_vacuum_camera.camera] camera image update process: True 2023-07-07 20:21:34.624 DEBUG (SyncWorker_4) [custom_components.valetudo_vacuum_camera.valetudo.connector] Processing data from MQTT 2023-07-07 20:21:34.624 DEBUG (SyncWorker_4) [custom_components.valetudo_vacuum_camera.utils.valetudo_jdata] Decoding PNG to JSON 2023-07-07 20:21:34.624 DEBUG (SyncWorker_4) [custom_components.valetudo_vacuum_camera.utils.valetudo_jdata] data grabbed 2023-07-07 20:21:34.624 DEBUG (SyncWorker_4) [custom_components.valetudo_vacuum_camera.utils.valetudo_jdata] Extracting JSON 2023-07-07 20:21:34.903 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.valetudo_vacuum_camera fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 695, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 942, in async_device_update await hass.async_add_executor_job(self.update) File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/valetudo_vacuum_camera/camera.py", line 184, in update pil_img = self._map_handler.get_image_from_json(parsed_json) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/valetudo_vacuum_camera/valetudo/image_handler.py", line 344, in get_image_from_json img_np_array = self.draw_zone_clean( ^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/valetudo_vacuum_camera/valetudo/image_handler.py", line 229, in draw_zone_clean tot_zones = len(coordinates) - 1 ^^^^^^^^^^^^^^^^ TypeError: object of type 'NoneType' has no len()
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 22 (15 by maintainers)
@billyourself I could draw the background layers and got the image, anyhow I understood also that the image is too big so I will test it with the cropping function, if all goes well I will later give you the beta release version to test it.
So, I did some improvement based on your founding, will continue tomorrow and post a complete change list. I’m also including a function that will export the json and the payload received from MQTT. This will be stored in the same folder of the integration (it is the same folder where will store the snapshots) this function will be released on 1.1.5 as soon it will pass the tests (not yet here in github… but on the real world) I will post also the checks made on this new release. And anyhow… if this will not work with your vacuum I will do my best to fix it so that we can state that for instance it works with both robots 😉