- Platform information:
- Hardware: i5 8Gb
- OS: Linux Mint 19
- Java Runtime Environment: 10.0.2
- openHAB version: 2.5.0 m3
import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*
import java.lang.Integer.*
import java.lang.Double.*
import java.lang.String.*
import java.lang.Math.*
rule “dp”
when
Item T changed or
Item H changed
then
var T = T.state
var H = H.statevar Double T2 = T as Double
var Double H2 = H as Doubledp.postUpdate(Math.log(T2 + H2))
end
and this gives me e.g. Rule ‘dp’: Could not cast 19.58 to java.lang.Double;
I have tried lots of other ‘copy./pastes’ from other peoples scripts that i have googled, but i can’t seem to get anything to work
Any help greatly appreciated