Automation error with options

Hello!

I am having problems with an automation that uses choice of options based on sun elevation and time of day. Excuse me if I don’t use the right format in the thread but it’s the first time I open one.

Logger: homeassistant.components.automation.cambio_rangos_iluminacion
Source: helpers/script.py:420
Integration: Automatización (documentation, issues)
First occurred: 06:00:00 (2 occurrences)
Last logged: 06:00:00

Cambio Rangos Iluminación : Choose at step 1: choice 4: Error executing script. Error for call_service at pos 1: Invalid option: Madrugada (possible options: Madrugada , Mañana, Tarde, Noche Antes de Dormir, Noche Durmiendo)
Cambio Rangos Iluminación : Error executing script. Error for choose at pos 1: Invalid option: Madrugada (possible options: Madrugada , Mañana, Tarde, Noche Antes de Dormir, Noche Durmiendo)

Automation gives an error when choosing the first option. With the rest it works correctly.

alias: "Cambio Rangos Iluminación "
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.sun_solar_elevation
    above: 10
    id: Mañana
  - platform: numeric_state
    entity_id: sensor.sun_solar_elevation
    below: 25
    id: Atardecer
  - platform: numeric_state
    entity_id: sensor.sun_solar_elevation
    below: 0
    id: Anochecer
  - platform: time
    at: "06:00:00"
    id: Madrugada
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - Mañana
        sequence:
          - service: input_select.select_option
            data:
              option: Mañana
            target:
              entity_id: input_select.rangos_iluminacion
      - conditions:
          - condition: trigger
            id:
              - Atardecer
        sequence:
          - service: input_select.select_option
            data:
              option: Tarde
            target:
              entity_id: input_select.rangos_iluminacion
      - conditions:
          - condition: trigger
            id:
              - Anochecer
        sequence:
          - service: input_select.select_option
            data:
              option: Noche Antes de Dormir
            target:
              entity_id: input_select.rangos_iluminacion
      - conditions:
          - condition: trigger
            id:
              - Madrugada
        sequence:
          - service: input_select.select_option
            data:
              option: Madrugada
            target:
              entity_id: input_select.rangos_iluminacion
mode: single

I don’t see the origin of the problem and I don’t know if it could be due to incompatibility between hourly and sun elevation options.

I think you may have typed a space character after Madrugada somewhere.

2 Likes

Yeah, looks like the input_select option config, not the automation, has a space after it.

possible options: Madrugada , Mañana, Tarde, Noche Antes de Dormir, Noche Durmiendo)
                           ^
                           |
                         Here
1 Like

That is!

I was so obfuscated reviewing the automation that I didn’t look at the space behind the input configuration.

Thank you very much!