Best way to cascade light rules?

I'd like to do something like the following, but various ways I have tried it seem to fail or my lights get stuck updating to the same number.

Specifically I'd like to have a dimmer I have gradually turn on when we turn our TV off (done watching a movie), then turn off after 5 minutes (within that 5 minutes there is a chance a manual control might already turn the lights off).

What's the best way in a rule to do something like this that is timed based?

  1. Dim lights up from 0 to 30% over 15- to 20 seconds
  2. Turn off the lights after 5 minutes.

I'm worried about messing up any delays or wait processes not knowing how the internals of Hubitat effect theses.

Here's a simple rule that should do what you're asking for, if I'm interpreting it right:

image

This does depend on your light ("TEST Dimmer 1" in my example) supporting a 15-second fade time. This is higher than I normally use, but I just tested a Hue bulb and Inovelli dimmer, and both were fine with that rate (Hue was a lot smoother...). If this is too high for your bulb, you could use RM's "Fade dimmer level over time" action instead; this will just split your change up into several "Set Level"s that it will space apart for you according to the options you set to achieve the desired effect. You probably won't need to do this.

I did a bit more than you specifically asked for: if the TV turns on again, it will cancel the scheduled "Off" action (the dim will still keep happening). This would help if you ever turn the TV off, then back on again--the light won't turn off after 5 minutes when it's still on (or if you turn it off, back on for a few minutes, then back off again, it will again wait the full 5 minutes). This is probably what you want. I didn't do some things that you might want: will this dimmer ever be on to start? If so, you may want to put either an "Off" or "Dim (to 1%)" action before the "Dim" action in the ELSE if you want that.

Hope this helps!

1 Like