mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-02-04 23:55:40 +00:00
First implementation of energy accounting
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
var nextVersion;
|
||||
var im, em;
|
||||
var ds = 0;
|
||||
var currency = "";
|
||||
|
||||
// Price plot
|
||||
var pp;
|
||||
@@ -432,6 +433,7 @@ var drawPrices = function() {
|
||||
timeout: 30000,
|
||||
dataType: 'json',
|
||||
}).done(function(json) {
|
||||
currency = json.currency;
|
||||
data = [['Hour',json.currency + '/kWh', { role: 'style' }, { role: 'annotation' }]];
|
||||
var r = 1;
|
||||
var hour = moment.utc().hours();
|
||||
@@ -750,6 +752,18 @@ var fetch = function() {
|
||||
}
|
||||
}
|
||||
|
||||
if(json.ea) {
|
||||
$('#each').html(json.ea.h.u.toFixed(2));
|
||||
$('#eachc').html(json.ea.h.c.toFixed(2));
|
||||
$('#eacd').html(json.ea.d.u.toFixed(2));
|
||||
$('#eacdc').html(json.ea.d.c.toFixed(2));
|
||||
$('#eacm').html(json.ea.m.u.toFixed(2));
|
||||
$('#eacmc').html(json.ea.m.c.toFixed(2));
|
||||
$('#eax').html(json.ea.x.toFixed(2));
|
||||
$('#eat').html(json.ea.t.toFixed(2));
|
||||
$('.cr').html(currency);
|
||||
}
|
||||
|
||||
if(json.me) {
|
||||
$('.me').addClass('d-none');
|
||||
$('.me'+json.me).removeClass('d-none');
|
||||
|
||||
Reference in New Issue
Block a user