Dynamically Set Entity in Lovelace?

Is something like this even possible? I have a slider bar that I want to be able to control whatever light I have selected based on a sensor that returns the exact value/ID of the light I want to control, in this case, the senor returns light.zachs_lamp or light.erics_lamp.

- type: custom:slider-entity-row
  entity: "[[[return `${states['sensor.selected_light'].state}`]]]"
  full_row: true
  hide_state: true
  style:
    left: 67%
    top: 60%
    width: 50%

I’ve also tried using the Custom State-Switch card to no avail.

- type: custom:state-switch
  entity: sensor.selected_light
  style:
    left: 67%
    top: 60%
    width: 50%
  states:
    light.zachs_lamp:
      - type: custom:slider-entity-row
        entity: light.zachs_lamp
        full_row: true
        hide_state: true
    light.guest_suite:
       - type: custom:slider-entity-row
        entity: light.erics_lamp
        full_row: true
        hide_state: true

Thoughts?

The slider-entity-row does not support templates.
Place the card into config-template-card.

Try using “”.

These questions are better to ask in corresponding threads for “slider-entity-row” & “state-switch” card, probably you will get answers faster.