If I see it right dsc binding first initialize item states at startup to off ,then read the real states. Is this normal or I have anything badly ?
When partition is armed , my rule send me notification .
After restart OH the item is first initialized to OFF , then go to real state
From event logs:
2017-02-12 00:25:50.069 [ItemStateChangedEvent ] - PARTITION1_ARMED changed from NULL to OFF.
.
.
2017-02-12 00:25:55.934 [ItemStateChangedEvent ] - PARTITION1_ARMED changed from OFF to ON
.
.
Because this reason my rule is triggered on every startup ,and I get notification needlessly (with OH1 dont have a problem) :
rule “Partition1Armed”
when
Item PARTITION1_ARMED changed from OFF to ON
then
Notify_Warn.postUpdate(“MyHome is armed.”)
end
My rule works as I wanted , with instructions from rlkoshak :
rule "System Started"
when
System started
then
SystemStarting.sendCommand(ON)
startedTimer = createTimer(now.plusSeconds(30), [| SystemStarting.sendCommand(OFF)])
end
rule "Partition1Armed"
when
Item PARTITION1_ARMED changed from OFF to ON
then
if ( SystemStarting.state == OFF ) {
Notify_Warn.postUpdate("House Armed.")
}
end