<?php
$kds = file_get_contents("http://192.168.178.128/data");
if ($kds == false) {
http_response_code(500);
die("Could not access sensor :(");
}
$kda = json_decode($kds, true);
?>
<!DOCTYPE html>
<html>
<head>
<title>H3's Kellersensor</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/hacker3000.css">
</head>
<body>
<img src="rotate_h3.gif" height=10%>
<h1>H3's Kellersensor</h1>
<ul>
<li>Temperatur: <?php print($kda["temp"]);?>°C</li>
<li>Feuchte: <?php print($kda["hum"]);?>%</li>
<li>Wassersensor: <?php print($kda["leak_percent"]);?>%<br>Alles unter 15 ist gut, 100 ist sehr schlecht.</li>
</ul>
</body>
</html>