Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

[GUIDE] Automations for Octopus Intelligent with Home Assistant

This site may earn commission on affiliate links.

Medved_77

TM3 SR+ | MSM+Black | No FSD
Jan 20, 2020
2,541
2,891
Scotland
A quick guide on how to create a couple of useful automations in Home Assistant that resolve a couple of minor irritations I had with the tariff. These are:

  1. Preventing the car from charging during peak periods immediately upon plugging in.
  2. Ensuring that the Tesla charge limit is always above the Octopus Intelligent charge limit.

You will need:
  1. Home Assistant
  2. Home Assistant Community Store (HACS)
  3. Tesla Custom Integration
  4. Octopus Intelligent Integration
  5. An integration for your 'smart' wall charge point:


1. Preventing the car from charging during peak periods:

With this automation I don't need to manually stop the charge just after plugging in or set a start charge time in the car. The charge point only delivers power if Octopus are providing electricity at off peak rate.

The Octopus Intelligent integration contains a sensor that confirms whether an 'Intelligent Slot' is currently active. This is active during the regular 6 hours and any additional times provided at the off peak rate.

1694631748994.png


With a smart charge point that supports a home assistant integration, you can allow/prevent charging. I have a PodPoint so examples below will be for that manufacturer, however the automations should be easy enough to modify to support others and happy to help if struggling:

1694631926002.png


With these two entities, you can create an automation that activates the charge point when Octopus Intelligent slot is on and deactivates when it isn't. We can also add a condition so that this automation only runs when the car is plugged to your home charge point which prevents unnecessary state changes on your home charge point.

For the automation:

I can provide the YAML on request however the device IDs and entity IDs will need to be modified to match your entities in Home Assistant as well as the charge point you are using. Images below are probably more useful as a guide:

Triggers:

1694632736516.png

Conditions:

1694632764677.png

Actions:

1694632796673.png

There are cleaner and more efficient ways to lay out this automation so I plan to improve this, however it's been working well for around 3-4 months in it's current state so comfortable sharing.

2. Ensuring that the Tesla charge limit is always above the Octopus Intelligent charge limit.

This is a more recent change with Octopus Intelligent where you see this warning appear:

1694633242578.png

I'm not really sure how critical this is but it was annoying me none the less. I really don't want to set the charge in the Tesla app and then set the charge in the Octopus App, so with this automation I just set the value I want in the Tesla app which then propagates to the Octopus app.

The Tesla integration contains a sensor for the charge limit:

1694633400391.png


As does the Octopus Intelligent integration:

1694633558355.png


So we create an automation that listens to any changes made to the Tesla charge limit, and if changed, take the Tesla value and set the Octopus target state to 1% less.

For the automation:

Change the entity to match your cars name. the rest you should be able to copy exactly:

1694633847592.png

The 'Number: Set' service requires YAML so you can copy and paste this:

YAML:
service: number.set_value
data:
  value: "{{ (states('number.trevor_charge_limit')|float - 1)|round }}"
target:
  entity_id: number.octopus_energy_intelligent_charge_limit

Warning:

1. Changing the charge limit value in the tesla app takes several minutes to propagate to Home Assistant so there's a short delay between changing the value in the Tesla app and the Octopus App updating.
2. I've only been using this automation for two days. It appears to work fine, however if you want to use this setup keep an eye out on both values to make sure they're being set as expected e.g. after changing the charge limit value for Tesla, wait ~5 mins then confirm the Octopus value is 1% less.

-----

So there's two first world problems solved. Next I'm going to look into integrations that allow the home charge point to deliver power if Octopus bump charge is on and no intelligent slot is available. I also want to look at a way to automate setting the 'Octopus Target Ready By Time' so that it can sync with calendar events, but that'll be more complex, given I WFH 90% of the time and I share the car with the wife.
 
Nice automations.

I use the Octopus Energy integration (GitHub - BottlecapDave/HomeAssistant-OctopusEnergy: Unofficial Home Assistant integration for interacting with Octopus Energy) as it brings me all the billing information, but it provides a similar sensor that will show when an intelligent slot is potentially active at binary_sensor.octopus_energy_intelligent_dispatching

I must admit the charge limit thing doesn't make sense. Why does Octopus know the cars limit but then require you to set something higher, what's the point? Why not just follow the car anyway.
 
I love the not letting it start charging one.

Unless I've misunderstood?

My car is has a schedule to start charging at Off Peak (middle of night in my case). It never starts charging if I plug in at other times (unless I specifically override on the Dash with "Charge now", which (from memory) requires a confirmation step, or if I use the APP to force a charge.

If I come home really really late, after start of Schedule Charge, it still charges (dunno what sort of offset it will do that for, but its pretty generous based on the few times I've come home really really late!)
 
Unless I've misunderstood?

My car is has a schedule to start charging at Off Peak (middle of night in my case). It never starts charging if I plug in at other times (unless I specifically override on the Dash with "Charge now", which (from memory) requires a confirmation step, or if I use the APP to force a charge.

If I come home really really late, after start of Schedule Charge, it still charges (dunno what sort of offset it will do that for, but its pretty generous based on the few times I've come home really really late!)

So because i'm on Intelligent, I can't set that kind of schedule on the car as my "off peak" slots could be anywhere from 6pm through to 11am.
 
  • Like
Reactions: WannabeOwner
The main issue we want to tackle is that IO goes peak at 5:30 am and, from now and through the winter, we want to ensure that when cheap rate goes off, we are not taking from the grid but from the powerwall. Is that possible with this setup?
 
I use the Octopus Energy integration (GitHub - BottlecapDave/HomeAssistant-OctopusEnergy: Unofficial Home Assistant integration for interacting with Octopus Energy) as it brings me all the billing information, but it provides a similar sensor that will show when an intelligent slot is potentially active at binary_sensor.octopus_energy_intelligent_dispatching
I'm also running the BottlecapDave integration but didn't realise it had added support for the intelligent Octopus sensors. Checking the release notes it looks like this was in version 7.50 which was released mid July this year and I think I first started using the Octopus Intelligent Tariff integration around May.

I'll probably update the automation in that case so that I'm only relying on a single Octopus integration in home assistant.
 
  • Like
Reactions: browellm
The main issue we want to tackle is that IO goes peak at 5:30 am and, from now and through the winter, we want to ensure that when cheap rate goes off, we are not taking from the grid but from the powerwall. Is that possible with this setup?
I don't own a powerwall unfortunately but there is a Home Assistant integration available for it:


You may be able to use the Grid status binary sensor to tell the powerwall not to consume power when an IO slot is not on?
 
  • Like
Reactions: kuruma
really appreciate..
HOWEVER:
Ensuring that the Tesla charge limit is always above the Octopus Intelligent charge limit.
It is the wrong way to look at it. In my particular case, PodPoint is producing 30 amps only, not 32. - if you keep Tesla limit SAME as IO - car will never reach target SOC.
 
It's not the wrong way to look at it for the vast majority of people who have correct EVSE installations.
look, I know you love to nitpick stuff... but PodPoint limits their chargers to 30 amp, not 32. my EVSE installation is done properly by PodPoint. and works fine for last 5 years by now.
However, having said that, as per my tests on MULTIPLE times, I miss around 10% of charging if I set IO and Tesla both at 100% (.i.e. tesla charge level set to 80% and IO set to 80% I end up at 72% (+/-).

I get full 80% only if I set IO to 100% and then adjust Tesla charge level in tesla app/car

unless Octopus fixed this bug
 
really appreciate..
HOWEVER:

It is the wrong way to look at it. In my particular case, PodPoint is producing 30 amps only, not 32. - if you keep Tesla limit SAME as IO - car will never reach target SOC.
I don't have that issue with my PodPoint installation but regardless, you can change the offset value with either a + or - here:

Code:
float - 1)

For the saving of the YAML, I should have mentioned that you need to change your cars name (mine is called trevor), also, don't include the top row that says `YAML:`
 
PodPoint limits their chargers to 30 amp, not 32
If that's universally correct then Octopus should change the onboarding database entry for the charger so it records 30A as the max it can deliver and schedules are created correctly. Have you contacted them over this?

What model do you have? Both the S3 and S7 are rated at 32A on their datasheets.
 
If that's universally correct then Octopus should change the onboarding database entry for the charger so it records 30A as the max it can deliver and schedules are created correctly. Have you contacted them over this?

What model do you have? Both the S3 and S7 are rated at 32A on their datasheets.
No, I did not contact them

It is refered as Solo, installed 4 years ago. So not 5 but 4 years in my possession

It is also info about 30 A limit is what I found on some older post on another forum, like this Home pod points should push out more than 6.7kW, right ?

Or Max amps from home charge point (podpoint)

It is rated 32 A, but there is something in settings by podpoint on original Solos which has some limitation

I read it something like: max possible draw shou be 40 A but 80% rated, so 32 Amos. But then there Can be 10% surge which is is suddenly above 32 amps.. thus podpoint limited.. something like that
 
Last edited:
  • Like
Reactions: browellm
Just to add, Octopus Intelligent just needs to see that the Tesla is connected to the charger at home, it doesn't need to see charging itself occur, in order to schedule IO charging sessions.

The documentation was ambiguous and inferred that the car needed to be plugged in and start to charge, before they recognised the charge, stopped it, and scheduled off-peak charging. I was finding that the car would charge enough on peak-rate for it to cost as much as the overnight session.

My charger isn't controllable by either IO or HA, so I leave it on a timer to enable at 23:30. IO then picks up the charging sessions fine. Okay, I'd miss out on any scheduled sessions before 23:30, if I don't adjust the timer manually, but this is a safer bet, than charging for 2 hours before IO realises and stops the charge.

I tried stopping the charge via the HACS Tesla integration, just after the car was plugged in, so at/around the same time that IO would be polling the car, and it looks like the two may have interfered. IO were struggling to schedule charging sessions. I disabled my automation and IO operated a lot more consistently.
 
2. I've only been using this automation for two days. It appears to work fine, however if you want to use this setup keep an eye out on both values to make sure they're being set as expected e.g. after changing the charge limit value for Tesla, wait ~5 mins then confirm the Octopus value is 1% less.
What's the reason for setting the charge limit to be 1% less than the car?

Edit: Also thank you for providing this, I've pinched it for my car :)
 
What's the reason for setting the charge limit to be 1% less than the car?
I think Octopus provide that warning to prevent owners setting for example, 70% in the Tesla app and 80% in the Octopus app, then being disappointed in the morning that they didn't reach the charge level requested with Octopus. Maybe some owners don't realise that the Tesla value is definitive.

This also advises when owners may want to set Octopus to 100% and Tesla to 90% expecting an extra 60 mins of off peak slots (perhaps granted during a typical peak period) thus saving Octopus some money.

Just a notification for now, but maybe enforceable in the future. Given we can set the Tesla charge limit with the API there's no reason why Octopus can't.
 
  • Like
Reactions: Cnixon