Octopus Energy Plugin is now Published in the plugin store

Posted on
Wed Apr 29, 2020 4:15 pm
neilk offline
Posts: 714
Joined: Jul 13, 2015
Location: Reading, UK

Octopus Energy Plugin is now Published in the plugin store

Hi UK Energy Customers.

You will find the plugin published in the plugin store http://www.indigodomo.com/pluginstore/232/ with the documentation at https://github.com/neilkplugins/Octopus_Energy-indigo-plugin/wiki

You do not need to switch electricity suppliers to make use of the plugin, if you are curious to see what "plunge pricing" could look like for your location then you can simply use it to see at any given point in time what "Time of Use" electricity rate could apply. In these strange times of lockdown, we have seen the longest periods of "negative energy pricing" when you are paid to consume electricity as the grid has surplus capacity. Minimal industrial demand couple with a long period of sunny and windy weather has actually resulted in a surplus of renewables (wind farms needed to be switched off). You could theoretically store energy in your power wall, and sell it back if you have a feed in tariff when the rates are high (or consume energy from your store during the evening peak).

Please let me know of any problems, feedback or feature requests. Consumption (for both Gas and Electricity) will come in future versions as well as the ability to show your actual costs from the previous day as soon as I can switch.

Thanks,
Neil

Posted on
Sun May 03, 2020 7:36 am
neilk offline
Posts: 714
Joined: Jul 13, 2015
Location: Reading, UK

Re: Octopus Energy Plugin is now Published in the plugin sto

Version 0.1.3 just published to the plugin store.

Release Notes:

Added write to event log when the rate is updated, useful to validate if all rate changes actually happened every 30 mins without needing the SQL logger

Added test that the CSV directory is writable (not just that it exists) in the plugin configuration

Added a defaulting option for CSV writing if the device property is checked but the path is null (defaults to the plugin prefs folder)

Improved error handling for API timeouts (discovered an uncaught error issue)

Posted on
Wed May 06, 2020 10:33 am
neilk offline
Posts: 714
Joined: Jul 13, 2015
Location: Reading, UK

Re: Octopus Energy Plugin is now Published in the plugin sto

Known Issue: When upgrading the plugin gets stuck in a "refreshing states" loop, a plugin restart clears it but of course that should not be necessary. Fixed in 0.1.6 and link updated to prevent accidental use

Do not use this version, included here to maintain the release integrity, skip to 0.1.6-alpha or later or wait for next official release via plugin store & update process.


Release Notes: (0.1.5)

Added write to event log when the rate is updated, useful to validate if all rate changes actually happened every 30 mins without neding the SQL logger

Added test that the CSV directory is writable (not just that it exists) in the plugin configuration

Added a defaulting option for CSV writing if the device property is checked but the path is null (defaults to the plugin prefs folder)

Improved error handling for API timeouts (discovered an uncaught error issue)

API calls are now persisted in the plugin, such that only a two API calls are necessary per day rather than the previous approach of every 30 mins

The "day" related device states will now reflect the BST if daylight savings applies rather than using UTC time

The code was restructured and improved for clarity

State name "UTC-Today" replaced by "API-Today" which should upgrade for existing devices, this shows the date of the last API refresh

You will still get variation through the day the max, min and average states as the full 48 periods are not available until after 17:00 UTC, so if you wish to log or graph these then that should be done after then.

New States added for "Yesterday Max/Min/Average and Standing Charge"

Testing continues and when satisfied this will be pushed to the plugin store
Last edited by neilk on Fri May 08, 2020 3:25 pm, edited 2 times in total.

Posted on
Fri May 08, 2020 4:29 am
neilk offline
Posts: 714
Joined: Jul 13, 2015
Location: Reading, UK

Re: Octopus Energy Plugin is now Published in the plugin sto

Pre-release version 0.1.6

KNOWN ISSUE #2 - In fixing one problem, a new one came to light locking the plugin up at 17:00Z / 18:00 BST, please skip to 0.1.7 but again consider it pre-release.


This supersedes 0.1.5 which should not be used.

Release notes

Fixes upgrade issue (in 0.1.5) where the logic did not elegantly handle (understatement) the upgrade of a running device. Device state name change refreshed correctly, but the resultant "" value surfaced a flaw in the logic to determine what if any updates are required in a cycle. Cause was an incorrect indentation that caused server updates to be created but not updated on the server.

Fixes issue with Yesterday_Standing_Charge.ui state that was accidentally hard-coded to "Today_Standing_Charge" rather than the value (would only have shown on a Control Page, but debugging the other issue surfaced it.

Fixes issue with the "yesterday rates" update running during the afternoon refresh cycle which is not the intended behaviour. Improved clarity of the logic for determining the necessary updates per cycle so code should be more readable (at least for me). This is not completely tested but at present this has no impact on plugin use, it is needed for future capability.

One final interim release will come prior to the next full release and will add capability to export the rate information to either the event log or to file on demand, and allow time for more testing
Last edited by neilk on Fri May 08, 2020 3:25 pm, edited 2 times in total.

Posted on
Fri May 08, 2020 4:36 am
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: Octopus Energy Plugin is now Published in the plugin sto

neilk wrote:
... One final interim release will come prior to the next full release and will add capability to export the rate information to either the event log or to file on demand, and allow time for more testing

That will be useful. :)

Posted on
Fri May 08, 2020 3:21 pm
neilk offline
Posts: 714
Joined: Jul 13, 2015
Location: Reading, UK

Re: Octopus Energy Plugin is now Published in the plugin sto

Pre-release version 0.1.7

https://github.com/neilkplugins/Octopus_Energy-indigo-plugin/releases/tag/0.1.7-Alpha

Hopefully the last pre-release before publishing to the plugin store (it is release number 13)

But hope is not a strategy, just delayed dissapointment :D

Release Notes

Fixed a bug that cause the plugin to lock up at 17:00Z

Added a device state to track if the "Afternoon API refresh" has actually taken place, and to ensure it does not for example get stuck in an endless loop at 17:00Z because the developer of the plugin is an imbecile. Also useful if you want to check the full days data is available before you do something with it.

Added "Device Actions" that will create rate csv's on demand for each device with the date, device name and suffix(es) "-Action-Today-Rates", "-Action-Yesterday-Rates" on demand. Currently the filename is built from the date, device name and the suffix. If you run the action multiple times in the same day it will overwrite. Open to other naming approach and suggestions welcome.

Added plugin Menu items to dump rates into the event log, or raw device data (again useful if a plugin developer produces multiple pre-release versions with similar failure modes for different problems)

I would say deploy this at your own risk ! I will complete full testing before pushing to the store.

Posted on
Sat May 09, 2020 11:45 am
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Octopus Energy Plugin is now Published in the plugin sto

Not sure if this is a bug or not.

Around an hour ago, I dumped the rates down to the log.

If I’m understanding right, it’s supposed to be today’s and yesterday’s rates, but it looks like the same rates based on the timestamps?

Might also be worth noting in Indigo log that the states have been dumped to debug/plugin log as they don’t show in main indigo log.


Sent from my iPhone using Tapatalk Pro

Posted on
Sat May 09, 2020 11:51 am
neilk offline
Posts: 714
Joined: Jul 13, 2015
Location: Reading, UK

Re: Octopus Energy Plugin is now Published in the plugin sto

Pre-release 0.1.8

https://github.com/neilkplugins/Octopus_Energy-indigo-plugin/releases/tag/0.1.8-Alpha

Addresses behaviour that was still not correct (but thankfully not badly behaved this time) in 0.1.7

- Corrects issue when rate dump to log only went to the debugLog (from the plugin menu)
- Clarified menu description for the "Raw Device Information" so say this only works if debugging is enabled

- Corrects issue when the "Afternoon Refresh" device state was being reset to false in error
- Correct issue when updates between 17:00Z and 17:30Z would all make an API request when it was not necessary
- Correct issue when the "Yesterday" states were incorrectly updated during the 17:00Z refresh actually removing the real yesterday rates

Posted on
Sat May 09, 2020 12:00 pm
neilk offline
Posts: 714
Joined: Jul 13, 2015
Location: Reading, UK

Re: Octopus Energy Plugin is now Published in the plugin sto

howartp wrote:
Not sure if this is a bug or not.

Around an hour ago, I dumped the rates down to the log.

If I’m understanding right, it’s supposed to be today’s and yesterday’s rates, but it looks like the same rates based on the timestamps?

Might also be worth noting in Indigo log that the states have been dumped to debug/plugin log as they don’t show in main indigo log.


Sent from my iPhone using Tapatalk Pro


