View soil-monitor.ino
/*********************************************************************
The LAZY GARDENER!
My simple soil moisture detection and pump activation utility.
Copyright (c) Chris Drumgoole 2016
http://www.cdrum.com
https://github.com/cdrum/lazy-gardener
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
View lifx-check.php
?php
$now = date("r");
// Change these settings to match your environment
const RESTAPI_URL = "http://192.168.1.221:56780";
$result = json_decode(file_get_contents(RESTAPI_URL . "/lights.json"));
View Example output
local http = require('socket.http')
http.TIMEOUT = 20
http.request{url='http://192.168.1.221:56780/lights/d073d5005654/on', method='PUT', headers = {['Content-Length'] = string.len(''),['Content-Type'] = 'application/x-www-form-urlencoded'}}
http.request{url='http://192.168.1.221:56780/lights/d073d5005654/color?hue=0&saturation=0&brightness=0.35138475623713&kelvin=2500', method='PUT', headers = {['Content-Length'] = string.len(''),['Content-Type'] = 'application/x-www-form-urlencoded'}}
http.request{url='http://192.168.1.221:56780/lights/d073d500114b/on', method='PUT', headers = {['Content-Length'] = string.len(''),['Content-Type'] = 'application/x-www-form-urlencoded'}}
http.request{url='http://192.168.1.221:56780/lights/d073d500114b/color?hue=0&saturation=0&brightness=0.28865491721981&kelvin=2500', method='PUT', headers = {['Content-Length'] = string.len(''),['Content-Type'] = 'application/x-www-form-urlencoded'}}
http.request{url='http://192.168.1.221:56780/lights/d073d5008af8/on', method='PUT', headers =