#Possible to display temperature in both C and F for one entity?

1 messages · Page 1 of 1 (latest)

flat kite
#

I have an ESPHome sensor board which monitors my HVAC system. That provides a few temperature sensors. I know I can convert and display in °C or °F, however is it possible to have one entity display both? For example display something like "Supply Temp 30°C/86°F"?

polar basalt
#

you could template a helper to do that

flat kite
#

any links to resources showing a somewhat simillar example?

polar basalt
#

{{ 'Supply Temp ' + states('sensor.temperature') + '°C / ' + (states('sensor.temperature')|float*(9/5)+32)|string+ '°F' }}

#

replace sensor.temperature with your temp sensor reporting in C

#

that can probably be cleaned up a bit but for something quick and dirty it should work

flat kite
#

Whoa, thank you! I wasnt expecting all of that!

polar basalt
#

no worries, you might need to put a round on the conversion to prevent strange results though

flat kite
#

I did notice that, "Supply Temp 18.53°C / 65.35400000000001°F" but thats a solvable issue

polar basalt
#

{{ 'Supply Temp ' + states('sensor.temperature') + '°C / ' + (states('sensor.temperature')|float*(9/5)+32)|round(1)|string + '°F' }}

#

that should do it

flat kite
#

Yup, I just did the same. Thanks again!