Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My Electric considers kWh to be cost of energy #174

Open
cricalix opened this issue Sep 8, 2022 · 0 comments
Open

My Electric considers kWh to be cost of energy #174

cricalix opened this issue Sep 8, 2022 · 0 comments

Comments

@cricalix
Copy link

cricalix commented Sep 8, 2022

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 added a commit to cricalix/emoncms_app that referenced this issue Sep 8, 2022
Addresses emoncms#174 by branching on the viewmode, and applying the unit cost to the kWh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant