Change part of the entity name

Hi , I define 2 gauge in dashboard and define about 40 sensor , 20 for pressure and 20 for tempture .
and i define one input select (sensor1,sensor2,…,sensor20).
I need when i select for example sensor5 from input select 2 gauges show sensor5.pressure and sensor5.tempture .
I know it is possible by define automations but if sensors become forexample 400 its very hard way .
I try to do this with custom:config-template-card , by change name of entity of gauges something like this : ${vars[0]}.pressure but it doesnt work
Can any one help me? Sorry about bad english

You could create a template sensor for the temperature and pressure to display:

  - sensor:
      - name: Display pressure
        unit_of_measurement: "kPa"
        device_class: pressure
        state: "{{ states('sensor.' ~ states('input_select.ENTITY_ID')  ~ '_pressure') }}"

      - name: Display temperature
        unit_of_measurement: "°C"
        device_class: temperature
        state: "{{ states('sensor.' ~ states('input_select.ENTITY_ID')  ~ '_temperature') }}"

When you change the input_select, these will update to match. So long as you only want current state and not history, you’re good.

  1. Concatenating strings in config-template-card (CTC) currently may only be like
entity: '${vars[0] + "some_string" }'


entity: ${vars[0]}some_string
  1. I wonder what this “xxx.pressure” means? What stands before the “.”? This is supposed to be an entity_id.
  2. I think that a template sensor suggested above is a better solution since you need to show only a current state (gauge), not a history.

Thank you very much