Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

goto is not working (with Dreame D9) #737

Open
jlssmt opened this issue Sep 29, 2024 · 15 comments
Open

goto is not working (with Dreame D9) #737

jlssmt opened this issue Sep 29, 2024 · 15 comments
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@jlssmt
Copy link

jlssmt commented Sep 29, 2024

Hello,

Describe the bug
I have installed latest Beta v2.0.0B16.
The goto feature is not working with my Dreame D9.
I send following command to my device:

action: dreame_vacuum.vacuum_goto
target:
  device_id: XXXXXXXXXXXXXXXXXXXXXXX
data:
  x: 2468
  y: -4428

Vacuum is answering me the following:

"start zone cleaning"
"unable to reach the specified area"
"please try to clear obstacles in the path"
"returning to the dock to charge"
"paused"
  • there are no obstacles in the way.

  • the vacuum has not even start to move.

  • it just has left the charging station.

  • i tried different coordinates.

  • i extracted the coordinates via lovelace-xiaomi-vacuum-map-card
     

the button of the service is green:
image

  • If I send totally bad coordinates (f.e. -999999999999) the button is red and i get the log message Error handling message: Coordinate is not inside the map
  • dreame_vacuum.vacuum_clean_spot with this coordinates is also working
  • so i don't think it's caused by wrong coordinates.
     
     

To Reproduce

  • send mentioned yaml via HASS dev tools to Dreame D9
     
     

Expected behavior
The vacuum should go to a specific coordinate and stop there until further commands.
 
 

Screenshots
no
 
 

Additional Information (please complete the following information)

  • Model Name [e.g. dreame.vacuum.p2028]: dreame-vacuum-p2009
  • Firmware Version [e.g. 1156]: 1132
  • Home Assistant Version: 2024.9.3
  • Configuration Type [With or without map support]: with map support
  • Errors or warnings shown in the HA logs (if applicable): none
@jlssmt jlssmt added bug Something isn't working question Further information is requested labels Sep 29, 2024
@Tasshack
Copy link
Owner

Tasshack commented Sep 30, 2024

Your vacuum does not internally have a go to feature like the vacuums has streaming capability.
Integration sends a 5cm² cleaning area and stop command to make go to possible for these vacuums.
This method has been tested on Z10/L10 and works without an issue.
The beaviour you are describing is the same when you try to use area coordinates that the vacuum cannot reach.

So there are two options;

  • You are sending coordinate that the vacuum thinks it cannot reach there.
  • 5cm² area may not be enough for you vacuum to check that it is reachable since it is much older than a L10.

Problem is I cannot reproduce the issue and I cannot test any modification, what is your suggestion about this?

@jlssmt
Copy link
Author

jlssmt commented Sep 30, 2024

Since I don't think that it's because I send wrong coordinates (see cause above):
Can you tell me how to test a bigger area with my setup, please? 😊

@Tasshack
Copy link
Owner

Tasshack commented Sep 30, 2024

You need to edit this line;
https://github.com/Tasshack/dreame-vacuum/blob/dev/custom_components/dreame_vacuum/dreame/device.py#L4000

Like this;
size = 100

50 is the minimum can be set and also the max resolution of the map coordinate system.
50 / 10 = 5.0 cm

So 100x100 px map image represents 5 square meters of area.

@jlssmt

This comment was marked as outdated.

@jlssmt
Copy link
Author

jlssmt commented Sep 30, 2024

forget my previous message. i set only the else part.
it's working with 100 if line 4000 is like this:
size = 100

@Tasshack
Copy link
Owner

Tasshack commented Sep 30, 2024

If it works with 100 then I can update the integration, it is not much difference between 5cm and 10cm for operation of the go to feature.
Your device firmware probably uses < symbol for checking the area coordinates instead of <= like mine so it cannot find valid a point when coordinates are set to 50x50 because that means 0x0 square cm area for it.

@Tasshack
Copy link
Owner

You should also be seeing a marker on the map image generated by the integration (for a brief period of time). You can confirm your coordinates from the image like that too.

@jlssmt
Copy link
Author

jlssmt commented Sep 30, 2024

yes. i can see the marker on map.
i updated my message above. i accidentially wrote 50.

it works if line 4000 is:
size = 100
 

it's not (!!!!!) working if line 4000 is:
size = self.status.current_map.dimensions.grid_size if self.status.current_map else 100

@Tasshack
Copy link
Owner

Tasshack commented Sep 30, 2024

it's not (!!!!!) working if line 4000 is:

Yes because if statement returns left side of the argument.

It should be like this because 50 is the grid_size and 100 is grid_size * 2
size = (self.status.current_map.dimensions.grid_size * 2) if self.status.current_map else 100

100 is for fallback in case of the integration does not have the current map data for some reason.

@Tasshack
Copy link
Owner

Can you also try values between 50 and 100 like 55 or 80?

Like;

size = 55
size = 80

@jlssmt
Copy link
Author

jlssmt commented Sep 30, 2024

size = 55
also works

@Tasshack
Copy link
Owner

There are several other places that needs to be edited for handling virtual go to markers like cleaning history maps so I have made the changes according to your results. I have also used 56 instead of 55 to prevent floating points when dividing it to half.

You can update this file and rest of it should work properly.
device.zip

@jlssmt
Copy link
Author

jlssmt commented Sep 30, 2024

the goto service is working with your zip file.
anything else I should test?

@Tasshack
Copy link
Owner

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

@jlssmt
Copy link
Author

jlssmt commented Sep 30, 2024

Thank you very much for your work!
This custom_component is the best innovation for my smart home in a few months!

I also posted an idea how to improve this even more:
#739

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants