Hi,
I setup a ESPHome DS18B20 sensor that provide me Celsius temp and as I need to display both temp unit (C/F), I did use template and it work fine until the device get not responding where the template provide me 32 instead of “Not Available” like ESPHome entity
Below is my config where you did try each of test 1 and test 2 without success.
sensor:
#----- Template -------
- platform: template
sensors:
pool_water_temperature_f:
friendly_name: "Pool Water Temperature F"
unit_of_measurement: 'ºF'
#--- test1 ---
value_template: "{{ (((states('sensor.pool_water_temperature_c') | float) * 9/5)+ 32)|round(1)}}"
#--- test 2 ---
#value_template: "{{ (((states.sensor.pool_water_temperature_c.state | float) * 9/5)+ 32)|round(1)}}"
Do HA have some way when the device is not available to also provide this status to a template function? I though test 1 will provide this benefit but both react by providing me only 32 causing big spike in my graph and losing the resolution.
Any suggestion?