Complete lost with getting xiaomi mi robot vacuum working

Hi I am completely lost and have so much to learn. I have tried to lookaround, but as I am so lost this is a little ouside my depth right now.

I have hass.io installed on a raspberry pi zero w. Got it yesterday and is my first venture into raspberry pi (I have played arpund with Arduino and Esp8266 microprocessors previsouly).

I have followed all I can find on getting this setup in Home Assistant but getting an error shown below. This is from the home-assistant.log

2018-11-08 22:13:00 ERROR (MainThread) [homeassistant.config] Invalid config for [vacuum.xiaomi_miio]: required key not provided @ data['host']. Got None
required key not provided @ data['token']. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/vacuum.xiaomi_miio/

I got the key by downgrading mi home to 5.0.30 and using miToolKit. It returned as ā€œ996e7972474555675647704345547377ā€ (modified a few digits when posting it here in case this is not good to make public.

I then put the following in configuration.yaml

# Xiaomi Vaccuum
vacuum:
- platform: xiaomi_miio
  host: 192.168.1.116
  token: 996e7972474555675647704345547377

Could be as simple as your spacing. Try this and see if it works.

# Xiaomi Vaccuum
vacuum:
  - platform: xiaomi_miio
    host: 192.168.1.116
    token: 996e7972474555675647704345547377

Unfortunately that didn’t fix it but thanks for the reply as I will keep that in mind in future.

This is my whole home-assist.log after the change and reboot.

2018-11-08 23:13:40 WARNING (MainThread) [homeassistant.setup] Setup of recorder is taking over 10 seconds.
2018-11-08 23:13:40 WARNING (MainThread) [homeassistant.setup] Setup of frontend is taking over 10 seconds.
2018-11-08 23:13:43 ERROR (MainThread) [homeassistant.loader] Unable to find component host
2018-11-08 23:13:43 ERROR (MainThread) [homeassistant.setup] Setup failed for host: Component not found.
2018-11-08 23:13:44 ERROR (MainThread) [homeassistant.loader] Unable to find component token
2018-11-08 23:13:44 ERROR (MainThread) [homeassistant.setup] Setup failed for token: Component not found.
2018-11-08 23:13:46 ERROR (MainThread) [homeassistant.config] Invalid config for [vacuum.xiaomi_miio]: required key not provided @ data['host']. Got None
required key not provided @ data['token']. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/vacuum.xiaomi_miio/
2018-11-09 00:13:49 ERROR (MainThread) [homeassistant.components.updater] Got unexpected response: None

Are you sure the Vacuum is on that IP? Have you given it a static IP?

Yes it’s definitely that ip. I haven’t given it a static ip yet (that was in the to do list), but I can ping it at that ip and it’s labelled as Xiaomi Rockrobo in the router up list.

This was the response from MiToolkit when extracted the toekn

rockrobo.vacuum.v1 - Rosie - 996e7972474555675647704345547377 - 192.168.1.116

Hmmm. Now I am confused. It is showing up now.

I have no idea what is different apart from resetting the config file (which returned the username back to admin) and rebooting again (I have rebooted multiple times).

At least it works now.

Good stuff. Sometimes reboots fix everything.

Anytime I update HASS or my RPi, I have to restart HASS 3 times to get all my Wemo’s to show up. Frustrating.

1 Like

Maybe this might be a new post… My automation has been done with Tasker until now, so still not confident in what I am doing in Home Assistanet yet…

So this could be completely wrong.

What I would like to do is detect when the vacuum brush is blocked and restart the vacuum automatically.

I guess eventually I would limit the amount of times it reset in half an hour to 2 resets in case the brush is actually blocked rather than just false triggered on the carpet. But for now getting it work is my first goal.

In my configuratiion.yaml I have this to get the status…

platform: template
sensors:
vacuum_status:
value_template: ā€˜{{ states.vacuum.xiaomi_vacuum_cleaner.attributes.status }}’

and this in automation which I hope triggers when the status changes… but this is copying parts from online so I may have the whole concept wrong…

alias: Chachaomi_limpiando
trigger:
platform: state
entity_id: sensor.vacuum_status
from: Cleaning
to: Blocked
action: vacuum.start
data: