Skip to main content

How To Control Your Xiaomi Robot Vacuum With Google Home

xiaomi robot cleaner integration

Excited to turn your home into the Ultrahouse 3000?

Use Google Home and/or Google Home mini to control your Xiaomi Vacuum with your voice!

Here are the things you need:

This is a brief HOW-TO guide and some of the finer details may be omitted. If you hit any trouble just ask in the comments below. [2019-03-24: Updated walk-through to use the new access methods for Home Assistant]

How It Works

This is how I have mine configured at the moment. A quick overview on how how everything works:

  1. Create a WebApplet in IFTTT (Account required) with an activation phrase (e.g. Release The Hounds)
  2. Pair Google Home Assistant to IFTTT
  3. Now say 'Hey Google, release the hounds' within your Assistant's earshot
  4. Google assistant will forward it to IFTTT
  5. IFTTT will call a web hook (your Home Assistant server)
  6. The Home Assistant Webhook sends the command to your XiaoMi vacuum cleaner
  7. Your vacuum cleaner starts cleaning the house.

Down the road I'd try and see if it's possible to script everything from within Home Assistant.

Know Before You Start

This requires an Internet connection to work. Google Home needs to talk to the Internet to understand your voice commands, and the IFTTT service needs to get into your home network to activate the XiaoMi robot.

Configuring all this may be daunting to people who has never done this before. But by bouncing ideas off each other, you will get all this to work if you stay committed.

Extracting The Damn Token

Let's get the most difficult thing out of the way first - retrieving the XiaoMi token.

This token is an auto-generated password, a special code the XiaoMi robot Vacuum use to verify the person has the authority to control it. Supply the token to your vacuum the wrong token and it will not accept the commands.

New: miio (Added 21 Feb 2018)

This may be the easiest way to extract the token. You'd need a computer with Wifi (be it a computer laptop or a PC with a Wifi dongle).

  1. Find a computer or notebook with Wifi access
  2. Install nodejs (Download the LTS version): Link
  3. Start a new command window (or console or terminal)
  4. run the following command:

    npm install -g miio
  5. Reset the wifi on your robot vacuum (if you have previously registered your vacuum to MiHome you have to delete the device and re-register again)
  6. The XiaoMi wifi should be enabled. Connect your laptop/PC's wifi to this new Wifi LAN. No password is required.
  7. Once connected to the Vacuum Wifi, run the following command:

    miio discover
  8. You should see the token.
  9. Note that the token will no longer be visible once the Vacuum is registered. So if you forget the details you'd have to reset the wifi connection agian.

If you get the token now, skip to the next page. Otherwise continue below to find other ways to extract the token.

Apple iPhone

There are a lot of information out there on how to extract this token from your iPhone. I have spent a day trying and just failed to work it out.

Perhaps it's because my iPhone isn't jail broken. If you want a sure-proof way to get the token with an iPhone, don't!

Use an android phone or tablet instead! Hey you are using Google Home, there are bound to be a Windows computer and Android device lying around somewhere. Because MiHome is cloud based, all you need to do is to install MiHome to an Android device, log in to your XiaoMi account and everything you need will be transferred over. Here's how to do it:

  1. Find an android phone.
  2. Install MiHome from the Play Store.
  3. Sign in to MiHome with your XiaoMi account.
  4. Your robot vacuum will show up if you have already paired the Robot Vacuum earlier. If not just setup it up now.
  5. And that's it! The XiaoMi token is now stored on your Android phone and is now ready for extraction.

Android Phone

The quickest way to do perform the token extraction is from an Android device, and using a tool call the MiTookkit:

  1. Turn on USB debugging (If you havn't done this before you need to activate Developer Settings menu).
  2. Your Windows computer should already have Java installed. If not, download and install the Java Runtime Environment (JRE).
  3. Connect your Android device to your Windows computer.
  4. Your Android device will prompt you for authorisation. Click Allow or Accept.
  5. Download the latest version of MiToolkit in a Windows computer. Extract the archive and run the MiToolKit program.
  6. Click the button that says 'Extract Token'.
  7. Read the instructions, and click the 'Extract Token' again to begin extraction.
  8. A prompt will remind you not to set a password. Click the 'OK' button to continue.
  9. Now your Android Device will have a prompt about performing a full backup. Click the 'Back Up My Data' button (Note this prompt will be different across the Android platform).
  10. If you succeed, the token will be displayed in the text box like so:
  11. This token is re-generated every time you pair the XiaoMi robot vacuum to your MiHome. So if you delete this device from MiHome and repair, you have to do this token extraction all over again.

You are one step closer with this token. We now move on to Home Assistant. 

Home Assistant

Installation

There are several ways to run Home Assistant - e.g. on a Raspberry Pi, or on a normal computer. Since I already have a home lab running at home, I'm using the PC method (running in a virtual computer). Once you have a Linux machine setup, you can install Home Assistant easily by following these simple instructions: Installation in virtualenv.

A better solution for most people would be to run Home Assistant on a Raspberry Pi. I have created a HOWTO detailing the steps of installing Hassbian. If you don't have a Home Assistant setup, buy a Pi and install Hassbian now.

Basic HTTP Server configuration

This section already assumes you're using HTTPS to secure your web page. Newer versions of Home Assistant forces you to use an account now. If you're still using an older version that requires API_PASSWORD, update to the latest version now.

Login to your Home Assistant computer, and edit the configuration.yaml file (Usually located in /home/homeassistant/.homeassistant). If you are new to Linux, use the nano editor when editing files. 

In the file, go to the section that says http: and set it to the following

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
http:
#api_password: !secret http_password
base_url: https://<your_ip_or_domain_name_here

Save the file and restart HomeAssistant.

Home Assistant

Adding XiaoMi

Edit configuration.yaml again and now add in the XiaoMi robot Vacuum:

Replace ip_address_of_robot with the IP address of your XiaoMi robot. You can find this information from the MiHome app (Go to your Vacuum, the network information is under General Settings → Network Info). Because the Vacuum is never powered off, the IP address is unlikely to change. But if you want to be safe you can always configure your router or DHCP server to always allocate a specific IP address for your XiaoMi.

Replace super_secret_password_token with the token you have extracted earlier.

Replace name_of_robot with a unique name (this is used to identify different components in the Home Assistant Web App). Now Restart Home Assistant again, and you should see this appear in the dashboard. I'm calling my vac 'The Hounds':

Click the vacuum icon (picture to the left of the name) and you will see all the stats.  Flick the switch in the lower right hand corner, and hear your Vacuum roar (or in my case - bark).

If everything works, well done. You'll need to enable IFFFT In Home Assistant.

Integrate IFTTT Into your Home Assistant

In your Home Assistant portal. Click on Configurations, followed by Integrations:

Scroll down the list of items until you see the entry IFTTT. Click it's configure command.

Copy down the URL on this screen, you'll going to need this later when configuring your IFTTT Web Applets.

Over the next few steps we'll need to jump back and forth between the two IFTT and your Home Assistant Portals.

IFTTT

IFTTT stands for IF This Then That. Refer to this wikipedia article if you are unfamiliar with this protocol. Start your web browser and go to https://ifttt.com. Login to your IFTTT account (or sign up if you don't have one).

IFTTT - Integration with Google Assistant

Register your Google Home/Mini device to your Google Home app. You'll need to do this so your google voice searches will look into the IFTTT ecosystem.

Skip this if you already have already added the Google Assistant IFTTT service.

  1. From your IFTTT portal, click the My Applets (marked in illustration below):
  2. Now click 'Services':
  3. Select All Services:
  4. Enter Google Assistant in the search box, and click the Google Assistant tile:
  5. Click the Connect button:
  6. Follow the prompts and login with your Google Account (Remember to use the same account for Google Home).
  7. When prompted, allow ifttt.com to manage your Google voice commands:

IFTTT - Add Service Webhooks

Skip this if you are already connected to the WebHooks service:

  1. Select All Services:
  2. Find the WebHook service and click the Webhooks picture:
  3. Click the Connect button:

IFTTT - Find Your Secret code for Home Assistant

Home Assistant and IFTTT needs to share the same password. To get this password, follow these instructions:

  1. Login to your IFTTT web page
  2. Click on My Applets → Services.
  3. Find the WebHooks tile and click it.
  4. Click the Settings button located in the top right corner:
  5. You should see this settings page next, copy your special ifttt password (Copy only the password, not the entire URL):
  6. Return to your Home Assistant computer. Edit the configuration.yaml file.
  7. Add a new section for IFTTT like so, replace your_ifttt_special_password with your unique code:
  8. Setup a new Automation to handle IFTTT webhookes, edit your automations.yaml and add the following block:

    - trigger:
    platform: event
    event_type: ifttt_webhook_received
    event_data:
    action: call_service
    action:
    service_template: '{{ trigger.event.data.service }}'
    data_template:
    entity_id: '{{ trigger.event.data.entity_id }}'
  9. Restart Home Assistant. If you get no errors your Home Assistant setup should now be complete!

If you think that was hard, you may not like the next section :).

Linking Everything Together

IFTTT Needs To Find You From The Internet

IFTTT needs to know your IP address because it needs to talk back to your Home Assistant. Unfortunately for most people your Internet IP changes all the time.e.g. Here in Australia most people will get a different IP address when they re-connect to their ISP.

To work around this problem, you need to subscribe to a dynamic hostname service. With a dynamic host name setup, your hostname remains the same regardless what your Internet IP address is. 

DuckDNS is a service that came up while I was researching this subject.  Have not tried this service myself but will do so eventually. Setting up a dynamic hostname is beyond the scope of this article, there are already a lot of resources on the Internet on how to get this working. 

IFTTT Firewall Permissions

Your Internet router's firewall will typically stop IFTTT from talking to your IP directly. Therefore you need allow this permission on your router.

In computer speak - this means forwarding port 8123 into your home assistant computer's IP. Every router does this differently, look for anything that says NAT, Port Forwarding or Virtual Host. Here's an example of mine (called Port Forwarding):

Both these sections are beyond the scope of this article. However feel free to comment below if you want me to help you out on these.

Check your dynamic hostname and firewall rule is working by using an online port checker tool. Enter your personal hostname and port 8123 in the field and click the Check button. 

If all goes well you should see the text 'Port 8123 is open'. If you have gone this far, well done!

Now let's start creating some IFTTT statements!

IFTTT

Now start your Web browser and login to your IFTTT account again.

Go into My Applets → Services and double check you have the following three services installed.

You are ready to create your very first Web Applet!

IFTTT - This Component

Here's your first Web Applet. How to use voice command to start vacuuming.

  1. In My Applets → Services, click the New Applet button:
  2. This took me a long time to work it out. Maybe obvious to people who are used to tablet devices, but not to me. Begin by clicking the word text:
  3. Enter Google in the search file, and click the Google Assistant tile:
  4. Click the 'Say a simple phrase' tile:
  5. In the 'What Do You Want To Say' field, type in the voice command you want to use. e.g. I want to start vacuuming when I say these words - 'Release The Hounds'. You can leave the two optional say fields blank for now (more on this later in trouble shooting).
  6. The last response box is Google home's response to your voice command. In the following example, when I say 'Release the Hounds', Google home will respond with 'Releasing The Hounds'.
  7. Click the Create Trigger button to create the Trigger. You should see the this bit is now replaced with the Google Assistant tile:
  8. This completes the this part of the IFTTT.

In the next page, we will finish the that component.

IFTTT - That Component

In the previous page we have configured the this component of IFTTT. When that condition is true (i.e. when somebody says 'Hey Google, release the hounds!'), an action will be triggered. This action is defined in the that component of the IFTTT Web Applet. To define what happens, continue the configuration:

  1. Click on the text that:
  2. Enter Webhooks in the search field, and click the Webhooks tile:
  3. Click the tile that says 'Make a web request'
  4. Paste the URL given to you by Home Assistant during the IFTTT integration steps. Use this same URL when creating future Web Applets for your Home Assistant. The URL should look like so:

      https://<your_ip_or_domain>/api/webhook/<random_magic_sequence>
  5. The Method should be POST.
  6. The Content Type should be Application/JSON.
  7. The body is where all the magic is at. Enter the following (replacing name_of_robot with the actual name of your robot, specified in your configuration.yaml mentioned here):

      { "action": "call_service", "service": "vacuum.start", "entity_id":"vacuum.name_of_robot"}
  8. Your panel should look something like this (Make sure you fill in your own URL):

  9. Click Create Action to complete.
  10. Click Finish.

You are ready to Rock And/Or Roll. Say the voice command (e.g. Release The Hounds) and see what happens. If the XiaoMi Vacuum starts cleaning, that's it. You've done it!

If nothing happens, or if Google responded with a phrase that's different from what you specified in the this component, go to the next page for troubleshooting.

Trouble Shooting

You can refer to the Home Assistant log file and hopefully it will tell you what the problem is:

Here are some issues I have discovered along the way. If you have a different problem please comment below and I'd address them:

Google Home/Mini responded with the correct phrase, but nothing happens to the Xiaomi Vacuum

Most likely to be a network or communications issues. Follow the checklist and make sure everything is working:

  • IFTTT password is correct in Home Assistant configuration.yaml file
  • Home Assistant password is correct in IFTTT actions
  • Dynamic hostname has the correct Internet IP
  • Port 8123 is open on the Internet
  • Incoming port 8123 is forwarding to the correct IP of your Home Assistant computer

Google Mini/Home responded with an incorrect phrase.

This happens when Google 'speech to text' technology can't work out what you're saying. e.g. .When I say 'release the hounds', Google always return me a google search instead. This means your speech is interpreted incorrectly.

To diagnose this problem, go to MyActivity (either viaGoogle Home app or the https://myactivity.google.com website). Look through your search history until you find the card with your voice activity.

This is the card when I said the phrase 'release the hounds':

So Google thinks I'm saying 'house' instead of 'hounds'. You can click the play button to hear a recording of your voice. The easiest way to fix this problem is to add 'release the house' as the secondary phrase. 

To fix:

  1. Go to your IFTTT, click on My Applets, and find the IFTTT tile:
  2. Click the cog icon (marked with white arrow):
  3. Add the new phrase in the optional field
  4. Click Save
  5. Now say the voice command again. It should work now :)

Other Commands

In your JSON body, the entry

"service": "vacuum.start"

is the command to start the cleaning. You can change the service command to something else for other things. Here's the list (as of 0.90.1):

Command Description
vacuum.clean_spot Tell the vacuum cleaner to do a spot clean-up.
vacuum.locate Locate the vacuum cleaner robot.
vacuum.pause Pause the cleaning task.
vacuum.return_to_base Tell the vacuum cleaner to return to its dock.
vacuum.send_command Send a raw command to the vacuum cleaner.  Parameters for the command. { "key": "value" }
vacuum.set_fan_speed vacuum.set_fan_speed
vacuum.start Start or resume the cleaning task.
vacuum.start_pause Start, pause, or resume the cleaning task.
vacuum.stop Stop the current cleaning task.
vacuum.toggle No idea what this is doing
vacuum.turn_off Stop the current cleaning task and return to home.
vacuum.turn_on Start a new cleaning task.
vacuum.xiaomi_clean_zone Start the cleaning operation in the selected areas for the number of repeats indicated.
xiaomi_remote_control_move Remote control the vacuum cleaner, make sure you first set it in remote control mode with `remote_control_start`.
xiaomi_remote_control_move_step Remote control the vacuum cleaner, only makes one move and then stops.
xiaomi_remote_control_start Start remote control of the vacuum cleaner. You can then move it with `remote_control_move`, when done call `remote_control_stop`.
xiaomi_remote_control_stop Stop remote control mode of the vacuum cleaner.

Some of these services require additional key value/pairs in the JSON body. You can refer to the Home Assistant API for more information.

Questions?

Please comment below if you have any questions or suggestions. Check out the Home Automation section for more articles like these.

I'm trying new things on the social media. If you are an audiophile, or am interested in Home Automation/Systems Integration, please join the following community:

That's it for now. Still finding new ideas for home automation. Be on the lookout for more in the future.

Comments

Radek (not verified) Sat, 18/11/2017 - 07:55

Hi - i’m trying to get token by MiToolkit but still i have error "There seems to be an error with the backup, it is way to small" ;(

agent_kith Sat, 18/11/2017 - 20:49

In reply to by Radek (not verified)

That would suggest the backup failed. Somethings you can check:

  • Did you turn on ADB debugging? When MiToolkit is backing up your phone, there should be a prompt on your phone asking you to enter a password. If you don’t see this screen, that means ADB debugging wasn’t set or permissions not given
  • Do you have Java (JRE) installed?

Radek (not verified) Sun, 19/11/2017 - 14:32

In reply to by agent_kith

Yes i have ADB debugging On and Java (JRE) installed ;/ phone asked me about permission and password for backup after he opened Mi app but i still got error "way too small". It looks like backup was made but didnt transfer do computer. Is it possible to find it by android file manager app??

agent_kith Sun, 19/11/2017 - 23:55

In reply to by Radek (not verified)

If your device is rooted yes, you can just download the database and use sqlite3 to retrieve the token. The Internet already have instructions on how to do that.

When you start your MiHome app do you see youself logged in to the XiaoMi cloud, and also see your Robot Vaacuum in the list?

Do you have another Android device you can from?

Marcin (not verified) Mon, 27/11/2017 - 05:57

can you help me with this

2017-11-27 21:32:26 ERROR (SyncWorker_0) [homeassistant.util.yaml] while scanning a simple key in "C:\Users\marci\AppData\Roaming.homeassistant\secrets.yaml", line 6, column 1 could not find expected ‘:’ in "C:\Users\marci\AppData\Roaming.homeassistant\secrets.yaml", line 7, column 1 2017-11-27 21:32:26 ERROR (MainThread) [homeassistant.config] Invalid config for [http]: string value is None for dictionary value @ data[’http’][’api_password’]. Got None. (See C:\Users\marci\AppData\Roaming.homeassistant\configuration.yaml, line 26). Please check the docs at https://home-assistant.io/components/http/ 2017-11-27 21:32:26 ERROR (MainThread) [homeassistant.setup] Setup failed for http: Invalid config. 2017-11-27 21:32:26 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of websocket_api. Setup failed for dependencies: http 2017-11-27 21:32:26 ERROR (MainThread) [homeassistant.setup] Setup failed for websocket_api: 2017-11-27 21:32:26 ERROR (MainThread) [homeassistant.components] Testing configuration at C:\Users\marci\AppData\Roaming.homeassistant 2017-11-27 21:32:26 ERROR (SyncWorker_0) [homeassistant.util.yaml] while scanning a simple key in "C:\Users\marci\AppData\Roaming.homeassistant\secrets.yaml", line 6, column 1 could not find expected ‘:’ in "C:\Users\marci\AppData\Roaming.homeassistant\secrets.yaml", line 7, column 1 2017-11-27 21:32:26 INFO (MainThread) [homeassistant.setup] Setting up introduction 2017-11-27 21:32:26 INFO (MainThread) [homeassistant.setup] Setting up recorder 2017-11-27 21:32:26 ERROR (MainThread) [homeassistant.config] Invalid config for [http]: string value is None for dictionary value @ data[’http’][’api_password’]. Got None. (See C:\Users\marci\AppData\Roaming.homeassistant\configuration.yaml, line 26). Please check the docs at https://home-assistant.io/components/http/

R (not verified) Sat, 02/12/2017 - 14:42

Thanks for sharing the setup.

I was able to setup everything, except one.

When i ask my Google home to Start the vacuum. It just responds "Starting the cleaner", but it just does not start.

When i go to Applet activities in IFTTT website, it says "Applet Skipped".

However I am able to control the vacuum directly from Home Assistant. Just the integration from IFTTT to Home Assistant is broken i guess.

Can you please guide?

agent_kith Sat, 02/12/2017 - 21:18

In reply to by R (not verified)

Looks like you’re router/firewall isn’t setup properly yet for the Webhook to connect back to your Home Assistant. So the good news is you’re halfway there.

I touched on this in page 9 of the tutorial with an example. Refer to your router manual and see how to setup a NAT/PortForwarding rule to map the webhook request back to your HomeAssistant in your LAN.

If you have problems just tell me the model number of your router and I’d see if I can guide you through it.

ghizmo82 (not verified) Mon, 04/12/2017 - 21:08

I solved the problem, everything worked, goggle home mini responded to my command but did not operate the vacuum, I followed the guide word by word …. I solved eliminating in the "make a web request" the words written under the box "body "and now work fine.Thanks a lot.

Bluerider (not verified) Fri, 12/01/2018 - 11:39

In reply to by ghizmo82 (not verified)

Hi ghizmo82,

How did you configured google home mini to work with this?

From the guide I understood that you need to have a dedicated google home server.

Best regards

Yaro (not verified) Mon, 29/01/2018 - 16:43

I tried with Sony Z5 compact, newest Version of MiHome and MiToolkit Version 1.6 Usb debugging on phone MiToolktin connects to the phone, backup witout password can be creted, But afterwords in the Text field Only one line is displayed: rockrobo.vacuum.v1 - Mi Robot Vacuum - 192.xxxxxxx there is no line with the token, I tried also MiToolkit Version 1.5 with the same result.

Any help?

Maike (not verified) Thu, 01/02/2018 - 21:06

In reply to by Yaro (not verified)

Same issue here. Rooted phone, tried via Mi Toolkit and got no token line. Tried via SQLite, ran query "select token from devicerecord where localIP is ‘XXX.XXX.X.XXX’" and got nothing, also tried the device record but I can’t find anything related to the token.

agent_kith Sat, 03/02/2018 - 21:57

In reply to by Yaro (not verified)

Apologies for the late reply.

Recent versions of MiHome no longer store the token in the APP. You’d need to install a early version of MiHome to get the token now. For details refer to this link.

So far extracting the token from MiHome still works best - I can’t even use ‘miio –discover’ to get the Vacuum token now.

Kien (not verified) Tue, 06/02/2018 - 09:22

Hi,

thanks for writing this tutorial. I was able to get most of the commands to work except set_fan_speed. How do i set this from the webhooks?

NewRaiden (not verified) Tue, 08/05/2018 - 12:07

In reply to by agent_kith

Hi, everithing woks really fine but I still can’t get fan_speed_control to work. Can you please help me?

Here is how I did set Webhooks in IFTTT:

URL: https://*********.duckdns.org:8123/api/services/VACUUM/SET_FAN_SPEED?api_password=**********

Method: POST

Content Type (optional): Application/json

Body (optional): { "entity_id" : "vacuum.xiaomi_vacuum_cleaner", "speed": "30" }

Is there anithing wrong?

Simon (not verified) Thu, 15/03/2018 - 19:03

I followed all the steps, ports have been forwarded and showing as open, I can see the robot of the assistant software and I can stop/start it from there but when I try to use voice control my Google home will respond but the vacuum itself does not respond :( Have checked all passwords and codes and they are all correct any ideas ??

agent_kith Thu, 15/03/2018 - 21:45

In reply to by Simon (not verified)

I followed all the steps, ports have been forwarded and showing as open, I can see the robot of the assistant software and I can stop/start it from there but when I try to use voice control my Google home will respond but the vacuum itself does not respond Image removed. Have checked all passwords and codes and they are all correct any ideas ??

That suggests the ‘that’ part of IFTTT (Page 11) is not working. Check:

  1. Confirm you can connect to Home Assistant from the Internet. Try and connect to your home assistant from your work computer, your 4G mobile, etc (any computer that’s not part of your network).
  2. Check your URL, are you using HTTP or HTTPS?

Use an app like Postman and manually call the webhook with the JSON payload. did that work? What response did you get?

Simon (not verified) Fri, 16/03/2018 - 08:51

not sure what im doing wrong but im not able to ping my ddns address, the port 8123 is open when i check but when i try to ping it if drops all packets. have also tried using the DLINK ddns service and it too fails to respond to a ping. have tried turning off the firewall on the modem, adding the pie to the dmz but it still fails. using a DLINK DSL-2890AL

Simon (not verified) Fri, 16/03/2018 - 09:18

ok i checked over every thing and found a typo corrected the typo and its working thanks heaps :)

agent_kith Fri, 16/03/2018 - 09:32

In reply to by Simon (not verified)

ok i checked over every thing and found a typo corrected the typo and its working thanks heaps Image removed.

Sorry for the late reply. Glad you have it sorted. You already have the API password setup if you followed this tutorial. Also make sure you have enabled SSL (See my LetsEncrypt tutorial) to encrypt your sessions, and also protect your API password from the public eye.

Simon (not verified) Mon, 19/03/2018 - 01:26

Does this also work with the new version of the vacuum, I ordered the new model for my office and would be handy to have voice control of that too.

Casper (not verified) Sat, 31/03/2018 - 11:11

Hi,

Im trying to run everything, but on the step where homeassistant should see the device, I get stuck :( home assistant does not recognise the device? I’ve managed to get the token from my phone using an older version of the android app, so im fine there. The IP address is also easy to get. the xiaomi_mii shouldnt be changed and the name does not matter right? Any suggestions? maybe run ahead to check if the ports are open?

Roborock and homeassistant are in the same network, i’ve got no clue what’s going wrong :(

thanks for anyone who could help ;D;D

agent_kith Sun, 01/04/2018 - 22:39

In reply to by Casper (not verified)

Hi Casper,

Click on the "circled i" button in developer tools (left hand side). It should show you a log of errors, an entry can probably tell you why it’s not working.

The xiaomi_miio library in HASS has been unstable of late and there are a few releases that broke the Vac robot. I’m on 0.66 right now and it’s working. If you havn’t yet perhaps also upgrade your HASS to this version and see how it goes? (Obviously look at the logs first before doing this).

Casper (not verified) Tue, 03/04/2018 - 07:29

In reply to by Casper (not verified)

I’ve figured out what is going wrong in my setup. On top of page 5 the manual tells you to add the vacuum to secrets.yaml while it should be added to configuration.yaml I think. I’ve googled around a bit, changed this and now I’m one step further. Vacuum is now recognised but still unavailable :/

Any suggestions for that? I did update to the latest version of home assistant. I own the second edition (roborock s50), maybe that changes something in the set-up?

Casper (not verified) Tue, 03/04/2018 - 08:18

In reply to by Casper (not verified)

Couldn’t edit anymore.

This is the info from the log, it keeps repeating this error every minute:

Got exception while fetching the state: No response from the device 12:16 components/vacuum/xiaomi_miio.py (WARNING) Got error when receiving: timed out 12:16 components/vacuum/xiaomi_miio.py (ERROR) Update of vacuum.the_kraken is taking over 10 seconds 12:16 core.py (WARNING)

agent_kith Tue, 03/04/2018 - 09:20

In reply to by Casper (not verified)

Hi Casper,

The secrets file is a place to put all your passwords. So your vac configuration is in configuration.yaml, but the token is stored in secrets.yaml.

I’d send you a email and we’d work from there privately.

PJ (not verified) Thu, 05/04/2018 - 07:59

I have the same issue like R and Simon.

I can control my robot from Home Assistant. Google Assistant responds to my command but nothing happens to the robot. I can access HA from external. I’m using HTTP. Using Postman, I get Access Error: 401 – Unauthorized. Authentication Error: Access Denied! Authorization required. I can login to HA from both internal and external using the same password that is defined in secrets.yaml.

Can you please assist?

Thanks.

agent_kith Thu, 05/04/2018 - 21:47

In reply to by PJ (not verified)

Hmm, that’s a weird one. From your browser, try the following URL:
https://xxx.dyndns.net/api/services?api_password=xxxxxxx
Change xxx where necessary, do you get anything or a invalid response?

PJ (not verified) Thu, 05/04/2018 - 23:38

From IE, I get "Can’t reach this page." If I change to http, I get a Windows Security pop up box for username and password.

"The server xxx.ddns.net is asking for your username and password. The server reports that it is from GENETEC."

From Postman, "no respond’ when I use https and unauthorized when I use http.

agent_kith Thu, 05/04/2018 - 23:44

In reply to by PJ (not verified)

From IE, I get "Can’t reach this page." If I change to http, I get a Windows Security pop up box for username and password.

 

"The server xxx.ddns.net is asking for your username and password. The server reports that it is from GENETEC."

From Postman, "no respond’ when I use https and unauthorized when I use http.

Ah, of course Image removed.. I’m using port 80 for my setup, but the default is 8123 for almost everybody else.

Seems you already mapped port 80 to some video camera system in your network. Add a new NAT for 8123 and forward it to your internal HASS port (8123 by default). Once done, try it again, you should hit the right server, and then it will all work.

http://xxx.dyndns.net:8123/api/services?api_password=xxxxxxx

PJ (not verified) Fri, 06/04/2018 - 05:19

Port 8123 has already been opened. I can access home assistant externally by xxx.ddns.net:8123.

"http://xxxxx.ddns.net:8123/api/services?api_password=xxxx" gives me a full page of all texts.

"…., "example": "vacuum.xiaomi_vacuum_cleaner"}}}, "locate": {"description": "Locate the vacuum cleaner robot.", "fields": {"entity_id": {"description": "Name of the botvac entity.", "example": "vacuum.xiaomi_vacuum_cleaner"}}}, "return_to_base": {"description": "Tell the vacuum cleaner to return to its dock.", "fields": {"entity_id": {"description": "Name of the botvac entity.", "example": "vacuum.xiaomi_vacuum_cleaner"}}}, "send_command": {"description": "Send a raw command to the vacuum cleaner.", "fields": {"command": {"description": …"

"http://xxxxx.ddns.net:8123/api/services/vacuum/turn_on?api_password=xxx…" returns 405: Method Not Allowed.

In my router and under NAT Virtual Server, I have set all external port start, external port end, internal port start and internal port end with 8123. Server IP address is of the computer running HA.

Ovaltine (not verified) Fri, 13/04/2018 - 21:20

:?:
I tried this and it wouldn’t show the vacuum in the HomeAssistant page. I soon learned that the vacuum settings need to go in the configuration.yaml, not the secrets file!

fabio (not verified) Sat, 23/06/2018 - 06:04

hi, i always do a zone cleanup;, even if a do a full full house cleaning, otherwise the map is always gone so i have rooms configured for kitchen/living but after some vacumm cleans, the zone is shifted up , like 2-3 meters, then i need to a clean vacuum again to make coordnates right again, … its not the issue that the map is rotated, just everything , all zones are shifted on the X as

any ideas? i am still on stock firmware, best to update to 001412

FilipeOS (not verified) Thu, 05/07/2018 - 23:28

Hi there,

Can you please change the instructions to use Join/Tasker on android and not raspberry?

I can confirm that I had to downgrade the MiHome app to 5.0.19 to get the token AND choose mainland China, not Europe etc…

Best regards

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.

Contents