Octopus Energy - Intelligent Tariff

23:30 - 05:30 is off peak whatever. No need to have the car plugged in.
The dispatches are a bonus

@megakid This is an amazingly useful thread, thanks to you and those contributing.
I’m relatively amatuer, and have an issue those on here may have solved.
I have a Zappi EV charger combined with my Solar panels and batteries. I programatically switch the charge mode of the Zappi, so that during the day it charges in Eco mode (taking all excess energy to the car before shipping to the grid), and Fast mode at night, to take advantage of the Intelligent Octopus Tariff.
I want to just have the API command to switch the switch.octopus_intelligent_smart_charging to off, during the day, so that the car just takes what charging it is given, and then switch.octopus_intelligent_smart_charging to on, at 5pm so Intelligent octopus can schedule any over night charging, if needed.
Can anyone on here highlight what API call I need to make (just via a noddy command line) to switch the smart charging on or off.
I’ve made an assumption here, this is the same ash the allow/disable “Smart Charging” option in the Intelligent Octopus app on my phone. I may be wrong.
Thanks in advance.

Specifically I am talking about this part of the UI/X

Hi Andy

Do you use a separate script to switch the luxpowers off at the end of the session, or do you do that manually?

WooHoo!
Hats off to @megakid !
Installed with ease on a Synolgy based Docker edition of HA.
NOTE - not sure how to / if possible to add Custom Repository through the UI when using this Docker version. But just as easy. If you are interested:

  1. download the build from GitHub
  2. locate in the download the subfolder ‘custom_components’ (it has the ‘octopus_intelligent’ folder contained within)
  3. copy this ‘custom_components’ folder to your HA \config\ folder.
    3a - IF you already have a ‘custom_components’ folder under your HA \config folder, like I did because I had already installed some other custom intergration, then copy the ‘octopus_intelligent’ folder from the downloaded build and paste inside your existing HA \config\custom_components\ folder.
  4. restart HA
  5. as megakid details, add it like any other Integration to your system. It will prompt for your Octopus API Key and Account.
  6. Add the entities to a dashboard - easy peasy!

Brilliant! Thanks!!!

Weird, I don’t get a notification that someone has asked me a question … So sorry for the delay.

Yes, I have two scripts, one to start battery charging during a cheap-rate trigger and another to stop it.

Andy

To show the upcoming charging schedule, I have this:

image

It uses template-entity-row and extracts the plannedDispatches attribute from the octopus_intelligent_slot sensor.

title: Octopus Intelligent Tariff
type: entities
show_header_toggle: false
entities:
  - entity: switch.octopus_smart_charging
    name: Smart charging enabled
  - entity: select.octopus_target_ready_by_time
    name: Ready by
  - entity: select.octopus_target_state_of_charge
    name: Charge to
  - type: custom:template-entity-row
    name: Planned slots
    secondary: >-
      {% if (state_attr('binary_sensor.octopus_intelligent_slot', 'plannedDispatches') | length > 0) %}
        {% for dispatch in state_attr('binary_sensor.octopus_intelligent_slot', 'plannedDispatches') -%}
           ⏰ {{ (dispatch.startDtUtc | as_datetime | as_local).strftime('%H:%M') }} to {{ (dispatch.endDtUtc | as_datetime | as_local).strftime('%H:%M') }}
        {%- endfor %}
      {%- else -%}
         ⏰ None
      {%- endif  %}

[EDIT 2023-03-27] Added as_local to template to show times correctly when in British Summer Time.

7 Likes

Very cool. I need to update the readme to show others how to do that sort of things.

1 Like

I agree with @megakid, this is very cool!

Have unashamedly copied this and put it on a test view to see how it well it works… I def see a version of this making it to my main views!

Thanks @duncansmart for sharing :+1:

1 Like

Hello,

I’ve been monitoring the Intelligent sots and comparing them with my bill and they don’t seem to be reliable enough to use for triggering battery charges. Is this something with my setup? An example would be the 26th Feb, see attached photos.

My bill shows an off peak slot 06:30-07:30 however homeassistant has it at 07:20-08:00


I have an Ohme charger and I’m wondering if the basic ‘beta’ integration of the Ohme is affecting things.

FYI: my car wasn’t even plugged in when this slot became available and it’s still being billed at off-peak. Again, I think this might be an Ohme specific issue.

When you use the Ohme integration with a car that does not have a specific API, the octopus API does not publish dispatch slots later in the day past its initial publish
This is due to the OHME man in the middle
Ultimately this plug in cant help you as it has to valid data to pull from octopus later in the evening when Octopus actually update the slots.
(Ive since learnt this from the facebook group dedicated to non-api ohme charging)

The best you can achieve, as i do, is to watch for the car charging outside of offpeak and then use that to trigger things.
In my case, this time of year (due to plenty of solar) i pause house discharge when the car starts charging during normal peak hours
Later in the year i will probably activate top up charges as well.

1 Like

Hi there!

Pretty new to HA, less than a week using it, still amazed by the capabilities of this thing! I’m not a programmer, just a bit of a geek.

@megakid many thanks for this integration! It’s helping people same some money and fully automate this tariff.

I have a Tesla Model 3 and a Hypervolt 2.0, and I also don’t like the idea of plugging in and letting the car charge for a “few” minutes waiting for Octopus to kick in, plan the charge and stop the current charge.

I found out that if I set the Hypervolt to “Schedule” (as opposed to “Plug and Charge”) and plug the car in before 23:30, the car won’t start charging (schedule times are set to the base Intelligent hours) but Octopus will indeed plan the night’s charge. But if I then set the charger to “Plug and Charge” the car will start charging. I could leave it in “Schedule” mode which would allow charging from 23:30, but I see 2 potential issues: One is that the car will probably start charging at 23:30, even if that’s not the first planned slot as per Octopus’ plan, don’t know if Octopus will send a stop charge command to the car so it waits for the first planned slot (I’m guessing not) and this might ruin the charge plan. The other is it won’t allow the charge to start in the odd occasion that Octopus plans an earlier slot than 23:30.

Anyway, excited to start tinkering with this integration and HA in general.

If it helps @paulo.frings, I have a HV 2.0 and the way I work it is, when the cheap tariff is not active an automation sets the HV to Super Eco (i.e. solar charging only), and then when the cheap tariff is active an automation sets the HV to Boost.

This works well… stops the car charging while it awaits the schedule, and it also allows the car to charge with any excess solar (I still need to set the Octopus app to Bump Charge, but I don’t need to change anything on HV). If you don’t have solar, you can still use this method, the HV will just not be able to receive any excess solar for additional charging.

Thanks @Dave888 , interesting idea, it certainly helps.

I’m also interested in how you created your tariff sensor, do you mind sharing that?

Thanks.

Hi @paulo.frings

This is the sensor I use for the elec price:

      # Intelligent Elec Price
      - name: "Current Electricity Price"
        unique_id: current_electricity_price
        unit_of_measurement: '£/kWh'
        device_class: monetary
        state: >-
          {% set tariff = { "Peak": 0.3984015, "Offpeak": 0.075 } %}
          {% if is_state('binary_sensor.octopus_intelligent_slot', 'on') %}
            {{ tariff.Offpeak }}
          {% else %}
            {{ tariff.Peak }}
          {% endif %}

Many thanks @Dave888 .

Hi Andy,

What integration are you using to invoke the charging on the Lux inverter please?

Cheers, Mick

Hi @duncansmart thanks for this and for introducing me to custom: template-entity-row - super useful!

When I have multiple slots, I can’t get them to display on separate rows - did you experience this too?

There’s some talk of multiline support here, but nothing I could make work with my numpty templating skills :confused:

Hi

Looking at the script I think Andy is using @guybw private integration. I found it here Luxpower ac inverter integration? - #9 by guybw .

I am new to home assistant but I would recommend it.

Kind regards,

Arun

Sorry @martin.dell I couldn’t work it out either :man_shrugging: which is why I used the clock emoji to delimit the items!

1 Like

Hum… the integration stopped working for me just now. Here are 2 screenshots taken from the HA mobile app:



Also, when I tried to check the Octopus app on my phone, the Devices tab was empty. I wonder if the problem is at Octopus’ end.