Octopus Energy Agile Tariff

i use the above and it works like a charm… very helpful as i get notified of any actions in my automation as needed. Try it out !

I’m unsure if you could turn on these devices. They normally require an input from a push-button.

I’m using Octoblock to provide the some best agile time slots for the day. But as I understand it octoblock runs from midnight for the full day calculations, but the agile prices are updated at 16:30. So any evening slots calculated will be incorrect once the new agile prices are published.

Ah. It runs every half hour and updates the whole days calculation every time.

1 Like

Is it possible to download greener day details and provide a green index of when best to do washing, charging etc?

using octoblock
trying to get the format for the price and date but seems to be ignord

so in my app.yaml

` price_round: 2
  time_format: "%a %-I:%M %p"`

but still showing as multiple dec places and date
is showing as time_format: “%Y-%m-%dT%H:%M:%S%Z”
as shown in GitHub - badguy99/octoblock: Octoblock is an app which works under AppDaemon within Home Assistant which finds the cheapest “n” hour block for import or the most expensive “n” hour block for export, and works out the price of that block, for the Octopus Energy, Agile Octopus / Agile Outgoing Octopus tariffs.

Not sure if anyone asked something similar before:

I’d lie to build an automation which looks at the rates on a daily basis, and if one or more of the periods are above a defined value, send an email with these time periods.

Any suggestions?

Did you fix this? I’m getting the same.

I’m doing something based on your example here. A couple of thoughts:

o Does anyone have any pointers on how to handle a request that does not get a reply or gets some kind of corrupted reply? How does one spot that the prices are junk and what does one do?

o Like others, I am making use of the MINIMUM price in the coming period to set a threshold (actually 2p higher) which I can use to decide when to charge batteries or other power-hungry activities. For this sort of automation, I am thinking that it might be better NOT to get prices every half hour but maybe only once or twice a day. That way I would have a stable minimum and not one that marched up once I had passed the true minimum. In particular, one can do different things with a NIGHTTIME minimum which you can’t do with a DAYTIME minimum*. I’m using sun elevation as a condition. Thoughts, anyone?

I found these examples extremely helpful and easy to get going - so thanks very much for that. I have about 24 hours experience with YAML. I’m a bit of a ‘C’ (or C++ at a pinch) old fogey when it comes to programming.

*footnote: The way my inverter works, when there is solar coming in that gets used before grid - which is usually great, but not so much when you get the occasional negative price. At night that’s not a problem but it does mean that a not all minima are the same.

As long as there is a way to loop through the rates / filter out the rates below your defined value using templates or similar, you should be able to do something along the lines of:

  • When: time is 6pm (or any time after the next day’s rates are available, in fact could trigger on that explicitly)
  • And if: any of the rates in the next day’s rates is above your defined value
    (i.e. the “rates” array in Electricity - Home Assistant Octopus Energy)
  • Then do: call service to send email notification via SMTP (SMTP - Home Assistant) with only the times/rates above your defined value

It actually sounds like quite a useful thing to do (and perhaps also the inverse if rates are particularly low), so if you didn’t already work it out I might have a go at it myself (if so I’ll post back here).

1 Like

I’ve had the octopus-rates-energy-card providing me the 30min slices of rates for ages, but (despite reading this thread) still not managed to work out how to simply have a small list of the cheapest times of the day (i.e. 5 cheapest 30hr slots) displayed on a card, or on a notification using HA. Has anyone else managed this?

I had a quick go at a template to pull this info - needs formatting and there is probably a neater way to do it but it should give the raw data as a starting point (the cheapest 5 rates of the current or next day):

{% set num_rates_required = 5 %}
{% set rates_sorted = state_attr("event.octopus_energy_electricity_<your IDs here>_<current/next>_day_rates", "rates") | sort(attribute="value_inc_vat") %}
{% for rate in rates_sorted %}
  {% if loop.index <= num_rates_required %}
    {{ rate.start }} to {{ rate.end }}: £{{ rate.value_inc_vat }}
  {% endif %}
{% endfor %}
1 Like

Hi there,
I’m the person that added the time/date and decimal place formatting to Octoblock.
It should work, I’m using it at the moment.
Here’s my app.yaml, maybe you have an error in the config?

octoblock:
  module: octoblock
  class: OctoBlock
  region: A
  import_code:AGILE-FLEX-22-11-25
  export_code: FLUX-EXPORT-23-02-14
  use_timezone: True
  price_round: 2
  time_format: “%a %-I:%M %p”
  blocks:
    - hour: 1
      Import: True
      start_period: now
      name: octopus_1hour