How can I use DST as a trigger to run an automation slightly before the DST change?

I have a mains-powered device with a digital clock that doesn’t adjust to DST (Daylight Savings Time), and the way to modify the time is slightly irksome, causing very mild annoyance every six months. However, if there’s a power cut, the clock immediately resets to 00:00. Therefore, I thought of hooking the device up to a smart plug/relay, and having an automation run whenever DST changes to cut power to it so that the clock changes to the correct time.
After doing some quick calculations, I realised that I would need to cut the power at different times to get it to show the correct time. When DST kicks in, I would need to cut and restore the power at 23:00, so that the clock jumps an hour ahead to 00:00. When DST ends, I would need to cut and restore the power at 01:00, so that the clock jumps back to 00:00. So this automation would also need to offset the time of the actual DST change and technically run a little bit before DST officially changes.
Through the search function I found this post by someone who made a DST sensor which seems to provide several useful attributes:

However, I’m not sure how to do the time offset to make sure it runs before the actual DST change and at different times depending on if DST is about to start or end.

Can anyone point me in the right direction?

Are you saying the DST changeover date and time isnt the same every year?
Can’t you set an automation to run once every year, one for DST on, and another for DST off?
Making and tracking a DST sensor for the rest of the year seems a little overcomplicated.

Here it is:

starting at 2:00 am (AEST) on the first Sunday in October and ending at 3:00 am (AEDT) on the first Sunday in April.

Which should be easy enough to determine with a template, and apply an offset.

What are the rules where you live @smartlightenthusiast

You may even be able to trigger the automation directly from a calendar entry [coming to a future release soon I hear]

When this is 0 and time is 23:00 in April trigger.
And 01:00 if October.