Ok, I have been trying to setup a template sensor to convert from Fahrenheit to Celsius, and I have code that works perfect in the Templates dev/testing area, but as soon as I try it in the value_template field of a sensor under platform: template, it only returns the temperature in Fahrenheit and even changes the unit, which I explicitly set to ‘°C’ to ‘°F’
Anyway,s I have no idea what is going on. Why is the following template code working perfect in the testing area, but not as a sensor template?
{{(((states.sensor.ender_3_actual_bed_temp.state | float - 32) * 5 / 9) | round(1)) }}
And here is the sensor code
- platform: template sensors: ... ender3_curr_bed_temp_c: friendly_name: Ender 3 Current Bed Temp unit_of_measurement: '°C' value_template: "{{(((states.sensor.ender_3_actual_bed_temp.state | float - 32) * 5 / 9) | round(1)) }}"