How to show the state of the entity currently selected via an input_select

I have a lovelace card (code below) intended to allow the power socket to be controlled by my timer to be selected from a list using an input_select field. I want to also show the state of the selected socket using markdown but not having any luck. Referencing input_select.power_sockets as I do in example returns ‘unknown’. Is what I’m trying to do possible?

type: entities
entities:
  - entity: sensor.wifikit_timer
    type: custom:multiple-entity-row
    name: Timer
    secondary_info:
      attribute: time
    entities:
      - attribute: mode
        name: Mode
      - attribute: duration
        name: Durn
      - attribute: endtime
        name: End
  - type: custom:hui-markdown-card
    content: >-
      Select the socket to be controlled by the timer
  - entity: input_select.power_sockets
    name: Power socket to be controlled
  - type: custom:hui-markdown-card
    content: >-
      The Power Socket is currently **{{states("input_select.power_socket")}}**

title: Wifi Timer

This is the configuration for the input_select

power_sockets:
  name: Power Socket 
  options:
    - switch_innr_socket_1_on_off
    - switch_innr_socket_2_on_off
    - switch.sonoff_socket_1
    - switch.sonoff_socket_2
    - switch.tasmota

In the final markdown card, the entity_id for the Input select in the template is missing an “s”…

Well spotted @Didgeridrew, although now it returns the name of the selected item switch_innr_socket_1_on_off rather than the state of the associated entity.

You need to nest it in another states() function…

  - type: custom:hui-markdown-card
    content: >-
      The Power Socket is currently **{{{states(states("input_select.power_sockets"))}}**
1 Like

Of course - silly me. Thanks again @Didgeridrew