[SOLVED] Preset bulb color by daytime

hello,

i use openhab with the tradfri binding.

Is it possible in a rule to say the following.

if i turn on item between 6PM an 6AM be color temperature should “warm white”

and between 6AM and 6PM “cold white”

without turning the bulb on, just preset the color for all bulbs?

Add a switch or slider for color temp and try it manually. If it works manually it will work in a rule.

You can definitely have a proxy switch that triggers a rule with time based if statement. The color change would happen fast enough to not notice most likely.

I know what you are asking works for my hue lights.

In addition to @Thedannymullen advice you can also do some neat stuff with item profiles.

Link to profile info:

hi thank for the hint.

my rule works as wished

rule "preselect warm light"
when
    Time cron "0 0 18 1/1 * ? *"
then
    Bathroom_Light_Slider_Color.sendCommand(new PercentType(100))
    Bedroom_Light_Slider_Color.sendCommand(new PercentType(100))
    Dining_Light_Slider_Color.sendCommand(new PercentType(100))
    KidsRoom_Light_Slider_Color.sendCommand(new PercentType(100))
    Hallway_Light_Slider_Color.sendCommand(new PercentType(100))
    LivingRoom_Light_Slider_Color.sendCommand(new PercentType(100))
    Office_Light_Slider_Color.sendCommand(new PercentType(100))
end

rule "preselect cold light"
when
    Time cron "0 0 6 1/1 * ? *"
then
    Bathroom_Light_Slider_Color.sendCommand(new PercentType(0))
    Bedroom_Light_Slider_Color.sendCommand(new PercentType(0))
    Dining_Light_Slider_Color.sendCommand(new PercentType(0))
    KidsRoom_Light_Slider_Color.sendCommand(new PercentType(0))
    Hallway_Light_Slider_Color.sendCommand(new PercentType(0))
    LivingRoom_Light_Slider_Color.sendCommand(new PercentType(0))
    Office_Light_Slider_Color.sendCommand(new PercentType(0))
end

i take a look at the profiles, thank you for your answers.

1 Like

Glad you got it working. :+1:

Please click the square box on the post that provided the solution to mark the topic as solved e.g. @Thedannymullen post.

Thanks

1 Like