Switch Template: friendly_name as template

I have a couple of switches that I use for multiple purposes.

For example, I have a switch in my backyard that I use for the swimming pool pump during the summer and in the winter I use it for the Christmas lights.

I already have a input_select set up so I can manually switch between these states, but it would be even nicer if I could make the name of the switch change based on the input_select value.

i use something similar and it works fine for me :thinking:

Can you give me an example of how that looks?

there is look under the custom:card-templater

type: custom:card-templater
card:
  type: entities
  show_header_toggle: false
  columns: 2
  title: Lucky's Litter Box Visits
  entities:
    - entity: sensor.litter_box_visits
      name_template: 'Lucky''s Litter Box is {{ states.sensor.litter_tray.state }} '
    - entity: binary_sensor.poop_door

I see you are using a custom frontend card. My feature request is to support this natively, just like the name of sensors can be templates. So unless someone can show me this can be done natively, my request stands.

If you want I think you have to place a vote in other they don’t know

Here you go

  input_select:
    ga_plug_2_mode:
      options:
        - Brunnen
        - Halloween
        - Weihnachten

  switch:
    - platform: template
      switches:
        ga_plug_2_saisonal:
          unique_id: 035197ac-0c8c-4949-9d26-07ecd4432b44
          friendly_name: "{{ states('input_select.ga_plug_2_mode') }}"
          value_template: "{{ is_state('switch.ga_plug_2', 'on') }}"
          icon_template: >
            {% set state = states('input_select.ga_plug_2_mode') %}
            {% if state == 'Brunnen' %}
            mdi:meditation
            {% elif state == 'Halloween' %}
            mdi:halloween
            {% elif state == 'Christmas' %}
            mdi:hexagram-outline
            {% endif %}
          turn_on:
            service: switch.turn_on
            target:
              entity_id: switch.ga_plug_2
          turn_off:
            service: switch.turn_off
            target:
              entity_id: switch.ga_plug_2

Ah, I did not know that you could simply put a template in friendly_name. Nice, thank you. This is what I was looking for!