Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Octopus Free Electricity Sessions #973

Closed
1 of 2 tasks
jonathanadams opened this issue Aug 14, 2024 · 71 comments
Closed
1 of 2 tasks

Octopus Free Electricity Sessions #973

jonathanadams opened this issue Aug 14, 2024 · 71 comments
Assignees
Labels
enhancement New feature or request

Comments

@jonathanadams
Copy link

jonathanadams commented Aug 14, 2024

Describe the feature

I’ve received a email from octopus today advertising their free electricity sessions.

Is there a way this can be integrated into this integration. For example similar to saving sessions with a sensor or an event? Would be nice to be able to automate based on free electricity.

https://octopus.energy/free-electricity

Expected behaviour

N/A

Use Case

A sensor to be able to automate from.

Confirmation

  • By submitting this feature request, you agree that you have read the documentation and confirmed it does not already exist
  • I am willing/able to help contribute to the solution of this feature
@jonathanadams jonathanadams added the enhancement New feature or request label Aug 14, 2024
@Gary-Manuel
Copy link

I logged in to make exactly the same request.
Would be a great enhancement.

@philipdouglas
Copy link

Yeah, me too! 😆 It doesn't look like they've added anything to the API for it, but maybe it will use the same mechanism as saving sessions? I guess we'll see tomorrow...

@BottlecapDave
Copy link
Owner

Thanks for raising. It feels like this doesn't offer a high tech solution yet as we're opting in via web forms. I too can't see anything in the API regarding these sessions and people have asked if there's an API in the OE forums, but have yet to have a reply.

Once it's available, it'll be a top priority to add it as it will benefit a large number of people.

@greedyboyuk
Copy link

Thanks for very thorough answer & future commitment if & when Octopus add it to the API. 🤞👍🤙

@plord12
Copy link

plord12 commented Aug 14, 2024

I simply added a calendar entry for tomorrow and created automations from that.

If/when we get an API working, the calendar can be deleted and the automation trigger tweaked.

@elyobelyob
Copy link

Same, I've added a calendar entry which will kick off some devices. But at ~4p per kWh on Agile I'll not be saving much.
Also had a look through GraphQL stuff and couldn't see anything. I suspect it's more of a marketing thing rather than a full time policy. So, the amount of work to change the API for "2 or 3 sessions before winter" would unlikely happen.

@plord12
Copy link

plord12 commented Aug 14, 2024

Yea, exporting the battery charge before the free hour (and then re-charge) is worth more.

@chris-y
Copy link

chris-y commented Aug 15, 2024

Same, I've added a calendar entry which will kick off some devices. But at ~4p per kWh on Agile I'll not be saving much. Also had a look through GraphQL stuff and couldn't see anything. I suspect it's more of a marketing thing rather than a full time policy. So, the amount of work to change the API for "2 or 3 sessions before winter" would unlikely happen.

I already have a calendar for Power-Ups (which coincide with this first session anyway) to trigger battery charging.

I think this is a test of the "reverse saving sessions" that were announced as part of the extension of the grid balancing schemes. Those aren't due to start until after winter (in winter we get the regular saving sessions, then afterwards we get the reverse), so likely Octopus are running a few off their own back to gauge interest or work out how much to bid, or maybe even inform the process (not sure if there is industry discussion going on but I suspect it's likely). It will probably be merged into the Saving Sessions API when that scheme restarts.

@Quickstep3
Copy link

+1 for this. Have an automation script to trigger everything to max import manually (or at specific time which seems to be 1pm generally) but would be great if for this integration to pick up anything the Octopus API exposes and use that as a trigger

@RobinXe
Copy link

RobinXe commented Aug 18, 2024

With the second one happening today, it looks like the signup only happens once, and then you're opted in for all of them, unlike SSs. Whether this continues to be the case when the move out of trail phase clearly remains to be seen. I too suspect that Octopus are doing this to demonstrate the capability to the Grid.

One thing that occurred to me during the last one, as my solar provided power to fully half of the stuff that I was doing to try to use more energy, is that I'm not entirely sure that it's worth it for IO customers with solar and battery, when you could potentially make more exporting the solar than you're saving against a shifted import cost of 7 p/kWh. Not entirely sure how to quantify it yet, but I'll add it to the list of things to think about when I have time!

@Quickstep3
Copy link

Quickstep3 commented Aug 18, 2024

given it's sunny and we've already got a full battery here I've set my solar and battery to export max (i.e. with battery topping up generation to max inverter rating) this morning and can then import and charge the battery for free and export that again later. As battery is rated 10kWh @5kw delta will be 5kWh in at 0p and out (later) at 15p => MAXIMUM +75p not accounting for loses over doing nothing PLUS whatever else we can import (e.g. immersion heater) LESS the local solar generation from 1-2pm.

@DavidqStokes
Copy link

As today is the second free energy day I was also thinking about setting up automations to schedule the home battery and th EV to charge. I also was also about to suggest adding an entity for free electricity (if available from the OE API) so would also use this enhancement.

@plord12
Copy link

plord12 commented Aug 20, 2024

One thing that occurred to me during the last one, as my solar provided power to fully half of the stuff that I was doing to try to use more energy, is that I'm not entirely sure that it's worth it for IO customers with solar and battery, when you could potentially make more exporting the solar than you're saving against a shifted import cost of 7 p/kWh. Not entirely sure how to quantify it yet, but I'll add it to the list of things to think about when I have time!

Yea, good point. I suppose you could set a rule based if it's a sunny day or not.

@DavidqStokes
Copy link

It depends on your solar setup. I'm on the original FIT scheme and we get paid 65p per kWh for generating, not for export.
Any additional free import is worth it as the solar PV only generates 3.2kW, and if we charge the home battery (at 3kW) and the EV (at 7kW), run appliances etc we still use an extra ~8kWh, which is worth 8 x the difference between our day and night rate.

Plus, we're reducing curtailment, which is good for everyone.

@craig1410
Copy link

given it's sunny and we've already got a full battery here I've set my solar and battery to export max (i.e. with battery topping up generation to max inverter rating) this morning and can then import and charge the battery for free and export that again later. As battery is rated 10kWh @5kw delta will be 5kWh in at 0p and out (later) at 15p => MAXIMUM +75p not accounting for loses over doing nothing PLUS whatever else we can import (e.g. immersion heater) LESS the local solar generation from 1-2pm.

You don't necessarily lose the solar generation between 1-2pm because some people (like me) have DC coupled solar, so I can absorb solar energy into my batteries, as long as the batteries are not full, regardless of what I'm doing on the AC side. So for the first Free Electricity session, I force exported for an hour before the 1-2pm session then charged my batteries at max charge rate (70A) plus absorbed solar PV at (IIRC) 40A or so (it was a cloudy day) for a total of 110A battery charge current. By force exporting at around 4kW I netted an extra 60p of export and then I imported again for free at around 3.5kW to get my batteries more or less back to where they were. Actually my charge level afterwards was higher due to the simultaneous PV storage.

@plord12
Copy link

plord12 commented Aug 21, 2024

It would be great if we could find a way to take a set of household settings and auto generate rules.

(where household settings includes electricity supplier details, ev details, solar details, battery details, heating details, goals etc)

Could get complicated, I guess ...

@ragg987
Copy link

ragg987 commented Aug 22, 2024

Is it possible to over-ride the rate during the free periods? At present costs in HA are calculated based on the full rate (~24p for IOG). The results for the first session just dropped in, I imported nearly 6kWh extra during that period. Not too shabby given I generated 3kWh solar power at the same time. But instead of showing a cost of zero it is showing it as £1.45.

@craig1410
Copy link

Is it possible to over-ride the rate during the free periods? At present costs in HA are calculated based on the full rate (~24p for IOG). The results for the first session just dropped in, I imported nearly 6kWh extra during that period. Not too shabby given I generated 3kWh solar power at the same time. But instead of showing a cost of zero it is showing it as £1.45.

I think this will be complicated to get accurate because the electricity used during the "free" period isn't actually all free. It's only the EXTRA energy you used compared to your 10 day average, and they even separate out week days and weekends when calculating what "normal" is for you. They also exclude free sessions when calculating normal.

In my case I got told by Octopus that I used 10.47kWh overall and my normal consumption is 0.01kWh so I used 10.46kWh extra. That is 103524% more than normal and worth £2.40 according to them, but that's assuming I used that energy at peak rate when it's far more likely I would have used it at off-peak rate to charge my batteries, or for free from PV.

@ragg987
Copy link

ragg987 commented Aug 23, 2024

@craig1410 that is a good point. I was not clear, was wondering if there was a manual way to override the rate. Potentially retrospectively. I think it's off topic for the original feature request.

@BottlecapDave
Copy link
Owner

I think this will be complicated to get accurate because the electricity used during the "free" period isn't actually all free. It's only the EXTRA energy you used compared to your 10 day average, and they even separate out week days and weekends when calculating what "normal" is for you. They also exclude free sessions when calculating normal.

This is a difficult one, as technically it's still cost you this amount it's just your account will be credited the difference. Some people might not want this deducted because of this technicality.

However I'm currently building the sensors to show the target/baseline for saving sessions, which is a similar calculation. I'm not wanting to overload the the OE APIs to get the data for the target periods, so I'm hoping to try and build up a local copy of this data as I retrieve the previous consumption data. This principle could potentially be used for free electricity sessions, but will be difficult when importing retrospectively via the availale service. Alternatively, I might be able to look at the account balance for certain payloads which indicate credit from these sessions, but again this could be expensive when importing retrospectively.

Either way, it's something that needs to be addressed (along with updating target rate sensors to optionally favour free electricity sessions, but this too could get complicated as it depends on what you're using the sensor for)

Is it possible to over-ride the rate during the free periods? At present costs in HA are calculated based on the full rate (~24p for IOG).

This was never built into the system as it was always assumed OE would provide the correct accurate data :) I'm also not sure it's possible with how HA stores the data, as they store each hour as an ever growing sum. This means if you want to change a record from a few days ago, you need to change all subsequent records.

@Gary-Manuel
Copy link

Gary-Manuel commented Aug 23, 2024 via email

@8none1
Copy link

8none1 commented Aug 23, 2024

I put together something which publishes a JSON object with the start and end times of Power Ups in my region (NB: Power Ups are not the same as Free Electricity Session) here:

https://www.whizzy.org/2024-01-24-powerups-api/

I'm currently adding support for Free Electricity Sessions (FES) too, and I will post here when it's working, likely in the next couple of days. It will use the same concepts but publish to a different JSON object so PUs and FESs will work independently.

Until OE publish a proper API for FES people following this thread might find this new data source useful.

Expect it to be fragile though. The style of the FES announcement emails hasn't completely settled down yet and my egregious use of regex will likely cause problems when it changes. I'm motivated to keep it working though, so a fix probably won't be far away.

@Gary-Manuel
Copy link

Gary-Manuel commented Aug 23, 2024 via email

@gcoan
Copy link
Contributor

gcoan commented Aug 23, 2024

I put together something which publishes a JSON object with the start and end times of Power Ups in my region (NB: Power Ups are not the same as Free Electricity Session) here:

@8none1 that looks a neat solution but you don't mention anywhere where in the country you live? Power Up sessions started in the East of England but I think they are now available in Scotland and the Midlands so may be different in each area.
I've also seen occasionally slightly different power up sessions between myself and @PianSom and we only live about 10 miles apart (I'm in Bedfordshire and he is in Cambridgeshire). We pretty much always get the same sessions but occasionally he or I get one different from each other 🤷‍♂️

The Power Up sessions have been of variable benefit to me, and the free electricity sessions have so far been of zero benefit. The most two recent power up sessions (yesterday and today) coincided with with negative Octopus Agile rates so it wasn't financially worth it to sign up! But more than that, recent Power Up and Free electricity have been on sunny days when I'm generating and exporting more solar than I can charge into the battery so its simply not worth discharging and recharging the battery.

On the subject of how to handle the finances of Free sessions in HA Energy dashboard, I have multiple tariffs on my import utility meter sensor and swap between the 'free' and 'day' rates at appropriate times.

@8none1
Copy link

8none1 commented Aug 24, 2024

you don't mention anywhere where in the country you live?

Good point. I didn't find a reliable way to get data about PUs in other regions and so never got round to adding location based feeds. The good news for @gcoan and @PianSom is that I'm also in Bedfordshire (Potton) so the feed is (generally) appropriate for them. I have a friend in Suffolk who has seen one different PU to me, so it's not perfect, but without a better data source from OE there isn't much I can do. Not wishing to take this issue further off topic, if anyone has ideas on how to solve this please open an issue on this project and we can chat there.

@gcoan
Copy link
Contributor

gcoan commented Aug 24, 2024

The good news for @gcoan and @PianSom is that I'm also in Bedfordshire (Potton) so the feed is (generally) appropriate for them.

Ha @8none1 amazing coincidence, I live in Wrestlingworth (which is the next village for those not local to East Bedfordshire)!

Pretty sure we will get identical power up events.

I've set the sensor up already and will test it next power up we get.

@8none1
Copy link

8none1 commented Aug 24, 2024

I've wrangled the regexs and have what might be a JSON object listing future Free Electricity Sessions (FES).

As I mentioned, the style of the emails announcing FESs is a bit unpredictable, so it might take a little while to tweak the regex until such time as the wording on the emails is stable. I'll do what I can do keep it working, but I make no promises about it's reliability.

The JSON data is published here: https://www.whizzy.org/octopus_powerups/free_electricity_session.json

It's currently an empty list, because there are no future FES known.

If you want to see the gory details the GS script is here but you will need to get it set up in Google Apps Script yourself. Do note however, there is no need to run it yourself since FESs seem to be UK wide so the data source URL above, which is hosted on Github's infra and so should be highly available and fast, should work for everyone who has signed up to FES. Unlike Power Ups there is no need to also complete an opt-in form to benefit from the free power.

I haven't yet integrated this in to HA, but it will be essentially the same as detailed here. See the Home Assistant section on that post.

@Gary-Manuel
Copy link

Gary-Manuel commented Sep 14, 2024 via email

@gcoan
Copy link
Contributor

gcoan commented Sep 15, 2024

Here's my solution:

  1. Three date time helpers, a date only octopus_power_up_date, and time only octopus_power_up_start_time and _end_time

  2. REST API calls to retrieve the times of the power up and free electricity events https://github.com/8none1/octopus_powerups
    These are setup in configuration.yaml to retrieve the times into HA sensors

  3. Scripts that decode the start/end date/times from the above HA sensors and write the REST API sensors into the 3 helper sensors

  4. A dashboard which shows the helper entities (and manually change them), write those sensors to predbat’s apps.yaml, see the REST API sensors (with the retrieved Octopus event details) and invoke the scripts that decode those sensors into the helper entities

Code:

  1. my configuration.yaml:
sensor: !include sensors.yaml

sensors.yaml:

  # Octopus Power up times
  - platform: rest
    name: "Octopus Power Up Times"
    unique_id: octopus_power_up_times
    resource: "https://www.whizzy.org/octopus_powerups/powerup.json"
    scan_interval: 900
    json_attributes_path: "$.[0]"
    json_attributes:
      - start
      - end

  # Octopus Free electricity times
  - platform: rest
    name: "Octopus Free Electricity Times"
    unique_id: octopus_free_electricity_times
    resource: "https://www.whizzy.org/octopus_powerups/free_electricity_session.json"
    scan_interval: 900
    json_attributes_path: "$.[0]"
    json_attributes:
      - start
      - end
  1. Script to retrieve the free electricity times from the REST API and write them into the 3 octopus power up helper entities.
    The REST API gets the Octopus date and time in UTC so have to convert to unix time and then back to local time in the right format to write to the helper time entities:
