['timeout' => 2]]); $raw = @file_get_contents($url, false, $ctx); return ($raw !== false) ? json_decode($raw, true) : null; } /* ---------- Load data ---------- */ $api_url = "$api_host:$api_port$api_path"; $payload = fetch_json($api_url); ?>
Could not fetch data from the API.
| Device | Comment | Temp (°C) | Humidity % |
|---|---|---|---|
| = htmlspecialchars($s['name']) ?> | = htmlspecialchars($s['comment'] ?? '') ?> | = htmlspecialchars($temp) ?> | = htmlspecialchars($hum) ?> |