Logger: homeassistant.config
Source: config.py:454
First occurred: 1:24:04 PM (5 occurrences)
Last logged: 1:24:08 PM

Invalid config for [automation]: Unable to determine action @ data['action'][0]. Got None. (See ?, line ?).
Invalid config for [automation]: [automation] is an invalid option for [automation]. Check: automation->automation. (See ?, line ?).
Invalid config for [automation]: required key not provided @ data['action']. Got None. (See ?, line ?).
Invalid config for [script]: template value should be a string for dictionary value @ data['sequence'][0]['data_template']. Got None. (See /home/homeassistant/.homeassistant/configuration.yaml, line 22).

I got those errors for this automation:

automation:
  - alias: "Set ideal values for chosen plant"
    trigger:
      - platform: state
        entity_id: input_select.plant_species
    action:
      - variables:
          plant_index: "{{ states('input_select.plant_species').state | int(0) }}" # Use int(0) for default 0 if not an integer
          ideal_values: >
            [
              {
                # Домат - Index 0
                'max_light_mmol': 1200,
                'min_light_mmol': 300,
                'max_light_lux': 100000,
                'min_light_lux': 3000,
                'max_temp': 30,
                'min_temp': 15,
                'max_env_humid': 70,
                'min_env_humid': 40,
                'max_soil_moist': 70,
                'min_soil_moist': 30,
                'max_soil_ec': 4.0,
                'min_soil_ec': 1.5
              },
              {
                # Краставица - Index 1
                'max_light_mmol': 1000,
                'min_light_mmol': 200,
                'max_light_lux': 80000,
                'min_light_lux': 2000,
                'max_temp': 28,
                'min_temp': 12,
                'max_env_humid': 65,
                'min_env_humid': 35,
                'max_soil_moist': 65,
                'min_soil_moist': 25,
                'max_soil_ec': 3.5,
                'min_soil_ec': 1.2
              },
              {
                # Салата - Index 2
                'max_light_mmol': 800,
                'min_light_mmol': 150,
                'max_light_lux': 60000,
                'min_light_lux': 1500,
                'max_temp': 25,
                'min_temp': 10,
                'max_env_humid': 60,
                'min_env_humid': 30,
                'max_soil_moist': 60,
                'min_soil_moist': 20,
                'max_soil_ec': 3.0,
                'min_soil_ec': 1.0
              },
              {
                # Зелка - Index 3
                'max_light_mmol': 1200,
                'min_light_mmol': 300,
                'max_light_lux': 100000,
                'min_light_lux': 3000,
                'max_temp': 30,
                'min_temp': 15,
                'max_env_humid': 70,
                'min_env_humid': 40,
                'max_soil_moist': 30,
                'min_soil_moist': 20,
                'max_soil_ec': 4.0,
                'min_soil_ec': 1.5
              }
            ]
      - choose:
          - conditions:
              - condition: numeric_state
                entity_id: input_select.plant_species
                below: "{{ ideal_values | length }}"
            sequence:
              - service: input_number.set_value
                data_template:
                  entity_id: input_number.max_light_mmol
                  value: "{{ ideal_values[plant_index].max_light_mmol }}"
              - service: input_number.set_value
                data_template:
                  entity_id: input_number.min_light_mmol
                  value: "{{ ideal_values[plant_index].min_light_mmol }}"
              - service: input_number.set_value
                data_template:
                  entity_id: input_number.max_light_lux
                  value: "{{ ideal_values[plant_index].max_light_lux }}"
              - service: input_number.set_value
                data_template:
                  entity_id: input_number.min_light_lux
                  value: "{{ ideal_values[plant_index].min_light_lux }}"
              # ...Repeat for all other input_numbers...
              - service: input_number.set_value
                data_template:
                  entity_id: input_number.max_soil_ec
                  value: "{{ ideal_values[plant_index].max_soil_ec }}"
              - service: input_number.set_value
                data_template:
                  entity_id: input_number.min_soil_ec
                  value: "{{ ideal_values[plant_index].min_soil_ec }}"
          - default:
              - service: notify.your_notification_service # Replace with your notification service
                data:
                  message: "Invalid plant index selected."