Problem with timer automation for climate

Hi all. Can anyone see why this automation isn’t working?
Input boolean to enable/disable the timer

master_timer_input:
  name: Enable Master Vent Timer
  initial: off
  icon: mdi:clock-start

Time selected to start automation. The value_template tested and showing a true result at the designated time. sensor.time component added.

- id: master_vent_automation
  alias: Master Vent Automation
  trigger:
  - platform: template
    value_template: '{{ states.sensor.time.state == states.input_select.master_timer_select.state
      }}'
  condition:
  - condition: state
    entity_id: input_boolean.master_timer_input
    state: 'on'
  action:
  - data:
      entity_id: climate.master
    service: climate.turn_on

The timer appears and can be set on the front end.

master_timer_select:
    name: Master Vent Open
    initial: 07:00
    options:
      - '04:30'
      - '04:45'
      - '05:00'
      - '05:15'
      - '05:30'
      - '05:45'
      - '06:00'
      - '06:15'
      - '06:30'
      - '06:45'
      - '07:00'
      - '07:15'
      - '07:30'
      - '07:45'
      - '08:00'
      - '08:15'
      - '08:30'
      - '08:45'
      - '09:00'

Any help much appreciated.

What do these two templates return in the dev tools template editor:

{{ states.sensor.time.state }}
{{ states.input_select.master_timer_select.state }}

(looking at the format, don’t care about the values)

Also this:

    initial: 07:00

Should probably be:

    initial: '07:00'

Thanks for the reply.

{{ states.sensor.time.state }} = 16:11 (Current time)
{{ states.input_select.master_timer_select.state }} = 14:42 (last time I tested the automation to try find the problem!

Good pickup. I’ll add the ’ ’ to see if that helps.

Ok the time formats are the same so it should work.

You should change the template to this format to avoid ‘unknown’ errors at start up though:

"{{ states('sensor.time') == states('input_select.master_timer_select') }}"

Thanks Tom. Really appreciate the help. Sometimes you cant see the trees for the forrest :wink:

Hmmmmmm Giving this error on config check…

Error loading /config/configuration.yaml: while parsing a block mapping
  in "/config/automations.yaml", line 63, column 5
expected <block end>, but found '<scalar>'
  in "/config/automations.yaml", line 64, column 33

Can you post your whole trigger block?

Each climate.xxx is connected to the vent switch in that room. The climate.living is the actual heating device that switches the gas heating on and off. So once the climate.xxx room is triggered, they switch on teh gas heating then the climate.xxx controls the temp in the room by opening and closing the vent. That secondary part works perfect if I switch them on or off individually. And it I switch a room on, it starts the heater and works perfectly. So its just the timer that I am having problems with turning on the individual rooms. :frowning:

This block starts at line 50.

- id: climate_on_automation
  alias: Climate On Automation
  trigger:
  - platform: template
    value_template: '{{ states.sensor.time.state == (states.input_datetime.heater_on_timer.attributes.timestamp
      | int | timestamp_custom("%H:%M", False)) }}'
  action:
  - data:
      entity_id: climate.living
    service: climate.turn_on
- id: chloe_vent_automation
  alias: Chloe Vent Automation
  trigger:
  - platform: template
    value_template: '{{ states('sensor.time') == states('input_select.chloe_timer_select') }}'
  condition:
  - condition: state
    entity_id: input_boolean.chloe_timer_input
    state: 'on'
  action:
  - data:
      entity_id: climate.chloe
    service: climate.turn_on
- id: phoebe_vent_automation
  alias: Phoebe Vent Automation
  trigger:
  - platform: template
    value_template: '{{ states('sensor.time') == states('input_select.phoebe_timer_select') }}'
  condition:
  - condition: state
    entity_id: input_boolean.phoebe_timer_input
    state: 'on'
  action:
  - data:
      entity_id: climate.phoebe
    service: climate.turn_on
- id: lounge_vent_automation
  alias: Lounge Vent Automation
  trigger:
  - platform: template
    value_template: '{{ states('sensor.time') == states('input_select.lounge_timer_select') }}'
  condition:
  - condition: state
    entity_id: input_boolean.lounge_timer_input
    state: 'on'
  action:
  - data:
      entity_id: climate.lounge
    service: climate.turn_on
- id: master_vent_automation
  alias: Master Vent Automation
  trigger:
  - platform: template
    value_template: '{{ states('sensor.time') == states('input_select.master_timer_select') }}'
  condition:
  - condition: state
    entity_id: input_boolean.master_timer_input
    state: 'on'
  action:
  - data:
      entity_id: climate.master
    service: climate.turn_on
- id: '1566025395204'
  alias: Heating Control On
  trigger:
  - entity_id: climate.chloe_s_room
    from: 'off'
    platform: state
    to: heat
  - entity_id: climate.phoebe_s_room
    from: 'off'
    platform: state
    to: heat
  - entity_id: climate.lounge
    from: 'off'
    platform: state
    to: heat
  - entity_id: climate.master_bedroom
    from: 'off'
    platform: state
    to: heat
  condition:
  - condition: state
    entity_id: climate.living
    state: 'off'
  action:
  - data:
      entity_id: climate.living
    service: climate.turn_on
- id: '1566029706612'
  alias: Auto Heating Control Off
  trigger:
  - entity_id: climate.chloe_s_room
    platform: state
    to: 'off'
  - entity_id: climate.lounge
    platform: state
    to: 'off'
  - entity_id: climate.master_bedroom
    platform: state
    to: 'off'
  - entity_id: climate.phoebe_s_room
    platform: state
    to: 'off'
  condition:
  - condition: state
    entity_id: climate.chloe_s_room
    state: 'off'
  - condition: state
    entity_id: climate.phoebe_s_room
    state: 'off'
  - condition: state
    entity_id: climate.master_bedroom
    state: 'off'
  - condition: state
    entity_id: climate.lounge
    state: 'off'
  - condition: state
    entity_id: group.family
    state: not_home
  action:
  - data:
      entity_id: climate.living
    service: climate.turn_off
- id: '1566213145093'
  alias: Heater Away Mode
  trigger:
  - entity_id: group.family
    from: home
    platform: state
    to: not_home
  condition:
  - condition: state
    entity_id: climate.living
    state: heat
  action:
  - data:
      entity_id: climate.living
      preset_mode: away
    service: climate.set_preset_mode

Here’s your problem:

Note where the single qutotes start and end:

 value_template: '{{ states('sensor.time') == states('input_select.chloe_timer_select') }}'
                 ^          ^                         

That’s why I used double quotes outside:

 value_template: "{{ states('sensor.time') == states('input_select.chloe_timer_select') }}"
1 Like

Rookie mistake! Copied between the quotes.
Will test on the morning.

So that fixed the error but still not triggering the action… Grrrr

EDIT: So Tom, it turns out that the entity needs to EXACTLY match the one you want to switch on. Facepalm. Can’t believe I missed it so many times…

entity_id: climate.master

should have been

entity_id: climate.master_bedroom

That will teach me for not copying and pasting in the first place!

Thanks so mutch for your help. Much appreciated!