PHP script show value

Post Reply
Posts: 50
Joined: Sunday 20 May 2018 12:56
Target OS: OS X
Domoticz version: Beta

PHP script show value

Post by Knibor » Thursday 26 July 2018 15:03


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?

$json_string = file_get_contents("");
$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";


User avatar
Posts: 2747
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: Beta
Location: Beitem, BE

Re: PHP script show value

Post by Egregius » Saturday 28 July 2018 6:42

Depending on your needs you could use a small javascript to refresh the browser window:

Code: Select all

<script type="text/javascript">
You could also have a look at my PHPFloorplan and unleash the power of PHP on Domoticz :-)

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests