How to get Octopus intelligent to create charging schedules

I use Octopus (UK power company) Intelligent Go, it charges my EV when Octopus wants to charge it and in return I get nice low rates every night and also when it’s charging the car.
I have ESS setup and that works great too, I top up the batteries overnight and use them to power the house all day. My goal is to only use off peak power and never use full price power :slight_smile:
As I have an EV, dynamic ESS isn’t working so well for me so Ive disabled this until it fully supports EV’s.

What I would like is to have a routine running on perhaps node red (on my Cerbo GX) that listens out for the cheap kwh rates that come through from Octopus and on the fly, create a schedule within the scheduled charge settings (ESS menu) so that my batteries don’t go empty during the day and in fact top up their charge while the power is cheap.

The problem I have today is that if I plug my car in during the day and Octopus decides it has spare power, it tells my car to charge (which it does). Unfortunately this uses my batteries before it uses the grid. The cheap rate then ends but I now have empty batteries and I’m back on a full price kwh price.

I can a see the current rates from the API feed I get from Octopus. I don’t have the skills to create the node red routine and am hoping someone else has already done it.

Spencer

Rather than using the octopus API I used the API of my charger to find if it is charging as this means I am on cheap rate. I then set my Victon to charging by setting an all day scheduled charge to active and turning it inactive when the car charger finishes. To set a scheduled day to 7 and to turn off set it to -7 using the ESS control node

That’s an interesting approach. Have you done this in node red?
When I plug my car in it immediately starts to charge, I then either stop in manually via the car app or let octopus stop it when it has set up the charging schedule.
Does your solution get confused with this type of scenario? Ie charging in a peak period for maybe a few minutes?

Thanks

Spencer

I have integrated the charger and not the car so never see that but it would be fairly simple to program around using a delayed start. If you are happy to just charge you battery during the the always cheap 11.30 to 5.30 slot then you can set Victon to charger only mode while car is charging to avoid draining the home battery
Yes I have used the node red from the large Victon image

I use the second CT clamp on a Shelly EM (the first provides grid consumption) to monitor the EV charge circuit

I then use Home Assitant to switch ESS modes - basically if EV circuit >500W set ESS mode to keep batteries charged

I also have Home Assistant running. How do you tell HA to switch ESS modes?

If it helps. I’m running 0.0.11 of the victron integration loaded via HASS.
I have a helper running which recognises when I’m in a cheap time period.
If I can just tell ESS to enable a schedule or disable a schedule based on the price, I’d be sorted.

Spencer

So it sounds like I could switch the listening for the EV charger to listening for the octopus price change, just listening to a different API feed?
Can you share what your flow looks like?

I stopped using the API feeds - just too unreliable!

I use Victron GX modbusTCP integration - https://github.com/sfstar/hass-victron

Then an automation:

Can you share the YAML of this? I can’t seem to make mine look like yours. Not sure if Ive not installed something correctly or I’ve missed a step :slight_smile:

Thanks

Spencer

Sure:

alias: Charge batteries if car charging
description: ""
triggers:
  - entity_id:
      - sensor.broadpark_grid_channel_2_power
    above: 500
    trigger: numeric_state
conditions:
  - condition: time
    after: "05:30:00"
    before: "23:30:00"
actions:
  - device_id: 6fe3549eedccb2098c6b7daf9eee469c
    domain: select
    entity_id: 3540ff1ea0d6aba3fc0b67c32a154145
    type: select_option
    option: KEEP_BATTERIES_CHARGED
mode: single

I’ve used some of the ideas suggested and have produced something that has worked flawlessly for the last couple of weeks.

I already had my Home Assistant collecting the Octopus API data.
I created a helper in HA to show the electric rate as Cheap or not. Under 10p/kwh is cheap, over this isn’t.
I connected a Shelly Plus 1 that I had spare and got the helper code to switch it on for cheap, off for not cheap.
So all that bit does is listen for the latest prices and switch a relay.

I then connected the output of the relay to the digital input of the Cerbo GX.
So now, given the code, the Cerbo can tell whether its cheap power or not.

I then created a node red flow to listen out for the relay change.
I noticed that the Shelly relay would seem to be unreachable occasionally (sleep mode or poor wifi range?) so I added a little keep alive routine which pings my HA and the Shelly.

In the ESS settings I created a “Scheduled Charge Levels” to be 24/7 and set as PV. It defaults to 10% so that it mirrors the system rules.
The node red then only has to adjust the SOC Limit and the system minimum Battery SOC.
So when the power is cheap (based on the relay) the Scheduled charge level and the Battery SOC are changed to 80%, when its not cheap they are set to 10%.

The chart node is there to remind me to build a chart to record what actually happened and when.