alias: Set Octopus Power Up helpers from free electricity REST sensor
sequence:
  - action: input_datetime.set_datetime
    target:
      entity_id: input_datetime.octopus_power_up_date
    data:
      date: >-
        {% set dt=state_attr('sensor.octopus_free_electricity_times','start') %}
        {% if dt != None %}
          {{ as_timestamp(dt)|timestamp_custom('%Y-%m-%d') }}
        {% else %}
          {{ states('input_datetime.octopus_power_up_date') }}
        {% endif %}
  - action: input_datetime.set_datetime
    target:
      entity_id: input_datetime.octopus_power_up_start_time
    data:
      time: >-
        {% set
        st_time=state_attr('sensor.octopus_free_electricity_times','start') %}
        {% if st_time != None %}
          {{ as_timestamp(st_time)|timestamp_custom('%X') }}
        {% else %}
          {{ states('input_datetime.octopus_power_up_start_time') }}
        {% endif %}
  - action: input_datetime.set_datetime
    target:
      entity_id: input_datetime.octopus_power_up_end_time
    data:
      time: >-
        {% set en_time=state_attr('sensor.octopus_free_electricity_times','end')
        %} {% if en_time != None %}
          {{ as_timestamp(en_time)|timestamp_custom('%X') }}
        {% else %}
          {{ states('input_datetime.octopus_power_up_end_time') }}
        {% endif %}
description: ""

3b Ditto script for Power up events:

alias: Set Octopus Power Up helpers from Power Up electricity REST sensor
sequence:
  - action: input_datetime.set_datetime
    target:
      entity_id: input_datetime.octopus_power_up_date
    data:
      date: >-
        {% set dt=state_attr('sensor.octopus_power_up_times','start') %} {% if
        dt != None %}
          {{ as_timestamp(dt)|timestamp_custom('%Y-%m-%d') }}
        {% else %}
          {{ states('input_datetime.octopus_power_up_date') }}
        {% endif %}
  - action: input_datetime.set_datetime
    target:
      entity_id: input_datetime.octopus_power_up_start_time
    data:
      time: >-
        {% set st_time=state_attr('sensor.octopus_power_up_times','start') %} {%
        if st_time != None %}
          {{ as_timestamp(st_time)|timestamp_custom('%X') }}
        {% else %}
          {{ states('input_datetime.octopus_power_up_start_time') }}
        {% endif %}
  - action: input_datetime.set_datetime
    target:
      entity_id: input_datetime.octopus_power_up_end_time
    data:
      time: >-
        {% set en_time=state_attr('sensor.octopus_power_up_times','end') %} {%
        if en_time != None %}
          {{ as_timestamp(en_time)|timestamp_custom('%X') }}
        {% else %}
          {{ states('input_datetime.octopus_power_up_end_time') }}
        {% endif %}
description: ""
  1. Dashboard card to pull all these bits together.
type: entities
entities:
  - entity: input_datetime.octopus_power_up_date
  - entity: input_datetime.octopus_power_up_start_time
  - entity: input_datetime.octopus_power_up_end_time
  - type: divider
  - entity: sensor.octopus_free_electricity_times
  - type: button
    icon: mdi:script-text-play-outline
    name: Set free electricity times
    action_name: Execute
    tap_action:
      action: perform-action
      perform_action: script.set_octopus_power_up_helpers_from_free_electricity_rest_sensor
  - type: divider
  - entity: sensor.octopus_power_up_times
  - type: button
    icon: mdi:script-text-play-outline
    name: Set Power Up electricity times
    action_name: Execute
    tap_action:
      action: perform-action
      perform_action: >-
        script.set_octopus_power_up_helpers_from_power_up_electricity_rest_sensor

