- Platform information:
- Hardware: RaspberryPi 2
- OS: OpenHabian
- Java Runtime Environment: which java platform is used and what version
- openHAB version: 2.4
I’m trying to calculate windchill and display it in a sitemap. I have the following:
In items:
Group Weather <Temperature>
Number OWM_Current_Windchill "Current Windchill [%.1f °C]" <temperature>
(Weather)
In sitemap:
Frame label="Weather" {
Group item=Weather
}
In rules:
rule "Windchill_Calculate"
when
Item OWM_Current_Temperature received update
then
OWM_Current_Windchill.postUpdate(13.12 +
0.6215 * OWM_Current_Temperature.state -
11.37 * Math.pow((OWM_Current_Windspeed.state * 3.6), 0.16) +
0.3965 * OWM_Current_Temperature.state * Math.pow((OWM_Current_Windspeed.state * 3.6), 0.16)
)
end
I can see the Windchill item in my sitemap but it just appears as - °C. I know the problem is with the rule but can’t figure out how to get it working. Here is the error in the log:
2019-01-12 13:38:21.551 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘Windchill_Calculate’: An error occurred during the script execution: Could not invoke method: org.eclipse.xtext.xbase.lib.DoubleExtensions.operator_multiply(double,byte) on instance: null
I believe it’s something to do with needing to cast something but it’s been 20 years since I’ve written a line of java.
Thanks for any help.