geoffreycoan
I have now just about finished the scripting project that went on longer than I had anticipated. Please can I ask you to check my understanding of a few things? (I did have a look at the SpeakToTheGeek website, but I prefer to have HA manage everything rather than have to manually set times for each Saving Session.)
As background, I now have the following card:

When I join a Saving session by accepting the Octopus email then
- the card will populate itself with data about the Saving Session (scraped from the Octopus API by the integration), and
- automatically get HA to do a battery discharge during the SS times (if I later change my mind then I can prevent the discharge with a simple switch), and
- revert back to my default desired settings (Eco, plus a few others) afterwards
- it will also get ready to do a Pre-charge of the battery (if this is something I want to do).
It all seems to be working (though won't be properly debugged until the next SS goes live). But I'd like to check my understanding of the GivTCP/HA interface with someone who's been there before me! Let's assume my serial number is "xxxxxx". Hopefully you can answer a quick YES to the following:
1 - will this code set the target battery charge level to 100%?
- service: number.set_value
data:
value: 100
target:
entity_id: select.givtcp_xxxxxx_battery_charge_target
2 - will this code force a battery charge from the grid (up to the target set above)?
- service: select.select_option
target:
entity_id:
- select.givtcp_xxxxxx_force_charge
data:
option: Running
3 - will the same code with option: Normal stop charging the battery from the grid? (As you suggested, I do have a default battery reserve set, which is never changed.)
4 - will this code force a battery dump to the grid?
- service: select.select_option
data:
option: Running
target:
entity_id: select.givtcp_xxxxxx_force_export
(BTW I think Timed Export is different from Timed Demand? Isn't one dump to grid, and the other dump to load? Maybe not.)
5 - as above will a Normal option stop the battery dump?
Finally - have you found that comms between HA and your battery/inverter are stable? It will be pretty trivial for me to add in "check+repeat if necessary" code for all commands, but I haven't gone there (yet).
FYI I had hoped to automate in a similar way Power-ups. But, sadly, they are not currently exposing these events to the API, according to BottlecapDave.