# Phillips HUE Fade in at SunSet Rule

**URL:** <https://community.openhab.org/t/phillips-hue-fade-in-at-sunset-rule/65742>\
**Category:** Tutorials & Examples\
**Tags:** rules\
**Created:** [January 27, 2019, 2:35pm UTC](https://community.openhab.org/t/phillips-hue-fade-in-at-sunset-rule/65742 "2019-01-27T14:35:46Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![lipp\_markus](https://community.openhab.org/user_avatar/community.openhab.org/lipp_markus/32/56218_2.png) [@lipp\_markus](https://community.openhab.org/u/lipp_markus)\
**Post date:** [January 27, 2019, 3:20pm UTC](https://community.openhab.org/t/phillips-hue-fade-in-at-sunset-rule/65742/3 "2019-01-27T15:20:43Z")

</div>

Your rule will be running for a very long time (30mins) and mostly sleeping. OpenHAB cannot run many rules in parallel, and you will run quickly out of rules threads. More details here:

> [@(OH 1.x and OH 2.x Rules DSL only\] Why have my Rules stopped running? Why Thread::sleep is a bad idea](https://community.openhab.org/t/why-have-my-rules-stopped-running-why-thread-sleep-is-a-bad-idea/47695):
>
> EDIT: While the general advice in this article still applies (i.e. it’s always worth while to make short running rules), the problem described in this article only applies to OH 1.x and Rules DSL in OH 2.x. In OH 3 and beyond, this is no longer a problem so if your rules stop running in any version of OH released in the last two years (as of this edit in 1/2023) this is not your problem. By way of explanation, in OH 3 each rule gets it’s own thread. It is no longer possible for a rule to starve…

I believe you can use timers for this, but I am not capable of giving you the code. This will give you a start though:

> [@Design Pattern: Looping Timers](https://community.openhab.org/t/design-pattern-looping-timers/47699):
>
> Edit: Update for OH 4 Please see [Design Pattern: What is a Design Pattern and How Do I Use Them](https://community.openhab.org/t/design-pattern-what-is-a-design-pattern-and-how-do-i-use-them/40319) to understand the scope and purpose of this and other Design Patterns. Problem Statement Often one may require a loop in a Rule, to wait for some event to occur or some state to change before doing something. For example, if a door is opened for a long time to send an alert every hour until the door is closed. Concept Use a Timer that reschedules itself instead of a while loop or sleeps. …

---

_[View the full topic](https://community.openhab.org/t/phillips-hue-fade-in-at-sunset-rule/65742)._
