sca075 / mqtt_vacuum_camera

Camera Integration for Home Assistant to export and render all Vacuums connected via MQTT( including Valetudo Hypfer and RE(rand256)) Maps.
Apache License 2.0
102 stars 5 forks source link

Map trims reset required using one vacuum on two floors. #220

Closed carefulcomputer closed 3 months ago

carefulcomputer commented 3 months ago

Checklist

The problem

Map is not rendered properly. I tried deleting the entity and readding it. But doesn't show full map.

image

What version of an integration has described problem?

2024.07.4

What was the last working version of an integration?

No response

What vacuum model do you have problems with?

Dreame D9+

Please firmware installed on your Vacuum.

valetudo latest

What type of platform you use?

VEMLinux (Virtual Machine) such as Proxmox, VMWare, etc.

What version of Home Assistant do you use?

core-2024.7.2

What type of installation are you running?

Home Assistant Container

Logs or Errors shown in the HA snapshots (please enable the Debug Mode) text will be auto formatted to code.

No response

Function, that in your opinion is creating the issue.

Calibration of the Map

Additional information

No response

sca075 commented 3 months ago

@carefulcomputer would you please check: -advanced option -> reset map trims

sca075 commented 3 months ago

Aaa forgot you needed to reload the component when you reset the trims. If you look at the release notes of the recent releases, it was documented 😉.. also.. when I made this change I thought about your specific setup and I know... it can be a little, uncontrollable for you.

carefulcomputer commented 3 months ago

thanks. that worked! appreciate the instructions.

carefulcomputer commented 3 months ago

i use maploader component to swap maps on my vacuum and I see vacuum camera tends to get messed up after swap. is there a way to handle the map swap gracefully (i.e. map on vacuum has changed). Maybe allow named backups of current trims/settings and restore on demand. If not maybe creating a service which resets the trims and reload the integration. Then I can call the service after map swap.

sca075 commented 3 months ago

Well, I know that you are using the maploader component to swap the maps, and I will evaluate the scenario to handle the reset of the trims / reload the Camera function (that honestly is already on the roadmap that I should make public at this point).

I hope you understand, the Camera in this moment is developing slowly (I'm trying to refactor the code) so please allow me sometime to handle this scenario. I will improve also the documentation as soon the spec. will be fixed once per all. For the time be please allow me to fix this next month. Hopefully, as a counter measure will set an option to disable/enable the current function to save the trims at startup on the next version. Do we a deal with that?

Thanks as always for your kind report @carefulcomputer, this is helping a lot to make this component more flexible and 100% compatible with Home Assistant.

carefulcomputer commented 3 months ago

@sca075 , there is no hurry. i really appreciate your looking into this issue. Please take the option you think is right.

sca075 commented 3 months ago

@carefulcomputer I opened also a proposal issue in the maploader, if the guys over there can raise an event each time they load a map in the vacuum to Home Assistant, this will be great to get the Camera and probably also the Card to switch to the new map. Anyhow as per the time be, the 2024.08.0 will have the function to enable or disable the trims load / save operations.

sca075 commented 3 months ago

@carefulcomputer I checked the code of maploader, can you please check the with MQTT Explores the topics in Valetudo, apparently maploader publish when the maps change, if so I can, instead to add simply this function to stop the trims do the reset automatically by checking those payloads.

sca075 commented 3 months ago

Screenshot 2024-08-03 at 10 43 04

Working actually on the reload service, probably this is the best solution.

sca075 commented 3 months ago

@carefulcomputer the next beta version and also the final version of 2024.08.0 will included the Service = Actions "reset_trims". This service require the Camera entity_id that will be re-trimmed. The service automatically reload the camera so just this service will do the operations you did to change the maps. Hope this can helps to use "maploader". Thanks once again for the input here.

carefulcomputer commented 3 months ago

sorry, I was out last few days so couldn't reply. I will of course test out the final version when it is released. Do you need me to test/check anything else ? And thank you so much for being so responsive and solving this issue!

sca075 commented 3 months ago

@carefulcomputer If you want / can you can download the beta 2024.08.0b2 this contains the "reset_trims" service. With this version you can probably setup your script or automation so that with the final version, either HA or Camera all should work as I think we agreed. You just need to setup the "reset_trims" service and the Camera will delete the file and restart automatically. This way as soon the map change.. should work similar as before. I need to thank you for the idea and also for the feedback when all works for you.

Edit: the issue closed automatically as it was reference in the PR, GitHub, but of course fill free to re-open it if there is any problem ;)