Thanks for the reply, this prompted me to finally sort this out. For information @AP05TLE that doesn’t work during summer as all the values are 1 hour out. A simple fix is to add local=false in each of the timestamp_custom functions. So timestamp_custom (’%Y-%m-%dT%H:%M:%SZ’, local=false)
However, this solution hits the Octopus API servers every 30 seconds which seems wrong when the data is only updated once per day. My solution, currently in testing, is to create an automation that updates the rest sensor every 24 hours at 16:10pm. I still need to add a test to take action in case of failure…
and then create a template sensor that searches through the list to pull out the correct data for the 30 minute slot. The various triggers ensure the value is updated at restart etc. and defaults to 7.5p if an invalid result is obtained.
Thanks @gedger - very helpful. I’ll give it a try
somewhere back in the depths of this post it was mentioned that setting scan interval didn’t work and the api was being hit anyway. Have you checked this in your tests?
This feels like a very stupid question (well it probably is) but just starting to look at this and skimming through the thread here this doesnt seem to be an issue for others but just trying to load up/install for the first time I dont know what to fill in on the front page? Do I need to bypass this by populating configuration.yaml?
As a further update I’ve now created a simple markdown card to display Octopus Outgoing data as a table. It only shows the future rates from now. The styling is done by the card-mod plugin so delete the style section if you don’t want to use this.
Hey everybody. Before I dust off the HA syntax docs, does anybody have the logic to select top X most £ per KW exported slots and trigger an action only for these per day?
I can find a lot of examples of if value > INT, but that could be 12 30 mins slots and my batteries would be flat after 4 slots, so ideally I want to limit it to the most profitable slots to force discharge my batteries.
Hello, Looks like this thread has not been touched in a long time (or I don’t understand the time stamps). World went and firmly stayed in the proverbial, but from an Octopus Agile point of view its getting better/cheaper it seems. October has seen 8 plunges at the time of post and many sub 10p slots. Average (based on nothing but glancing at energy-stats and agileprices website graphs) is about 20-25p which is cheaper than most tariffs available. How long this will last for, who knows, too much turmoil. I however am in the lucky position that I am capped at 35p till May 2023, while over Summer I almost never saw it dip below 35p its getting back to being rare to seeing it got to 35p over than 4-7pm.
Anyway, Has anyone been working on anything Agile related in HA? I have the Octopus Energy and Octopus Agile HACS integrations working which works great for viewing and basic on/off scenarios for plunges and user defined cheaper than scenarios, has anyone got anything new to share?
I have just had 6kw of Solar Panels and 9.5kwh battery installed to mitigate the insanity to a point and should finally be able to export as of Monday and be paid for it. Sadly Agile Outgoing has the negative impact of the cheaper energy mentioned earlier. Will still stick with it though for a bit even though Octopus SEG is now 15p per kwh. May switch once calculations have been done as to what works out better.
My ideal scenario would be to maximise the plant I have to minimise cost of import and maximise the cost of export. This would need to be timed and scripted carefully.
So specifically I need:
a way to charge my battery on plunges but never overshoot. Octoblock seemed the best option for this but not available in HACS and if I try to install custom repo to the git then it errors with “<Integration badguy99/octoblock> Repository structure for v0.2.2 is not compliant”. Was hoping it would do 30 minute minimum as a block too but does not seem to work. Installed Manually.
a method to charge my battery from the cheapest slots IF the solar won’t cover the demand
exporting of energy at the peak prices. Import needs to be lower than export price at all times.
So in a nut shell, act as a cost effective battery for the grid with Solar being the preference source.
Hoping I don’t have to re-invent the wheel here and that the silence is just temporary. Would love to never have to look at the logo again one day and just sit back in the confidence that there is no other earthly way to get cheaper energy and be maximising the return on my investment.
Look forward to this threads revival (or am I alone now? and just a mad man shouting into a long emptied event hall…?)
So… I’m getting my kit installed in a couple of weeks and have been playing with some Python code to optimise usage based on historical data. My objective is to write something in appDaemon that will optimise the next 24 hours based on forecast.solar, my typical usage for a xxxday in month and the tariff I am on. At present I’m on Octopus Eco7 and I’m not sure whether I will switch to Agile. My gut tells me that this we are in the lull before the storm for Eurpoean utility prices: gas stores are full, the weather is mild, there’s still some solar being generated but it’s been pretty windy. Long term wholesale energy prices are still high so the market says it’s a temporary blip. That said, there is more scope for optimising usage when on a fixed rather than an agile tariff - though with limited solar at present it seems to be as simple as “charge your battery at night”:
I don’t suppose anyone has the knowledge to display the Outgoing rates using the Agile rates card? I would like the outputs in the same format but cannot seem to make it work
I have tried to adjust a copy of the agile-rates-card.js to use the attributes format from the sensor.octopus_outgoing but my limited JS coding skills are holding me back.
Hi so i might me able to help with getting Octoblock on to your HA. Ive just been trying to work out the same thing as you and been able to add it to HA without using HACS as i got the same error as you. For a while i was trying to add the information as i would for any other sensor in the config file for HA and custom components folder. But as it turns out it needs to be within the App Deamon folders.
Steps as follows:
Make sure that app Daemon and file editor are installed.
Download the Git repository for Octoblock
Using file editor copy the ‘octoblock.py’ file into the config/appdeamon/apps folder
add the templated code to the apps file from the github apps.yaml area that starts with ‘octoblock:
module: octoblock’
If you restart the app deamon add on you should see those sensors in HA
you can then edit the parameters following the Github to choose what you want out of those entities
We are back on Agile after a year away on Go, so I am trying to put everything back.
Something we used a lot was the rates card from MarkG, but as both it and the integration that drove it are no longer maintained and are appear to be broken, I wonder if anyone had an alternative.
I see above there is an outgoing rates card that has been developed, which I have tried to modify, but without much luck. I can see the content is in the Octopus integration under sensor.octopus_energy_electricity_xxxx_xxxxx_current_rate but haven’t found an easy way to extract it. Does anyone have anything I can borrow?
I am in the same boat. I have moved to Agile a couple of days ago. I use the Octopus integration and then markdown card to display simple table with the upcoming rates.
type: markdown
content: >
Time Price
{%- set results =
state_attr('sensor.octopus_energy_electricity_xxxxxxxx_xxxxxxxxxx_current_rate',
'rates') %}
{%- for record in results %}
{%- set ts = as_timestamp(record.from) %}
{%- set ts_now = ((as_timestamp(now())/1800)|round(0,'floor')|int * 1800) %}
{%- if ts >= ts_now %}
{{ ts|timestamp_custom ('%H:%M', local=true)
}} {{
record.rate }}
{%- endif %}
{%- endfor %}
title: Octopus Agile Rates