I am still a beginner and far a way from a coder …
I searched around and copied code from the web to get my drier working, based on a formula to get dew point.
I am running OH 2.5M3 on a Rpi 3 without any problem.
But when I activate following rule OH goes to >100% CPU usage and the log is late with entries from rules for about 10 minutes.
So it is not possible for me to react on infos from log.
Following the rule:
import java.lang.Math
rule "Drier WG"
when
Item Humidity_WG changed
then
double Dewpoint = 243.5*(Math::log((Humidity_WG.state/100))+((17.67*Temperatur_WG.state)/(243.5+Temperatur_WG.state)))/(17.67-Math::log((Humidity_WG.state/100))-((17.67*Temperatur_WG.state)/(243.5+Temperatur_WG.state)))
if((Temperatur_WG.state+localCurrentTemperature)/2 <= Dewpoint)
{
sendCommand(DrierWG, ON)
}
else if((Temperatur_WG+localCurrentTemperature)/2 > Dewpoint+2)
{
sendCommand(DrierWG, OFF)
}
end
Is it possible that the formula could bring the rules engine to such a high load?
Am I totally wrong with my approach?
The log shows an entry:
2019-10-20 18:57:18.807 [INFO ] [el.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model 'DrierWG.rules', using it anyway:
This expression is not allowed in this context, since it doesn't cause any side effects.
2019-10-20 18:57:18.814 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'DrierWG.rules'
But just once, then OH is on >100% CPU load.
Any help or advise would be very much appreciated!