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

[Ecovacs] Adding support for Ecovacs DEEBOT X2 OMNI #16117

Closed
Stan-Pines opened this issue Dec 26, 2023 · 19 comments · Fixed by #16487
Closed

[Ecovacs] Adding support for Ecovacs DEEBOT X2 OMNI #16117

Stan-Pines opened this issue Dec 26, 2023 · 19 comments · Fixed by #16487
Labels
enhancement An enhancement or new feature for an existing add-on

Comments

@Stan-Pines
Copy link

Please add support for Ecovacs DEEBOT X2 OMNI
Ecovacs Binding for Openhab

Your Environment

Hello guys, Merry Christmas and thank you very much for the great binding and all the work you put into it.
I have a Deebot X2 Omni that I would like to integrate with Openhab. The binding works, the bridge is online, I get the following message:
15:01:51.616 [INFO ] [vacs.internal.api.impl.EcovacsApiImpl] - Found unsupported device DEEBOT X2 (class lf3bn4, company eco-ng), ignoring.

I would be very grateful if someone would add this to the database.
Stay smart and happy new year :-)

@Stan-Pines Stan-Pines added the enhancement An enhancement or new feature for an existing add-on label Dec 26, 2023
@FlorianReinartz
Copy link

Hello everyone,
I also bought the Ecovachs Omni X2 for Christmas and would also be happy about integrating it into the binding.
It would also be great if the Ecovacs Goat G1 robotic lawnmower could also be integrated.
Since all devices are controlled with the same app, I can imagine that integration into the binding can be implemented...
Thank you for your support and hard work.
I'm available if you have any questions about the X2, I'd like to buy the G1 first...
Thanks and regards
Florian Reinartz

@maniac103
Copy link
Contributor

Since all devices are controlled with the same app, I can imagine that integration into the binding can be implemented...

That unfortunately isn't the case. Even for the vacuums, Ecovacs has multiple ways of interfacing, each completely independent from each other. The app then essentially has a couple of copies of the UI and backend code that talks to the vacuum. Therefore I think the G1 interface will need to be figured out from scratch, ideally by someone owning the device.

As for the X2, supporting the basic features (vacuum itself) probably won't be much of an issue, but any further feature (everything done by the station) again will need help by someone else: as I only own an N8 and a 950 OZMO I don't even know what features would need support, let alone the API for those features...unfortunately, reverse engineering the app is the only way to find out about that API. :-/

@FlorianReinartz
Copy link

If you need access to my ecovacs account, I'm available for anything

@maniac103
Copy link
Contributor

As for the X2, when running 4.x you should be able to add the device entry locally for testing, see here. The file contents you'd need for custom_device_descs.json would be

[
    { "modelName": "DEEBOT X2 Omni", "deviceClass": "lf3bn4", "deviceClassLink": "fqxoiu" }
]

That should make it create a thing at least. I assume you'll also run into the same issue as #16187 though, can you please confirm whether that's the case?

@Stan-Pines
Copy link
Author

Hi maniac103,
Thank You for the good work. Today I did a bit of testing (as you described above), with the following results:
Action Command, State, Battery, Cleaning Spot, WiFi Signal, Mopping Water Amount, Suction Power, Switch for Continuous Cleaning, True Detect 3D, Yiko Volume and i think all the Total Counters are working at first glance.

I will continue detailed testing next week :-). but i still have some questions:

  • At the moment I cannot confirm the issue [ecovacs] T20 Omni values not recognized #16187, i don´t get any errors in Openhab. How could I trigger it?

  • What is the Water System Present Switch? Is it , when the station is connected to the water pipe? How could I check whether it works?

  • For some items I don't get any values such as Mode. Cleaning Time, Cleaned Area, and all the "Last" Counters. I get "updated to UNDEF" I'll check whether they work after a full cleaning and give feedback.

If you want me to try something out more, I'd be happy to do so.

And finally, thank you so much again for your work and fast feedback. The fact that the essential things work is really, really cool.

Smartest Greetings :-)

@maniac103
Copy link
Contributor

maniac103 commented Mar 1, 2024

At the moment I cannot confirm the issue #16187, i don´t get any errors in Openhab. How could I trigger it?

