My Rule fires, but doesn’t turn on the lamp.
home.rules
rule BeforeSunset
when
Item SunElevation changed
then
var DateTime sunsetTime = new DateTime((Sunset_Time.state as DateTimeType).calendar.timeInMillis)
if (sunsetTime.minusMinutes(60).isBefore(now) && Lounge_Toggle.state==OFF) {
logInfo("rule", "Firing Sunset in 30m")
Lounge_Brightness.postUpdate(80)
//Lounge_Toggle.postUpdate(ON)
}
end
The log has…
15:03:59.885 [INFO ] [marthome.event.ItemStateChangedEvent] - SunElevation changed from 6.29 to 5.82
15:03:59.891 [INFO ] [.eclipse.smarthome.model.script.rule] - Firing Sunset in 30m
15:03:59.942 [INFO ] [marthome.event.ItemStateChangedEvent] - Lounge_Brightness changed from 0 to 80
15:04:01.294 [INFO ] [marthome.event.ItemStateChangedEvent] - Lounge_Brightness changed from 80 to 0
I can toggle the switch manually in ClassicUI and the app normally.