55 comments
Comment from: Radek Visitor
Comment from: Agent Kith Member
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?
Comment from: Radek Visitor
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??
Comment from: Agent Kith Member
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?
Comment from: Marcin Visitor
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/
Comment from: Agent Kith Member
Hi, it appears you have a mistake in your secrets.yaml file. Check out the home assistant document here
Comment from: Benoit N. Visitor
Congrats ! Great Tuto ! Next step is to bypass Home Server It will be so cool.
Comment from: Marcin Visitor
I was following the instructions : Use this file to store secrets like usernames and passwords. Learn more at https://home-assistant.io/docs/configuration/secrets/ http_password: Password vacuum: platform:xiaomi_miio host:192.168.0.107 token:634secret523756token656f70 name:MiMi
Comment from: Mike Visitor
Waste of time
Comment from: R Visitor
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?
Comment from: Agent Kith Member
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.
Comment from: ghizmo82 Visitor
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.
Comment from: Bluerider Visitor
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
Comment from: Agent Kith Member
You’d need to run a computer inside your network for IFTTT. Something small like a Raspberry Pi can do it. Have a HOWTO on how to get Home Assistant up and running on a Pi <a href="https://www.snakeoil-os.net/news/home-automation/install-home-assistant-on-a-raspberry-pi">here</a>.
Comment from: Yaro Visitor
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?
Comment from: Maike Visitor
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.
Comment from: Agent Kith Member
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 <a href="https://github.com/ultrara1n/MiToolkit/issues/12">link</a>.
So far extracting the token from MiHome still works best - I can’t even use ‘miio –discover’ to get the Vacuum token now.
Comment from: Kien Visitor
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?
Comment from: Agent Kith Member
The REST API is now set_fan_speed, e.g.:
https://server/api/services/VACUUM/SET_FAN_SPEED?api_password=your_api_password
And the payload, is { "entity_id" : "your_vac_entity", "speed": "100" }
Speed can be a number from 0 to 100. Or high, medium, low.
Have amended the table with the new call.
Comment from: NewRaiden Visitor
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:
<code>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?</code>
Comment from: Agent Kith Member
Can you try and use this payload and see what happens? (Assuming you got the name right)
{ "entity_id" : "xiaomi_vacuum_cleaner", "speed": "30" }
Comment from: Simon Visitor
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 ??
Comment from: Agent Kith Member
simon wrote:
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 ??That suggests the ‘that’ part of IFTTT (Page 11) is not working. Check:
- 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).
- 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?
Comment from: Simon Visitor
stupid question but how do i connect to it from outside my network do i just type in my ddns address ?
Comment from: Simon Visitor
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
Comment from: Simon Visitor
ok i checked over every thing and found a typo corrected the typo and its working thanks heaps
Comment from: Agent Kith Member
Simon wrote:
ok i checked over every thing and found a typo corrected the typo and its working thanks heapsSorry 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.
Comment from: Simon Visitor
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.
Comment from: Agent Kith Member
Hi Simon,
can’t answer that as I don’t own the newer model. I assume it will still work but my answer is really a guess.
Comment from: Simon Visitor
So i got the new model vacuum about 15min ago and can confirm this still works with the new model, now i can vac and mop my house using my voice.
Comment from: Agent Kith Member
Thanks for finding out the new model (Roborock) still works .
Comment from: Casper Visitor
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
Comment from: Agent Kith Member
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).
Comment from: Casper Visitor
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?
Comment from: Casper Visitor
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)
Comment from: Agent Kith Member
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.
Comment from: PJ Visitor
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.
Comment from: Agent Kith Member
Hi PJ,
Did you add the api_password at the end of your URL, where XXXXX is your API password?
?api_password=XXXXX
Comment from: PJ Visitor
Hi Kith,
Yes, this is my url, http://xxxxxxx.ddns.net/api/services/VACUUM/TURN_ON?api_password=xxxxxxx
Comment from: Agent Kith Member
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?
Comment from: PJ Visitor
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.
Comment from: Agent Kith Member
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.Ah, of course . I’m using port 80 for my setup, but the default is 8123 for almost everybody else."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.
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
Comment from: PJ Visitor
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=xxxxx" 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.
Comment from: Agent Kith Member
Looks like need to investigate futher, I’d take it up with you via email.
Will also create a ‘Home Automation’ section in the forums. Folks with the harder problems can create an account and post in the forums instead (https://www.snakeoil-os.net/forums/Forum-Home-Automation), as it’d be easier to communicate.
Comment from: Mattia Visitor
Yes because the link is IFTTT and no Http, you try a say the phrase on your Assistant or maybe you don’t have a IP public. Sorry for my English…
Comment from: jucas_pt Visitor
Hi,
How did you resolve the issue with the :
"returns 405: Method Not Allowed. "
Thanks
Comment from: Ovaltine Visitor
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!
Comment from: fabio Visitor
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
Comment from: Agent Kith Member
This sounds like a firmware bug. Best way is to update to the latest firmware and see if it still have this problem.
Comment from: FilipeOS Visitor
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
Comment from: Agent Kith Member
Hi FilipeOS,
Join/Tasker certainly looks interesting! I’d try and see if I can get some time to give that a go..
Comment from: FilipeOS Visitor
Thank you so much because I’ve setup the Roborock to Europe and now I can’t go back to China since it’s forcing me to change Region… I can’t do anything unless go to Europe again… I tried almost everything…
Join/Tasker allow you to do the same thing you did but without servers, I just don’t have that experience…
Comment from: Agent Kith Member
api_password deprecated in 0.90. This tutorial updated with new information on how to integrate IFTTT with Home Assistant using the new access methods.
Comment from: Gaetano Visitor
Finally this guide is updated! Everything works perfectly but I really don’t understand how to set the fan speed. Can someone help?
I tried in body section:
{ "action": "call_service", "service": "vacuum.set_fan_speed", "entity_id": "vacuum.xiaomi_vacuum_cleaner", "fan_speed": "quiet"}
It does not work.
Comment from: Agent Kith Member
The API isn’t fantastically clear, and it keeps changing. Try and use a number between 0 to 100 for fan_speed.. See if that works.
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" ;(