Template alarm time as trigger in an automation


I try to get lights on, when I get up and the android alarm rings

To trigger the automation I use this template

{{now().strftime('%a %h %d %H:%M %Z %Y') == (((state_attr('sensor.mi12stefan_next_alarm', 'Time in Milliseconds') | int / 1000) ) | timestamp_custom('%a %h %d %H:%M %Z %Y'))}}

Now I realize, that alarm starts 1 hour before in wintertime Germany.

Has anybody an idea how to do the template correct, so it works in summer and winter?

Best regards,

Is your system time right?

I use this

 {{now().strftime("%a %h %d %H:%M %Z %Y") == (((state_attr('sensor.mobil_naeste_alarm', 'Time in Milliseconds') | int / 1000) - 10*60 ) | timestamp_custom('%a %h %d %H:%M %Z %Y'))}} 

starts 10 min before alarm, and I have no Issue with summer/winter time (Denmark)

I think you are right. Its something else.

Best regards,