Текущее потребление электроэнергии
(custom)
<link rel="stylesheet" href="/css/font-awesome.min.css" />
<style>
table {
font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
font-size: 14px;
text-align: left;
border-collapse: collapse;
width: 100%;
margin: 0 auto;
}
td {
border-bottom: 1px solid #E9E9E9;
padding: 5px;
background: white;
}
</style>
<table>
<tbody>
<tr>
<td><span><i class="fa fa-bolt"></i></span></td>
<td><span>Потребление</span></td>
<td><span id="cur_power"></span></td>
</tr>
<tr>
<td><span><i class="fa fa-clock-o"></i></span></td>
<td><span>Последний час</span></td>
<td><span id="last_hour"></span></td>
</tr>
<tr>
<td><span><i class="fa fa-calendar"></i></span></td>
<td><span>Текущий день</span></td>
<td><span id="this_day"></span></td>
</tr>
</tbody>
<table>
<script>
var last_hour, _today;
$.ajax({
url: '/objects/?script=Данные%20потребления%20электроэнергии%20за%20последний%20час%20и%20сегодня',
type: 'GET',
dataType: "json",
async: false,
success: function (data) {
last_hour = data[0].Last_hour;
_today = data[0].Today;
}
});
$("#cur_power").html((%HomePowerMeter.W%/1000).toPrecision(3)+" КВт");
$("#last_hour").html(last_hour+" КВт*ч");
$("#this_day").html(_today+" КВт*ч");
</script>