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

Octopus app does not calculate Go pricing when SolarPV enabled #180

Open
delboy711 opened this issue Feb 3, 2023 · 0 comments
Open

Octopus app does not calculate Go pricing when SolarPV enabled #180

delboy711 opened this issue Feb 3, 2023 · 0 comments

Comments

@delboy711
Copy link

I have just started using the Octopus app and found the 'Import Go' costs are always £0.00.

I traced the problem to the function graph_load() the code block starting at line 816 tests for solarpv mode. If true it calculates costs for 'Agile' tariff, but not for 'Go' tariff. If solarpv mode is false it calculates for both tariffs.

This revised code block works for me.

            if (solarpv_mode) {
                // ----------------------------------------------------
                // Solar PV agile outgoing
                // ----------------------------------------------------
                // calculate half hour kwh
                let kwh_use = 0;
                let kwh_import = 0;
                let kwh_solar = 0;

                if (use_kwh[z]!=undefined && use_kwh[z-1]!=undefined) kwh_use = (use_kwh[z][1]-use_kwh[z-1][1]);
                if (import_kwh[z]!=undefined && import_kwh[z-1]!=undefined) kwh_import = (import_kwh[z][1]-import_kwh[z-1][1]);
                if (solar_kwh[z]!=undefined && solar_kwh[z-1]!=undefined) kwh_solar = (solar_kwh[z][1]-solar_kwh[z-1][1]);

                // limits
                if (kwh_use<0.0) kwh_use = 0.0;
                if (kwh_import<0.0) kwh_import = 0.0;
                if (kwh_solar<0.0) kwh_solar = 0.0;

                // calc export & self consumption
                let kwh_solar_used = kwh_use - kwh_import;
                let kwh_export = kwh_solar - kwh_solar_used;

                // half hourly datasets for graph
                data["use"].push([time,kwh_use]);
                data["import"].push([time,kwh_import]);
                data["export"].push([time,kwh_export*-1]);
                data["solar_used"].push([time,kwh_solar_used]);

                // energy totals
                total_kwh_import += kwh_import
                total_kwh_export += kwh_export
                total_kwh_solar_used += kwh_solar_used

                // costs
                let cost_import = data.agile[2*(z-1)][1]*0.01;
                let cost_import_go = data.go[2*(z-1)][1]*0.01;
                let cost_export = data.outgoing[2*(z-1)][1]*0.01*-1;
                
                // half hourly datasets for graph
                data["import_cost"].push([time,kwh_import*cost_import]);
                data["import_cost_go"].push([time,kwh_import*cost_import_go]);
                data["export_cost"].push([time,kwh_export*cost_export*-1]);
                data["solar_used_cost"].push([time,kwh_solar_used*cost_import]);

                // cost totals
                total_cost_import += kwh_import*cost_import
                total_cost_import_go += kwh_import*cost_import_go
                total_cost_export += kwh_export*cost_export
                total_cost_solar_used += kwh_solar_used*cost_import

                if (show_carbonintensity) {
                    let co2intensity = data.carbonintensity[2*(z-1)][1];
                    let co2_hh = kwh_import * (co2intensity * 0.001)
                    total_co2 += co2_hh
                    sum_co2 += co2intensity
                    sum_co2_n++;
                }

            } else {
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