Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // This script replaces the $50 that Universal Devices charges for the ISY weather module
- $r = mysql_connect('127.0.0.1','MySQLUSERNAME','MySQLPASSWORD') or die("couldnt connect");
- mysql_select_db('weathercat') or die("couldnt select db");
- $q = "SELECT ROUND(((`temperature_c` * 9) / 5) + 32) as outside_temp FROM `WeatherData` ORDER BY `WeatherData`.`Time` DESC LIMIT 1";
- $r = mysql_query($q) or die(mysql_error());
- $result = mysql_fetch_object($r);
- file_get_contents('http://ISYUSERNAME:ISYPASSWORD@10.0.1.201/rest/vars/set/1/1/'.$result->outside_temp);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement