35 lines
952 B
PHP
35 lines
952 B
PHP
|
<?php
|
||
|
$options = array(
|
||
|
'http' => array(
|
||
|
'method' => 'GET',
|
||
|
'header' => 'x-ha-access: nXa7LiR1PG'
|
||
|
)
|
||
|
);
|
||
|
|
||
|
$context = stream_context_create($options);
|
||
|
$data = json_decode(file_get_contents("http://192.168.0.25:8123/api/states", false, $context), true);
|
||
|
|
||
|
foreach($data as $item) {
|
||
|
$output[$item["entity_id"]] = $item;
|
||
|
}
|
||
|
?>
|
||
|
|
||
|
<!DOCTYPE html>
|
||
|
<html>
|
||
|
<head>
|
||
|
<meta charset="utf-8" />
|
||
|
<title>Welcome to JnF.me</title>
|
||
|
<link href='//fonts.googleapis.com/css?family=Source+Sans+Pro:300' rel='stylesheet' type='text/css'>
|
||
|
<style type="text/css">
|
||
|
* {margin: 0; border: 0; padding: 0; font-family: 'Source Sans Pro', sans-serif; font-weight: 300; text-align: center;}
|
||
|
html, body {height: 100%; min-height: 100%;}
|
||
|
body {background-color: #333333;}
|
||
|
p {font-size: 10vh;}
|
||
|
h1 {font-size: 20vh; color: #FFFFFF;}
|
||
|
</style>
|
||
|
<body>
|
||
|
<p>Where tf is Jason?</p>
|
||
|
<h1><?= ucwords($output['device_tracker.jasonsphone_jason']['state']) ?></h1>
|
||
|
</body>
|
||
|
</html>
|