Speak EV - Electric Car Forums banner

1 - 4 of 4 Posts

·
Registered
Joined
·
1,006 Posts
Discussion Starter #1
While I wait for my billing to be sorted out - I am told that any gaps in the consumption create a manual task for their backend folk to sort out - I have been finally playing with the Octopus API. It's basic but good enough.

The docs are here: Octopus Energy API — Octopus Energy API 1.0 documentation
Your API key and example queries are linked to from the bottom of your Account Info page on the portal.

Just for play, I've continued building out my Node-Red flows and have added MySQL/MariaDB as a backend to store the data. I have filled the tariff and consumption tables from the start of July (when my smart meter went live) and done some very basic queries of pricing. Each day I let the system fetch new tariffs and previous day's consumption. The consumption data is a day behind - this is apparently a data cost thing with fetching the data across the 3rd party infrastructure.

I can see the gaps in my data, there should be 48 1/2 hour values each day:

MariaDB [home]> select date_format(interval_start, "%Y-%m-%d") as date, count(*) as intervals from consumption group by date having count(*) != 48 and date <> curdate();
+------------+-----------+
| date | intervals |
+------------+-----------+
| 2018-07-05 | 46 |
| 2018-08-08 | 2 |
| 2018-08-09 | 46 |
+------------+-----------+


and only just starting, but monthly electricity costs:

MariaDB [home]> select date_format(t.valid_from, "%Y-%m") as month, sum(t.value_inc_vat * c.electricity_kwh) as pence from agile_tariffs t, consumption c where t.valid_from = c.interval_start group by date_format(t.valid_from, "%Y-%m") order by valid_from desc;
+---------+--------------+
| month | pence |
+---------+--------------+
| 2018-09 | 2985.9858945 |
| 2018-08 | 3540.0420195 |
| 2018-07 | 2414.4872850 |
+---------+--------------+


Highest usage dates:

MariaDB [home]> select date_format(interval_start, "%Y-%m-%d") as date, sum(electricity_kwh) as kwh from consumption group by date order by kwh desc limit 10;
+------------+--------+
| date | kwh |
+------------+--------+
| 2018-09-09 | 27.983 |
| 2018-08-27 | 26.430 |
| 2018-09-16 | 22.012 |
| 2018-08-23 | 20.688 |
| 2018-09-10 | 16.891 |
| 2018-08-19 | 16.466 |
| 2018-07-14 | 16.084 |
| 2018-08-01 | 14.535 |
| 2018-08-16 | 12.475 |
| 2018-09-11 | 12.050 |
+------------+--------+


Anyway, just playing for now, but once the database is filled reliably I can see more reporting (and tidier SQL!) coming out of it.

Anyone wants specifics of node-red flows just ask. It's a little messy right now:

upload_2018-9-21_18-51-6.png
 

·
Registered
Joined
·
334 Posts
Came across this... Agile now integrated with IFTTT.

Whether you’ve got Agile or not, what would (or could) you use a time of use tariff with IFTTT integration?

Be good to hear some ideas.

I think when we look at the discretionary electric consumption then we might think it’s not worth it but it all adds up

Octopus Energy automates Agile tariff to create smart homes - Utility Week
 

·
Registered
Joined
·
279 Posts
Resurrecting this thread, but I was wondering if anybody has automated anything based on electricity prices on Agile? I looking at what I could do for car charging, and thinking that a python script which:

  • On Vehicle plug-in, make sure the charge is off, and then...
  • Get Octopus rates for next 24 Hours (Octopus API)
  • Get state of charge (for me via BMW Connected Drive)
  • Calculate energy required to get car to desired SoC
  • Divide energy by power (e.g. 15kWh / 7.2 kW = 2h 5m)
  • Round up to the nearest 30m
  • Search rates for lowest priced period of that length (before desired departure time)
  • Enable charging at start of that period. (via an OpenEVSE charger)
  • Monitor SoC and disable once desired level is reached.
...shouldn't be too difficult. I'm thinking I'd use something like Node-Red or HomeAssistant to bind it all together, but I don't want to reinvent something that somebody else might already have.

Anybody done anything like this already?
 

·
Registered
Joined
·
77 Posts
Resurrecting this thread, but I was wondering if anybody has automated anything based on electricity prices on Agile? I looking at what I could do for car charging, and thinking that a python script which:

  • On Vehicle plug-in, make sure the charge is off, and then...
  • Get Octopus rates for next 24 Hours (Octopus API)
  • Get state of charge (for me via BMW Connected Drive)
  • Calculate energy required to get car to desired SoC
  • Divide energy by power (e.g. 15kWh / 7.2 kW = 2h 5m)
  • Round up to the nearest 30m
  • Search rates for lowest priced period of that length (before desired departure time)
  • Enable charging at start of that period. (via an OpenEVSE charger)
  • Monitor SoC and disable once desired level is reached.
...shouldn't be too difficult. I'm thinking I'd use something like Node-Red or HomeAssistant to bind it all together, but I don't want to reinvent something that somebody else might already have.

Anybody done anything like this already?
Open Energy Guys are doing some stuff in emoncms

My site only pulls the info together each night

The Ohme charger pulls tariff data from Octopus
 
1 - 4 of 4 Posts
Top