Power on pattern

How to create entity, that is on and off in 15 min intervals starting 7min30s after midnight.

Reasoning:
My electricity operator started to use power payment based on months third biggest hourly consumption. And the payment is quite big. At summer we will have 15 min interval for nettoing electricity production. In both cases it would be useful to be able to run things so, that it is on for example 7min 30s and keeps alternating state every 15 min. Average consumption is halved, and also solar production will be better utilised.

You can use helper utility meter but you need some device or entity that will measure real time consumption.
Or use some template entity that will again be based on some other entity that you can monitor and do caclucation from there.