DeebotUniverse / client.py

Deebot client library in python
https://deebot.readthedocs.io
GNU General Public License v3.0
28 stars 43 forks source link

T30 Omni new features (full support) #555

Open pepperonzo opened 2 months ago

pepperonzo commented 2 months ago

Checks

The problem

Home Assistant doesn't support all new features of Deebot T30 Omni (many of them in common with T20) I've mapped them all, but I think I lack the knowledge to implement them by myself. All I can do is a copy->paste->edit work and, for what I've seen, it's not enough. Hope this can help

Mopping Plates Auto-Lifting setCarpetInfo
auto-lifting        body:{"data":{"mode":0}}
bypass carpets      body:{"data":{"mode":1}}
no-lifting      body:{"data":{"mode":2}}

Do Not Disturb  setBlock
on      body:{"data":{"enable":1,"start":"22:0","end":"8:0"}}
off     body:{"data":{"enable":0,"start":"22:0","end":"8:0"}}

Child Lock  setChildLock
on      body:{"data":{"on":1}}
off     body:{"data":{"on":0}}

Foot Touch Control  setSwitchState
on      body:{"data":{"kickClean":1}}
off     body:{"data":{"kickClean":0}}

TrueDetect 3D Sensitivity   setTrueDetect
off     body:{"data":{"enable":0}}
on - standard   body:{"data":{"enable":1,"level":1}}
on- high    body:{"data":{"enable":1,"level":0}}

Mop Auto-Wash Frequency setWashInfo
by time     body:{"data":{"roomwise":0}
by room     body:{"data":{"roomwise":1}}
Mop Auto-Wash Frequency - By time - Interval    setWashInterval
10 min      body:{"data":{"interval":10}}
15 min      body:{"data":{"interval":15}}
25 min      body:{"data":{"interval":25}}

Hot Air Drying Duration setDryingDuration
2 hours     body:{"data":{"duration":120}}
3 hours     body:{"data":{"duration":180}}
4 hours     body:{"data":{"duration":240}}

Auto-Empty  setAutoEmpty
auto        body:{"data":{"enable":1,"frequency":"auto"}}
smart       body:{"data":{"enable":1,"frequency":"smart"}}
on      body:{"data":{"enable":1,"frequency":"auto"}
off     body:{"data":{"enable":0,"frequency":"auto"}

TruEdge Adaptive Edge Mopping   setMopExpandState
extreme     body:{"data":{"enable":1,"level":0,"frequency":1}}
standard    body:{"data":{"enable":1,"level":1,"frequency":1}}
on      body:{"data":{"enable":1,"level":0,"frequency":1}}
off     body:{"data":{"enable":0,"level":0,"frequency":1}}

Cleaning Speed  setCustomAreaMode
standard    body:{"data":{"sweepMode":0}}
deep cleaning   body:{"data":{"sweepMode":1}}
quick cleaning  body:{"data":{"sweepMode":2}}

I've put them in excel for better reading T30 features.xlsx

On which deebot device (vacuum) you have the issue?

Deebot T30 Omni

Which version of the deebot-client are you using?

8.3.0

Country

it

Continent

eu

Anything in the logs that might be useful for us?

No response

Additional information

No response

edenhaus commented 2 months ago

Do you have the technical skills to contribute the code directly via a pull request? That will help a lot as you can test the code directly

pepperonzo commented 2 months ago

Unfortunately I'm not skilled enough. I can try something by looking at the code and copying/editing what's already done. But I would need some tips to do all the tests locally, both on my home assistant instance and linux VM. Judging for what I can see, I should theoretically fork your library, make changes, then edit ecovacs integration to look at my fork instead of the main branch. Practically, I don't know exactly how to do it, so I would need some help

pepperonzo commented 2 months ago

I managed to set up a test environment on my linux vm. I fixed ChildLock feature (it was already there but it wasn't updating the status on home assistant) and then added it to T30 capabilities. All working fine

Then I tried to add True Detect Sensitivity feature and ran into issues, because it's a "select" entity, not a switch, so it requires more effort. True Detect is already in your library as a switch (on/off) But in new deebot models also sensitivity can be set, as you can see here

TrueDetect 3D Sensitivity   setTrueDetect
off     body:{"data":{"enable":0}}
on - standard   body:{"data":{"enable":1,"level":1}}
on- high    body:{"data":{"enable":1,"level":0}}

enable defines on/off level defines high=0 or standard=1

Then I tried to add a TrueDetectSensitivity capability to define only the level of sensitivity, by just copy/editing WorkMode capability I managed somehow to get it working (halfway). Get and Set commands were working properly, the status was updating correctly, but the deebot wasn't setting sensitivity.

I discovered that the enable argument is required (0 or 1 value it works the same), while the level argument is optional so I had to revert all the changes because I lost myself trying to send 2 arguments I will try again in the next days What I'm trying to do is to keep enable argument unchanged while sending level argument so that if True Detect is off it stays off, or vice versa In this way it should be possible to keep True Detect switch working for old models, and then add a True Detect Sensitivity ( High | Standard) select entity to adjust sensitivity

If you have suggestions or examples it could help me a lot Please forgive my poor technical language

edenhaus commented 2 months ago

Sorry for the delay, but I had a rough month due to an accident. I'm fine

Please feel free to open a PR on the client here and after that one is merged and if it's required I can assist you on the PR for home assistant core. It's possible that core will show a select entity instead of a switch if there are more options available (I can implement it for you after you have open the PR for the client part here)

vlebourl commented 1 week ago

Hi all, Following this issue as I recently acquired a T30 Omni. I have some rough knowledge in programming and the robot at home to run some tests. I'll try to find some time to create a PR for this cli to integrate the new features. I haven't had a look at the code yet, but @pepperonzo you mentioned some features are already present in this client. Is it listed in your excel sheet? Bests

pepperonzo commented 1 week ago

Hi there, yes they are listed, though they are only 2. I've highlighted them in the sheet, but some text has been cut in the description so I will explain better here Please forgive my poor techical language from now on, I'm just a hobbyist

I hope I've been clear enough to be helpful Greetings