# Turn on Lights X mins before Sunset - Not working

**URL:** <https://community.homey.app/t/turn-on-lights-x-mins-before-sunset-not-working/144028>\
**Category:** Flows\
**Created:** [October 12, 2025, 10:29am UTC](https://community.homey.app/t/turn-on-lights-x-mins-before-sunset-not-working/144028 "2025-10-12T10:29:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt20v](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/matt20v/32/11393_2.png) [@Matt20v](https://community.homey.app/u/Matt20v)\
**Post date:** [October 12, 2025, 10:29am UTC](https://community.homey.app/t/turn-on-lights-x-mins-before-sunset-not-working/144028/1 "2025-10-12T10:29:17Z")

</div>

HI All  
I really hope this is a silly question and someone will point out what i am doing wrong !

I have tried with both the built in Date & Time function and after some research the Sun Events app but i cannot get the flow to work properly

Below is my flow, i am just wanting the light to turn on 45 mins before sunset happens.

No matter how i do this the light never turns on and i cannot figure out why.

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/d/8dcd555a8512390452134fd345a82af21a664b4d.png)

Thanks in advance!!

---

<div class="post-metadata">

**Author:** ![DirkG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkg/32/118897_2.png) [@DirkG](https://community.homey.app/u/DirkG)\
**Post date:** [October 12, 2025, 2:38pm UTC](https://community.homey.app/t/turn-on-lights-x-mins-before-sunset-not-working/144028/2 "2025-10-12T14:38:30Z")

</div>

You need to insert **-45** in the Sun Events Flow card, not 45.

---

<div class="post-metadata">

**Author:** ![JohanP](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/johanp/32/119002_2.png) [@JohanP](https://community.homey.app/u/JohanP)\
**Post date:** [October 12, 2025, 7:30pm UTC](https://community.homey.app/t/turn-on-lights-x-mins-before-sunset-not-working/144028/3 "2025-10-12T19:30:53Z")

</div>

Put a timeline notification behind the trigger and the AND. Maybe it goes wrong on ‘Someone is at home’ ?

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [October 12, 2025, 8:13pm UTC](https://community.homey.app/t/turn-on-lights-x-mins-before-sunset-not-working/144028/4 "2025-10-12T20:13:51Z")

</div>

And, always add a notification card right after the trigger(s), to find out if the trigger actually fails, or other parts of your flow fail, or just don’t act as expected.

---

<div class="post-metadata">

**Author:** ![JohanP](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/johanp/32/119002_2.png) [@JohanP](https://community.homey.app/u/JohanP)\
**Post date:** [October 12, 2025, 8:22pm UTC](https://community.homey.app/t/turn-on-lights-x-mins-before-sunset-not-working/144028/5 "2025-10-12T20:22:56Z")

</div>

To test a faillure I put one behind each card in the flow.

---

<div class="post-metadata">

**Author:** ![Matt20v](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/matt20v/32/11393_2.png) [@Matt20v](https://community.homey.app/u/Matt20v)\
**Post date:** [October 13, 2025, 4:03am UTC](https://community.homey.app/t/turn-on-lights-x-mins-before-sunset-not-working/144028/6 "2025-10-13T04:03:58Z")

</div>

Thanks everyone yes i did add a notification after i posted that screen shot so i could verify,

I will add the -45 today and see what happens tonight !

hopefully that solves it and will post back.

Thanks

---

<div class="post-metadata">

**Author:** ![Matt20v](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/matt20v/32/11393_2.png) [@Matt20v](https://community.homey.app/u/Matt20v)\
**Post date:** [October 13, 2025, 8:12am UTC](https://community.homey.app/t/turn-on-lights-x-mins-before-sunset-not-working/144028/7 "2025-10-13T08:12:34Z")

</div>

Thanks Everyone using the -45 has fixed the issue!

Really appreciate the guidance, and again sorry for the basic question 🙂

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/2/327453440326a52621190cc459582d873a8243f0.png)
