I use the Home Assistant Calendar integration: Google Calendar Event - Home Assistant (home-assistant.io)
I then (painstakingly) entered my loadshedding schedule as recurring events into a Google Calendar (colors optional, just helped me keep sane when entering that many events):
This is then pulled into Home Assistant and using the features mentioned here Google Calendar Event - Home Assistant you can basically create binary sensors to indicate whether you’re in a specific Load-shedding event (basically within a specific Calendar Event). E.g. on mine, due to the way I named the entries, I can see that I am currently in a load shedding slot for level 2, or 3 or 4 (I didn’t bother going higher).
HA then creates the following binary sensors for me:
A couple of additional template sensors later I get this:
The “minutes until loadshedding” one is particularly useful, as I can basically now do an automation which says if I’m within 60 minutes of a loadshedding event, and the current LS level matches, and my batteries are below X (say 50%), then force charge them from the grid up to 50%.
The only part that I haven’t managed to solve yet is when it is not currently loadshedding, but scheduled to start at say 8:00 AM tomorrow and I’m in the first slot - then that automation won’t trigger. So far I’ve been lucky.
EDIT: we should really just go and develop a Load shedding integration/custom component for Home Assistant.