Can't create fancy name for switch?

Id like to use something like Receiver Living Room, but apparently it throws an error

switch:
  - platform: template
    switches:
      ReceiverUpstairs:
        value_template: "{{ is_state_attr('remote.living_room', 'current_activity', 'Listen to Music') }}"
        turn_on:
          service: remote.turn_on
          data:
            entity_id: remote.living_room
            activity: 'Listen to Music'
        turn_off:
          service: remote.turn_on
          data:
            entity_id: remote.living_room
            activity: 'PowerOff'

Invalid config for [switch.template]: [Receiver-Upstairs] is an invalid option for [switch.template]. Check: switch.template->switches->Receiver-Upstairs. (See ?, line ?). Please check the docs at Template Switch - Home Assistant

Should it be:
“{{ is_state_attr(‘remote.living_room.current_activity’, ‘Listen to Music’) }}”
?
Check the state in the dev tools for the correct entity name

It works fine when i use a 1 word name for the switch

remote.living_room off current_activity: PowerOff friendly_name: Living Room hidden: true

remote.downstairs off current_activity: PowerOff friendly_name: Downstairs hidden: true

Check out Ludeus’ comment here: Errors setting "Friendly Names" for devices (Yeelights)

My issue was that dashes aren’t parsed correctly and HA just drops them. Perhaps you need to try remote.livingroom instead.

Are you trying to lead us on a wild goose chase? :stuck_out_tongue:

The error states:

Invalid config for [switch.template]: [Receiver-Upstairs] is an invalid option for [switch.template]. Check: switch.template->switches->Receiver-Upstairs

That erorr would be here:

switch:
  - platform: template
    switches:
      ReceiverUpstairs:

Where you have ReceiverUpstairs and not Receiver-Upstairs as the log indicates.
Are you sure the log is “up to date”?
With that said AFIK that Key needs to be lower case.
Try this instead:

switch:
  - platform: template
    switches:
      receiver_upstairs:
        friendly_name: "Receiver Upstairs"
        value_template: "{{ is_state_attr('remote.living_room', 'current_activity', 'Listen to Music') }}"
        turn_on:
          service: remote.turn_on
          data:
            entity_id: remote.living_room
            activity: 'Listen to Music'
        turn_off:
          service: remote.turn_on
          data:
            entity_id: remote.living_room
            activity: 'PowerOff'

thank you! i’ll try this tonight