Templates - start with sensor: or template: to get either friendly_name or icon ?!?

Nope, no friendly_name in the new method. However the name: option can be used as long as you don’t mind the entity id being auto generated.

e.g.

name: "Air quality level" would create the entity sensor.air_quality_level.

When changing from the old to the new method I had to do a bit of using customize to prevent having to change the entity id in a lot of places:

template:
  - sensor:
      - name: "offpeak_cost_today" # Customized as, friendly_name: Offpeak
        icon: "mdi:currency-usd"
        unit_of_measurement: "$"
        state: "{{ (states('sensor.energy_from_grid_daily_offpeak')|float(0) * states('input_number.t93_offpeak_energy_cost')|float(0) )|round(2) }}"

There is an alternative using unique id, see:

1 Like