Time_pattern automation stops running after 10-12 hours

I have 2 automations… One that turns off my fans every 5 minutes, and one that checks every minute if the upstairs temp is different enough from downstairs and turns them back on. It ran (based on looking at the logs) for about 10-12 hours yesterday, and then sometime this morning decided to just stop running.

Is there something wrong with my automation, or is there a limit for # of times an automation will run?

- alias: r9 turn on fans when the climate temperatures are different
  trigger:
    platform: time_pattern
    minutes: /1
    seconds: '10'
  condition:
    condition: or
    conditions:
    - condition: template
      value_template: '{% if ( state_attr(''climate.main_floor'', ''current_temperature'')|
        int - state_attr(''climate.upstairs'', ''current_temperature'') | int >2 )
        %}true{% else %}false{%endif %}'
    - condition: template
      value_template: '{% if ( state_attr(''climate.upstairs'', ''current_temperature'')
        | int - state_attr(''climate.main_floor'', ''current_temperature'')| int >2)
        %}true{% else %}false{% endif %}'
  action:
  - device_id: 625bd8a96d1e4d229753c115136f1a57
    domain: fan
    entity_id: fan.kitchen_fan
    type: turn_on
  - device_id: 4df017f706594f219129a73acc2a82b7
    domain: fan
    entity_id: fan.living_room_fan
    type: turn_on
  id: 04260cc4aa50403bb9bf802c3798304c
- id: 6f3105367c924d9ebca7029a5d83360c
  alias: r10 turn off fans when temperatures are nearly equal
  trigger:
  - minutes: /5
    platform: time_pattern
  action:
  - device_id: 625bd8a96d1e4d229753c115136f1a57
    domain: fan
    entity_id: fan.kitchen_fan
    type: turn_off
  - device_id: 4df017f706594f219129a73acc2a82b7
    domain: fan
    entity_id: fan.living_room_fan
    type: turn_off

There’s no limit. Of course, the question is… which stopped running?

This can be simplified a lot:

To:

    - condition: template
      value_template: '{{ ( state_attr(''climate.main_floor'', ''current_temperature'')|int - state_attr(''climate.upstairs'', ''current_temperature'')|int) >2 }}'
    - condition: template
      value_template: '{{ ( state_attr(''climate.upstairs'', ''current_temperature'')|int - state_attr(''climate.main_floor'', ''current_temperature'')|int) >2 }}'

Or even:

    - condition: template
      value_template: '{{ ( state_attr(''climate.main_floor'', ''current_temperature'')|int - state_attr(''climate.upstairs'', ''current_temperature'')|int)|abs >2 }}'
1 Like

For your first question as to which one: both of them stopped running after a while. Everything else in HomeAssistant seems to be running fine, though I do see some older attempts at these automations that are no longer in my automations.yaml file show up in the history screen.

Thanks for the simplifications. I really like the abs capability and had tried that before with no luck.

However, so far no luck getting this to trigger every 1 (or 5) minutes. Seems like the time_pattern trigger isn’t very reliable