Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95419

Temperature conversion from F to C with sensor with Value_template not working

$
0
0

@toofewacres wrote:

I am trying to convert a F temperature sensor value to a new C temperature sensor. I have the following code that I am trying, but it only sets the sensor value to the F temperature comes from the original sensor.

  - platform: template
    sensors:
      octoprint_bed_temp_celsius:
        friendly_name: 'Bed Temperature'
        unit_of_measurement: "°C"
        value_template: "{{ ((states('sensor.octoprint_actual_bed_temp')|float-32)* 5 / 9)|round(1) }}"

If I take the template string to the template developer, it converts the F value to the correct C value. For some reason the sensor code does not put the correct value in the new sensor.

Posts: 5

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95419

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>