I am trying to set up automations in HA to charge my battery based on the solcast forecast at the cheapest rates coming in from my octopus Agile tariff. I have GivTCP, Solcast and the bottlecap Dave integration all installed.
Issue:
Currently the battery doesn't seem to charge based on the bottlecap Dave sensor and weirdly it now selects a random time to export to the grid until empty which I have not asked it to do, I want to use that power myself. I've looked at the logs and I can't see anything at the time the export starts that would explain why, no automation firing and nothing in GivTCP other than the usual updates on times
Setup:
I have configured my Solcast API in GivTCP.
The sensor for the bottlecap Dave integration accurately identifies the cheapest rate and fires. I've checked the state in dev tools.
Here is the automation I created to read the cheapest rate and charge the battery. When it is above 99% it stops and goes back to discharge (or at least should, this doesn't work right now)
'alias: Start battery charge at cheapest rate
description: ""
trigger:
- platform: state
entity_id:- binary_sensor.octopus_energy_target_battery_over_night
from: "off"
to: "on"
condition: []
action:
- binary_sensor.octopus_energy_target_battery_over_night
- device_id: 002ed8c01f7e01e577b4760e9883f896
domain: number
entity_id: aed2527e0cb1712ae99a6da271eec002
type: set_value
value: 100 - choose:
- conditions:
- type: is_battery_level
condition: device
device_id: c2d5b9907762e6c266d4a79a0a86a7fb
entity_id: d6b458012452e5a01263efb2cc928270
domain: sensor
above: 99
sequence:- device_id: 002ed8c01f7e01e577b4760e9883f896
domain: number
entity_id: aed2527e0cb1712ae99a6da271eec002
type: set_value
value: 0 - type: turn_on
device_id: 002ed8c01f7e01e577b4760e9883f896
entity_id: cd1f948df1aad27ab5ac56b584eede2b
domain: switch
mode: single'
- device_id: 002ed8c01f7e01e577b4760e9883f896
- type: is_battery_level
- conditions:
I did find this thread on here with what looked like exactly what I wanted from @Arg0t but I couldn't get those automations to work. I think because I didn't know how to set the charge slot in GivTCP so tried creating something simpler myself.
If anyone has any ideas I'd be grateful, I'm tearing my hair out here (well I would be if I wasn't bald!)

