PHP script show value
Posted: Thursday 26 July 2018 15:03
Hi,
I use this PHP script on my website to show the actual temperature in my living room.
But this value doesn't auto update.
Can someone help me to make this script auto update?
#!/usr/bin/php
<?php
$json_string = file_get_contents("http://192.168.1.37:8080/json.htm?type=devices&rid=37");
$parsed_json = json_decode($json_string, true);
$test_link = "/home/pi/domoticz/scripts/test_1.txt";
$test_data = fopen ($test_link, "w+");
fwrite ($test_data, print_R($parsed_json, TRUE));
fclose ($test_data);
$parsed_json = $parsed_json['result'][0];
$temp = $parsed_json['Temp'];
echo "".$temp.""."\n";
Thanks
I use this PHP script on my website to show the actual temperature in my living room.
But this value doesn't auto update.
Can someone help me to make this script auto update?
#!/usr/bin/php
<?php
$json_string = file_get_contents("http://192.168.1.37:8080/json.htm?type=devices&rid=37");
$parsed_json = json_decode($json_string, true);
$test_link = "/home/pi/domoticz/scripts/test_1.txt";
$test_data = fopen ($test_link, "w+");
fwrite ($test_data, print_R($parsed_json, TRUE));
fclose ($test_data);
$parsed_json = $parsed_json['result'][0];
$temp = $parsed_json['Temp'];
echo "".$temp.""."\n";
Thanks