YAML help - using value from helper to select option in list

Hi All
As the header suggests, I’m trying to set an input select/list to the specific value of a String helper.
I have Netatmo thermostatats, and to set the used schedule in HA in an automation action, one choses the “my_home” device and the selects from the list of options.

Picture of the UI:

The autogenerated YAML for this, looks like the below:

alias: test2_set_value_from_helper
description: ""
trigger: []
condition: []
action:
  - device_id: 67eead9f6f98241d9ac6a52aeeb4ec9f
    domain: select
    entity_id: select.netatmo_mit_hjem
    type: select_option
    option: Standard
mode: single

Trace output from this is:

Executed: December 21, 2022 at 8:07:55 AM

So, I thought that I would just retrieve the state of a string helper, to whatever should go as the selcected option - when the automation ran, but this doesn’t work. See below

alias: test2_set_value_from_helper
description: ""
trigger: []
condition: []
action:
  - device_id: 67eead9f6f98241d9ac6a52aeeb4ec9f
    domain: select
    entity_id: select.netatmo_mit_hjem
    type: select_option
    option: "{{ states('input_text.climate_helper_open_windows') }}"
mode: single

Trace output from this is:

Executed: December 21, 2022 at 8:09:49 AM
Error: Option {{ states('input_text.climate_helper_open_windows') }} not valid for Mit hjem

So, what am I doing wrong?
I’m a noob in the world of YAML, so nothing is obvious for me :slight_smile:

Using device actions that don’t support templates.

Use the service instead. That does support templates.

Then replace all device triggers, conditions and actions in your config.

Thanks for answering…
So i did the change below to the best of my ability.
(normally I don’t use device IDs for automations - I just made a change to the autogenerated one)

New automation:

alias: test2_set_value_from_helper4
description: ""
trigger: []
condition: []
action:
  - service: input_select.select_option
    data:
      option: "{{ states('input_text.climate_helper_open_windows') }}"
    target:
      entity_id:
        - select.netatmo_mit_hjem
mode: single

Output below … no change to the state of “select.netatmo_mit_hjem”

Executed: December 21, 2022 at 11:12:58 AM
Result:
params:
  domain: input_select
  service: select_option
  service_data:
    option: Standard
    entity_id:
      - select.netatmo_mit_hjem
  target:
    entity_id:
      - select.netatmo_mit_hjem
running_script: false
limit: 10

What are the available options of the input_select?

They are case sensitive.

I took these from the developer tools-> states

options:
  - Standard
  - Ferie Hjemme
  - 20Grader
  - Sluk alt
  - Arbejder hjemme
attribution: Data provided by Netatmo
friendly_name: Mit hjem

The value of my helper is “Standard” - no quotes.
Current state of select.mit_hjem is “20Grader” - no quotes.
I have tried other states with copy paste from the above list - no luck
The “last changed” on state of mit_hjem says this morning - and I just ran it now. So it doesn’t change the state back to the previous one.

You are using the wrong service,

The input_select services do not work on select entities.

Change this:

action:
  - service: input_select.select_option

To:

action:
  - service: select.select_option
1 Like

YES! … success :slight_smile:
Thank you.