elov wrote:Have anyone had any time and interest to look at integrating the Neato with Indigo yet?
Neato have published their API's here (
https://developers.neatorobotics.com ) so everything is good to go.
I'm ready to order a Botvac Connected soon and will certainly look forward to integrating it with Indigo so it will clean once houseMode is set to away (with temporary motion alarm inactivation) during the vacuum runtime.
Let me know if anyone have started this plugin development, otherwise I might refresh my python skills and make something useful for the community next year.
I have not had the time to learn how an Oauth2 integration should be done from a simple python script so I made myself a workaround that provides the basic (clean while I'm not at home).
Basically I used this PHP fork of the unofficial API
http://github.com/tomrosenback/botvac/ and added a HTTP GET in a python script to a Action Group in Indigo.
So once I trigger the action group, the Botvac Connected robot starts cleaning, which it does on a regular basis once the home is armed/away-mode. Simple yet flexible! The trigger also looks at a variable so I can put the Botvac in maintenance and make sure it doesn't run to often.
The basic HTTP get with a status eval using requests in python is attached below:
- Code: Select all
# -*- coding: utf-8 -*-
# -*- tab-width: 4; indent-tabs-mode: t -*-
import requests
r = requests.get("http://127.0.0.1/neato-botvac/examples/client.php")
if r.status_code == 200:
indigo.server.log("Neato: API is alive, attempting to start house cleaning cycle")
r2 = requests.get("http://127.0.0.1/neato-botvac/examples/robot.php")
if r2.status_code == 200:
indigo.server.log("Neato: House cleaning started.")
else:
indigo.server.log("Neato: Error starting cleaning cycle!")
else:
indigo.server.log("Neato: Error contacting botvac API.")