I have a mysensors gateway and a DS18B20 temp sensor attached to Nodemcu. It sends data thru mqtt.
Anyway, it will only send Celsius and I need F… How can I convert the data to show in F?
I think I need to make a sensor template but all my efforts have failed
Here is what I have
sensor 7:
- platform: template
sensors:
sensor1_temperature:
entity_id:
- sensor.temperature_sensor_0_0
value_template: "{{((float(states('sensor.temperature_sensor_0_0'))* 9 / 5)+ 32)|round(1)}}"
the value string works but can’t get the sensor template to work… any help appreciatedPreformatted text
keithh666
(Keith Hull)
May 26, 2017, 10:06pm
2
try…
sensor 7:
- platform: template
sensors:
sensor1_temperature:
value_template: "{{((float(states.sensor.temperature_sensor_0_0.state))* 9 / 5)+ 32)|round(1)}}"
keithh666
(Keith Hull)
May 26, 2017, 11:25pm
4
OK, try,
sensor 7:
- platform: template
sensors:
sensor1_temperature:
value_template: '{{(((states.sensor.temperature_sensor_0_0.state | float)* 9 / 5)+ 32) | round(1)}}'
Edit should work.
the value_template works well for the conversion, but the sensor template does not pass config. anyway thank for your help . I got to looking into the sketch for the ardiono and I was able to convert it there… But thank you so much for your help.
keithh666
(Keith Hull)
May 26, 2017, 11:35pm
6
is it in config.yaml or a sensor.yaml file?
keithh666
(Keith Hull)
May 26, 2017, 11:37pm
8
Then I think this should work
sensor 7:
platform: template
sensors:
sensor1_temperature:
value_template: '{{(((states.sensor.temperature_sensor_0_0.state | float)* 9 / 5)+ 32) | round(1)}}'