Closed domagalaszymon closed 7 years ago
Its not a great example, but this worked for me: https://github.com/brownad/homebridge-doorbird/blob/master/index.js
Its set to locked by default, opens for a few seconds then locks again (I never know if its locked due to API I call, can only trigger an open event)
@KhaosT can probably close this now
Hi, i have the code, that opens my door by the realy. It give High state for 3 seconds and after that i wanted to switch the status to Locked back. How can i do this? ;)
My code:
https://pastebin.com/b4EGy0gp
and the python code:
import RPi.GPIO as GPIO from time import sleep
this is the pin variable, change it if your relay is on a different pin
relay=36; GPIO.setmode(GPIO.BOARD) GPIO.setup(relay, GPIO.OUT) GPIO.output(relay, GPIO.HIGH) GPIO.output(relay, GPIO.LOW) sleep(3) GPIO.output(relay, GPIO.HIGH) GPIO.cleanup()