MQTT value template problem

I have the following in my sensors.yaml

  - platform: mqtt
    name: "Temp. sonoff"
    state_topic: "tele/sonoff_udv/SENSOR"
#    qos: 0
    value_template: "{{ value_json['DHT22'].Temperature | float + 0.8 | round(0) }}"
    unit_of_measurement: "°C"

I have a problem with value_template line
The round (0) will not Work when combined with the float + 0.8. Only float + 0.8 is used.
Deleting the float + 0.8 part will make the round(0) Work.
I have used similar combination in other value_templates and both Works.
What can be wrong?

Tried this with one of mye temperature sensors and it didn’t work…

This worked for me:

{% set a = states.sensor.mqtt_bedroom_temperature.state | float + 0.8 %}{{ a | round(0) }}

I don´t know quite how to use this in my case. Is it not a value_template anymore?
How will the line look in my case?
The line below Works for another sensor and I cannot see the big difference.
value_template: '{{ (states.sensor.yr_wind_speed.state | float * 1.944) | round(0) }}'

Try value_template: "{{ (value_json['DHT22'].Temperature | float + 0.8) | round(0) }}"

Where is the difference?

Parentheses

of course!!!
and now it Works… thanks!!! :slight_smile: