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

Add support for G1 robot mower #261

Closed
dogmatic69 opened this issue Jun 2, 2023 · 18 comments · Fixed by #432
Closed

Add support for G1 robot mower #261

dogmatic69 opened this issue Jun 2, 2023 · 18 comments · Fixed by #432
Labels
enhancement New feature or request

Comments

@dogmatic69
Copy link

dogmatic69 commented Jun 2, 2023

Adding support for the Goat as per DeebotUniverse/Deebot-4-Home-Assistant#341

I've collected some logs so far, not looked into the code too much but I guess there is a need for a new class that is not a vacuum.

goat.log

@dogmatic69 dogmatic69 added the bug Something isn't working label Jun 2, 2023
@dogmatic69
Copy link
Author

If there is a better way to get this info, let me know

@edenhaus edenhaus added enhancement New feature or request and removed bug Something isn't working labels Jun 3, 2023
@edenhaus edenhaus changed the title G1 robot mower Add support for G1 robot mower Jun 3, 2023
@edenhaus
Copy link
Contributor

edenhaus commented Jun 3, 2023

As you see from the logs, many commands are not implemented yet in this library. To support the G1 first we need to add this commands and verify that we have at least covered the basic methods.

If there is a better way to get this info, let me know

The easiest would be to log the traffic between the app and the ecovacs server by a mitmproxy as want do know, which commands the app will send.

The mower support in HA will be discussed in home-assistant/architecture#894 and the first PR home-assistant/core#93623

@dogmatic69
Copy link
Author

I'm happy to help out and spend some time on this. Are there any guides for doing this as I'm relatively new to this kind of thing (intercepting the traffic)

@mikey0000
Copy link

Yeah it's easier if you have a rooted Android phone. There are a few mitm proxies, there's one which you can load from desktop too, I used that.

@JeedHome44
Copy link

I have packet capture in my Android. And I just install my Goat G1.
Can I help you ?

@edenhaus
Copy link
Contributor

Please analyze the request from the ecovacs app. Not sure if the call the same endpoints as the vacuum cleaner...
If yes you should see some call to the endpoint iot/devmanager.do and than verify the body of the request. It should be json and the command name should be stored with the key cmdName (More details about the request can be found here)

It could also be that the G1 used different endpoint so please analyze the requests :)

@JeedHome44

This comment was marked as off-topic.

@JeedHome44
Copy link

Nobody can say me how to captur my Goat G1 to send you results ?

@tobiaskuntzsch
Copy link

The requests look a little different than those from the vacuum cleaner, some have a V2 at the end but not all.
This is certainly the reason why the mower is found, but you cannot control it with the current ha integration.

I still don't fully understand how client.py works here. But I'll try to understand the code, for everyone who is faster or already knows what they're doing: https://gitlab.com/goat-g1/rest-api-dumps

@edenhaus
Copy link
Contributor

@tobiaskuntzsch You can contact me over Discord for help. My username is edenhaus
And thanks a lot for the dump :D

@tobiaskuntzsch
Copy link

Hi, I got the basic functions to work. The thing that doesn't work is the map.
I don't have a deboot vacuum cleaner and was only able to test it with a Goat G1. Before I open the PR, it would be great if someone with a vacuum cleaner and another goat could test it out.

Repo: https://github.com/tobiaskuntzsch/Deebot-4-Home-Assistant.git
(Client: https://github.com/tobiaskuntzsch/client.py)

Screenshot from 2023-10-01 11-13-15
Screenshot from 2023-10-01 11-13-29
Screenshot from 2023-10-01 11-13-37
Screenshot from 2023-10-01 11-13-47
Screenshot from 2023-10-01 11-15-12

I had difficulties importing the json commands, so i make this quick fix. If anyone has a tip what I did wrong? ;-)
https://github.com/tobiaskuntzsch/Deebot-4-Home-Assistant/blob/1245c4ba68652973fd9f438c259d92938942f504/custom_components/deebot/vacuum.py#L7

@edenhaus
Copy link
Contributor

edenhaus commented Oct 2, 2023

@tobiaskuntzsch It is fine to open directly a PR and than I can directly write my feedback their :) I'm happy to add support for the G1

@edenhaus
Copy link
Contributor

edenhaus commented Oct 6, 2023

I had difficulties importing the json commands, so i make this quick fix. If anyone has a tip what I did wrong? ;-) tobiaskuntzsch/Deebot-4-Home-Assistant@1245c4b/custom_components/deebot/vacuum.py#L7

I refactored the client a lot for adding support XML based robots. The "Deebot-4-Home-assistant" needs still be updated to that change and use the new DeviceCapabilities

@edenhaus
Copy link
Contributor

edenhaus commented Dec 4, 2023

@dogmatic69 Are you planning to open a PR to add support for it? I'm happy to review it :)

@dogmatic69
Copy link
Author

I would but have no previous experience with reverse engineering the traffic. I'll see if I get some time over christmas perhaps.

@edenhaus
Copy link
Contributor

edenhaus commented Dec 5, 2023

If you can control the goat over HA, you have done everything right :) Also if it works only partly we can add it

@dogmatic69
Copy link
Author

Bit hard to test with 10cm of snow on the ground... :)

@edenhaus
Copy link
Contributor

edenhaus commented Dec 7, 2023

That's true :)

@edenhaus edenhaus linked a pull request Feb 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants