Howt to use set_value for entity with drop-down value?

I’m creating a script to set the “start-up behavior”, “start-up color temperature” and “start-up current level” of all my Hue lights.

The “start-up color temperature” and “start-up current level” are working fine…

hue_default_values:
  alias: "Hue Default Values"
  sequence:
    - service: number.set_value
      target:
        entity_id: number.hall_hue_start_up_color_temperature
      data:
        value: 500
    - service: number.set_value
      target:
        entity_id: number.hall_hue_downstairs_start_current_level
      data:
        value: 100

Any idea how I can set “start-up behavior”?

The value is a drop-down list with the options “Off”, “On”, “Toggle” and “PreviousValue”.

If you have an ‘Input Select’ for these 4 values, you can use ’ input_select.select_option to set the desired option. See here for example:
https://www.home-assistant.io/integrations/input_select/

I tried this, but it’s not working… :face_with_raised_eyebrow:

- service: input_select.select_option
      target:
        entity_id: select.hall_hue_start_up_behavior
      data:
        option: PreviousValue

it should be something like:

    - service: input_select.select_option
        target:
          entity_id: input_select.hall_hue_start_up_behavior
        data:
          option: Off

‘Off’ and ‘On’ must be quoted (or they will be converted to boolean states) and check your indentation.

    - service: input_select.select_option
      target:
        entity_id: input_select.hall_hue_start_up_behavior
      data:
        option: 'Off'

It’s still not working. :cold_face:

The entity name is “select.hall_hue_start_behavior”, but should I use “input_select” as domain for the entity?

entity_id: input_select.hall_hue_start_behavior

or

entity_id: select.hall_hue_start_behavior

No. That is the wrong service for a select entity, use this:

    - service: select.select_option
      target:
        entity_id: select.hall_hue_start_behavior
      data:
        option: 'Off'