Outdoor Lighting Relay Control

The code on GitHub relies on the Simple Spark PHP Proxy that I built a while back. To get around using, it you will need to change some of the code in index.html:

Line 73: $.post('https://api.spark.io/v1/devices/'+CORE_ID+'/toggleRelay?access_token=YOUR_ACCESS_TOKEN_HERE', {'args':'relay'+i+relayState}, function(resp) {

Line 122: $.get('https://api.spark.io/v1/devices/'+CORE_ID+'/tempF?access_token=YOUR_ACCESS_TOKEN_HERE', function(resp) {

Line 137: $.get('https://api.spark.io/v1/devices/'+CORE_ID+'/relayStates?access_token=YOUR_ACCESS_TOKEN_HERE', function(resp) {

It’s a quick (untested) fix but should work. Be sure to replace YOUR_ACCESS_TOKEN_HERE in the fixes above with your account’s access token. Please note that this is considered a security risk to put your access token in plain text in the HTML source, which is why I created the PHP proxy.

Let me know how it goes!