Of course... Here come my small contribution to your frontpage...
It's a bit rough but it works and should be easy to implement if you follow these steps...
I use BLOCKY, 2 dummy TEMP sensors and own made PHP scripts as I don't like lua...
Blocky handles the comparison and checks if actual min temp is lower than registered value... See below:
UTE is the outside sensor.
- Skärmklipp2.PNG (13.68 KiB) Viewed 2409 times
If actual value is below registered value it runs the php script. My script even notifies me via PROWL...
set_min.php code:
Code: Select all
<?PHP
//PROWL Class to include
include "class.prowl.php";
// Get UTE temp. IDX: 9
$json_string = file_get_contents("http://192.168.1.236:8080/json.htm?type=devices&rid=9");
$parsed_json = json_decode($json_string, true);
$parsed_json = $parsed_json['result'][0];
$temp = $parsed_json['Temp'];
$today = date("Y-m-d")."Temp: ".$temp;
// Send PROWL -->
$prowl = new Prowl("XXXXX", "XXXXXX", "Temperatur uppdatering!!");
$result = $prowl->send("Ny MIN Temp!", $temp."°C");
// Set new MAX temp to virtual sensor no: 514 using $ute
$ute = "http://192.168.1.236:8080/json.htm?type=command¶m=udevice&idx=514&nvalue=0&svalue=".$temp;
$json_string = file_get_contents($ute);
// -----------------------------------------------
?>
set_max.php code:
Code: Select all
<?PHP
//PROWL Class to include
include "class.prowl.php";
// Get UTE temp. IDX: 9
$json_string = file_get_contents("http://192.168.1.236:8080/json.htm?type=devices&rid=9");
$parsed_json = json_decode($json_string, true);
$parsed_json = $parsed_json['result'][0];
$temp = $parsed_json['Temp'];
$today = date("Y-m-d")."Temp: ".$temp;
$ute = "http://192.168.1.236:8080/json.htm?type=command¶m=udevice&idx=513&nvalue=0&svalue=".$temp;
// Send PROWL -->
$prowl = new Prowl("XXXXX", "XXXXXX", "Temperatur uppdatering!!");
$result = $prowl->send("Ny MAX Temp!", $temp."°C");
// Set new MAX temp to virtual sensor no: 513 using $ute
$json_string = file_get_contents($ute);
// -----------------------------------------------
?>
As seen in the PHP code I update the virtual TEMP sensors whit the actual TEMP and the result is this: