Determining Input Select State in Automation Generating Error

Hello,

I am trying to use the following automation, and I’m getting an error. I think it’s related to checking the state of input_select.ac_off_time_select.

- alias: Update AC Off Timer
  trigger:
    platform: state
    entity_id: input_select.ac_off_time_select
  condition:
    platform: template
    entity_id: input_select.ac_off_time_select
    value_template: "{{ not is_state('input_select.ac_off_time_select', 'ON') }}"
  action:
  - service: climate.set_preset_mode
    data:
      preset_mode: eco
    entity_id: climate.living_room
  - service: timer.start
    data:
      entity_id: timer.ac_off_timer
      duration: "00:{{ states('input_select.ac_off_time_select') }}:00"
- alias: AC Off Timer Expired
  trigger:
  - platform: event
    event_type: timer.finished
    event_data:
      entity_id: timer.ac_off_timer
  action:
  - service: climate.set_preset_mode
    data:
      preset_mode: none
    entity_id: climate.living_room
  - service: input_select.select_option
    data:
      entity_id: input_select.ac_off_time_select
      option: "ON"

Logger: homeassistant.config
Source: config.py:415
First occurred: 10:49:40 PM (1 occurrences)
Last logged: 10:49:40 PM
Invalid config for [automation]: Unexpected value for condition: ‘None’. Expected numeric_state, state, sun, template, time, zone, and, or, not, device @ data[‘condition’][0]. Got None expected dict for dictionary value @ data[‘action’][0][‘data’]. Got None. (See ?, line ?).

Thoughts? Thanks

Hi there, Please change the conditon to this and try.

condition:
  - condition: template
    value_template: '{{ states(''input_select.ac_off_time_select'') != "ON" }}'

That did it. Thanks.

Can you please help me understand why this needed changed?

This is the standard format for a template condition. When I checked your configuration it was different.

You can find the standard formats from this link.

Also you check your templates in the templates tab in the developer console.