Hi All,
I'm looking to create a flow based on some event data which I get out of my Octopus Energy integration. Every so often, we get cheap electric for a period of time - and I see this information in home assistant - for example, we have one today:
event.octopus_energy_octoplus_saving_session_events
event_types: octopus_energy_all_octoplus_saving_sessions
event_type: octopus_energy_all_octoplus_saving_sessions
available_events:
joined_events:
- id: 1165
start: '2023-11-29T17:00:00+00:00'
end: '2023-11-29T18:30:00+00:00'
rewarded_octopoints: null
- id: 1166
start: '2023-12-01T16:30:00+00:00'
end: '2023-12-01T18:00:00+00:00'
rewarded_octopoints: null
If we have a 'saving session' on a given day - I want to charge my home battery up 4 hours before - so for example, I would want to start my charge at 12:30 today, as there is a saving session at 16:30 - but I'm struggling with a flow that can pick out the latest date and time out of that dynamic attribute list from the event entity.
I already have the charging flow working - I just need a node that can fire at the right time, dependent on the above - can anyone help with how I go about doing that? I imagine that I'd have to write a function to do this, as I can't see a built-in node to do it with.
Thanks
Leacho