I currently have the below rule running that turns a group of lights off when the house alarms is set only when its dark, however every so often the alarm seems to send send a false signal for 1 second then returns back to off/unset however this then stars the rule and turns the group of lights off.
My question is can it be changed so the rule will wait for maybe 5 seconds of the state change to stay set/on before running and if its changes back in less then 5 seconds/ it would cancel or not do anything
rule "Alarmset"
when
Item F2_AlarmSet changed
then
if(F2_AlarmSet.state == ON && SunElevation.state < 0 ) {
gHome.sendCommand(ON)
}
end
thank you for anyone who can help what i have tried has failed