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

T30 Omni new features (full support) #555

Open
4 tasks done
pepperonzo opened this issue Aug 8, 2024 · 16 comments
Open
4 tasks done

T30 Omni new features (full support) #555

pepperonzo opened this issue Aug 8, 2024 · 16 comments
Labels
enhancement New feature or request

Comments

@pepperonzo
Copy link
Contributor

Checks

  • I have searched the existing issues and no issue is describing my issue
  • I have checked the FAQ
  • I have checked the documentation
  • I have installed the latest version

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

@pepperonzo pepperonzo added the bug Something isn't working label Aug 8, 2024
@edenhaus edenhaus added enhancement New feature or request and removed bug Something isn't working labels Aug 14, 2024
@edenhaus
Copy link
Contributor

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
Copy link
Contributor Author

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
Copy link
Contributor Author

pepperonzo commented Aug 16, 2024

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
Copy link
Contributor

edenhaus commented Sep 3, 2024

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
Copy link

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
Copy link
Contributor Author

pepperonzo commented Oct 20, 2024

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

  • Child Lock (setChildLock) is already in this library. It’s fully working, it's just a matter of adding the capability to the device, easy. I did it on my test machine and it worked
  • True Detect 3D Sensitivity (setTrueDetect) is already in this library as well, but not as you're expecting. The command setTrueDetect in this library has a boolean which sends "enable:1" or "enable:0" to activate or deactivate the True Detect feature, and it's already working on T30 as it is, to toggle True Detect. But, if you want to set the sensitivity, you have to send also another argument in the body, which is "level:0" or "level:1" (STANDARD=1 , HIGH=0). Pay attention if you try to add this feature, because the "enable" argument has to be declared anyways, otherwise the bot will not accept the command. What I tried to do, unsuccessfully, was to add another command to set only the sensitivity, in order not to mess with the original toggle command and make it more compatible. I struggled with the two arguments thing and now i don't have much time
    The same applies for all features that involve 2 or more arguments at the same time (such as setAutoEmpty, setMopExpandState etc)
  • All other features inside the excel sheet are not present in this library

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

@flubshi
Copy link
Contributor

flubshi commented Nov 7, 2024

  • Child Lock (setChildLock) is already in this library. It’s fully working, it's just a matter of adding the capability to the device, easy. I did it on my test machine and it worked

Looks like you implemented and tested this change. If it is working for you, could you please create a Pull Request?

XxInvictus added a commit to XxInvictus/client.py that referenced this issue Dec 10, 2024
- Initial clone of most compatible, requires extra features not supported yet in DeebotUniverse#555
edenhaus pushed a commit that referenced this issue Dec 10, 2024
- Initial clone of most compatible, requires extra features not supported yet in #555
@XxInvictus
Copy link
Contributor

Found this while looking to add X5 Pro Omni support, one thing that is worth noting is that Do Not Disturb is a one-to-many not one-to-one. You can have multiple Do Not Disturb schedules it's not as simple as just a single map on any Getter.

XxInvictus added a commit to XxInvictus/client.py that referenced this issue Dec 10, 2024
Contributes DeebotUniverse#555
- Add support for Mop Auto-Wash Frequency `setWashInterval`
@XxInvictus
Copy link
Contributor

Also just an FYI to divide and conquer I have started working on the Mop Auto-Wash Frequency in a fork branch 😊

@XxInvictus
Copy link
Contributor

@edenhaus can you just confirm how you have been handling new capabilities with the many-to-one symlinking. Further up in this thread there is the setChildLock capability already existing but not attached to p1jij8.py that these devices are linked from (T30/X5).

In the past have you been updating the source of the symlink or branching off into a new file for these where a new capability needs to be added that may not exist on ALL symlinked devices?

Both T30 (4vhygi.py) and X5 (lr4qcs.py) are currently symlinked to p1jij8.py and from my check, the below all also link to this source file:

4vhygi.py
p1jij8.py
85nbtp.py
p1jij8.py
9ku8nu.py
jtmf04.py
lx3j7m.py
paeygf.py
py3qif.py
z4lvk7.py
zwkcqc.py

@XxInvictus
Copy link
Contributor

XxInvictus commented Dec 12, 2024

@pepperonzo can you confirm with certainty that the API endpoint for Wash Interval by Time is getWashInterval/setWashInterval for the T30?

I tried to build based on this but from it not working in testing went back to dump from my X5 Pro Omni and discovered that on my device both the interval and time/room selector is a part of the getWashInfo/setWashInfo JSON as per the example getWashInfo output below:

  "body": {
    "code": 0,
    "data": {
      "amount": 1,
      "dryMop": 1,
      "duration": 60,
      "interval": 15,
      "mode": 1,
      "roomwise": 0
    },
    "msg": "ok"
  },

@edenhaus
Copy link
Contributor

In the past have you been updating the source of the symlink or branching off into a new file for these where a new capability needs to be added that may not exist on ALL symlinked devices?

When adding a new feature, we will add it to the capabilities of the models we know. For example, if the T20 (p1jij8) has this feature, we will update the file. If the new feature has only the T30 (4vhygi) but not the target device of the symlink. Then we replace the symlink with a copy of the target device and edit the T30 caps file only

Did I explain it understandable?

@XxInvictus
Copy link
Contributor

That makes sense thanks! I just didn't know if it was played on the cautious side because some features may not be listed on official spec sheets but available in the app.

@pepperonzo
Copy link
Contributor Author

@pepperonzo can you confirm with certainty that the API endpoint for Wash Interval by Time is getWashInterval/setWashInterval for the T30?

I tried to build based on this but from it not working in testing went back to dump from my X5 Pro Omni and discovered that on my device both the interval and time/room selector is a part of the getWashInfo/setWashInfo JSON as per the example getWashInfo output below:

  "body": {
    "code": 0,
    "data": {
      "amount": 1,
      "dryMop": 1,
      "duration": 60,
      "interval": 15,
      "mode": 1,
      "roomwise": 0
    },
    "msg": "ok"
  },

Here is the debug log of my T30 when I try to change mop wash interval

DEBUG:deebot_client.mqtt_client.client:Received PUBLISH (d0, q0, r0, m0), 'iot/p2p/setWashInterval/HelperMQClientId**censored**, ...  (165 bytes)
DEBUG:deebot_client.mqtt_client:Got message: topic=iot/p2p/setWashInterval/HelperMQClientId**censored**, payload=b'{"body":{"data":{"interval":15}} **censored**
DEBUG:deebot_client.mqtt_client:Command setWashInterval does not support p2p handling (yet)

DEBUG:deebot_client.mqtt_client.client:Received PUBLISH (d0, q0, r0, m0), 'iot/p2p/setWashInterval/**censored**, ...  (144 bytes)
DEBUG:deebot_client.mqtt_client:Got message: topic=iot/p2p/setWashInterval/**censored**, payload=b'{"header":**censored**},"body":{"code":0,"msg":"ok"}}'
DEBUG:deebot_client.mqtt_client:Command setWashInterval does not support p2p handling (yet)

DEBUG:deebot_client.mqtt_client.client:Received PUBLISH (d0, q0, r0, m0), 'iot/atr/onWashInfo/**censored**, ...  (220 bytes)
DEBUG:deebot_client.mqtt_client:Got message: topic=iot/atr/onWashInfo/**censored**, payload=b'{"header":{**censored**},"body":{"data":{"mode":1,"interval":15,"hot_wash_amount":1,"amount":1,"roomwise":0},"code":0,"msg":"ok"}}'
DEBUG:deebot_client.event_bus:Event is the same! Skipping (AvailabilityEvent(available=True))
DEBUG:deebot_client.device:Try to handle message onWashInfo: b'{**censored**},"body":{"data":{"mode":1,"interval":15,"hot_wash_amount":1,"amount":1,"roomwise":0},"code":0,"msg":"ok"}}'
DEBUG:deebot_client.messages:Unknown message "onWashInfo"

DEBUG:deebot_client.mqtt_client.client:Received PUBLISH (d0, q0, r0, m0), 'iot/atr/onFwBuryPoint-bd_setting-evt/**censored**, ...  (221 bytes)
DEBUG:deebot_client.mqtt_client:Got message: topic=iot/atr/onFwBuryPoint-bd_setting-evt/**censored**, payload=b'{"header":**censored**},"body":{"gid":"**censored**","index":"**censored**","ts":"**censored**","orig":{"dusterTime":10},"new":{"dusterTime":15}}}'
DEBUG:deebot_client.event_bus:Event is the same! Skipping (AvailabilityEvent(available=True))
DEBUG:deebot_client.device:Try to handle message onFwBuryPoint-bd_setting-evt: b'{"header":{**censored**},"body":{"gid":"**censored**","index":"**censored**","ts":"**censored**","orig":{"dusterTime":10},"new":{"dusterTime":15}}}'
DEBUG:deebot_client.messages:Unknown message "onFwBuryPoint-bd_setting-evt"

I always focused on iot/p2p messages and ignored iot/atr ones because from what I read they're not compatible with this library.
Actually both "set" commands work. Both setWashInfo and setWashInterval (both with parameter "interval" : x ) do the job
I can't tell anything about "get" commands because I never got them working in my private branch. Maybe I'm doing something wrong (only get commands with "enable" boolean work).
Perhaps you can tell by yourself what may work by looking at the debug log above.
My theory is that the "get" command is not received because it's iot/atr and not iot/p2p (like "set" ones), but I'm not skilled enough to debug or code further

@pepperonzo
Copy link
Contributor Author

@XxInvictus I just tested get commands also
When I send them using Home Assistant "send command" action this is what I get

DEBUG:deebot_client.mqtt_client:Got message: topic=iot/p2p/getWashInterval/**censored**, payload=b'{"header":**censored**},"body":{"data":{"interval":15},"code":0,"msg":"ok"}}'
DEBUG:deebot_client.mqtt_client:Command getWashInterval does not support p2p handling (yet)
DEBUG:deebot_client.mqtt_client.client:Received PUBLISH (d0, q0, r0, m0), 'iot/p2p/getWashInfo/HelperMQClientId-**censored**, ...  (70 bytes)

DEBUG:deebot_client.mqtt_client:Got message: topic=iot/p2p/getWashInfo/HelperMQClientId-**censored**, payload=b'{"header":{**censored**}}'
DEBUG:deebot_client.mqtt_client:Command getWashInfo does not support p2p handling (yet)
DEBUG:deebot_client.mqtt_client.client:Received PUBLISH (d0, q0, r0, m0), 'iot/p2p/getWashInfo/**censored**, ...  (220 bytes)

DEBUG:deebot_client.mqtt_client:Got message: topic=iot/p2p/getWashInfo/**censored**, payload=b'{"header":{**censored**},"body":{"data":{"mode":1,"interval":15,"hot_wash_amount":1,"amount":1,"roomwise":0},"code":0,"msg":"ok"}}'
DEBUG:deebot_client.mqtt_client:Command getWashInfo does not support p2p handling (yet)

They BOTH seem to work as the set commands
Using getWashInterval the API replies with "interval" parameter only
Using getWashInfo the API replies with the full body
"body":
{
"data":
{
"mode":1,
"interval":15,
"hot_wash_amount":1,
"amount":1,
"roomwise":0
},
"code":0,
"msg":"ok"
}

only "mode", "interval" and "roomwise" are in common with your output
and only "roomwise" and "interval" actually change anything in deebot settings. The other parameters are received (the deebot beeps) but bring no change in settings.

XxInvictus added a commit to XxInvictus/client.py that referenced this issue Dec 12, 2024
Ref DeebotUniverse#555
- Add support for Mop Auto-Wash Frequency
- Add Capability to T20/T30 Omni/X5 Pro Omni via `p1jij8.py`
XxInvictus added a commit to XxInvictus/client.py that referenced this issue Dec 13, 2024
Ref DeebotUniverse#555
- Add support for Mop Auto-Wash Frequency
- Add Capability to T20/T30 Omni/X5 Pro Omni via `p1jij8.py`

Fix missing list seperator

Make pre-commit happy

Fix error in SetAutoMopWashFrequency test case

Small fix to resolve Mop Auto Wash and checkers not agreeing with int
XxInvictus added a commit to XxInvictus/client.py that referenced this issue Dec 13, 2024
Ref DeebotUniverse#555
- Add support for Mop Auto-Wash Frequency
- Add Capability to T20/T30 Omni/X5 Pro Omni via `p1jij8.py`

Fix missing list seperator

Make pre-commit happy

Fix error in SetAutoMopWashFrequency test case

Small fix to resolve Mop Auto Wash and checkers not agreeing with int

Ruff lint/format
XxInvictus added a commit to XxInvictus/client.py that referenced this issue Dec 13, 2024
Ref DeebotUniverse#555
- Add support for Mop Auto-Wash Frequency
- Add Capability to T20/T30 Omni/X5 Pro Omni via `p1jij8.py`

Fix missing list seperator

Make pre-commit happy

Fix error in SetAutoMopWashFrequency test case

Small fix to resolve Mop Auto Wash and checkers not agreeing with int

Ruff lint/format

Ruff Linting/Fixes
@XxInvictus
Copy link
Contributor

XxInvictus commented Dec 13, 2024

#677 should be good to go for supporting the Auto Mop-Wash time, just need to create the PR against the homeassitant/core repo to add the support for the entities on that end.

XxInvictus added a commit to XxInvictus/client.py that referenced this issue Dec 14, 2024
Ref DeebotUniverse#555
- Add support for Mop Auto-Wash Frequency
- Add Capability to T20/T30 Omni/X5 Pro Omni via `p1jij8.py`

Fix missing list seperator

Make pre-commit happy

Fix error in SetAutoMopWashFrequency test case

Small fix to resolve Mop Auto Wash and checkers not agreeing with int

Ruff lint/format

Ruff Linting/Fixes
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

No branches or pull requests

5 participants