Its basically a matter of clicking Execute on the Free electricity or Power up script which copies the rest data into the helper entities at the top of the screen and they can then be used by normal automations in HA

I also have an automation that detects when the REST API has retrieved new Octopus event details - see #973 (comment)

@Gary-Manuel
Copy link

Gary-Manuel commented Sep 15, 2024 via email

@gcoan
Copy link
Contributor

gcoan commented Sep 17, 2024

Final bit of the power-up/free electricity jigsaw, an automation that detects when there is a new power up or free electricity event (as registered by the REST sensor) and raises an alert.

Could quite easily automate this to invoke the scripts to decode the REST response and update the helper date/time entities (and make any other automations you want), but I'd prefer to be a bit more in control. Amend the URL in the automation to the pathname of the Powerup dashboard so clicking on the notification results in the correct dashboard page being opened.

  1. Automation:
alias: Octopus New Power up Alert
description: Alert when new Octopus Power up or Free Electricity period
trigger:
  - platform: state
    entity_id:
      - sensor.octopus_free_electricity_times
    from: "[{\"start\":null,\"end\":null}]"
    variables:
      alert_text: New Free Electricity times
  - platform: state
    entity_id:
      - sensor.octopus_power_up_times
    from: "[{\"start\":null,\"end\":null}]"
    variables:
      alert_text: New Power up electricity times
action:
  - action: notify.all_devices
    data:
      title: Octopus Electricity session
      message: |
        {{ now().timestamp() | timestamp_custom('%-d %b %H:%M') }} INFO: {{ alert_text }}
      data:
        visibility: public
        persistent: true
        url: /dashboard-givenergy/powerup
        push:
          sound:
            name: default
            critical: 0
            volume: 0.8
mode: single

@8none1
Copy link

8none1 commented Sep 17, 2024

I wrote up how I'm triggering automations in this post: https://www.whizzy.org/2024-09-14-free-electricity-sessions/

@gcoan
Copy link
Contributor

gcoan commented Sep 17, 2024

I wrote up how I'm triggering automations in this post: https://www.whizzy.org/2024-09-14-free-electricity-sessions/

A nice clear writeup of how to configure the rest API and a 'session active' binary sensor. My use case uses the first bit of your solution but I want to know in advance the date and time of the sessions as I need to program them into Predbat which manages my battery & solar inverter activity. Predbat decides (and executes) whether to discharge my battery ahead of the session and then charge up in the session or not. If the sessions coincide with a sunny day then often its not worth discharging as I'll be generating more solar than I can charge into the battery, so its better to just export the excess.
Cloudy windy days, it can be worthwhile.

The API is working great and with my scripts and automations I have a great way to feed this into HA and Predbat

@Leventionz
Copy link

Just wanted to login and say thank you @gcoan for your work; this is great.
I use your sensors in my node-red automation for decisioning when to overwrite the logic in my scripts and charge the battery/car for the duration of the session.

@gcoan
Copy link
Contributor

gcoan commented Oct 20, 2024

Just wanted to login and say thank you @gcoan for your work; this is great. I use your sensors in my node-red automation for decisioning when to overwrite the logic in my scripts and charge the battery/car for the duration of the session.

Thanks @Leventionz glad to hear its of use. I have made a minor set of updates to scripts 3 and 3b #973 (comment) as there was a bug that if the REST sensor wasn't populated with times of a free electricity/power up event and you ran the script, it failed. This is now fixed, so running either script when there isn't a future event scheduled, the script just leaves the input_datetime's unchanged.

And for those that are using predbat to automate their battery charging and discharging, the following script can be used to automatically send the details of the powerup/free electricity event into Predbat via the new Predbat manual API:

alias: Send Powerup event to Predbat manual API
sequence:
  - action: select.select_option
    data:
      option: >-
        rates_import_override?date={{          
        states('input_datetime.octopus_power_up_date')| as_timestamp |          
        timestamp_custom('%Y-%m-%d') }}&start={{          
        states('input_datetime.octopus_power_up_start_time') }}&end={{          
        states('input_datetime.octopus_power_up_end_time') }}&rate=0
    target:
      entity_id: select.predbat_manual_api
