Rules execution speed


I am executing multiple commands via single rule (like a mood or scene activation) but there is a lot of delay in this execution from pressing a button on IOS app the execution of rule and commands inside happens after 3-4 seconds this makes the user feels that nothing happened by pressing button and tend to press it again. Any pointers to improve this ?

I run system on Pi3 and “top” shows me Java taking up close to 100% of cpu most of time.
rule “LR_AllOff_Fast”… i have mix of Items from Hue to Zwave to lightwaverf in single rule as below -

Switch Item=LRAllOff mappings=[On=“All Off”]

String LRAllOff “Living Room All Off”

Item LRAllOff changed to ON or
Item LRBrightMood changed to OFF

sendCommand(PoppDimmer1LoadLevelStatus, 0)
sendCommand(PoppDimmer2LoadLevelStatus, 0)
sendCommand(LRDimmerBulb02_03, 0)
sendCommand(LRCornerLamp01, OFF)
sendCommand(LRCornerLamp02, OFF)
sendCommand(LRTallCabinetLight, OFF)
sendCommand(LRDiningAntiqueLight, OFF)
sendCommand(LRBookRackLight, OFF)


Mmh. A RPi3 is way fast enough and OH should need far less CPU.
Check logging, in particular increase it for rules.
<logger name="org.openhab.model.script.rules" level="DEBUG" />

Reinitializations use 100% CPU They’re taking place after you change items, rules or sitemaps.
While this is normally accomplished in less than seconds, if a rule fails to load or crashes during execution, this can become a repetitive process, resulting in permanent CPU load you’re seeing.

Thanks for the pointer … however i am using OH2 and i cannot figure out where to put the logging statement for “rules” as there is no logbook.xml in OH2 … can you suggest further.

hi Rich,

thanks i tried this - with the following updated to my logging file
the rules.log file is generated by no entries are wrttend in it … :frowning: … any help.

openHAB specific logger configuration = ALL, rules, osgi:* = false

File appender - rules.log

log4j.appender.rules.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} [%-26.26c{1}] - %m%n

You should use = ALL, rules, osgi: *

All of the core classes have changed packages in OH 2.

I tried

openHAB specific logger configuration = ALL, rules, osgi: * = false

also i tried

openHAB specific logger configuration = ALL, rules, osgi: * = false

but both doesnt generate any logs from rules :confused:

Not sure what is wrong. The sum total of my knowledge on the subject is captured by the link I provided.