Update for camera.valetudo_vacuum_camera fails #5
Replies: 22 comments 1 reply
-
hello @billyourself, thanks for your report. It looks there is an issue on the 1.1.4, I will check the last modification I made recently and release the 1.1.5 within tomorrow. It seams to be an issue with the Image_handler module that should be already fixed on the new release I'm going to publish soon. By the way can you please try to setup the integration via the GUI, (remove the configuration from the yaml / restart home assistant / go on device & services and add integrations setup and search "valetudo" and reboot once again. Please note I tested the integration with the Robock V1, if you are still facing issues with the DreamD9 I will add some additional debug logs so that we can get the json data information on the next version so that we can fix this issue with your robot. Thank you really much for your cooperation. |
Beta Was this translation helpful? Give feedback.
-
Oops closed the issue by accident. I tried both GUI and config YAML and the same error occurred for both. I'll wait for 1.1.5, try again and report back. Thanks! |
Beta Was this translation helpful? Give feedback.
-
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 ;) |
Beta Was this translation helpful? Give feedback.
-
@billyourself Release 1.1.5v is now available. Please note that there are additional required parameters. So please delete the configuration prior to install the new version and reconfigure the camera from GUI. I guess the issue is now fixed, I was able to reproduce it somehow and after 24h continuous running on the HassOS (PI4) no errors at all. Note the PI4 is my test env. I didn't check it on my production (home) instance yet.. HA is updated to the last version (that anyhow was probably the root cause of the braking code). I'm really happy that you started to use this integration.. so at your disposal for any request and or suggestions.. when hopefully it will work also for you :) |
Beta Was this translation helpful? Give feedback.
-
hold on please I just checked the installer and "snapshots" folder is no present.. this cause a warning (as expected) you can create the folder by your on i"valetudo_vacuum_camera/" add the "snapshots" folder. Will check and confirm if the installer will work in few minutes. |
Beta Was this translation helpful? Give feedback.
-
okay fixed the release :) the folder is now included on the installer. |
Beta Was this translation helpful? Give feedback.
-
Thanks @sca075 - Looks like this issue has been resolved... but we have a new one. It appears to be decoding the JSON just fine and getting all the map points. The entity now gets a result, although it is just a blank grey image. Error that is the problem this time is 'Error in get_image_from_json: object of type 'NoneType' has no len()'. Config was done via the UI, more or less the same but I set the rotate and crop as both 0. Log entries:
|
Beta Was this translation helpful? Give feedback.
-
It happens usually when it starts for the first time, you just need few cycles to wait that the image is completely finished. Until it is gray the data are not fully loaded. I will try with rotation and crop 0 |
Beta Was this translation helpful? Give feedback.
-
I probably got the reason... for [custom_components.valetudo_vacuum_camera.valetudo.image_handler] Drawing Zone Clean 2023-07-08 21:01:56.343 ERROR (SyncWorker_3) please give me few hours and it will be fix. |
Beta Was this translation helpful? Give feedback.
-
Thanks, appreciate your quick work on all of this! |
Beta Was this translation helpful? Give feedback.
-
okay.. the json structure of your vacuum is a little different from the one I use.. the vacuum as no zone clean but probably rooms, is that correct? I replaced the errors with info messages so that home assistant will be a little more happy.. the image handler will not attempt to draw the zone as per the data as logged are none. The only Error will occur when the position of the robot is not got.. hope this should help to complete the startup sequence. I will let you know how to install the patch in about 30 minutes. |
Beta Was this translation helpful? Give feedback.
-
By zone cleaning, do you mean the ability to manually select a rectangular/square area to clean like the screenshot below? If so, yes it has that capability - that screenshot is direct from my Valetudo interface. It also has rooms (noted as Segments in Valetudo). Thanks again, I'll await your instructions. |
Beta Was this translation helpful? Give feedback.
-
Okay let's give it a try if you go on HACS, click on the integration, then refresh data. Re-download, but before you confirm check the show beta version. There should be a version Select v23.608.02 here the changes discussed are in. So when it finish to install there is to reboot unfortunately to get the new version operative. It will load the image after a while.. then the calibration data will be created as soon the full image is display.. if all get right as it should.. you don't need to reconfigure the camera for this. And yes the clean zones in your json are called differently.. if you have a file explorer or visual studio you will see that in the snapshot folder there is a png and json for sure when we finally get the image.. |
Beta Was this translation helpful? Give feedback.
-
N.B. if you will finally get the image it would be really appreciated a copy of the json having the "segments" defined, I noticed you have also no_go areas it will be nice to add those functionality to the image_handler. So if you don't mind, I will wait for your feedback... |
Beta Was this translation helpful? Give feedback.
-
Okay so I got something to show. I couldn't get it working with 0 rotation/0 cropping (I noticed something in the logs about tile size cannot be larger than frame) so I used your settings. I then sent the robot to do a quick area clean so the map would push some updates. That's what I get - it's displaying two rooms but there are many more missing (including the room the robot docks in). Interestingly, I had debug logging enabled and after about 10 seconds, my entire HA instance crashed and restarted - not sure if related, and my logs show nothing to clue me on to why. Probably worth noting though. Here's some logs:
|
Beta Was this translation helpful? Give feedback.
-
Here's the map JSON as requested:
|
Beta Was this translation helpful? Give feedback.
-
Okay will work on it, I hope you can wait for a while. For the most the code works and I guess it is just matter of reformatting the Image. Will keep you posted |
Beta Was this translation helpful? Give feedback.
-
No rush, thanks again for your effort on this. |
Beta Was this translation helpful? Give feedback.
-
There is to re-design the image_handler but I already know how to do it. The reason why it crashed is probably because the code was developed with the V1, so I decided to re-do the image_handler in a more flexible way.. it was long time that I waited for it. It is a nice challenge and we will get it done. Thanks once again for the data :) |
Beta Was this translation helpful? Give feedback.
-
@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. |
Beta Was this translation helpful? Give feedback.
-
@billyourself version 236.09.01 is now available. I will move this post to the discussions. |
Beta Was this translation helpful? Give feedback.
-
@billyourself I'm going soon to release the v1.1.6, if you faced issues with the beta version please let me know. I improved the map drawing and also the zones now will show the no_go areas on the map. I'm open to get new inputs, also I noticed that there is a parameter on the data you shared that show if the room area is active or not.. does it mean when you request to clean one room the room is display with a different colour or attribute? At the moment I'm not labelling the rooms but I guess it would be nice when the card get the rooms areas (I will later check how to do it). Thanks in advance for your kind inputs. |
Beta Was this translation helpful? Give feedback.
-
Checklist
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
Logs or Errors shown in the HA logs (please enable the Debug Mode)
Additional information
No response
Beta Was this translation helpful? Give feedback.
All reactions