Platform information:
- Hardware: Raspberry Pi 3 Model B Rev 1.2
- OS: Raspbian GNU/Linux 10 (buster) from OpenHABian install
- Java Runtime Environment: openjdk version “1.8.0_222”
OpenJDK Runtime Environment (Zulu8.40.0.178-CA-linux_aarch32hf) (build 1.8.0_222-b178)
OpenJDK Client VM (Zulu8.40.0.178-CA-linux_aarch32hf) (build 25.222-b178, mixed mode, Evaluation) - openHAB version: 2.5.3-1 (Release Build)
- Updated all apt
- CPU load is only 1-5%
When an item changes it should start a rule but it takes between 5 and 20 seconds for the rule to trigger (eg. turn a group of lights on with a switch on the sitemap). Is this usual?
I have uninstalled all unused bindings, UI, addons, removed all rules and just added the lights rule and stopped OH service and restarted Pi.
The lights are mostly using the WiFiLED binding but the delay is with all rules, not just lights. If I operate the light from the sitemap directly it is instant but through the rule there is a 5-20 second delay before the rule triggers.
The light rule I was using to test is simple:
rule "Kitchen Mood Lights" //Change light status when Item GF_Kitchen_Mood changed then logInfo("Lights", "Kitchen Mood changed") if (GF_Kitchen_Mood.state == 'off') { logInfo("Lights", "Kitchen Lights Off") GF_Kitchen_Ceiling.sendCommand(OFF) GF_Kitchen_Worktop.sendCommand(OFF) GF_Kitchen_Floor.sendCommand(OFF) GF_Dining_MainLt.sendCommand(OFF) GF_Dining_BacklightPW.sendCommand(OFF) GF_Kitchen_Spot.sendCommand(OFF) GF_Kitchen_Bar.sendCommand(OFF) logInfo("Lights", "Kitchen Lights Off - Done") } else if (GF_Kitchen_Mood.state == 'morning') { logInfo("Lights", "Kitchen Morning Lights") GF_Dining_FishtankPW.sendCommand(ON) // GF_Kitchen_Ceiling.sendCommand(ON) // GF_Kitchen_Worktop.sendCommand(ON) // GF_Kitchen_Floor.sendCommand(OFF) GF_Dining_MainLt.sendCommand(OFF) GF_Dining_BacklightPW.sendCommand(OFF) GF_Kitchen_Spot.sendCommand(OFF) GF_Kitchen_Bar.sendCommand(OFF) logInfo("Lights", "Kitchen Morning Lights - Done") } else if (GF_Kitchen_Mood.state == 'evening') { logInfo("Lights", "Kitchen Evening Lights") GF_Kitchen_Ceiling.sendCommand(ON) // GF_Kitchen_Worktop.sendCommand(ON) // GF_Kitchen_Floor.sendCommand(OFF) GF_Dining_MainLt.sendCommand(OFF) GF_Dining_BacklightPW.sendCommand(OFF) GF_Kitchen_Spot.sendCommand(OFF) GF_Kitchen_Bar.sendCommand(OFF) logInfo("Lights", "Kitchen Evening Lights - Done") } else if (GF_Kitchen_Mood.state == 'dinner') { logInfo("Lights", "Kitchen Dinner Lights") GF_Kitchen_Ceiling.sendCommand(ON) // GF_Kitchen_Worktop.sendCommand(OFF) GF_Kitchen_Floor.sendCommand(OFF) GF_Dining_MainLt.sendCommand(ON) // GF_Dining_BacklightPW.sendCommand(ON) // GF_Kitchen_Spot.sendCommand(OFF) GF_Kitchen_Bar.sendCommand(ON) // logInfo("Lights", "Kitchen Dinner Lights - Done") } end
The log shows no errors but does show the massive delay that happens every time and not just for the first compile:
2020-04-02 20:04:04.141 [ome.event.ItemCommandEvent] - Item 'GF_Kitchen_Mood' received command evening 2020-04-02 20:04:04.152 [vent.ItemStateChangedEvent] - GF_Kitchen_Mood changed from dinner to evening 2020-04-02 20:04:19.974 [INFO ] [clipse.smarthome.model.script.Lights] - Kitchen Mood changed 2020-04-02 20:04:25.491 [INFO ] [clipse.smarthome.model.script.Lights] - Kitchen Evening Lights 2020-04-02 20:04:25.528 [INFO ] [clipse.smarthome.model.script.Lights] - Kitchen Evening Lights - Done 2020-04-02 20:04:25.535 [ome.event.ItemCommandEvent] - Item 'GF_Kitchen_Ceiling' received command ON 2020-04-02 20:04:25.537 [nt.ItemStatePredictedEvent] - GF_Kitchen_Ceiling predicted to become ON 2020-04-02 20:04:25.578 [ome.event.ItemCommandEvent] - Item 'GF_Kitchen_Worktop' received command ON 2020-04-02 20:04:25.601 [ome.event.ItemCommandEvent] - Item 'GF_Kitchen_Floor' received command OFF 2020-04-02 20:04:25.637 [ome.event.ItemCommandEvent] - Item 'GF_Dining_MainLt' received command OFF 2020-04-02 20:04:25.663 [ome.event.ItemCommandEvent] - Item 'GF_Dining_BacklightPW' received command OFF 2020-04-02 20:04:25.673 [ome.event.ItemCommandEvent] - Item 'GF_Kitchen_Spot' received command OFF 2020-04-02 20:04:25.684 [ome.event.ItemCommandEvent] - Item 'GF_Kitchen_Bar' received command OFF 2020-04-02 20:04:25.689 [nt.ItemStatePredictedEvent] - GF_Kitchen_Worktop predicted to become ON 2020-04-02 20:04:25.723 [nt.ItemStatePredictedEvent] - GF_Kitchen_Floor predicted to become OFF 2020-04-02 20:04:25.754 [nt.ItemStatePredictedEvent] - GF_Dining_BacklightPW predicted to become OFF 2020-04-02 20:04:25.780 [vent.ItemStateChangedEvent] - GF_Kitchen_Worktop changed from OFF to ON 2020-04-02 20:04:25.785 [vent.ItemStateChangedEvent] - GF_Dining_MainLt changed from ON to OFF 2020-04-02 20:04:25.789 [vent.ItemStateChangedEvent] - GF_Dining_BacklightPW changed from ON to OFF 2020-04-02 20:04:25.792 [vent.ItemStateChangedEvent] - GF_Kitchen_Bar changed from ON to OFF
CPU Load over the week is always low:
I am only using 128 Processes of 32768 max available.
Any ideas how to fix this issue?
Thanks