Hi All,
My motion sensor keeps being switch off, at least once a day.
The ONLY rule which has control of this item FibaroEye1Motion_Armed
is in the rule below:
rule "When Kodi Player changed to PLAY"
when
Item myKodi_control changed
logInfo("Kodi Changed", "Kodi Control Changed"
then
if (myKodi_control.state == PLAY){
FibaroEye1Motion_Armed.sendCommand(OFF) // Disable the motion sensor from turning on
//Slowly Dim the Lights if they are on
if (LivingRoomSw1.state == ON) {
if (fade_timer === null) {
percent = LivingRoomDim1.state as Number
fade_timer = createTimer(now.plusMillis(100), [ |
if (percent > 0) {
percent = percent - 2
if (percent < 0) percent = 0
LivingRoomDim1.sendCommand(percent)
fade_timer.reschedule(now.plusMillis(100))
} else {
fade_timer = null
}
])
}
}
}
else {
FibaroEye1Motion_Armed.sendCommand(ON) // Enable the motion sensor for any other state of myKodi_control
}
end
This is the only rule that can be causing this to the best of my knowledge as its the only rule which sends a command. The rest of the rules check for state of the item.
For whatever reason, it keeps setting the switch to off, which disables my motion sensor and subsequently my lights at night (highly annoying!)
A grep of my events log for OH2 shows no instances of ‘PLAY’ where by myKodi_control is being set to PLAY and therefore turning it off.
kris@openhab2:/etc/openhab2/rules$ cat /var/log/openhab2/events.log | grep PLAY
Any suggestions?? Losing my mind!
Further, is there a way for an item to have a default state of ON, even after restarts?
Thanks