Hi everybody,
currently I am struggeling with some problems on my openhab2 setup on an RPI3.
I have one rule which is executed slowly, see the following example.
2017-10-28 13:44:02.819 [ItemStateChangedEvent ] - ZW_PIR6_Motion changed from OFF to ON
2017-10-28 13:44:02.831 [GroupItemStateChangedEvent] - Bedroom_Motion changed from OFF to ON through ZW_PIR6_Motion
2017-10-28 13:44:07.953 [ItemStateChangedEvent ] - ZW_PIR3_Temperature changed from 22.9 to 22.6
2017-10-28 13:44:08.856 [DEBUG] [ome.model.script.bedroom_motionLight] - Starting DEBUG Routine
2017-10-28 13:44:08.864 [DEBUG] [ome.model.script.bedroom_motionLight] - Bedroom_Lights state: OFF
2017-10-28 13:44:08.872 [DEBUG] [ome.model.script.bedroom_motionLight] - Lux state: 19
2017-10-28 13:44:08.881 [DEBUG] [ome.model.script.bedroom_motionLight] - Motion-Light Setting state: ON
2017-10-28 13:44:08.903 [ItemCommandEvent ] - Item 'ZW_WP1_Switch' received command ON
2017-10-28 13:44:08.921 [ItemCommandEvent ] - Item 'MotionLight_Bedroom' received command ON
2017-10-28 13:44:08.932 [ItemStateChangedEvent ] - ZW_WP1_Switch changed from OFF to ON
2017-10-28 13:44:08.944 [GroupItemStateChangedEvent] - Bedroom_Lights changed from OFF to ON through ZW_WP1_Switch
PIR6 and WP1 are Z-Wave devices. It takes about 6 seconds from the point of time where the movement is reported to OH2 to the point where the lights are on. I have added some mesages to trace down which action takes time, but I can’t find it out.
Here is the rule that is used:
rule "Bedroom: Turn on the lights when there is motion and its dark"
when
Item Bedroom_Motion changed to ON
then
logDebug("bedroom_motionLight", "Starting DEBUG Routine")
//sendCommand(Hue_Light14_Alert, "SELECT") // DEBUG
//logDebug("bedroom_motionLight", "Motion in bedroom was detected - Lights in bedroom are " +Bedroom_Lights.state +" / " +Bedroom_Lights.state)
logDebug("bedroom_motionLight", "Bedroom_Lights state: " +Bedroom_Lights.state)
logDebug("bedroom_motionLight", "Lux state: " +ZW_PIR4_Lux.state)
logDebug("bedroom_motionLight", "Motion-Light Setting state: " +Set_Bedroom_MotionLight.state)
if(Bedroom_Lights.state == OFF && ZW_PIR4_Lux.state <= checkLuminance && Set_Bedroom_MotionLight.state == ON) {
//Turn on bedroom lights
sendCommand(ZW_WP1_Switch, ON)
// Switch on item for motionlight
sendCommand(MotionLight_Bedroom, ON)
logDebug("bedroom_MotionLight", "Motion in bedroom was detected - triggered light ON! ")
} else if(Bedroom_Lights.state == OFF && ZW_PIR4_Lux.state <= checkLuminance && Set_Bedroom_MotionLight.state == ON && Home_Mode.state == "Night") {
logDebug("bedroom_motionLight", "Conditions for Motion-Night-Light are met - turning night light on.")
sendCommand(Hue_Light17_Color, "357,97,19")
sendCommand(MotionLight_Bedroom, ON)
}
else {
logDebug("bedroom_motionLight", "Conditions not met: " +ZW_PIR4_Lux.state +" Lux, Auto Light setting= " +Set_Bedroom_MotionLight.state.toString())
}
end
I also used “top” to see the used resources of the PI - the top-entry which is Java jumped up to 111% in “idle” state, but is around 15% on average.
Does anybody have an idea on how to trace down the problem? Thanks a lot in advance!