# Compare sun events to time

**URL:** <https://discourse.nodered.org/t/compare-sun-events-to-time/24963>\
**Category:** General\
**Created:** [16 April 2020 17:47 UTC](https://discourse.nodered.org/t/compare-sun-events-to-time/24963 "2020-04-16T17:47:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tompijls](https://avatars.discourse-cdn.com/v4/letter/t/e9a140/32.png) [@tompijls](https://discourse.nodered.org/u/tompijls)\
**Post date:** [16 April 2020 17:47 UTC](https://discourse.nodered.org/t/compare-sun-events-to-time/24963/1 "2020-04-16T17:47:49Z")

</div>

Hi,

I'm using node red with home assistant to switch on my home lights when I'm not at home.

I was using a time range node, set to Start Time 7:00 and End Time SunriseEnd.

This worked pretty well until recently, when SunriseEnd happens before 7:00, which now means the Timerange node gives true almost the entire day and night, with 2am lights in my room switching on when my phone disconnects from wifi... 🤣

What option do i have to return true if currenttime is between 7am and SunriseEnd, only when SunriseEnd is later than 7am?

Thanks!

Thanks

Tom

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [15 June 2020 17:47 UTC](https://discourse.nodered.org/t/compare-sun-events-to-time/24963/2 "2020-06-15T17:47:50Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