mode: single
description: ""

@BottlecapDave
Copy link
Owner

While it's probably a little late, the v13.1.0 release now has the first stage for free electricity sensors. This includes a binary sensor to indicate if you're in a free electricity session and a baseline sensor for you to know when you've reached the point where free electricity is starting to be awarded to you. These sensors are being powered by a private API, which I'll be monitoring the activity of. This means the data might be delayed in coming through as I need to update the data manually. I'll switch these over to the official APIs once they become available.

The next stage will see the ability for target rate sensors to optionally favour free electricity periods, which will hopefully be in the next major/minor release.

@PianSom
Copy link

PianSom commented Nov 4, 2024

Are there any rumours of Power-ups making it to the official API also?

@BottlecapDave
Copy link
Owner

There arent currently any rumours on the forums about either free electricity or power hours coming across to the official APIs. But free electricity is more likely due to its wider national use (if the trial was successful)

@gcoan
Copy link
Contributor

gcoan commented Nov 5, 2024

There arent currently any rumours on the forums about either free electricity or power hours coming across to the official APIs. But free electricity is more likely due to its wider national use (if the trial was successful)

The problem with the Octopus Power Up events is they can be quite localised. @PianSom lives in CB24 and I live in SG19, we're about 10 miles apart but whilst the first set of Power up events were the same, they are increasingly being specific to the postcode. I have an event today from 11:30-1:30pm, the same day that Agile prices peak at 86p, he does not.

Power up really will need an official Octopus API linked to your account, or an API to parse your email for the event notification as @8none1 has done

@BottlecapDave
Copy link
Owner

Indeed, the complexity around power ups is enormous. The mapping from postcode to power up regions alone was in the 100s. Then the only resource for power ups for each region is email (no website that I can see for each posted region like free electricity), so would rely on a large community source to keep the data relevant which would have a large admin attached.

I have a plan to try and expose a service where you can assign a weighting to rate blocks, which would then be used by the target rate sensors. This means that external data sources can influence the target rate sensors without having to directly integrate with the integration. This could be used by external power hour sources to influence target rate sensors or by other sources like solar forecasts.

@DavidMW38
Copy link

I simply added a calendar entry for tomorrow and created automations from that.

If/when we get an API working, the calendar can be deleted and the automation trigger tweaked.

