In your first you are trying to postUpdate with a plain number, in the second one you are using a number:temperature.
Why don’t you try something similar with the first example, like:
How are you calculating myTemperature? It may be easier to define it as a QuantityType from the start, and then use QuantityType’s methods for performing the calculations. If not, you’d need to use this format in the sendCommand…