Open NEVdataDyne opened 11 months ago
Screenshots
Thanks a lot :heart_eyes:. It will take some time to implement them all :)
As the cleaning mode is important for you, I gave it a quick look and have some questions:
Ecovacs T20 cleaning mode.txt
What is the bdTaskID
? Looks like it can be a unix time as it is similar to the value of ts
but it a lot longer
I don't know about bdTaskID but I performed the follwing tests. They all worked bdTaskID = 1696155367474117; ts=1696155367471 (new request, no modifications) bdTaskID = 1695925609322691; ts=1696155367471 (took the bdTaskID from a request in the file provided three days ago and kept new timestamp) bdTaskID = 1695925609322691; ts=1695925609319 (changed both bdTaskID and ts to the values from the file provided three days ago) bdTaskID = HAisAwesome; ts=HAisAwesome (put a string where there should be an integer)
I think that if you put the same value as in ts, it'll work fine 😄
Can you test what happens if we omit bdTaskID
? If we don't need it, we should not send it to have bigger backward compatibility.
Yes, I tested and bdTaskID is not needed at all
I realized that I'd need two other functionalities. The first one is the "cleaning pads interval" with the possibility to put a higher number in "interval" than 15 (I'll make some tests but I'd say 30 and 60 (min) ). This is because some weeks ago there seems to have been an update and since then, when the robot cleans a floor where the station is not present, after the "cleaning pad interval" has been reached, it will search endlessly for its station...
The second one would be the washing moping pads (in "station start action" file) because of course, before putting the robot on another floor where there is no station, one need to ask the robot to wet and clean the pads. In the "station start action" file, I put one entry for washing moping pads with hot water and one for washing moping pads without hot water but they are the same. The fact that it uses hot water or not comes from the command in the file "station hot water washing option" (I do not need this option in HA since I always use the same (hot water)).
I confirm that bdTaskID is not necessary for both commands above.
I put 6000 (min) for the "cleaning pads interval" and the robot seemed to accept it. I think adding 30 and 60 min would be perfect (or allowing any input as a parameter). I'll make some tests to confirm that if I put 60, the robot do clean using the mops for >15min without returning to the station (I don't have a house big enough for the robot to clean 60 min straight so if it cleans for >15min I'll consider the test to be a success 😆 )
Thank you so much to both of you for working on this. Not sure how I can help but let me know where to tip :)
I confirm that putting 60min (or any value) for the cleaning pads interval works fine to avoid deebot to return cleaning the mopping pads while cleaning a floor where there is no station. Btw I could fulfill all my requirements by using the restful command integration to send each missing command from the deebot integration that I needed.
I will add the commands after I have changed the whole lib and integration to use device capabilities as not all devices support all features/commands.
For example my bot does not support V2 commands and newer support only support V2 commands
I understand, no problem.
I thought I could simply use hard coded restful commands to perform the actions and change settings I wanted but unfortunately the token changes with time. Is there a variable where I can get it from your integration somehow?
There is no easy way to get it as the token is refreshed automatically in the authenticator.
But I think it would be easier if you add the missing commands to this integration and add support for the T20. For the work mode command, I have created two PRs one with the command logic in the library (https://github.com/DeebotUniverse/client.py/pull/330/files) and one to add an entity to this component (https://github.com/DeebotUniverse/Deebot-4-Home-Assistant/pull/449)
Could you please review the PR's and maybe also test it? I have added "blind" the partly capabilities of the T20 Omni here. It would be very helpful if you could review/test it. I don't have your model so I can't do it. Note the capabilities are only partly with the new work_mode command. When a new command is added the capabilities will be extended.
As I'm currently a little bit short on time, could you add the remaining commands to the library following the example above? One PR per command please as this helps reviewing it. Please feel free to comment, if you need any help.
I want to test your code however could you please provide me some hints or guidance as to how to install the version including the pull requests into my HA?
If I understand correctly, I need somehow to take your project into my github, then I need to merge your pull requests and then install that into my HA? If yes that's a lot of steps where I need to figure out how to do it (I know I can do it but with my current knowledge that'll take me some time). I see that in your pull request DeebotUniverse/Deebot-4-Home-Assistant#449 it says that there are some unsuccessful merges, can this be ignored?
Currently it is not possible to install a PR directly with HACS. For each PR, the bot will create a zip file, which must be downloaded and extract in [config folder]/custom_components/deebot
. Can you test it like this?
I downloaded the zip file from this link https://github.com/DeebotUniverse/Deebot-4-Home-Assistant/pull/449
Then I went to HA through samba share and replaced the content from config\custom_components\deebot with the content of the zip file.
I restarted the Home assistant virtual machine.
I don't see a "work mode" anywhere
Did I do something wrong?
No option to set work mode in device
No Vacuum: service related to a work mode (not complete list in screenshot)
No config or diagnostic related to a working mode
It looks the same for me when I tried. I get this error in the logs:
Logger: [homeassistant.components.select](http://homeassistant.components.select/)
Source: helpers/entity_platform.py:359
Integration: Select (documentation, issues)
First occurred: 12:20:20 (3 occurrences)
Last logged: 13:11:57
Error while setting up deebot platform for select
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 359, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/deebot/select.py", line 67, in async_setup_entry
controller.register_platform_add_entities(
File "/config/custom_components/deebot/controller.py", line 109, in register_platform_add_entities
new_entites.append(entity_class(device, capability, description))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/deebot/select.py", line 88, in __init__
self._attr_options = self.entity_description.options_fn(capability)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/deebot/select.py", line 50, in <lambda>
options_fn=lambda cap: [mode.display_name for mode in cap.types],
^^^^^^^^^
AttributeError: 'CapabilitySet' object has no attribute 'types'
It is fixed in the library.
A restart of HA should be enough to install the new library version. If the error still exists, please login to the HA container (or where HA is running) and run pip uninstall deebot-client
and restart. This forces a new installation of the library.
Otherwise comment here :) Thanks for testing. Please always attach the logs as I need them to identify the problem
That has resolved the issue. I can confirm that the work mode selection is now available and changes are correctly reflected in the Ecovacs app.
Perfect to hear, so I can merge it the next days.
@schmoogol Can I ask you to test if the T20 supports the getNetInfo
command?
You can easily test it with the developers tools.
deebot_custom_command
service: vacuum.send_command
data:
command: getNetInfo
target:
entity_id: vacuum.todo
If the command is supported, you should get something similar to
event_type: deebot_custom_command
data:
name: getNetInfo
response:
header:
[REMOVED as not relevant]
body:
code: 0
msg: ok
data:
IP: [REMOVED]
ssid: [REMOVED]
rssi: "-68"
wkVer: 0.1.2
mac: [REMOVED]
The only interesting part is located under data->response->body->data. It would be nice to share all field names with their value type (int, float, string,...)
Could you please repeat the above steps with the command getWifiList
Thanks in advance :) With these commands, I can retrieve the mac address which allow to link the vacuum with other device entires like unifi and co
Could you tell me where to find the updated files to be installed?
The getNetInfo
and getWifiList
commands both work. I've anonymised my IP, SSID and MAC for the readouts below - is there a way for me to get it to tell me the value types or we just have to infer them?
event_type: deebot_custom_command
data:
name: getNetInfo
response:
header:
[REMOVED]
body:
code: 0
msg: ok
data:
ip: 192.168.123.456
ssid: MySSID
rssi: "-53"
wkVer: 0.1.2
mac: 12:A3:B4:56:78:91
event_type: deebot_custom_command
data:
name: getWifiList
response:
header:
[REMOVED]
body:
code: 0
msg: OK
data:
mac: 12:A3:B4:56:78:91
list:
- ssid: MySSID
rssi: 67
ip: 192.168.123.456
mask: 255.255.255.0
state: ok
Could you tell me where to find the updated files to be installed?
@NEVdataDyne, you shouldn't have to manually add any additional files. I ran the pip uninstall
command suggested above from within the HA container then restarted HA and the updated version of deebot-client was automatically installed.
@schmoogol Thanks for testing :)
As the PR is merged, the branch doesn't exist anymore, but the feature is already on dev, so you can easily install via hacs the "dev" version
Hello,
Because I want to understand everything, I have (too many?) questions...
I tried to execute the "pip uninstall deebot-client" command. I am running HA in a VM on ESXi and on the virtual screen I get the HA CLI, not the ssh one. I made some researches and I am still confused between HA installations where some people can run ssh commands and some people can't. Also I didn't find a clear answer as to how I need to force the uninstall without using "pip uninstall deebot-client". Do you know how I can either run ssh commands or uninstall without using pip uninstall?
Anyway, I did install the dev version using HACS, rebooted HA and I get the same error schmoogol had before you fixed it. I suppose I really need to either find a way to run pip uninstall or find an alternative?
Unsing web terminal add on, I get this message when trying to uninstall deebot-client
I think the HA CLI should be the same as using ssh but keeping in mind that HA OS runs everything in docker containers. As the uninstall command needs to be run inside the HA container you could try docker exec -it homeassistant bash
then run the pip uninstall deebot-client
command within the container.
I'm not exactly sure how VM installs work but on my Pi install I have to use the 'Advanced SSH & Web Terminal' add-on with protection mode off to run commands within containers.
Unsing web terminal add on, I get this message when trying to uninstall deebot-client
You need to access the terminal where HA is running. I'm not familiar with ESXi and therefore I cannot give you hints there... As already described by @schmoogol, you need to access the container
Got it working, thanks for the explainations! I thought all this docker discussions were due to people running HomeAssistant unsing a docker container and since I am using a VM I didn't think it applied to me...
As I'm currently a little bit short on time, could you add the remaining commands to the library following the example above? One PR per command please as this helps reviewing it. Please feel free to comment, if you need any help.
I created PR https://github.com/DeebotUniverse/client.py/pull/339, as you will probably notice... I had close to no clue of what I was doing so I don't know if my work is helpful or not.
I wanted the cleaning pads interval to be a integer that could be freely set between 1 and 60, I tried to do something like that combining what you did with the work mode and the volume setting but... it was probably so wrong that wouldn't have helped at all. Then I decided to copy the work mode and went for four predifined values, the three provided by ecovacs and one with 60 min interval so the robot basically never go to the station to clean the pads.
If what I did did help, the next one I'd like to do is the clean mop action and empty dust bin action but these are very different from work mode so I'd need some guidance
Each PR will help as I cannot implement all custom on my own :) I left some comments directly in the PR :)
@edenhaus Could you please implement the base station "Washing moping pads" action so I have an example? I really don't know where to start with this one.
Yes but not within the next two weeks as I have no time.
I tried installing the beta version to see if I could get the map and other functions working for the T20, however I’m throwing this error in the logs, any idea?
`Logger: deebot_client.commands.json.common Source: runner.py:188 First occurred: 9:29:51 PM (12 occurrences) Last logged: 9:30:52 PM
No response received for command "getCachedMapInfo". This can happen if the device has network issues or does not support the command No response received for command "getMapTrace". This can happen if the device has network issues or does not support the command No response received for command "getMajorMap". This can happen if the device has network issues or does not support the command No response received for command "getBattery". This can happen if the device has network issues or does not support the command No response received for command "getSpeed". This can happen if the device has network issues or does not support the command `
I tried installing the beta version to see if I could get the map and other functions working for the T20, however I’m throwing this error in the logs, any idea?
`Logger: deebot_client.commands.json.common Source: runner.py:188 First occurred: 9:29:51 PM (12 occurrences) Last logged: 9:30:52 PM
No response received for command "getCachedMapInfo". This can happen if the device has network issues or does not support the command No response received for command "getMapTrace". This can happen if the device has network issues or does not support the command No response received for command "getMajorMap". This can happen if the device has network issues or does not support the command No response received for command "getBattery". This can happen if the device has network issues or does not support the command No response received for command "getSpeed". This can happen if the device has network issues or does not support the command `
Have you read the thread above and the other issues? There is still a lot missing, including the map, I think this is the same issue as DeebotUniverse/Deebot-4-Home-Assistant#268
Could someone who has some time implement the "Washing moping pads (with hot water)" in "Ecovacs T20 Station start action.txt" so I have an example of a "press button" action?
Got it working, thanks for the explainations! I thought all this docker discussions were due to people running HomeAssistant unsing a docker container and since I am using a VM I didn't think it applied to me...
Could you share with me how you resolved it? My HA is also installed in VM, and my host is MacOS. When I enter the command in terminal, it always shows "pip command not found". Do I need to install more add-on for pip to work?
Got it working, thanks for the explainations! I thought all this docker discussions were due to people running HomeAssistant unsing a docker container and since I am using a VM I didn't think it applied to me...
Could you share with me how you resolved it? My HA is also installed in VM, and my host is MacOS. When I enter the command in terminal, it always shows "pip command not found". Do I need to install more add-on for pip to work?
Never mind. I've figured it out.
Could someone who has some time implement the "Washing moping pads (with hot water)" in "Ecovacs T20 Station start action.txt" so I have an example of a "press button" action?
https://github.com/home-assistant/core/blob/dev/homeassistant/components/ecovacs/button.py
@edenhaus I can see some implementation of buttons but my level in coding is so low, the only way I can develop something is to see exactly what someone had to add in every file of the project and do something similar.
@edenhaus I can see some implementation of buttons but my level in coding is so low, the only way I can develop something is to see exactly what someone had to add in every file of the project and do something similar.
wash pad and hot air drying button/option would be good. or even a send command function that we can trigger would be appreciated :)
love everyone's work on this btw, as so far, its proving to be a better alternative than having to use the deebot app in terms of flexibility. :)
Is there an existing issue for this?
Is your feature request related to a problem?
No
Suggested solution
I'd like for the HA integration to support the "cleaning mode" option of the T20. (this is what is important for me)
However I extracted all options into files with corresponding jsons so it is possible to implement support for all the T20 options and actions.
All files contain options to define how all future cleanings will be performed. One exception is the "Station start action" file where these jsons are command for the station to perform an action.
Update 2023-10-25 : Added action "Wash station sink" in file "Ecovacs T20 Station start action.txt" Update 2023-11-03 : Added "Ecovacs T20 Reset dust bag life span.txt" Update 2023-11-14 : Added get commands