I’ve run into a problem with a rule that call postUpdate() to update a value in my UI. Whenever the rule runs, it seems to trigger the rule continuously. Here is the rule:
when
Item Temperature received update
then
val temp = (Temperature.state as DecimalType * 9/5 + 32)
logInfo("temp", temp.toString)
Temperature.postUpdate(temp.toString)
end```
It seems that each invocation of the rule operates on the current value of Temperature and I get this output in the log:
```2017-09-13 20:38:19.621 [INFO ] [.eclipse.smarthome.model.script.temp] - 68.00000000
2017-09-13 20:38:19.631 [INFO ] [.eclipse.smarthome.model.script.temp] - 154.40000000
2017-09-13 20:38:19.644 [INFO ] [.eclipse.smarthome.model.script.temp] - 309.92000000
2017-09-13 20:38:19.654 [INFO ] [.eclipse.smarthome.model.script.temp] - 589.85600000
.
.
.
This will continue until I edit the rule. What gives?
My Item looks this:
Number Temperature "Temperature [%.1f °F]" <temperature> { channel="yahooweather:weather:918d6903:temperature"}