Farenheight, Celcius, Lovelace & Templates (oh my) :)))

Hi home assistant experts. The initial problem here is just that I recently got some temperature sensors and they are reporting temperature on the dashboard in Celcius. This is predictable because my instance is configured for metric units. But in the case of temperature, my wife and I still want to see that it’s 72 in the house rather than 21. So…

Question 1: Is there some easy way to report the temperature in Farenheight on the dashboard?

Question 2: Templates – Huh?
I’ve looked over the documentation on templates and what I really need is some sort of tutorial. At no point did the documentation explain how or why to use a template. But, from researching my temperature problem, I gather a template might help. I get that about a lot of other problems too. But so far, despite me being a programmer by trade, I’m utterly mystified. So… does anyone know of any good tutorials out there that start from the beginning, preferably with some examples?

Thank you in advance

I’m not a “programmer by trade” and the documentation helped me become familiar with how Home Assistant uses Jinja templating.

Home Assistant - Templating

I’ve never referred to any Jinja tutorial and have simply relied on its official documentation.
https://jinja.palletsprojects.com/en/3.0.x/templates/

I have found the most useful sections of the documentation to be the built-in Filters and Tests.

In a nutshell, you employ a template when you need to compute an option’s value. For example, imagine you have an entity_id option like this:

  - service: light.turn_off
    target:
      entity_id: ...some kind of value goes here...

The value could be a hard-coded light.kitchen or it might be the computed result of a template.

Get a list of entity_ids representing all lights that are currently on.

      entity_id: "{{ states.light | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}"

Ahhhhhhh! (the light bulb goes on)

I begin to understand. My problem wasn’t understanding jinja syntax, it was figuring out WHERE it would be used. Now I see that that is an artifact of me avoiding YAML in favor of Node-Red. But your response somehow got me thinking in the right head space and with a bit more googling I came across the phrase “template sensors”. That finally got me on the right track and several more articles later:

sensor:
  - platform: template
    sensors:
      temperature_livingroom:
        friendly_name: Living Room Temperature
        unit_of_measurement: 'f'
        value_template: >-
            {{ ((states('sensor.temp_1_temperature') | float) * 1.8) + 32 }}

You can just tell home assistant which unit system you prefer and whether you prefer temperature displayed in celsius or fahrenheit by default. It’s part of basic configuration. Then you won’t have to make a duplicate template sensor for every entity with a temperature value.

Basically just put this in configuration.yaml

homeassistant:
  temperature_unit: F

You can also set it to use the imperial system by default if you prefer that too. Or mix and match:

homeassistant:
  unit_system: metric
  temperature_unit: F

To clarify, that’s one particular application of templating. It’s used in many other places as well.