Yeah me too. Well, similar anyway. I've created an automation (similar to, but obviously the opposite of, my Savings Sessions automation (switching everything on rather than off)) that I turn on when I get the email from Octopus (either in the automations page or, as they always tend to be at 1pm and last an hour, via a widget that enables it for the next 1pm), and then at the end of the sequence, I've set it to automatically disable itself, just in case I forget to do it manually (I don't want it kicking in every day until I remember to switch it off 😂😂). I was going to do it via a calendar entry but, tbh, as they're always at the same time, creating the calendar event (even by finding the last one and copying and pasting it) seemed like more effort than a widget click to re-enable the automation. Obviously, the savings sessions, while generally in the same time frame (early evening peak hours), they're much more variable in terms of start time and, occasionally, duration, so a calendar entries may work better for that, although so far, I've just been enabling the Savings automation and setting the duration manually when I get the Savings email/pop up.....because of a question I've had for a while 👇 and this seems like the perfect time to ask lol.

When you're using a calendar entry for automations, do you have it set up so that the duration of the calendar event marks the beginning and end of the automation, or do you set a 2nd entry to switch everything off again? I've never worked out how to do the former. Am I just being dense? Or am I searching for a solution that doesn't exist, yet? Thanks

@elyobelyob
Copy link

Use the event.end event ...

triggers:

  • event: start
    offset: "0:0:0"
    entity_id: calendar.xxxxxx
    id: event start
    trigger: calendar
  • event: end
    offset: "0:0:0"
    entity_id: calendar.xxxxxx
    id: event end
    trigger: calendar

When you're using a calendar entry for automations, do you have it set up so that the duration of the calendar event marks the beginning and end of the automation, or do you set a 2nd entry to switch everything off again? I've never worked out how to do the former. Am I just being dense? Or am I searching for a solution that doesn't exist, yet? Thanks

@guy-BW
Copy link

guy-BW commented Nov 10, 2024

Just to add.. I do the same with calendars.. but I have an automation which triggers 1 hr prior to the event start time to have my battery discharge to the grid, ready to the filled again.

@DavidqStokes
Copy link

Just to add.. I do the same with calendars.. but I have an automation which triggers 1 hr prior to the event start time to have my battery discharge to the grid, ready to the filled again.

I'm interested why you would do this. Unless you're being paid for export surely this doesn't make sense financially. From a grid balancing perspective, exporting just before a time of excess power on the grid also seems counterintuitive.

@guy-BW
Copy link

guy-BW commented Nov 10, 2024

Just to add.. I do the same with calendars.. but I have an automation which triggers 1 hr prior to the event start time to have my battery discharge to the grid, ready to the filled again.

I'm interested why you would do this. Unless you're being paid for export surely this doesn't make sense financially. From a grid balancing perspective, exporting just before a time of excess power on the grid also seems counterintuitive.

Yes I'm paid for export at 15p/kWh

@Meatballs1
Copy link
Contributor

Is the integration working for tomorrow? It's not showing up on the event (but has previous ones) and it doesn't show on next period on the binary sensor.

@springfall2008
Copy link

I'm seeing the same thing, but wonder if its Octopus's end?

@springfall2008
Copy link

BTW: I added support for this to Predbat now, so should talk to Octopus integration and automatically charge the battery: https://github.com/springfall2008/batpred/releases/tag/v8.7.1

@jacoscar
Copy link

jacoscar commented Nov 23, 2024

Can anyone tell me if this trigger for when a free energy session is announces is correct?

image

YAML format:

event_type: event.octopus_energy_a_9a9aa2b2_octoplus_free_electricity_session_events
trigger: event

And I've copied this from the documentation, but when I try to manually run the action, I get this
image

@kylegordon
Copy link

The stopgap API data at https://oe-api.davidskendall.co.uk/free_electricity.json does not seem to have the upcoming data

@bfayers
Copy link

bfayers commented Nov 23, 2024

The stopgap API data at oe-api.davidskendall.co.uk/free_electricity.json does not seem to have the upcoming data

If you want this to work immediately you can edit custom_components/octopus_energy/api_client/__init__.py at line 905 and swap the URL to https://oe-api.bfayers.me/free_electricity.json

Can't provide any guarantees of how well this will work (or how long I will support it), since it's live scraping the Octopus site with a Cloudflare Worker. It will also only show the most recent/upcoming since I haven't got it scraping the "historic" entries.

2024-11-23_21-58-48

@kylegordon
Copy link

Excellent, thank you. Have made the change, and also updated Predbat. Battery system is now planning a charge at the right hours.

@BottlecapDave
Copy link
Owner

I unfortunately missed the email for the new session. The session was added at around 6:15am this morning. If you reload the integration, it should force the data to be updated using my source.

@BottlecapDave
Copy link
Owner

I've made changes so I shouldn't miss the email in the future, but if I'm slow to update, you can raise a PR at https://github.com/BottlecapDave/OctopusEnergyApi to update the data.

@BottlecapDave
Copy link
Owner

@jacoscar You can't manually trigger the action in the docs because it uses a source trigger, for which there is none when manually run. It should fire when the sessions become available.

@BottlecapDave
Copy link
Owner

As part of the latest release, you can now update target rate sensors to favour free electricity sessions https://bottlecapdave.github.io/HomeAssistant-OctopusEnergy/setup/target_rate/#free-electricity-weighting

Because of this, I'll be closing this issue as basic support for free electricity sessions is now available. Please raise new issues for bugs or feature requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests