Automation Action based on Input_select

Hi Guys,

I have a automation that’s triggers on motion sensor and i have a input_select to chose a scene name.

Can some help me with a action that will check the value of de input_select en triggers a scene. The scene names are not the same as the input_select options.

someting like

Action
If input_select is Normal scene.turn_on light_normal
If input_select is Dimd scene.turn_on light_Dimd
If input_select is off scene.turn_on light_of

Try this:

 - alias 'motion'
    trigger: 
      platform: state
      entity_id: sensor.yourmotionsensorname
      to: 'on'
    action:
      service: scene.turn_on
      data_template:
        entity_id: >
           {% if is_state('input_select.scene', 'Normal') %}scene.light_normal
           {% elif is_state('input_select.scene', 'Dimmed') %}scene.light_dimd    
           {% elif is_state('input_select.scene', 'Off') %}scene.light_off
           {% endif %}
1 Like