Turn on Hue lights x minutes before smart period

I would like to be able to automatically turn on Hue lights a configurable amount of minutes before the start of the smart period.

Currently, if you want Hue lights to turn on before the alarm rings, you have to configure a delayed alarm sound start. This works, but you have to consider this delay when setting an alarm. I selected a delay of 24 minutes. Now, if I want the alarm to ring at 8:00, I actually have to set it for 7:36. That’s not intuitive and if you forget it, you wake up late.
And if you use the smart wake up period, the lights turn on at the optimal wake up moment, but when the alarm rings 24 minutes later, you might be in deep sleep again.

The solution would be to turn on the lights at a configurable time before the start of the smart period. For example: Alarm set to 8:00, smart period 30 minutes, light-on time 10 minutes before smart period. The lights would then turn on at 7:20 and the alarm would sound at the optimal moment between 7:30 and 8:00 (as usual).

I’m currently working on something similar but I just did it myself: Sleep as Android will publish an event called “before_smart_period” 45 minutes before your smart period starts. You can use this in Tasker, Llamalab’s Automate with the tasker plugin, get it to trigger a webhook, get it to publish on your MQTT network or on IFTTT. Then if you want it to only start 10 minutes before, just delay 35 minutes in your automation.