I don't know any more than what's written in that issue ;-) which looks like it should happen right after connection. I guessed the problem with T20 also applied to X2, because both are from the same generation, but I could very well be wrong there.

What is the Water System Present Switch? Is it , when the station is connected to the water pipe? How could I check whether it works?

On older models (such as mine) it signals whether water reservoir and cleaning plate/mop are attached to the vacuum. How about your device, can you still detach the mop, essentially making the vacuum a pure vacuum? If so, does the value of that switch follow the mop attachment?

For some items I don't get any values such as Mode. Cleaning Time, Cleaned Area, and all the "Last" Counters. I get "updated to UNDEF" I'll check whether they work after a full cleaning and give feedback.

Last counters will only update after a full cleaning run. (Total) cleaning time and area should work right away though, and so should mode. Can you please

  • disable the vacuum thing
  • enable verbose logging (log:set TRACE org.openhab.binding.ecovacs in OH console)
  • reenable the vacuum thing
  • wait 1 minute
  • grab the log and share it here
    ?

Maybe Ecovacs slightly changed the protocol, they like to mess around with that.

@FlorianReinartz
Copy link

FlorianReinartz commented Mar 4, 2024

As for the X2, when running 4.x you should be able to add the device entry locally for testing, see here. The file contents you'd need for custom_device_descs.json would be

[
    { "modelName": "DEEBOT X2 Omni", "deviceClass": "lf3bn4", "deviceClassLink": "fqxoiu" }
]

That should make it create a thing at least. I assume you'll also run into the same issue as #16187 though, can you please confirm whether that's the case?

Hi maniac103,

thank You for your hard work.

I get the following message in the log file:

2024-03-04 13:59:26.034 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'ecovacs:vacuum:ecovacsapi:E0XXXXXXXXXXXXXX5' to inbox.

and now, I have the Deebot X2 Omni in my Things-Inbox:
Things-Inbox

I think I'll now test what happens if I add the X2 ;-)

@FlorianReinartz
Copy link

FlorianReinartz commented Mar 4, 2024

The status of the wearing parts is displayed correctly.
"clean"="Automatische Reinigung", "pause"="Pause", "resume"="Fortsetzen", "stop"="Stopp", "charge"="Station"
works too ;-)
The volume cannot be changed and cleaning individual areas (spotArea) cannot be activated.
I tested the following commands:
"spotArea:A"="Arbeitszimmer reinigen", "spotArea:1"="Arbeitszimmer reinigen" and "spotArea:01"="Arbeitszimmer reinigen"
Errors are not reset after they are fixed.
The X1 writes error 0 if there are no errors.
The X2 seems to keep showing the last error.

@maniac103
Copy link
Contributor

The volume cannot be changed and cleaning individual areas (spotArea) cannot be activated.

Please define 'cannot' here ... what exactly happens when you try it? Also for all failure cases (like these two, or the missing data mentioned above), please provide a verbose log as described above.

@FlorianReinartz
Copy link

Sorry, but I've never looked into the possibility of changing the log function.
What do I have to do so that I can change the logging?
Log:set doesn't work in the console ( log:set: Kommando nicht gefunden.)

@maniac103
Copy link
Contributor

It should work. I just mentioned a wrong debug level name above (fixed now), but other than that, it should work:

$ openhab-cli console

Logging in as openhab
Password:  
/var/lib/openhab/tmp/jansi-2.4.0-344d138d893786d-libjansi.so.lck (Keine Berechtigung)

                           _   _     _     ____  
   ___   ___   ___   ___  | | | |   / \   | __ ) 
  / _ \ / _ \ / _ \ / _ \ | |_| |  / _ \  |  _ \ 
 | (_) | (_) |  __/| | | ||  _  | / ___ \ | |_) )
  \___/|  __/ \___/|_| |_||_| |_|/_/   \_\|____/ 
       |_|       4.1.1 - Release Build

Use '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
To exit, use '<ctrl-d>' or 'logout'.

openhab> log:set VERBOSE org.openhab.binding.ecovacs
Error executing command: No enum constant org.apache.karaf.log.core.Level.VERBOSE
openhab> log:set TRACE org.openhab.binding.ecovacs
openhab>  

