OpenGarage Forums Comments, Suggestions, Requests reminder for open door at 10 p.m. Re: Re: reminder for open door at 10 p.m.

#120

Anonymous
Guest

I wasn’t up for doing a whole firmware, so I put together this python script using selenium package that I run as a cron job from my RaspberryPi. Pretty straightforward.

from selenium import webdriver
from pyvirtualdisplay import Display

#create virtual display
display = Display(visible=0, size=(800, 600))
display.start()

# make a firefox-instance
browser = webdriver.Firefox(timeout=100)

#open url of og
browser.get('http://192.168.1.3')
status = browser.find_element_by_id('lbl_status').text
dkey = browser.find_element_by_id('dkey').send_keys('yourkey')
btn = browser.find_element_by_id('btn_click')

if (status == 'OPEN'):
btn.click()

browser.quit()