Regularly skipping scheduled charging slots with predbat

7 comments started 2025-03-25 last 2025-03-29
APIsHome AutomationHome Assistant
W
#1 Weasel

My 13.5kWh AIO plus gateway is doing exactly what I expect it to do. I have predbat happily running to control charge and discharge and am current on the Cosy Octopus tariff with it's 3x cosy periods per day.

I am looking for a way to use HomeAssistant to tell predbat to "skip" a period. I know this will involve setting up an automation that will be triggered once per day and will need to add in the required number of manual-demand overrides. I have never tried to use an API with predbat, so would appreciate a few pointers

Thanks in Advance

G
#2 geoffreycoan

Weasel Is this the sort of thing you were looking for?

Its an automation that every night forces Predbat to Demand (Eco) mode for the two slots from 3pm. Was to fix an issue where Predbat kept on wanting to discharge at that time

alias: "Predbat: stop 3pm discharge"
description: ""
triggers:
  - trigger: time
    at: "23:00:00"
actions:
  - action: select.select_option
    target:
      entity_id:
        - select.predbat_manual_demand
    data:
      option: "15:00:00"
  - delay:
      minutes: 1
  - action: select.select_option
    target:
      entity_id: select.predbat_manual_demand
    data:
      option: "15:30:00"
mode: single
W
#3 Weasel

geoffreycoan Thank you sir, that is exactly the sort of thing I am looking for

G
#4 geoffreycoan

Weasel the delay between the first and second select.select_option is to give Predbat time to respond to the request. If you fire a sequence of selects without any pauses then its likely Predbat will miss some of them, so that’s why its like that. Possibly could have a shorter delay, but this worked for me.

Also of course could use other predbat_manual_xxx controls if you want to do other things at specific times

W
#5 Weasel

geoffreycoan Thanks. I will be using a couple of manual controls, one to skip a potential charging period and the other to occasionally force discharge to my 4% reserve.

I figured that 1 minute delay was to ensure predbat had time to properly process each directive and I will continue in the same vein

G
#6 geoffreycoan

geoffreycoan

@Weasel update, it turns out you can instruct Predbat to accept multiple control commands in one go, you just need to specify it in the right format

Here's a revised automation:

alias: multi-set force demand overnight
description: ""
triggers:
  - trigger: time
    at: "22:16:00"
conditions: []
actions:
  - action: select.select_option
    target:
      entity_id:
        - select.predbat_manual_demand
    data:
      option: 00:00:00,00:30:00,01:00:00,01:30:00,02:00:00,02:30:00,03:00:00,03:30:00
mode: single

Sets all 6 overnight slots to between the Cosy charging periods to Force demand