# Astro Local Sun not doing quite what I hoped

**URL:** <https://community.openhab.org/t/astro-local-sun-not-doing-quite-what-i-hoped/131051>\
**Category:** Beginners\
**Created:** [January 2, 2022, 4:27pm UTC](https://community.openhab.org/t/astro-local-sun-not-doing-quite-what-i-hoped/131051 "2022-01-02T16:27:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![NickLocke](https://community.openhab.org/letter_avatar_proxy/v4/letter/n/b5e925/32.png) [@NickLocke](https://community.openhab.org/u/NickLocke)\
**Post date:** [January 2, 2022, 4:27pm UTC](https://community.openhab.org/t/astro-local-sun-not-doing-quite-what-i-hoped/131051/1 "2022-01-02T16:27:36Z")

</div>

Starting with a positive, I am using a comparison with DAYLIGHT in several scripts to make them behave differently depending on the time of day.

I’ve not had quite as much luck trying to use Civil Dusk to trigger a rule. I have this set up:

 ![Capture1](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/a/d/ad41fc60b72c1e9b245a5f3e9fca3c5641a43f6e.jpeg)

When I set it up, much earlier today, I was encouraged to see that the box at the top changed to show what looked like the right time. However, perhaps strangely, it is still showing the same time although the local time here is now well past 16:03 - should it maybe have moved to tomorrow’s time by now?

I have then set the rule trigger up like this:

 ![Capture2](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/8/5/85b429ee3d1d78841157ba6d922089abbefd1226.jpeg)

Unfortunately 16:03 came and went and nothing happened.

Any clues on what I have done wrong would be appreciated.

Thanks, Nick

---

<div class="post-metadata">

**Author:** ![JustinG](https://community.openhab.org/user_avatar/community.openhab.org/justing/32/55948_2.png) [@JustinG](https://community.openhab.org/u/JustinG)\
**Post date:** [January 2, 2022, 4:55pm UTC](https://community.openhab.org/t/astro-local-sun-not-doing-quite-what-i-hoped/131051/2 "2022-01-02T16:55:01Z")

</div>

> [@NickLocke](#):
>
> it is still showing the same time although the local time here is now well past 16:03 - should it maybe have moved to tomorrow’s time by now?

This is the expected behavior for the astro items. The item has a DateTime state that contains the precise time the event will occur that day. At midnight each day all the astro items will change to the correct time for the new day. Astro items do not change at the time of the event.

> [@NickLocke](#):
>
> I have then set the rule trigger up like this:

This is the correct way to go, and you’ll note it actually doesn’t even use the item, it uses a trigger channel instead ([see here](https://community.openhab.org/t/openhab-glossary/130036#core-concepts-3)). So the actual question is why didn’t the rule do what you were expecting. You’ll have to show us the full rule for us to find out.

---

<div class="post-metadata">

**Author:** ![rossko57](https://community.openhab.org/user_avatar/community.openhab.org/rossko57/32/70263_2.png) [@rossko57](https://community.openhab.org/u/rossko57)\
**Post date:** [January 2, 2022, 4:55pm UTC](https://community.openhab.org/t/astro-local-sun-not-doing-quite-what-i-hoped/131051/3 "2022-01-02T16:55:01Z")

</div>

> [@NickLocke](#):
>
> t is still showing the same time although the local time here is now well past 16:03 - should it maybe have moved to tomorrow’s time by now?

No. Sunset today is at 16:03. At 09:00 today, sunset will be at 16:03. At 20:00 today, sunset was at 16:03. Today’s sunset is 16:03 all day long.

What you are looking for to make a rule run at sunset does not involve an Item - you want to use the **event** channel of similar name as a rule trigger. Lots of examples in this forum.

---

<div class="post-metadata">

**Author:** ![DrRSatzteil](https://community.openhab.org/user_avatar/community.openhab.org/drrsatzteil/32/63872_2.png) [@DrRSatzteil](https://community.openhab.org/u/DrRSatzteil)\
**Post date:** [January 2, 2022, 5:32pm UTC](https://community.openhab.org/t/astro-local-sun-not-doing-quite-what-i-hoped/131051/4 "2022-01-02T17:32:29Z")

</div>

Afaik the trigger event should be „START“ in capital letters. I guess this is the reason why your rule did not fire.

---

<div class="post-metadata">

**Author:** ![NickLocke](https://community.openhab.org/letter_avatar_proxy/v4/letter/n/b5e925/32.png) [@NickLocke](https://community.openhab.org/u/NickLocke)\
**Post date:** [January 2, 2022, 5:51pm UTC](https://community.openhab.org/t/astro-local-sun-not-doing-quite-what-i-hoped/131051/5 "2022-01-02T17:51:19Z")

</div>

Thanks everyone!

**Rossko57 and JustinG**  
It seems like my brain is a little sore today - now you have explained how the times will update at midnight, it’s pretty obvious. Thanks also for the pointer to rule triggers - quite a bit of a learning curve going on here.

That link to the concepts helps greatly, JustinG - thanks for the pointer.

**Rossko57**  
Lots of examples in the forum - yes indeed, several hours spent earlier getting more and more confused. Hopefully all sorted now.

**DrRSatzteil**  
Thanks for that extremely good spot - I shall update my rule and see what happens tomorrow.

Thanks for the input everyone - and have a great New Year!

Nick
