"Wait for Trigger" fails

Hi everyone,

I’m not sure where exactly to put this, but recently some of my automations have failed to proceed (or stop) as they should.
I run a number of electric heaters each with their own automation and the automation is supposed to trigger when the room temperature drops below a certain number and to then turn on the heater (via Zigbee socket). Then the automation is supposed to wait for the next trigger: When the room temperature exceeds a certain temperature provided by a Homematic thermostat and to turn off again as soon as the room’s warm enough.
Simple enough and it used to work very well.

However, this has started to fail more and more often recently with heaters running “unchecked” way past their imposed limits. Neither the sockets nor the thermostats are to blame as they all work and report their information correctly.

I’ve started to impose time limits on the triggers to cut the automations short and to then restart if the target temperature hasn’t been reached yet, but even these are now failing with heaters running way past the trigger deadline.

In either case there’s no error that I can see and the trace for anything following the stop trigger only reads “This step was not performed and therefore no further trace data is available.”

I hope I haven’t missed a relevant topic but has anybody else encoutered this or a similar behaviour?

Thank you!

We need to see the automation.
But generally if your automation is based on a wait for trigger then that is a major fail.
Automations should not be in a waiting state more than a few seconds, anything more risks failure like this.

I would suggest you look at a generic thermostat (helper). That probably solves a lot of your issues.
Obviously you can use an automation but it needs to be written in such a way that it’s less likely to fail, and we need to see your automation to help you with that.

1 Like

You had replied to me in another (old) topic but then deleted your post.

The contents of that deleted post are still available (it takes about 24 hours before it’s permanently deleted). You had posted a trace and I have copied it here.

Click to reveal the trace
{
   "trace":{
      "last_step":"action/0/else/1",
      "run_id":"0d7f08e7347df84c42ed54d20ae645c3",
      "state":"stopped",
      "script_execution":"cancelled",
      "timestamp":{
         "start":"2026-02-18T11:16:24.976945+00:00",
         "finish":"2026-02-18T11:25:59.816814+00:00"
      },
      "domain":"automation",
      "item_id":"1759740068221",
      "trigger":null,
      "trace":{
         "trigger":[
            {
               "path":"trigger",
               "timestamp":"2026-02-18T11:16:24.977123+00:00",
               "changed_variables":{
                  "this":{
                     "entity_id":"automation.heizlufter_hobby",
                     "state":"on",
                     "attributes":{
                        "id":"1759740068221",
                        "last_triggered":"2026-02-17T19:46:50.692170+00:00",
                        "mode":"restart",
                        "current":0,
                        "friendly_name":"Heizlüfter Hobby"
                     },
                     "last_changed":"2026-02-18T10:11:13.076264+00:00",
                     "last_reported":"2026-02-18T10:11:13.076264+00:00",
                     "last_updated":"2026-02-18T10:11:13.076264+00:00",
                     "context":{
                        "id":"01KHR3PZHM8Q8GRPQM2MJ3QF8B",
                        "parent_id":null,
                        "user_id":null
                     }
                  },
                  "trigger":{
                     "platform":null
                  }
               }
            }
         ],
         "action/0":[
            {
               "path":"action/0",
               "timestamp":"2026-02-18T11:16:24.978231+00:00",
               "changed_variables":{
                  "context":{
                     "id":"01KHR7EBRGV5D0395X5T5F2HTQ",
                     "parent_id":"01KHR7EBRGKM3RHND04NN75BWB",
                     "user_id":null
                  },
                  "wait":{
                     "remaining":5400,
                     "completed":false,
                     "trigger":null
                  }
               },
               "result":{
                  "choice":"else"
               }
            }
         ],
         "action/0/if":[
            {
               "path":"action/0/if",
               "timestamp":"2026-02-18T11:16:24.978859+00:00",
               "result":{
                  "result":false
               }
            }
         ],
         "action/0/if/condition/0":[
            {
               "path":"action/0/if/condition/0",
               "timestamp":"2026-02-18T11:16:24.979108+00:00",
               "result":{
                  "result":false
               }
            }
         ],
         "action/0/if/condition/0/entity_id/0":[
            {
               "path":"action/0/if/condition/0/entity_id/0",
               "timestamp":"2026-02-18T11:16:24.979307+00:00",
               "result":{
                  "result":false,
                  "state":19.3,
                  "wanted_state_above":20
               }
            }
         ],
         "action/0/else/0":[
            {
               "path":"action/0/else/0",
               "timestamp":"2026-02-18T11:16:24.980123+00:00"
            }
         ],
         "action/0/else/1":[
            {
               "path":"action/0/else/1",
               "timestamp":"2026-02-18T11:16:25.078915+00:00",
               "changed_variables":{
                  "wait":{
                     "remaining":5400,
                     "completed":false,
                     "trigger":null
                  }
               },
               "result":{
                  "result":false,
                  "state":19.3,
                  "wanted_state_above":21
               }
            }
         ]
      },
      "config":{
         "id":"1759740068221",
         "alias":"Heizlüfter Hobby",
         "description":"Schaltet den Heizlüfter ein, wenn die Temperatur im KG Hobbyraum unter 20° C sinkt.",
         "triggers":[
            {
               "device_id":"bb7849dff6beb98edc930c62d947175c",
               "domain":"climate",
               "entity_id":"31d3a67a7b76f01e7d25abe6c1fe3258",
               "type":"current_temperature_changed",
               "trigger":"device",
               "below":20
            },
            {
               "device_id":"bb7849dff6beb98edc930c62d947175c",
               "domain":"climate",
               "entity_id":"31d3a67a7b76f01e7d25abe6c1fe3258",
               "type":"current_temperature_changed",
               "trigger":"device",
               "below":19
            },
            {
               "device_id":"bb7849dff6beb98edc930c62d947175c",
               "domain":"climate",
               "entity_id":"31d3a67a7b76f01e7d25abe6c1fe3258",
               "type":"current_temperature_changed",
               "trigger":"device",
               "below":18
            },
            {
               "trigger":"homeassistant",
               "event":"start"
            }
         ],
         "conditions":[
            {
               "condition":"and",
               "conditions":[
                  {
                     "condition":"state",
                     "entity_id":"input_boolean.verreist",
                     "state":"off"
                  }
               ]
            }
         ],
         "actions":[
            {
               "if":[
                  {
                     "condition":"numeric_state",
                     "entity_id":"sensor.kg_heizung_hobby_int0000012_temperatur",
                     "above":20
                  }
               ],
               "then":[
                  {
                     "type":"turn_off",
                     "continue_on_error":true,
                     "device_id":"28cfcf340f1885db4184c00975b3acfa",
                     "entity_id":"4caeb68f0e488aefe23bff64b1ec3db7",
                     "domain":"switch"
                  }
               ],
               "else":[
                  {
                     "type":"turn_on",
                     "continue_on_error":true,
                     "device_id":"28cfcf340f1885db4184c00975b3acfa",
                     "entity_id":"4caeb68f0e488aefe23bff64b1ec3db7",
                     "domain":"switch"
                  },
                  {
                     "wait_for_trigger":[
                        {
                           "device_id":"bb7849dff6beb98edc930c62d947175c",
                           "domain":"climate",
                           "entity_id":"31d3a67a7b76f01e7d25abe6c1fe3258",
                           "type":"current_temperature_changed",
                           "trigger":"device",
                           "above":21
                        }
                     ],
                     "continue_on_timeout":true,
                     "timeout":{
                        "hours":1,
                        "minutes":30,
                        "seconds":0,
                        "milliseconds":0
                     }
                  },
                  {
                     "repeat":{
                        "while":[
                           {
                              "condition":"device",
                              "type":"is_on",
                              "device_id":"28cfcf340f1885db4184c00975b3acfa",
                              "entity_id":"4caeb68f0e488aefe23bff64b1ec3db7",
                              "domain":"switch"
                           }
                        ],
                        "sequence":[
                           {
                              "type":"turn_off",
                              "continue_on_error":true,
                              "device_id":"28cfcf340f1885db4184c00975b3acfa",
                              "entity_id":"4caeb68f0e488aefe23bff64b1ec3db7",
                              "domain":"switch"
                           },
                           {
                              "delay":{
                                 "hours":0,
                                 "minutes":1,
                                 "seconds":0,
                                 "milliseconds":0
                              }
                           }
                        ]
                     }
                  },
                  {
                     "delay":{
                        "hours":0,
                        "minutes":30,
                        "seconds":0,
                        "milliseconds":0
                     }
                  },
                  {
                     "action":"automation.trigger",
                     "metadata":{
                        
                     },
                     "target":{
                        "entity_id":"automation.heizlufter_hobby"
                     },
                     "data":{
                        "skip_condition":true
                     }
                  }
               ]
            }
         ],
         "mode":"restart"
      },
      "blueprint_inputs":null,
      "context":{
         "id":"01KHR7EBRGV5D0395X5T5F2HTQ",
         "parent_id":"01KHR7EBRGKM3RHND04NN75BWB",
         "user_id":null
      }
   },
   "logbookEntries":[
      {
         "name":"Heizlüfter Hobby",
         "message":"triggered",
         "source":null,
         "entity_id":"automation.heizlufter_hobby",
         "context_id":"01KHR7EBRGV5D0395X5T5F2HTQ",
         "domain":"automation",
         "when":1771413384.977368
      },
      {
         "state":"on",
         "entity_id":"switch.ug_htr_zb_steckdose_trockner_alt",
         "icon":"mdi:power-socket-de",
         "when":1771413385.0775886,
         "context_event_type":"automation_triggered",
         "context_domain":"automation",
         "context_name":"Heizlüfter Hobby",
         "context_message":"triggered",
         "context_entity_id":"automation.heizlufter_hobby"
      }
   ]
}
  • The automation contains three Numeric State Device Triggers.

  • Each trigger is monitoring the same climate entity, checking for the moment when its temperature decreases below 20, 19, and 18 degrees respectively.

  • The automation also contains a wait_for_trigger that uses yet another Numeric State Device Trigger to monitor the exact same climate entity. It checks for when the temperature increases above 21. Its timeout is set to 1.5 hours.

I believe the problem is that the automation’s mode is set to restart.

That mode means that if the automation is waiting for something to happen in its actions section (like a wait_for_trigger) it will automatically abort and restart if its main triggers detect changes to the values they are monitoring.

You are expecting the wait_for_trigger to detect when the climate entity report a value above 21. However, the main triggers are also monitoring that value. When that value changes, the main triggers detect it and restart the automation (because mode is restart).

I suggest you do this in your automation:

mode: single
max_exceeded: silent
1 Like