Variables:
- variables: sensor_entity: "{{ trigger.entity_id }}" room_name: >- {{ sensor_entity | regex_replace('sensor\\.sonde_(.*)_temperature', '\\1') | regex_replace(' ', '_') | replace('temperature', '') | lower }}
Condition:
- if: - condition: template value_template: "{{ states('select.thermostatique_{{room_name}}_sensor') == 'internal' }}" then: - data: entity_id: select.thermostatique_{{room_name}}_sensor option: external action: select.select_option
It seems that value_template doesn't aquire the variable {{room_name}}.
Thanks in advance for the help!