Turn light on with watch – GoCoEdit - Code & Text Editor Review
I wanted an app that I could turn lights on and off from my Apple watch, w/Raspberry Pi.
App is fantastic!! !!
The rest of the review is a more of a how to. ( turn light on/off with watch using a relay board)
Save the below files to your Pi directory home/pi. When you first login using SSH and type ls you should see these files light_on.py & light_off.py
light_on.py
#Light on
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setup(28, GPIO.OUT)
GPIO.output(28, GPIO.HIGH)
GPIO.cleanup()
exit()
light_off.py
#Light off
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setup(28, GPIO.OUT)
GPIO.output(28, GPIO.LOW)
GPIO.cleanup()
exit()
Now move to your iPhone and open the app
Click three dots upper right>click show mini player
Click scripts upper right>click plus
Write sudo python3 light_on.py click yellow check upper right
Write sudo python3 light_off.py click yellow check upper right
Click three lines upper left>click cloud lower left>click plus
Click plus sign next to sftp/ssh
Name - anything you want
Host - ip address of Raspberry Pi
Username - pi
Password - your password
Private key leave blank
Initial path leave blank
Port 22
Preview
Reboot watch and iPhone
Review by Projectrocket on
GoCoEdit - Code & Text Editor.