Adding a sensor offset using STATES

I want to apply an offset to my temperature sensor using STATES in the developer tools. I added a value template to the attributes of the sensor.

Entity: sensor.0xa4c138f90a81f552_temperature

State attributes:

state_class: measurement
unit_of_measurement: °C
device_class: temperature
friendly_name: ZBTemp04 Temperature
value_template: "{{states('sensor.0xa4c138f90a81f552_temperature') | float + 10.0 }}

When I click on the “set state” or “refresh” button the state does not change.
Is this the right way to apply the offset?

You are setting attributes there.
See the line above State attributes (YAML, optional).
The state is set above.
But I’m quite sure you can’t use templates there.

You’ll need to create a template sensor helper to do that, with a state template of:

{{ states('sensor.0xa4c138f90a81f552_temperature')|float(0) + 10.0 }}

You can’t ask a sensor to be 10 higher than itself…