Octopus Agile emoncms app


I also had to manually select the renamed feed in “My Solar” but having done that everything is now displaying as expected.


@TrystanLea, just exploring this App again - can you confirm, the ‘Cost/Value’ is the cost of the energy used if it had been on the Agile Tariff?

If this is calculating it correctly, for the last month average cost is 9.6p/kWh. My current tariff is 12.7p/kWh.

Could you offer the ability to download the data used to create the chart?

I had a look at this app, having seen encouriging 2 yr data in the other thread (and SpeakEV) from @Zarch.
Unfortunately I only have 2 weeks of data on emonCMS, but this app tells me my overall unit price will be only 6.2p. :open_mouth:
(EV charging, solar panels and we rarely use electric oven to cook dinner)

Same question as above, is it really overall average per unit cost of energy for my usage?

A similar but related question: any way to get current Agile unit price as an input in emonCMS?

(from another thread)

That is what the App does. If you click on day, you will see the red line continues up to 11pm - that is the forward pricing.

I zoomed in and looked at a couple of hours worth of data and did the sums and they seemed to work.

For me the next step is to see how accurate my EmonTX is v the meter readings.

1 Like

Yes this is correct. Here’s the section in the code where the calculation takes place:
app/octopus.php at master · emoncms/app · GitHub

let cost_import = data.agile[z-1][1]*0.01; // conversion from p/kWh to £/kWh
total_cost_import += kwh_import*cost_import // kWH in half hour x cost £/kWh

The average unit cost and running totals are then printed to the table just below that:

var unit_cost_import = (total_cost_import/total_kwh_import);

var out = "";
out += "<tr>";
out += "<td>Import</td>";
out += "<td>"+total_kwh_import.toFixed(1)+" kWh</td>";
out += "<td>£"+total_cost_import.toFixed(2)+"</td>";
out += "<td>"+(unit_cost_import*100*1.05).toFixed(1)+"p/kWh (inc VAT)</td>";
out += "</tr>";

There’s a multiplication by 1.05 to account for 5% VAT in the final unit price there too.


I’m wondering whether it is possible to get the instantaneous price into the rest of emonCMS.

In the app, there’s a “Current Price” display. This information would be very useful to display somewhere if I were to switch to Agile. Hence it would be great if it can be made available as an Input in the input table on emonCMS.

1 Like

As the data has already been pulled in, it is in the ‘database’ somewhere. Looking at the code I think a craftily constructed API call might pull the information out. @TrystanLea will be able to confirm.

1 Like

I’m getting this error on iPhone 13.3.1 when rotating the screen with your agile web page:

EmonCMS Error
Message: Error: Invalid dimensions for plot, width = 607, height = 0
Route: Lib/flot/jquery.flot.min.js?v=10
Line: 1
Column: 4094
Error: {"line":1,"column":4035,"sourceURL":""}

The data is actually pulled straight from emoncms.org in this app rather than mirrored locally. The data is available here Emoncms - graph including options to export selected views as CSV.

1 Like

Thanks @wyx087, I’ve created an issue to keep track of this here Invalid dimensions for plot on mobile device in landscape · Issue #135 · emoncms/app · GitHub this will be fixed at the next development iteration


Make me a +1 on this error. Amazon Kindle Fire HD8, using either Chrome or Silk browsers.

Something to do with the zero height???


Same here, on Android phone. I updated my Emonpi to get the Agile app, it was okay before the update.

@TrystanLea this catches me out everytime I look at it.


It isn’t the last half hour, it is the use in the current half hour block.

1 Like

I’ve just switched to Octopus Agile from Octopus Daily Tracker.

I’m loving the emoncms App. Good work @TrystanLea so far my daily usage has cost me 11 pence!


@TrystanLea I notice there has been an update to this app recently. I really like the new square lines for each half-hour and the drop-down for named periods. But… the agile outgoing prices in the table below were broken in the update.

Ref. Screenshots. Between 4pm and 7pm today the outgoing price was between 10.87p and 12.26p. The line on the graph looks right, but the 3.8kW export must be worth circa. 40p not 15p as shown in the table.

Been using the Octopus Agile app for quite a few months now and found it really useful. Noticed yesterday that a newer version was available so updated and now the totals are incorrect for cost over the period selected. Agile tariffs rates are correct.

Very noticeable early this morning as the cost per kWh was 0p and the bar total for that half says 19.6p? (see photos)

So I checked the monthly totals and they are also incorrect… 450kWh coming in at £37.11 which is also incorrect. It’s actually £16.85.

If you want my data give me a shout. It’s stored locally on the EmonPi but I can upload if needed.

Screenshot 2020-05-10 at 08.15.01|612x500

Thanks @kylelamb @ddewson I will take a look to see what is going wrong

Should now be fixed, available via standard update and on emoncms.org, thankyou for spotting!

1 Like

Just looking at his again, could the hover box be amended slightly


  • Could it include energy used and cost in both views?
  • Could it be clear that the time is the start time?

Overall, could the standing charge costs be included plus an option for a user to include their current tariff so providing a direct comparison?

Thanks, fixed.