Input boolean breaking automation

Can anyone figure out why this input boolean doesn’t work? It passes the check then throws and error in the logs saying that it received a ‘None’ value.

If I remove the input boolean condition it works fine.

- id: 'motion_dark_turn_on_Ensuite_bathroom_light'
  alias: If there is motion and its dark turn on the Ensuite bathroom light
  trigger:
    platform: state
    entity_id: binary_sensor.motion_sensor_158d0001e63621
    from: "off"
    to: "on"
  condition:
    condition: and
    conditions:
      - condition: numeric_state
        entity_id: sensor.illumination_158d0001e63621
        below: 10
      - condition: state
        entity_id: input_select.occupancy
        state: "True"
      - condtion: state
        entity_id: input_boolean.night_mode
        state: 'off'
  action:
    - service: switch.turn_on
      entity_id: switch.ensuite_bathroom_light

Log entry:

Logger: homeassistant.config
Source: config.py:443
First occurred: 7:53:19 AM (6 occurrences)
Last logged: 8:08:15 AM

Invalid config for [automation]: Unexpected value for condition: 'None'. Expected numeric_state, state, sun, template, time, zone, and, or, not, device @ data['condition'][0]['conditions'][2]. Got None. (See /config/configuration.yaml, line 22).

Have you tried it like this? (conditions are AND logic by default):

  condition:
    - condition: numeric_state
      entity_id: sensor.illumination_158d0001e63621
      below: 10
    - condition: state
      entity_id: input_select.occupancy
      state: "True"
    - condtion: state
      entity_id: input_boolean.night_mode
      state: 'off'

Unfortunately, the result is the same.

Are you sure it is this automation?

If you comment the whole condition block out does the error go away after a reload?

I don’t think that’s the issue as it is missing the condition platform (state, numeric_state etc…) not the entity_id.

1 Like

If i remove the last condition then the automation works and is visible in the UI. It doesnt make sense.

You typed condtion not condition.

@tom_l is correct that you don’t need the condition: and, but your typo got copied into that code too…

2 Likes

Good eyes.

OMG I’m such a potato. Thank you
Strange that check config didn’t pick this up.

1 Like

The menu button is a ‘quick’ configuration check.

For a full one run this at the CLI:

ha core check
1 Like