Peter - yes I am afraid the update process was running twice rather than once a day so overwriting the rates. I need to confirm a fresh full 2 day test cycle but think this is sorted now

On the "Dump Raw Device" option I have fixed that so it goes into the server log, with the "Raw" option it seems indigo.server.log behaves differently than server.debugLog so I cannot just lazily dump the device instance in the same way, but it is really only needed for debugging so I just changed the description. I may remove this from the formal release anyway

0.1.8 addresses both of these.

Neil

Posted on
Sat May 09, 2020 12:03 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Octopus Energy Plugin is now Published in the plugin sto

Ah, I think we cross posted.

For the purposes of testing my Energy plugin I only lost about 3 hours of Agile pricing overnight so it was useful to go and grab it.


Sent from my iPhone using Tapatalk Pro

Posted on
Sat May 09, 2020 12:45 pm
neilk offline
Posts: 714
Joined: Jul 13, 2015
Location: Reading, UK

Re: Octopus Energy Plugin is now Published in the plugin sto

Peter,
I can get you a longer period with your postcode as it does give some historical directly from the API, just let me know
Cheers,
Neil

Posted on
Sun May 10, 2020 2:27 am
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Octopus Energy Plugin is now Published in the plugin sto

It’s ok, coincidentally the batteries in my Network Owl monitors died two days ago as well so I lost a day of solar and therefore my energy use figures are broke as it’s double (?) counted the use figures.

I’ve made it up using the days before solar to give me some semblance of real looking data for coding against.


Sent from my iPhone using Tapatalk Pro

Posted on
Sun May 10, 2020 8:21 am
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Octopus Energy Plugin is now Published in the plugin sto

neilk wrote:
Peter,
I can get you a longer period with your postcode as it does give some historical directly from the API, just let me know
Cheers,
Neil

Neil, can you check the log dumps.

I think you're missing 21:30 - 23:00 every time you dump the rates?

Posted on
Sun May 10, 2020 9:20 am
neilk offline
Posts: 714
Joined: Jul 13, 2015
Location: Reading, UK

Re: Octopus Energy Plugin is now Published in the plugin sto

Peter,
It is an anomaly of the Octopus API depending on when you dump the rates. I have just checked the API via Postman the current response for today and rate information is still not published, but it does seen to be by the early evening (That is why I do a second refresh). In fact while I was typing the extra rates for today have been updated. The anomaly is to do with the fact that the wholesale rates are published in CET so our current day cannot be completed until tomorrow is published in CET.

The latest pre-release version I have just posted actually gets yesterdays data from the API so it is not impacted by the timing and conditional logic issues I was having, so when you dump that you will get the full 48 periods (as they will all be available) and depending when you dump for today you will get 46 prior to 17:00Z / 18:00 BST and 48 after that refresh.

The other advantage of this approach is that the "Yesterday information" is available immediately after the device is created. Your devices will correct this automatically during the 18:00 refresh today, or you can create a new device with the same postcode and it will populate yesterday on it's first refresh.

I am confident I have simplified the conditional logic that was confusing me and resulted in the errors but I need to run it through a couple of days worth of testing cycles given I thought I had it sorted before, and do some more regression testing etc.

https://github.com/neilkplugins/Octopus_Energy-indigo-plugin/releases/tag/0.1.10-Alpha

Thanks,
Neil

Posted on
Sun May 10, 2020 9:24 am
neilk offline
Posts: 714
Joined: Jul 13, 2015
Location: Reading, UK

Re: Octopus Energy Plugin is now Published in the plugin sto

Pre-Release 0.1.10-Alpha now available.


Release Notes:

The "yesterdays rates" functionality now refreshes from the API rather than the locally cached data. This is more robust if the process inadvertently runs twice in a day and newly created devices will have this data available immediately

Simplified and cleaned up the overly complex conditional logic that evolved rather than being designed and resulted in lack of clarity. improved readability and comments in the code to assist this

Note: The "Yesterday_Standing_Charge" state is set at todays rate on the initial device refresh after creations. this is because the API does not publish historical standing charge. This is a design choice as the only situation where this could be inaccurate is if the rate changed the day before the device was created. In that case it will be accurate moving forward, and that is better than having a default hard coded. The impact even if it happened should be minor, and it is better than under reporting it to zero.

This version is undergoing final testing, and when happy will be pushed to the plugin store

Who is online

Users browsing this forum: No registered users and 1 guest

cron