Hi guys,
I’m quite new to OH. I tried searching for similar issue with no luck.
I have successfully setup OH with DS18 temperature sensor, which I can see with proper values. But this rules doesn’t seem to be working properly - it’s acting as the condition is always met even when the temperature is under the defined value.
home.rules:
rule "Temperature relay test"
when
Item Temp1 changed
then
val t1=Temp1.state as Number
if (t1 > 22) {
channel1.sendCommand(ON)
logInfo("TEST", "Relay ON")
}
else {
channel1.sendCommand(OFF)
logInfo("TEST", "Relay OFF")
}
end
openhab2.log:
2019-12-19 13:40:43.050 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'home.rules'
2019-12-19 13:40:53.365 [INFO ] [.eclipse.smarthome.model.script.TEST] - Relay ON
2019-12-19 13:41:02.368 [INFO ] [.eclipse.smarthome.model.script.TEST] - Relay ON 2019-12-19 13:41:13.252 [INFO ] [.eclipse.smarthome.model.script.TEST] - Relay ON 2019-12-19 13:41:24.201 [INFO ] [.eclipse.smarthome.model.script.TEST] - Relay ON 2019-12-19 13:41:35.094 [INFO ] [.eclipse.smarthome.model.script.TEST] - Relay ON 2019-12-19 13:41:46.046 [INFO ] [.eclipse.smarthome.model.script.TEST] - Relay ON
Is there something I overlooked? Running on the latest stable 2.5 oh, java 1.8.0_222 in RPi Zero W
Many thanks!