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

#252

vrbt150
Participant

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 password

response = 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)
  • This reply was modified 4 years, 1 month ago by vrbt150.