humbertogontijo / python-roborock

Python library & console tool for controlling Roborock vacuum
GNU General Public License v3.0
58 stars 25 forks source link

Support for Roborock Zeo One #197

Open efstajas opened 5 months ago

efstajas commented 5 months ago

Hey there! I'm wondering whether supporting the Roborock Zeo One washer / drier is at all planned or even considered in-scope for this package. It'd be amazing if this would eventually be supported, maybe at least with a limited feature set (e.g. remote start).

The Zeo One uses the same Roborock app as the vacuums supported by this package already. The interface appears relatively simple compared to the vacuums — within the app, you can only view the current status, select a program, start / stop / pause if remote control has been enabled on the appliance, and set a few settings that aren't all that important (detergent auto dosing etc).

I own a Zeo One and would be more than happy to support with reverse-engineering and, assuming you consider it in-scope, maybe even give it a shot myself, though I have very limited python experience.

Lash-L commented 5 months ago

It uses a different protocol similar to the dyad vacuums. I am almost done adding support for those that should make support for the washer dryers easier. But they require some RE still

efstajas commented 5 months ago

Great to hear, thanks. Let me know if I can help with the RE work somehow, happy to help.

Lash-L commented 5 months ago

Hi @efstajas

I've finally got everything in a decent state.

v1.0.0 of the api adds support for the A01 devices (dyad + washing machine)

and https://github.com/home-assistant/core/pull/115331 adds support to HA for Dyad vacuums.

If you are still interested, I would happily take your help getting the Zeo incorporated.

efstajas commented 5 months ago

Great news! For sure, just lmk what to do.

Lash-L commented 5 months ago

Okay if you want to add me on discord it may be easier. conway220 is my username, or you can search for Lash-L on the HA discord.

But to start off with you need to do the following:

I just did a lot of the RE myself right now based on some api calls, so lets see how this goes.

Clone this repo: https://github.com/humbertogontijo/python-roborock/tree/zeo_support

As a rough start: api = RoborockApiClient("email_here") ud = await api.pass_login("pass_here") hd = await api.get_home_data_v2(ud) client = RoborockMqttClientA01(ud, DeviceData(Put the device from hd here, put the model from hd.products here), put the category from hd.products here) print(await client.update_values([RoborockZeoProtocol.MODE (You can try a list of all of them if you want.]))

yangqian commented 4 months ago

Thanks. I only have a Zeo One/H1 and running the following

from roborock.web_api import RoborockApiClient
from roborock.version_a01_apis import RoborockMqttClientA01
from roborock import DeviceData
from roborock.roborock_message import RoborockZeoProtocol
import asyncio

async def main():
    api = RoborockApiClient("email_here")
    ud = await api.pass_login("pass_here")
    hd = await api.get_home_data_v2(ud)
    device = hd.devices[0]
    cat = hd.products[0].category
    model = hd.products[0].model
    client = RoborockMqttClientA01(ud,DeviceData(device,model),cat)
    print(await client.update_values([RoborockZeoProtocol.MODE,RoborockZeoProtocol.STATE]))

if __name__ == '__main__':
    asyncio.run(main())

gives {204: 'wash_and_dry', 203: 'standby'}, which suggests that the API is working properly.

Lash-L commented 3 weeks ago

Basic zero support has been added. Further support should be possible and PRs are welcome.