postUpdate triggers same rule again

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"}

The reason for this behaviour is your setup, you are asking the rule to run whenever the item is updated and you are updating the same item in the rule. Use a different item for the display of the farenheit value and have the item that is connected to yahoo keep the celcius value.

Thank you. I’ve added a new Item for display that now gets the update. What you say does make sense, and I assumed as much, but this line in the docs made me think that a given rule would only execute once:

MyItem.postUpdate(<new_state>) - Change the status of an Item without causing any implicit actions. Can be used to reflect changes that may be caused by other means.

I understood ‘implicit actions’ as meaning that the rules would not loop. Clearly a flawed assumption.
Thanks for the reply.

Well, it does only execute once for each change. But since you send it another change… :wink: