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

Support for viomi.vacuum.v18 (Viomi Robot Vacuum S9) #913

Closed
jonasbark opened this issue Jan 19, 2021 · 10 comments · Fixed by #1581
Closed

Support for viomi.vacuum.v18 (Viomi Robot Vacuum S9) #913

jonasbark opened this issue Jan 19, 2021 · 10 comments · Fixed by #1581

Comments

@jonasbark
Copy link

jonasbark commented Jan 19, 2021

Describe the solution you'd like
Support for the mentioned vacuum device

Device information:
If the enhancement is device-specific, please include also the following information.

  • Name(s) of the device: Viomi Robot Vacuum S9

Use miiocli device --ip <ip address> --token <token>.

Model: viomi.vacuum.v18
Hardware version: Linux
Firmware version: 1.2.0_2192

Additional context
I'm always receiving timeouts when using e.g.
miiocli viomivacuum --ip 192.168.0.145 --token *** info
I increased the timeout but no luck. None of the requests work - I tried 4 different WIFIs without any change.

Interestingly a similar response happens with the Xiaomi Cloud API (using OpenHAB) - all the requests will result in e.g.

{"code":-3,"error":{"code":-3,"message":"timeout"},"id":5,"message":"timeout","otlocalts":1611060756356848}

or

{"code":-9999,"error":{"code":-9999,"message":"user ack timeout"},"id":8,"message":"user ack timeout","otlocalts":1611060790397708}

responses.

The Xiaomi Home app works however using local network or remotely - I'm still puzzled how.

INFO:miio.cli:Debug mode active
DEBUG:miio.protocol:Unable to decrypt, returning raw bytes: b''
DEBUG:miio.miioprotocol:Got a response: Container:
    data = Container:
        data = b'' (total 0)
        value = b'' (total 0)
        offset1 = 32
        offset2 = 32
        length = 0
    header = Container:
        data = b'!1\x00 \x00\x00\x00\x00\x13\xa2\x8c\x08`\x074\x11' (total 16)
        value = Container:
            length = 32
            unknown = 0
            device_id = unhexlify('13a28c08')
            ts = 2021-01-19 19:33:37
        offset1 = 0
        offset2 = 16
        length = 16
    checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16)
DEBUG:miio.miioprotocol:Discovered 13a28c08 with ts: 2021-01-19 19:33:37, token: b'ffffffffffffffffffffffffffffffff'
DEBUG:miio.miioprotocol:192.168.0.145:54321 >>: {'id': 1, 'method': 'miIO.info', 'params': []}
DEBUG:miio.miioprotocol:192.168.0.145:54321 (ts: 2021-01-19 19:33:37, id: 1) << {'partner_id': '', 'id': 1, 'code': 0, 'message': 'ok', 'result': {'hw_ver': 'Linux', 'fw_ver': '1.2.0_2192', 'ap': {'ssid': 'Turmbraeu', 'bssid': 'd4:3f:cb:88:5c:28', 'freq': '2412', 'rssi': '-58'}, 'sn': '10109000001349', 'netif': {'localIp': '192.168.0.145', 'mask': '255.255.255.0', 'gw': '192.168.0.1'}, 'miio_ver': 'miio-client 3.5.5', 'model': 'viomi.vacuum.v18', 'mac': '64:90:c1:6f:6e:1b', 'token': '776b6e3548635069325737444533326d', 'life': 30154}}
@rezmus
Copy link

rezmus commented Jan 20, 2021

/miotspec/* cloud api, however it should work with local miio api (using miot cmds) same as other viomi robots.

@jonasbark
Copy link
Author

I still had no luck locally - openhab/openhab-addons#9878 hinted me that it might be a cloud only device.

@rezmus
Copy link

rezmus commented Jan 20, 2021

while many new devices force cloud way to talk to device, they should still work fine via local api. i remember many viomi models had issues with local api. ppl made some workarounds to resend command multiple times or something with cmd id generation. try to dig into old issues. i'm pretty sure i talked to v18 via remote rpc api when my friend had one.

@rezmus
Copy link

rezmus commented Jan 20, 2021

> {"method":"miIO.info","params":[],"id":4254}
< {"code":0,"id":4254,"message":"ok","partner_id":"","result":{"ap":{"bssid":"28:d1:27:xx:xx:xx","freq":"2412","rssi":"-51","ssid":"T-Mobile-B528-XXXX"},"fw_ver":"1.2.0_2192","hw_ver":"Linux","life":791124,"mac":"64:90:c1:xx:xx:xx","miio_ver":"miio-client 3.5.5","model":"viomi.vacuum.v18","netif":{"gw":"192.168.31.1","localIp":"192.168.31.xx","mask":"255.255.255.0"},"sn":"101603000xxxxx","token":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}}

> {"method":"get_properties","params":[{"did":"X","siid":8,"piid":4}],"id":4258}
< {"code":0,"id":4258,"result":[{"code":0,"did":"X","piid":4,"siid":8,"value":"girl_zh"}]}

@jonasbark
Copy link
Author

You're right indeed. I'm getting responses. I'll dig in deeper.

@fokcuk
Copy link

fokcuk commented Jun 24, 2021

Hi everyone and @jonasbark
Did you get anywhere with Viomi S9?

@blakadder
Copy link

I got mine to work locally but after some time it stops responding and give the 9999 error. After a factory reset and repair it'll work locally again, but only for a while

@fokcuk
Copy link

fokcuk commented Jul 4, 2021

I gave up on local control and just using cloud one. 9999 error usually means cloud only command. I can do basic controls as local but zone cleaning is cloud only it seems

@r3pek
Copy link

r3pek commented Dec 29, 2021

@fokcuk how are you using it with the cloud? Is it integratable with Hass?

@blakadder
Copy link

ha0y/xiaomi_miot_raw#169

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants