Tasshack / dreame-vacuum

Home Assistant integration for Dreame robot vacuums with map support
https://community.home-assistant.io/t/custom-component-dreame-vacuum
MIT License
887 stars 110 forks source link

Dreame X40 Pro Ultra does not work zonal assembly for mapping after sweeping #768

Open DivanX10 opened 1 month ago

DivanX10 commented 1 month ago

Describe the bug A clear and concise description of what the bug is.

I send the vacuum cleaner to do zonal cleaning with such a team and it works properly

action: dreame_vacuum.vacuum_clean_segment
target:
  entity_id: vacuum.dreame_x40_pro_ultra
data:
  segments:
    - 1
    - 2

Zonal room cleaning does not work for mopping after sweeping 1) If you choose dry cleaning (sweeping), then zonal room cleaning works properly 2) If you choose wet cleaning (mopping), then zonal room cleaning works properly 3) If you choose dry and wet cleaning (sweeping_and_mopping), then zonal room cleaning works properly 4) If you select wet after dry (mopping_after_sweeping), then zonal room cleaning does not work and cleaning is done only in one room

To Reproduce Choose mopping after sweeping and select rooms

Expected behavior After choosing mopping after sweeping and rooms, the vacuum cleaner must do the cleaning in the selected rooms

Screenshots

action: dreame_vacuum.vacuum_clean_segment
target:
  entity_id: vacuum.dreame_x40_pro_ultra
data:
  segments:
    - 1
    - 2

I have selected two rooms 1 and 2 with the command and first two rooms are displayed on the map 2024-10-19_17-12-38

But when cleaning is started, only one room is displayed and cleaned 2024-10-19_17-07-29

Additional Information (please complete the following information)

home-assistant_dreame_vacuum_2024-10-19T16-53-16.183Z.log

Tasshack commented 1 month ago

Have you tested the same scenario from the app?

Tasshack commented 1 month ago

Also can you make sure customized_cleaning is disabled?

DivanX10 commented 1 month ago

Through the dreamhome app, wet cleaning after dry cleaning works properly. I took a screenshot from the story image

This is how the rooms are exposed after I set the cleaning order in the dreamhome application. image

The customized_cleaning option is disabled image

Tasshack commented 1 month ago

This may be just a visualisation error of the map. Can you acutally allow vacuum to finish the job and not stop just after?

DivanX10 commented 1 month ago

I initially thought so too, but in reality the vacuum cleaner was on base after cleaning one room. When starting wet cleaning after dry cleaning in the specified rooms with dreamehome, the map in Home Assistant displayed correctly and it was clear that two rooms were selected. I also checked with other cleaning modes, and all modes(sweeping, mopping, sweeping_and_mopping) work correctly, except for wet cleaning after dry (mopping_after_sweeping). By the way, I didn't look at what cleaning mode was displayed in Home Assistant if I selected wet cleaning after dry (mopping_after_sweeping)in dreamehome. I'll check it again later tomorrow afternoon."

Tasshack commented 1 month ago

Integration does not send cleaning mode when starting a cleaning job so it must be something else that causes this issue. The command has been sent to the robot should be same when cleaning mode is set to sweeping after mopping but I will check your log output and try to understand whats going on.

DivanX10 commented 1 month ago

Checked again. Something strange is happening. Even with dry cleaning, not all rooms are cleaned properly. Home Assistant simply displays the selected rooms or one selected room disappears, and the Dreame Home app reports that cleaning in this room is not possible, but from the Dreame Home app, cleaning by room works fine. It feels like the coordinates of the rooms between Dreame Home and Home Assistant are different. If I select rooms from Dreame Home, then the map in Home Assistant displays the rooms correctly, but if I select rooms in Home Assistant, then Dreame Home displays one room and reports that cleaning in this room is not possible.

Logging only cleaning from Dreame Home. home-assistant_dreame_vacuum_2024-10-20 (dreamehome).log

Logging is only done from Home Assistant. home-assistant_dreame_vacuum_2024-10-20 (home-assistant).log

Tasshack commented 1 month ago

I have checked the logs and still not sure what is causing this issue but I can see some differences between the job has been started from the app and home assistant. Unfortunately there is no way to know what the app actually sends to the API but the cleaning mode is not one of the parameters can be sent to start cleaning job command so it must not be related to that.

sa is the key for active segments from the map data and that is what the app and the integraion checks to render room color or not.

From Home Assistant 'sa': [[1, 1, 1, 16, 0], [2, 1, 1, 16, 0]]

From Dreamehome 'sa': [[1, 1, 1, 16, 1], [2, 1, 1, 16, 1]]

But the app does not use the last parameter which is different from two jobs so I don't know what it means to be 0 or 1.

Tasshack commented 1 month ago

Also app does not use the cleaning order parameter of the start cleaning job command and passes 1 as cleaning index for all rooms but the integration does actually use it for the older vacuums does not have custom cleaning order feature.

I really don't think this is the issue but I have modified the code for you to test it. device.zip Can you update this file and try again?

DivanX10 commented 1 month ago

Can you update this file and try again?

Yes, I can check it out. Tomorrow I will check and unsubscribe about the result

DivanX10 commented 1 month ago

We checked that it's working properly now. Now the zones are selected correctly. I'm attaching logs.

home-assistant_dreame_vacuum_2024-10-21T12-15-09.647Z.log

Tasshack commented 1 month ago

Data also looks same now with the Dreamehome job so that was an easy fix.

'sa': [[1, 1, 1, 16, 1], [2, 1, 1, 16, 1]]

Thanks for help, I will close the issue when a new version has been released.

DivanX10 commented 1 month ago

Thanks for help, I will close the issue when a new version has been released.

Thank you