Hi Everyone i have been working on my rules trying to centralise some of my lighting rules
so far i have come up with this rule but it behaves unexpectidly
whats supposed too happe
if item changed to on then check time and do stuff then turn item back off
whats happeneng
sometimes when the item turns too ON it just stays on and doesent c’hange the lights or log a time in the log just stays on and nothing happens
any advice appretiated
rule "Time Based Lighting" // WW = Warm White / W = White / CW = Cool White /
when
Item Timebasedlighting changed to ON
then
if( now.getHourOfDay < 6 ) { // 12AM <> 6AM
Lamp1_Brightness.sendCommand("5")
BULB6LRMAIN1_Color.sendCommand("39,87,5") // WW
Timebasedlighting.sendCommand ("OFF")
logInfo("RULE", "Time Based Lighting 12AM <> 6AM FINISHED")
return;
}
if( now.getHourOfDay > 6 && now.getHourOfDay < 8 ) { // 6AM <> 8AM
Lamp1_Brightness.sendCommand("100")
BULB6LRMAIN1_Color.sendCommand("39,87,75") // WW
Timebasedlighting.sendCommand ("OFF")
logInfo("RULE", "Time Based Lighting 6AM <> 8AM FINISHED")
return;
}
if( now.getHourOfDay > 8 && now.getHourOfDay < 12 ) { // 8AM <> 12AM
Lamp1_Brightness.sendCommand("100")
BULB6LRMAIN1_Color.sendCommand("227,30,100") // CW
Timebasedlighting.sendCommand ("OFF")
logInfo("RULE", "Time Based Lighting 8AM <> 12AM FINISHED")
return;
}
if( now.getHourOfDay > 12 && now.getHourOfDay < 16 ) { // 12AM <> 4PM
Lamp1_Brightness.sendCommand("75")
BULB6LRMAIN1_Color.sendCommand("227,30,0") // OFF
Timebasedlighting.sendCommand ("OFF")
logInfo("RULE", "Time Based Lighting 12AM <> 4PM FINISHED")
return;
}
if( now.getHourOfDay > 16 && now.getHourOfDay < 20 ) { // 4PM <> 8PM
Lamp1_Brightness.sendCommand("60")
BULB6LRMAIN1_Color.sendCommand("227,30,60") // CW
Timebasedlighting.sendCommand ("OFF")
logInfo("RULE", "Time Based Lighting 4PM <> 8PM FINISHED")
return;
}
if( now.getHourOfDay > 20 && now.getHourOfDay < 22 ) { // 8PM <> 10PM
Lamp1_Brightness.sendCommand("30")
BULB6LRMAIN1_Color.sendCommand("39,87,30") // WW
Timebasedlighting.sendCommand ("OFF")
logInfo("RULE", "Time Based Lighting 8PM <> 10PM FINISHED")
return;
}
if( now.getHourOfDay >= 22 ) { // 10PM <> 12PM
Lamp1_Brightness.sendCommand("15")
BULB6LRMAIN1_Color.sendCommand("39,87,15") // WW
Timebasedlighting.sendCommand ("OFF")
logInfo("RULE", "Time Based Lighting 10PM <> 12PM FINISHED")
return;
}
end
20:23:15.276 [INFO ] [smarthome.event.ItemCommandEvent ] - Item 'Timebasedlighting' received command OFF
20:23:15.277 [INFO ] [smarthome.event.ItemStateChangedEvent] - Timebasedlighting changed from ON to OFF
20:23:15.888 [INFO ] [smarthome.event.ItemCommandEvent ] - Item 'Timebasedlighting' received command ON
20:23:15.889 [INFO ] [smarthome.event.ItemStateChangedEvent] - Timebasedlighting changed from OFF to ON
20:23:16.793 [INFO ] [smarthome.event.ItemCommandEvent ] - Item 'Timebasedlighting' received command OFF
20:23:16.794 [INFO ] [smarthome.event.ItemStateChangedEvent] - Timebasedlighting changed from ON to OFF
20:23:17.396 [INFO ] [smarthome.event.ItemCommandEvent ] - Item 'Timebasedlighting' received command ON
20:23:17.397 [INFO ] [smarthome.event.ItemStateChangedEvent] - Timebasedlighting changed from OFF to ON
20:23:18.051 [INFO ] [smarthome.event.ItemCommandEvent ] - Item 'Timebasedlighting' received command OFF
20:23:18.052 [INFO ] [smarthome.event.ItemStateChangedEvent] - Timebasedlighting changed from ON to OFF
20:23:18.636 [INFO ] [smarthome.event.ItemCommandEvent ] - Item 'Timebasedlighting' received command ON
20:23:18.637 [INFO ] [smarthome.event.ItemStateChangedEvent] - Timebasedlighting changed from OFF to ON
20:23:19.224 [INFO ] [smarthome.event.ItemCommandEvent ] - Item 'Timebasedlighting' received command OFF
20:23:19.225 [INFO ] [smarthome.event.ItemStateChangedEvent] - Timebasedlighting changed from ON to OFF
20:23:19.721 [INFO ] [smarthome.event.ItemCommandEvent ] - Item 'Timebasedlighting' received command ON
20:23:19.722 [INFO ] [smarthome.event.ItemStateChangedEvent] - Timebasedlighting changed from OFF to ON
20:23:19.839 [INFO ] [smarthome.event.ItemStateChangedEvent] - Plug7_Signal changed from -51 to -52
20:23:20.226 [INFO ] [smarthome.event.ItemCommandEvent ] - Item 'Timebasedlighting' received command OFF
Thats me manually trying too trigger the rule turning the item off and on myself it sometimes functions perfectly