Hi Everyone,
I’m new to OpenHAB but have been using Vera device and Zway on a RPI for some years to run my home automation - finally got fed up of the rubbish Vera UI and decided to switch so I’m trying to move all my rules over to OH although for now leaving the devices attached where they are.
Thanks to all the great info here in the community, I’ve got OH2 running on the Raspberry Pi 3B and all working ok, showing and controlling my Vera and Zway devices ok but I’ve hit a problem trying to write my first rule.
Code is below, but is not behaving as expected and I’d appreciate some advice as to whether the code is right or not. Basically none of the motion states after the first two in the ‘OR’ part of the if condition trigger correctly. It gets to the ‘Hall lamp on’ bit if front door or loungemotion are triggered but not with landingmotion or dining4in1sensor. When I test the conditions individually they all work ok, just not together. Any help much appreciated, I’ve spent a couple of hours on this already!
rule "Hall Light"
when
Item vTimeOfDay received update or
Item Frontdoor2Tripped received update or
Item LoungemotionTripped received update or
Item LandingMotionTripped received update or
Item Dining4in1sensorTripped received update
then
if (vTimeOfDay.state=="EVENING" && (
Frontdoor2Tripped.state == OPEN ||
LoungemotionTripped.state == OPEN ||
LandingMotionTripped.state == OPEN ||
Dining4in1sensorTripped.state == OPEN
)
)
{
logInfo("lighting.rules","Hall light on")
}
else
{
logInfo("lighting.rules","Hall light off")
}
end
Mark