marotoweb / home-assistant-vacuum-viomise

Hacky Home assistant support for Viomi SE (V-RVCLM21A)
21 stars 3 forks source link

Cannot connect to vacuum #3

Closed PieterGoossens closed 3 years ago

PieterGoossens commented 3 years ago

Thanks for updating the installation instructions, installing it through HACS works like a charm! Unfortunately, my Viomi SE vacuum reports to be unavailable. My Xiaomi Mija 1S is working without any issues. I've extracted the tokens using the extractor script found here: https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor

$ python3 token_extractor.py
....
Server (one of: cn, de, us, ru, tw, sg, in, i2) Leave empty to check all available:

Logging in...
Logged in.

Devices found for server "cn":
   ---------
   NAME:  Vacuum-Upstairs
   ID:    2613xxxxx
   IP:    192.168.40.101
   TOKEN: 6e39xxxxxxxxxxxxxx6e4c
   MODEL: roborock.vacuum.m1s
   ---------

Devices found for server "de":
   ---------
   NAME:  Vacuum-Downstairs
   ID:    3754xxxxx
   IP:    192.168.40.102
   TOKEN: 5477xxxxxxxxxxxxxx6456
   MODEL: viomi.vacuum.v19
   ---------

After which I've added the following to configuration.yaml and restarted HA:

vacuum:
  - platform: xiaomi_miio
    host: 192.168.40.101
    token: 6e39xxxxxxxxxxxxxx6e4c
    name: Vacuum upstairs
  - platform: viomise
    host: 192.168.40.102
    token: 5477xxxxxxxxxxxxxx6456
    name: Vacuum downstairs

Any ideas why the Viomi vacuum doesn't work?

marotoweb commented 3 years ago

Can you check the log if there are any warnings or errors related?

PieterGoossens commented 3 years ago

The log is filled with these lines:

2021-01-24 23:22:17 WARNING (SyncWorker_2) [custom_components.viomise.vacuum] Got exception while fetching the state: Unable to discover the device 192.168.40.102
2021-01-24 23:22:37 WARNING (SyncWorker_3) [custom_components.viomise.vacuum] Got exception while fetching the state: Unable to discover the device 192.168.40.102
2021-01-24 23:22:57 WARNING (SyncWorker_1) [custom_components.viomise.vacuum] Got exception while fetching the state: Unable to discover the device 192.168.40.102
2021-01-24 23:23:17 WARNING (SyncWorker_5) [custom_components.viomise.vacuum] Got exception while fetching the state: Unable to discover the device 192.168.40.102
2021-01-24 23:23:37 WARNING (SyncWorker_4) [custom_components.viomise.vacuum] Got exception while fetching the state: Unable to discover the device 192.168.40.102
2021-01-24 23:23:57 WARNING (SyncWorker_3) [custom_components.viomise.vacuum] Got exception while fetching the state: Unable to discover the device 192.168.40.102
2021-01-24 23:24:17 WARNING (SyncWorker_0) [custom_components.viomise.vacuum] Got exception while fetching the state: Unable to discover the device 192.168.40.102
marotoweb commented 3 years ago

This happen when the device cannot be contacted, is it on, is the IP address correct?

Try using the miiocli from https://github.com/rytilahti/python-miio to see if you can contact the device with the same data you are using.

Are you blocking its access to the internet? https://python-miio.readthedocs.io/en/latest/troubleshooting.html#intermittent-connection-issues-timeouts-xiaomi-vacuum

PieterGoossens commented 3 years ago

SOLVED: The problem was caused by the issue described here: https://python-miio.readthedocs.io/en/latest/troubleshooting.html#discover-devices-across-subnets

The Viomi SE vacuum was in a different VLAN than my Home Assistant installation. As soon as I connected HA to the same VLAN everything started working. Xiaomi vacuums (non Viomi) appear to communicate differently and are not affected by VLAN boundaries. Thanks again for your assistance!