# Start a rule in a rule

**URL:** <https://community.openhab.org/t/start-a-rule-in-a-rule/83716>\
**Category:** Scripts & Rules\
**Tags:** rules\
**Created:** [October 17, 2019, 9:02am UTC](https://community.openhab.org/t/start-a-rule-in-a-rule/83716 "2019-10-17T09:02:37Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![trab](https://community.openhab.org/user_avatar/community.openhab.org/trab/32/40306_2.png) [@trab](https://community.openhab.org/u/trab)\
**Post date:** [October 17, 2019, 9:37am UTC](https://community.openhab.org/t/start-a-rule-in-a-rule/83716/3 "2019-10-17T09:37:38Z")

</div>

Thx Tom for your quick reaction!  
But for example I use this Progressive Dimmer rule as a wake up dimmer.

> [@Progressive Dimmer Rules](https://community.openhab.org/t/progressive-dimmer-rules/6630/8):
>
> @sam2b, it may be much simpler but it is really bad practice. Your rule is holding on one of the 5 threads available You should do that with a timer: Much safer val int timeoutMills = 3 \* 600 // 60000 divided by 100 dim levels var int dimLevel = 1 var Timer timer = null rule "Slowly Dim Up" when Item Outlet2\_Switch changed to ON then if (timer === null) { timer = createTimer(now.plusSeconds(0), [ | //Starts immediately Light1\_Dimmer.sendCommand(dimLevel) …

But I have changed/added some things (the dimLevel to 90 instead of 100).  
I have made another rule to do the same when I trigger a switch.  
But now I would rather have de dimLevel to 70 so I have to change it twice.  
Is there a way to make a “standard rule” to dim the lights and refer to it in another rule?

to be clear I want this part as the standard rule

```
if (timer === null) {
    timer = createTimer(now.plusSeconds(0), [ | //Starts immediately
        Light1_Dimmer.sendCommand(dimLevel)
        if (dimLevel == 100) {
            timer = null // cancel timer
        } else {
            dimLevel = dimLevel + 1
            timer.reschedule(now.plusMillis(timeoutMills)) // reschedule timer is 3 * 600 mills
        }
    ])
}

```

---

_[View the full topic](https://community.openhab.org/t/start-a-rule-in-a-rule/83716)._
