New Guy With A Basic Rule Question

Hi everyone, I just installed Hubitat a few days ago. I moved to a new house and was sick of Smartthings at my last house so I made the switch. I setup my first rule to tun on the porch lights just before sunset, and turn them off just after sunrise. At first I did not have the action "On: Front Porch , Kitchen Porch" in there. I got up this morning and noticed the lights were not on. So i just added that in now and will see if it runs tonight. It seems like I should be able to combine that and the action where the color and level is set. Am I doing this right, or is there a cleaner way?

I believe you want to use the Dim action instead of On and Set . You can also open the rule and use the Run Action button to see if the lights will turn on correctly.

1 Like

AFAIK, dim cannot set color temperature, which @24v uses in their rule.

1 Like

Are your porch lights simple smart bulb (on/off only) or are they dimmable and/or color bulbs?
I assume they are color or tuneable white, in which case you should be using Set color temperature and level.

If you continue to have issues with the time lights come on or off. My preference would be to use 2 rules. This will always work.

Rule: Outside Lights On
When time is Sunset-15
Set color temperature Porch Lights 5000, 100

Rule: Outside Lights Off
When time is Sunset+15
Off Porch light


Rule: Outside Lights Off
When time is Sunrise+15
Off Porch light

1 Like

What bulbs are you using? If you are using a device that has Color & Level prestaging, you may have to set the Color and Level and turn the light on...but i would do it in that order, not in the order you do it. If you do not have level and color prestaging, setting the color and level will turn the device on, there is no need to do both.

1 Like

Thanks for the answers guys. The bulbs are Hue color bulbs.

Why would I use "set color temp and level", versus using "set color and level"?

So level is the same in both cases. It sets the percent output from 0 to 100.

Color temperature refers to the temperature of white light in degrees Kelvin. For my Sengled bulbs, this can vary from 2000K (for something approximating sunset) to 6500K (which approximates daylight).

Color refers to an RGB combination that gives the specified color (eg. red or blue or green or any mixture thereof).

1 Like

I'm clear on the difference and what the numbers stand for. I was responding to @bbholthome's comment saying I should use one over the other. Just wanted to hear the reasoning. Also, why would I make 2 separate rules for this instead of one?

It would be more efficient than a long wait.

1 Like

Is there not any other way to make this work in a single rule?

Yes, there is:


When time is Sunset -15
When time is Sunrise +15


IF (Time is Sunset-15) THEN
    On: Porch Lights
    Set Set color temperature Porch Lights 5000, 100
    Off: Porch Lights

Why do I need to use the kelvin of the light rather than the name of the color?

Are you trying to set the temperature of white light or a color? If it is the former then use color temperature; if not, use color.

I don't know about how Hue handles this, but 4 LED (RGBW) LED strips that I have used before would approximate white using RGB LEDs unless I specified the use of the white LED and a color temp.

I have no desire to use the kelvin value unless for some reason I need to. See my original post. That is how I would like to call out the color and level.

1 Like

If Hue recognizes Daylight as a color that uses the white LED, you can certainly do that.

Edit: If it doesn't, then you can always use CT. It isn't like doing so is making your bulbs work extra hard or stressing your network :slight_smile:


Ok, here is what I have now.

1 Like

It is good practice to end each "IF" block with an "END-IF". Doesn't matter for this rule, but as your rules get more complex, it'll become essential. So may as well as get in the practice of doing so now.


Ok, thank you. I added the END-IF. :metal:

1 Like