@FlorianReinartz
Copy link

Ok, log:set TRACE org.openhab.binding.ecovacs worked.

There is a lot of information in the openhab.log!
Can I send you the file as a private message?

I've now had the X2 clean a room (kitchen) using the app and now there's a communication error in the thing.
org.openhab.binding.ecovacs.internal.api.util.DataParsingException: Could not get clean mode from response {"header":{"pri":1,"tzm":60,"ts":"1709563790309","ver":"0.0.1","fwVer":"1.75.0","hwVer":"0.1.1","wkVer":"0.1.54"},"body":{"code":0,"data":{"cleanState":{"category":0,"cid":"122","content":{"subContent":{"subContent":null,"type":"freeClean","value":"1,8"},"type":"freeClean","value":"1,8"},"motionState":"working","router":"plan"},"state":"clean","trigger":"none"},"msg":"ok"}}
The value for “ts” changes constantly. Maybe the position in the kitchen?!? Coordinates?

@maniac103
Copy link
Contributor

Can I send you the file as a private message?

Yes, just send it to me as PM on the forums.

The value for “ts” changes constantly. Maybe the position in the kitchen?!? Coordinates?

ts = timestamp ... I'll have a look at the message content later.

@FlorianReinartz
Copy link

When the cleaning of the kitchen was completed, the thing immediately came back online even though it was still in the kitchen.
It also stayed online on the way to the station and during self-cleaning.
I didn't get any values for the following items:

current-cleaning-mode	UNDEF
current-cleaning-time	UNDEF
current-cleaned-area	UNDEF
CurrentCleanSpot	UNDEF
last-clean-start	NULL
last-clean-duration	NULL
last-clean-area		NULL
last-clean-mode		NULL
last-clean-map		NULL

I sent the X2 into the bathroom and the thing was immediately offline again.

@jlaur jlaur changed the title [Ecovacs] - Adding support for Ecovacs DEEBOT X2 OMNI [Ecovacs] Adding support for Ecovacs DEEBOT X2 OMNI Mar 4, 2024
@FlorianReinartz
Copy link

Yes, just send it to me as PM on the forums.
I sent you a PM on community.openhab.org

@Stan-Pines
Copy link
Author

Hi guys,
if it helps: I couldn't find the robot automatically via the GUI. I checked again, even if I scan the thing in the GUI, the robot is not found. I created the robot as a thing manually. So "new thing" then Ecovacs Binding and then manually entered the bridge and the serial number. So it worked without any problems. When I change the volume of Yiko in the sitemap I see that it also changes in the Ecovacs app, so that seems to work for me too.
@maniac103: When I take the mops off, the switch for Water System Present works :-)
Do you need any more logs or was that from Florian what you needed? (I don't want to clutter up the history unnecessarily ;-))
Best regards

@FlorianReinartz
Copy link

When I checked the app, I found that the volume control did work.
The persistent error message when the X2 is working is a problem.
The SpotArea function is also very important to me.

maniac103 added a commit to maniac103/openhab2-addons that referenced this issue Mar 5, 2024
Fixes openhab#16117

Signed-off-by: Danny Baumann <dannybaumann@web.de>
@maniac103
Copy link
Contributor

Do you need any more logs or was that from Florian what you needed? (I don't want to clutter up the history unnecessarily ;-))

I think I can work out the logs with Florian ... important to me is that you both agree on what works and what doesn't ;-)

@maniac103
Copy link
Contributor

maniac103 commented Mar 5, 2024

The persistent error message when the X2 is working is a problem.

Please also send a log taken right when a non-0 error code is reported. In the log you shared all I can see is either 'no error code at all is reported' (list of error codes is empty) or 'error code 0 is reported'.

Edit: Thinking about it, 'empty error list' probably means the same as 'no error', so I'll change the code to interpret the former the same as error code 0.

jlaur pushed a commit that referenced this issue Mar 12, 2024
Fixes #16117

* [ecovacs] Interpret empty error code list as 'no error'

Newer devices don't explicitly report 'no error' anymore, but instead
send an empty list.

Signed-off-by: Danny Baumann <dannybaumann@web.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants