Announcement

Collapse
No announcement yet.

Robot Vacuum Plugin

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Robot Vacuum Plugin

    Anybody have a plugin for Xiaomi Mi Robot vacuum, been looking across multiple platforms and it seems rather difficult to automate via 3rd party software.

  • #2
    Originally posted by deanrparry View Post
    Anybody have a plugin for Xiaomi Mi Robot vacuum, been looking across multiple platforms and it seems rather difficult to automate via 3rd party software.
    I set up one of my extra Raspberry Pi's with Home Assistant (which has a component for the Xiaomi vacuums) and use a couple of events to start/stop the vacuum.

    For each event I use "run another program or process" and Curl.

    curl.exe -X POST -H "x-ha-access: HASSPASSWORD" http://192.168.86.65:8123/api/services/vacuum/turn_on

    Comment


    • #3
      Working...

      Works well in all fairness and installed home Assistant to my NAS which also runs HomeSeer so all under the same roof

      Now to fathom the status from Home Assistant to HomeSeer... Jon00 Data Scraper will allow me to grab the data for now

      Comment


      • #4
        Originally posted by deanrparry View Post
        Works well in all fairness and installed home Assistant to my NAS which also runs HomeSeer so all under the same roof

        Now to fathom the status from Home Assistant to HomeSeer... Jon00 Data Scraper will allow me to grab the data for now
        That would work. I'm using MQTT to get the status into HS currently.

        Comment


        • #5
          Any pointers?

          Comment


          • #6
            Originally posted by deanrparry View Post
            Any pointers?

            Actually I wrote a blog post about it shortly after.

            http://shadowscope.com/2017/10/how-t...from-homeseer/

            The hardest part was finding the token.

            Comment


            • #7
              Originally posted by rmiles7721 View Post
              Actually I wrote a blog post about it shortly after.

              http://shadowscope.com/2017/10/how-t...from-homeseer/

              The hardest part was finding the token.
              I can control it easy enough it is the status feedback without datascraping i was interested in

              Comment


              • #8
                Originally posted by deanrparry View Post
                I can control it easy enough it is the status feedback without datascraping i was interested in
                I was able to accomplish this by SSH to the location where I hosted the Vacuum Python library using Plink for Windows and then using a script to grab the results and grab the status. I didn't have to end up using a Data Scraper.

                I'm moving on to a Linux system and I will probably do the same with Curl and Grep.

                When I am in front of my machine, I will get you some more details of what I done.

                Comment


                • #9
                  Originally posted by panda2297 View Post
                  I was able to accomplish this by SSH to the location where I hosted the Vacuum Python library using Plink for Windows and then using a script to grab the results and grab the status. I didn't have to end up using a Data Scraper.

                  I'm moving on to a Linux system and I will probably do the same with Curl and Grep.

                  When I am in front of my machine, I will get you some more details of what I done.
                  Thank you kindly much appreciated

                  Sent from my Pixel XL using Tapatalk

                  Comment


                  • #10
                    Anybody any further forward with this? I have it working but it's so a hacky solution. Was hoping somebody might have taken the plunge and created a HomeSeer plugin lol

                    Comment


                    • #11
                      I just installed Python 3.7.1 on my windows server that runs HomeSeer, installed the python-miio (and python netifaces, that were missing and required). Then the token extraction (spent most time with that). Wrapped the mirobo calls to script (because the start external program event task was behaving oddly).
                      Code:
                      System.Diagnostics.Process.Start("mirobo", "--ip <ip> --token <token> <command>")
                      The result is few simple events as a facade, so now I can have my scheduled cleanup running only if I'm not home (HSBuddy geofencing) and I can also have several saved zoned-cleanups, like kitchen, dining table in living room - which I find very useful, because before that I hated drawing the zones in app, so I usually didn't used that functionality.

                      The plugin would be nice, but I think that my approach (no Home Assistant, no extra VM or RPi) is easy to setup and in my opinion not that messy.

                      Comment


                      • #12
                        I have this up and running the way I wanted. Using Homeseer and hassio , I have events in Homeseer that cleans certain areas , move the vacuum to certain places then perform a spot cleaning , also tracking the vacuum status and battery , everything using MQTT. I can work on a tutorial if anyone wants it

                        Comment


                        • #13
                          Did you ever get around to writing a tutorial? I just purchased my roborock and love it. Would be great to automate zone cleanup.

                          Comment


                          • #14
                            I have it working via MQTT (using python-miio, a bash-script and MQTT-launcher). But, I don’t want to be dependent on a lot of external scripts, so I started looking at a VB.net-option yesterday, only requiring python-miio.

                            I'm not a VB.net-programmer, so it might take some time to finish something.

                            This is is the concept:
                            HTML Code:
                            imports System.Diagnostics
                            IMPORTS Newtonsoft.Json
                            IMPORTS Newtonsoft.Json.Linq
                            
                            Sub Main(parm as object)
                            Dim obj as New JObject
                            Dim psi As New ProcessStartInfo()
                            
                            psi.FileName = "/bin/bash"
                            psi.Arguments = "-c ""miiocli -o json_pretty vacuum --ip 192.168.1.10 --token 123123123123123 status"""
                            psi.RedirectStandardOutput = True
                            psi.RedirectStandardError = True
                            psi.CreateNoWindow = False
                            psi.WindowStyle = ProcessWindowStyle.Hidden
                            psi.UseShellExecute = False
                            
                            Dim process As Process = Process.Start(psi)
                            Dim processoutput As String = process.StandardOutput.ReadToEnd()
                            
                            process.WaitForExit()
                            
                            hs.writelog("Output", processoutput)
                            
                            obj = JsonConvert.DeserializeObject(processoutput)
                            
                            hs.writelog("Output",obj.Item("clean_time").ToString)
                            
                            End Sub
                            This does output the values in the log. Just have to create a “setup-sub” that creates the devices and finish the rest of the script...

                            Comment

                            Working...
                            X