app icon indicating copy to clipboard operation
app copied to clipboard

My Electric considers kWh to be cost of energy

Open cricalix opened this issue 3 years ago • 0 comments

The code block

    var daily = feed.getdata(use_kwh,start*1000,end*1000,"daily",0,1);
    
    var usetoday_kwh = null;
    if (daily.length>0) {
        usetoday_kwh = daily[daily.length-1][1];
    }
    
    if (usetoday_kwh!==null) {
        if (usetoday_kwh<100) {
            $("#usetoday").html((usetoday_kwh).toFixed(1));
        } else {
            $("#usetoday").html((usetoday_kwh).toFixed(0));
        }
    } else {
        $("#usetoday").html("---");
    }

in the My Electric app makes no distinction between the "energy" and "cost" modes, resulting in the cost today being the kWh used today. The logic applied elsewhere in the file for current usage -> current cost should be applied here too, branching on the energy vs cost operating mode.

image

image

cricalix avatar Sep 08 '22 08:09 cricalix