Help! Automation stops working after HASS running for a day and returns to normal working after reloading automations

Hello folks!
I have a lot of automations, and one of them is quoted below.
This automation works, but after running for about a day without restarting HASS this automation no longer triggers, while others still work.
There are no messages in the log.
Simpy reloading automations from the UI makes the automation trigger again.
I am running on a Raspberry Pi, within a virtual environment. Everything is updated to latest version.

What could be wrong??? Or is it a bug?

The automation:

- alias: 'CV ketel override aan'
  initial_state: true
  trigger:
    - platform: state
      entity_id: sensor.max_ch_state2
      to: 'demand'
    - platform: state
      entity_id: climate.thermostat
      to: 'idle'
    - platform: time
      minutes: '/1'
      seconds: 0
  condition:
    - condition: template
      value_template: "{{ states.sensor.max_ch_state2.state == 'demand' }}"
    - condition: template
      value_template: "{{ states.climate.thermostat.state == 'idle' }}"
    - condition: template
      value_template: "{{ states.switch.cv_ketel_override.state == 'off' }}"
  action:
    - service: switch.turn_on
      entity_id: switch.cv_ketel_override
    - service: switch.turn_off
      entity_id: switch.cv_pomp
    - service: notify.simplepush
      data_template:
        title: CV Ketel override aan!
        message: |
          Totaal: {{states.sensor.max_ch_state2.state}}
          maxJudge: {{states.sensor.max_ch_maxjudge.state}} ( {{states.sensor.maxjudge_temperature.state}} / {{states.sensor.maxjudge_desiredtemperature.state}} )
          maxFabian: {{states.sensor.max_ch_maxfabian.state}} ( {{states.sensor.maxfabian_temperature.state}} / {{states.sensor.maxfabian_desiredtemperature.state}} )
          maxManouk: {{states.sensor.max_ch_maxmanouk.state}} ( {{states.sensor.maxmanouk_temperature.state}} / {{states.sensor.maxmanouk_desiredtemperature.state}} )
          maxMarten: {{states.sensor.max_ch_maxmarten.state}} ( {{states.sensor.maxmarten_temperature.state}} / {{states.sensor.maxmarten_desiredtemperature.state}} )
          maxGang: {{states.sensor.max_ch_maxgang.state}} ( {{states.sensor.maxgang_temperature.state}} / {{states.sensor.maxgang_desiredtemperature.state}} )
          Woonkamer: {{ states.climate.thermostat.state }} ( {{states.sensor.room_temp.state}} / {{states.sensor.room_setpoint.state}} )
          Trigger: {{ trigger.platform }} {% if trigger.entity_id is not none %} {{ trigger.entity_id }} {% endif %}

Any help is welcome!

This is anded together:

  condition:
    - condition: template
      value_template: "{{ states.sensor.max_ch_state2.state == 'demand' }}"
    - condition: template
      value_template: "{{ states.climate.thermostat.state == 'idle' }}"
    - condition: template
      value_template: "{{ states.switch.cv_ketel_override.state == 'off' }}"

Are you sure that is your intention? You’ll need to meet all 3 conditions for this to fire. Once this turns on once, it will never fire again because your cv_ketel_override was turned on. Unless you physically turn it off again.

Thanks! Of course I turn it off again, but thats another automation, and it works ok. It simply will not trigger again after running alone for a day or so.

I tried to find a way to monitor a single automation in debug mode, but I only could find a way to debug them all, and that gives me to much information… This morning I found another automation what was not triggering while all conditions were ok. I think perhaps I have to reinstall everything :frowning: or move my automations to appdaemon or node red.

I don’t think reinstalling is going to work. You should be monitoring the items that would cause the automation to trigger. My guess is that your condition is limiting your automation from firing. So look at the states of your thermostat and your sensor at the moment in time in which you think the automation should fire.

Oddities like this are always the logic in the automation, they are rarely - if ever - the installation of HA.

1 Like

Yeah, it’s funny that the first (or second, or third) thing people want to try is to “re-install” when that is almost never the solution.

You see some people come on here and say something like “i’ve re-installed 5 times and I still have the same problem…”. :roll_eyes:

3 Likes

The definition of insanity is doing the same thing over and over and expecting a different result… Honestly HA is pretty hard to screw up… it’s always a config file etc… (almost always)

1 Like

Had to reinstall everything because of an error on the SD card of the Raspberry Pi. Now running again with the same automations (yes! backuping rules!), and added a monitor automation using exactly the same triggers, but without any conditions, and with as only action writing to a file using notify. In this notify I print a timestamp, the trigger values, the triggerdd platform/entity, and all three conditions exactly as used in the original automation.

After about a day the same situation happens. (so you were right about the reinstall thing…:wink:)

The automation triggers, and all 3 conditions are True. Why are the actions not fired???

Any help would be nice. Is there any more monitoring I can do ???

I have the exact same problem with Time pattern automations. Did you find a solution in the meantime?

Try removing this from your trigger:

seconds: 0

It will still trigger every minute.