OpenGarage › Forums › Comments, Suggestions, Requests › reminder for open door at 10 p.m. › Reply To: reminder for open door at 10 p.m.
July 29, 2017 at 9:35 am
#489
Anonymous
Inactive
How do you implement this?
Hi, I’ve created a Python script to check the door status that uses the OG API.
It uses the Requests package for Python.
#!/usr/bin/env python2
import requests
og_address = ‘opengarage.lan’ # set OG IP or hostname
og_password = ‘password’ # set OG passwordresponse = requests.get(‘http://%s/jc’ % og_address)
data = response.json()
status = (data[‘door’])if (status == 1):
parameters = {‘dkey’:og_password,’click’:’1′}
response = requests.post(‘http://%s/cc’ % og_address, params=parameters)
Do you have to connect to OG via USB?
- This reply was modified 7 years, 2 months ago by .