I want to use an entity_id from a drop down select to have a card display the information from a specific sensor, in this case to have only one camera feed displayed on my main page and to choose which one from a drop down input select. I haven’t found a way to do the indirect reference. For example replacing:
type: custom:state-switch
entity: input_select.camera_list
states:
East Rear:
type: custom:advanced-camera-card
cameras:
- camera_entity: camera.ds_xxxx_xxx_1
with
type: custom:state-switch
entity: input_select.camera_list
type: custom:advanced-camera-card
cameras:
- camera_entity: input_select.camera_list
I’ve experimented with various {} bracket and apostrophe combinations to no avail. I tried using filter: template : (properly formatted) with codes such as:
{% for state in states.camera %}
{% if state.name == 'West Rear' %}
{{ state.entity_id }}
{% set ns.id_var = state.entity_id %}
{% endif %}
{% endfor %}
trying to use ns.my_var (various {} “” combos) and without the namespace just leaving the {{state.entity_id}}. The state resolves to the correct camera name (i.e. camera.ds_xxxx_xxx_1) but it still doesn’t work.
Maybe the card resolves before the code executes. In most cases I get:
Invalid configuration: [ “cameras[0] → camera_entity” ]
type: custom:advanced-camera-card
cameras:
- camera_entity:
'[object Object]': null'
The card resolves correctly if the camera.xxx… is hard coded
HA 2025.5.1
running on a Virtual Box on debian 12, HAOS
Any help or thoughts would be most appreciated. I would like to employ the solution in order to choose other sensor cards to display ( I’ve also tried auto-entities and state-switch using the above constructs)