Timer automation stopped working

I’ve had an automation to turn my hot water on and off for the last year and yesterday/today it just stopped working. I look in the Logbook and can see the timer finishing event:

6:06 PM    hot water daily changed to idle

and the matching automation:

- id: hot-water-timer-finish
  alias: "Turn off Hot water when timer finishes"
  initial_state: true
  trigger:
    - platform: event
      event_type: timer.finished
      event_data:
        entity_id: 
          - timer.hot_water_boost
          - timer.hot_water_daily
  action:
    - service: switch.turn_off
      entity_id: switch.sonoff_hot_water

This has been working for over a year, but now has just stopped, no errors etc, the automation just doesn’t trigger…

is the automation turned on?

Petro may have hit this nail on the head, but do you really want the end of the boost shut the heater off if the daily is still on ? Should you not have a condition ?

Yes it’s turned on !, and the boost timer will not activate if the daily timer is running. But this is beside the point, why has this automation stopped working ???

I’m sorry, we are trying to help.
How does the daily stop the boost ?
The point here being that ‘something’ has caused a change in behaviour and unless we know more we can’t point you at possible solutions.
So do we have all relevant configuration ?
You understand that no one here is employed by HA and as you paid nothing for the software you are merely reliant upon the kindness of strangers ?
Petro suggested that you may have inadvertently switched the automation off. The number of times that happens is almost unbelievable. But if you are happy to take it from here we’ll understand.
Good luck

Sorry if I was a bit short, but how the boost timer works is totally irrelevant in this case, on , off, it doesn’t make a difference to how this automation should run, there are no conditions, I get an event in the log to say the timer has finished, but this does not run. I can manually start and stop the timer, it still doesn’t run. The only thing that has changed its the latest release of HA.

So, automations with single timers in the trigger clause still work, any that have more than one no longer work. I wrote separate automations with 1, 2 and 3 timers to confirm that this is the case.

You need to take a chill pill. I don’t even feel like helping you but I will.

It looks like they may have changed something with event data. Could be a bug or by design. I don’t know, I haven’t really looked into it.

Change your automation to this to get it working.

- id: hot-water-timer-finish
  alias: "Turn off Hot water when timer finishes"
  initial_state: true
  trigger:
    - platform: event
      event_type: timer.finished
  condition:
    condition: template
    value_template: >
      {{ trigger.event.data.entity_id in ['timer.hot_water_boost', 'timer.hot_water_daily'] }}
  action:
    - service: switch.turn_off
      entity_id: switch.sonoff_hot_water

Have you tried to split the timer finished events into different ones with only one entity per trigger event?

like this:

  trigger:
    - platform: event
      event_type: timer.finished
      event_data:
        entity_id: timer.hot_water_boost
    - platform: event
      event_type: timer.finished
      event_data:
        entity_id: timer.hot_water_daily

He said he tried one entity_id. I also tried one yesterday on 0.105b and it wasn’t working. Something definitely changed. But I put about zero effort into seeing what changed and put all the effort into finding an automation that would work.

Sorry, I misunderstood.

I thought he said he tried with one timer event trigger with one entity_id and it worked. I didn’t realize he used two different timer event triggers with one entity_id each and it wouldn’t work.

my bad…

I don’t know if he meant that. That’s what I gathered from his post. But I went ahead and tried it myself and it wouldn’t work when I specified ‘enitity_id’ inside ‘event_data’. No matter how many entity_id’s you have. :man_shrugging:

I just ran this automation:

- alias: test timer finished event
    initial_state: 'on'
    trigger:
      # run when restart timer has finished
      - platform: event
        event_type: timer.finished
        event_data:
          entity_id: timer.garage_lights_timer
    condition:
      # only run if alarm clock is active
      - condition: state
        entity_id: input_boolean.bool_16
        state: 'on'
    action:
      # restart alarm, first_run false so no delay in alarm sounding
      - service: input_boolean.turn_on
        entity_id: input_boolean.bool_17

I started the already existing timer manually and when the timer finished the input boolean turned on as expected.

So I’m not sure what isn’t working?

EDIT: wait, are you guys both on v104 already?

if so then that’s bold. I never update until all of the wrinkles get ironed out.

and…nevermind…

I was testing it out on my dev box which was 0.105b.

So is it also (probably…maybe…) broken in 104?

Just trying to narrow down when the problem started to decide if the issue is a new HA version or something in the OP’s config.

He hasn’t reported back in to clarify which version he’s on so until then it’s hard to know which for sure.

:man_shrugging: I’m using 103.6 on my ‘don’t touch, let run house’ platform. I don’t want to add anything to it but i could…

Yeah, I’ve already verified the above works on v103.6 so no need to taint your production install with it. :wink:

the question really was about 104.

:man_shrugging: Nose goes. Not it!

I just ran into the same issue with my trigger not firing with the timer.finished event under v107.4 and found this thread to provide some direction on debugging. Good news is that it appears this is now working as of v107.4, at least with a single entity_id wrapped by event_data (I have not tested multiple entity_ids). I had borrowed some trigger logic for someone else in the HA community that wasn’t formatted as the examples given above. Bottom line for other’s seeing this in v104, it’s been fixed!

1 Like