This topic has been marked solved and closed to new posts due to inactivity. We hope you'll join the conversation by posting to an open topic or starting a new one.
- English
- /
- Arlo Forum Discussions
- /
- Partner Integrations
- /
- Re: Rolling my Own IFTTT integration... (WORK IN P...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK I am sick of waiting for IFTTT so I have decided to roll my own...
Here is where I am up to:
Raspberry PI 2 running minibian on a 2gb sd card
Selenium recording of the login and mode change (This works perfectly!) Exported in Python see below:
# -*- coding: utf-8 -*- from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import Select from selenium.common.exceptions import NoSuchElementException from selenium.common.exceptions import NoAlertPresentException import unittest, time, re class SetAllAlertsOn(unittest.TestCase): def setUp(self): self.driver = webdriver.Firefox() self.driver.implicitly_wait(30) self.base_url = "https://arlo.netgear.com/" self.verificationErrors = [] self.accept_next_alert = True def test_set_all_alerts_on(self): driver = self.driver driver.get(self.base_url + "/#/login") driver.find_element_by_id("userId").clear() driver.find_element_by_id("userId").send_keys("***USERNAME***") driver.find_element_by_id("password").clear() driver.find_element_by_id("password").send_keys("***PASSWORD***") driver.find_element_by_id("loginButton").click() for i in range(60): try: if driver.find_element_by_xpath("//div[@id='footerButtonModes']/div").is_displayed(): break except: pass time.sleep(1) else: self.fail("time out") driver.find_element_by_xpath("//div[@id='footerButtonModes']/div").click() driver.find_element_by_xpath("//div[3]/div[2]/div").click() driver.find_element_by_xpath("//span").click() def is_element_present(self, how, what): try: self.driver.find_element(by=how, value=what) except NoSuchElementException, e: return False return True def is_alert_present(self): try: self.driver.switch_to_alert() except NoAlertPresentException, e: return False return True def close_alert_and_get_its_text(self): try: alert = self.driver.switch_to_alert() alert_text = alert.text if self.accept_next_alert: alert.accept() else: alert.dismiss() return alert_text finally: self.accept_next_alert = True def tearDown(self): self.driver.quit() self.assertEqual([], self.verificationErrors) if __name__ == "__main__": unittest.main()
You may need to change this line:
driver.find_element_by_xpath("//div[3]/div[2]/div").click()
But I guarantee it is easier to record your own on firefox: (download here)
http://release.seleniumhq.org/selenium-ide/2.9.0/
I then export using python webdriver and then add this bit in (waits for the mode button to appear)
for i in range(60): try: if driver.find_element_by_xpath("//div[@id='footerButtonModes']/div").is_displayed(): break except: pass time.sleep(1) else: self.fail("time out")
I then saved this as ArloSetAllAlertsOn.py
Then on the raspberry Pi I logged in and ran:
apt-get install python-setuptools pip install selenium apt-get install xvfb apt-get install iceweasel Xvfb :99 -ac & export DISPLAY=:99
I can now run:
python ArloCamerasAllOn.py and it will change the camera's mode! 🙂
now all I need to do is:
create a second script for my other mode
create a secured webserver in python which calls that test
setup dyndns account and setup the raspberry pi to report my IP to that
Forward the correct ports on my router
create an IFTTT maker channel which calls that webserver when my thermostat detects we are away
create an IFTTT maker channel which calls that webserver when my thermostat detects we are home
not much more left to do really... perhaps another evening or 2 and it will be working the way I hoped in the beginning with ***multi person*** Geofencing
Solved! Go to Solution.
- Related Labels:
-
Installation
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
so as before run this:
apt-get install python-setuptools pip install selenium apt-get install xvfb apt-get install iceweasel Xvfb :99 -ac & export DISPLAY=:99
I now have a webserver! and I am using Bottle for that which you can install with the command below 🙂
pip install bottle
Code: (Replace *** USERNAME *** and *** Password ***)
# -*- coding: utf-8 -*- from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import Select from selenium.common.exceptions import NoSuchElementException from selenium.common.exceptions import NoAlertPresentException from bottle import route, run, template import unittest, time, re, os @route('/<name>') def index(name): os.environ["DISPLAY"] = ":99" driver = webdriver.Firefox() driver.implicitly_wait(5) base_url = "https://arlo.netgear.com/" accept_next_alert = True driver.get(base_url + "/#/login") driver.find_element_by_id("userId").clear() driver.find_element_by_id("userId").send_keys("*** USERNAME ***") driver.find_element_by_id("password").clear() driver.find_element_by_id("password").send_keys("***PASSWORD***") driver.find_element_by_id("loginButton").click() for i in range(10): try: if driver.find_element_by_xpath("//div[@id='footerButtonModes']").is_displayed(): break except: pass time.sleep(1) else: return template('<b>Sorry {{name}}</b>!', name=name) driver.find_element_by_xpath("//div[@id='footerButtonModes']").click() for i in range(3): time.sleep(1) if name == 'mode0': driver.find_element_by_xpath("//div[3]/div[2]/div").click() driver.find_element_by_xpath("//span").click() driver.quit() return template('<b>Hello {{name}}</b>!', name=name) elif name == 'mode1': driver.find_element_by_xpath("//div[3]/div[2]/div[2]").click() driver.find_element_by_xpath("//span").click() driver.quit() return template('<b>Hello {{name}}</b>!', name=name) elif name == 'mode2': driver.find_element_by_xpath("//div[2]/div[3]").click() driver.find_element_by_xpath("//span").click() driver.quit() return template('<b>Hello {{name}}</b>!', name=name) elif name == 'mode3': driver.find_element_by_xpath("//div[4]").click() driver.find_element_by_xpath("//span").click() driver.quit() return template('<b>Hello {{name}}</b>!', name=name) elif name == 'mode4': driver.find_element_by_xpath("//div[5]").click() driver.find_element_by_xpath("//span").click() driver.quit() return template('<b>Hello {{name}}</b>!', name=name) elif name == 'mode5': driver.find_element_by_xpath("//div[6]").click() driver.find_element_by_xpath("//span").click() driver.quit() return template('<b>Hello {{name}}</b>!', name=name) elif name == 'mode6': driver.find_element_by_xpath("//div[7]").click() driver.find_element_by_xpath("//span").click() driver.quit() return template('<b>Hello {{name}}</b>!', name=name) elif name == 'mode7': driver.find_element_by_xpath("//div[8]").click() driver.find_element_by_xpath("//span").click() driver.quit() return template('<b>Hello {{name}}</b>!', name=name) elif name == 'mode8': driver.find_element_by_xpath("//div[9]").click() driver.find_element_by_xpath("//span").click() driver.quit() return template('<b>Hello {{name}}</b>!', name=name) else: driver.find_element_by_xpath("//span").click() driver.quit() return template('<b>Sorry {{name}}</b>!', name=name) run(host='0.0.0.0', port=8080)
ok so... with this script you can change to any of the modes except schedule!
http://ipaddress:8080/mode0
will select the first cell under schedule
http://ipaddress:8080/mode1
will select the second mode etc...
http://ipaddress:8080/mode8
I have defined all up to mode 8 as i only have 9 modes (we start from 0 don't forget, Programmer in me)
If you get
Hello mode6! etc then you have successfully changed the mode...
if you get
Failed mode6! etc then something broke....
Now just to do the easy stuff like port forwarding and setting up the maker channel! 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
one thing to note is it takes about 15 seconds or so to action... because it has to load firefox, go to arlo.netgear.com, wait for the modes button to appeear, wait for the arlo spinner to disappear, wait for the modes to appear, and then click the mode you want! 😞 But hey its better than nothing!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Done! looks to even work too! 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For those who don't want to buy and host a raspberry pi... you should be able to run a free tier Amazon AWS instance and get the whole shebang for free! anyone want to set up a vm image that is easy to spin up?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nice solution. Thank you for sharing your work with us!
Using your code one can also implement a button on the RasperryPi and manually switch between two modes (like all cameras on, all cameras off).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yep button on the raspberry pi or by IFTTT compatible buttons 😉
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The great thing about ifttt is that you can use anything that can create a trigger... So your supported devices and your imagination are key
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ah.. my ecobees have IR motion detection and I figured if they detect motion, it might actually be an intruder, so i absolutely do NOT want to toggle arlo motion detection based on thermostat motion detection. True geofencing makes sense and I read that tado has multi-user geofencing so now i understand your setup.
Thanks for the excellent contribution. I wish Netgear/Arlo would get their act together on the app.. it def could be better in a few specific ways.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Im attempting this myself tonight.. I am intrigued by the AWS option.. but I'm leaning toward using my desktop machine and a hyper-v VM/Internet Explorer/iis.. I see slenium has an IE driver. am I wasting my time with that route?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
or should I just spin up a debian VM instead?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
now that I am reading more.. I see that arlo has mentioned geofencig and IFTTT support in a techhive review.. and I just got an email from arlo about an upcoming upgrade...
maybe i shoult hold off
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The update broke this and I haven't been able to fix it... seems that the project is dead!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Pretty gonzo. I guess it's not a shock that that the update broke it, given dependence on their exact DOM, but hats off!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We are excited to let the community know that IFTTT integration has been announced! For more information, take a look here: Introducing IFTTT Integration
JamesC
-
Amazon Alexa
103 -
Apple HomeKit
665 -
Apple TV App
7 -
AppleTV
27 -
Arlo Mobile App
57 -
Arlo Pro
2 -
Arlo Pro 2
1 -
Arlo Q (Plus)
1 -
Arlo Secure
9 -
Arlo Smart
36 -
Arlo Wire-Free
1 -
Before You Buy
29 -
Features
82 -
Firmware Release Notes
8 -
Google Assistant
80 -
IFTTT
77 -
IFTTT (If This Then That)
117 -
Installation
87 -
Modes and Rules
13 -
Motion Detection
1 -
Online and Mobile Apps
70 -
Samsung SmartThings
72 -
Security System
1 -
Service and Storage
5 -
SmartThings
73 -
Troubleshooting
386 -
Videos
1
- « Previous
- Next »