Lovelace: Is possible to display a temperature sensor (Celsius) in Celsius and also in Fahrenheit?

Hello,
I have an Esphome with a DS18B20 waterproof for the pool and so far it is sending the temperature in Celsius which is fine as we are in Canada and it will be easy to do some automation using the same unit with outside temperature ©.

So I would like to display the temperature on my lovelace in both unit C and F as we are used to F degrees (only for the pool temperature lol). So I’m trying to convert the family to used C degree but it will required time to get use to. :slight_smile:

Since I want to used History Graph to show both unit, which method do you recommend?

Thanks

Me i use custom sensor : change-the-unit-of-measurement

Thanks, it work. I was able to create another sensor in F from the original in C. I had issue with the Unit of Measurement and the degree sign ASCII 0176 “°” so I had to use ASCII 167 “º” instead. I believe is may be due to confusion with the unit_system: Metric or Imperial and my setup is unit_system set to metric.

 #----- Template -------
   - platform: template
     sensors:
       pool_water_temperature_f:
         friendly_name: "Pool Water Temperature F"
         unit_of_measurement: 'ºF'
         value_template: "{{ (((states('sensor.pool_water_temperature_c') | float) * 9/5)+ 32)|round(1)}}"
3 Likes

Lambda filter will do this very thing: https://esphome.io/components/sensor/index.html#lambda-filter

filters:
  - lambda: return x * (9.0/5.0) + 32.0;
unit_of_measurement: "°F"
2 Likes

@poldim Thanks for your answer but as I said I prefer to receive it in Celsius as all other sensors are all in Celsius and make easy to do automation. I only want to display it in both units on my lovelace display as I have family that keep use F. So far HA template work but I wish there was possibility to use a lovelace custom card that display both units on left C and right F.