Automations not working after restart

Hi there

Since a few weeks my automations never work after a HA restart. I created a script with a button to manually restart all automations. It’s a fix, but not a solution.

alias: Automationen neu starten
sequence:

  • service: automation.turn_off
    data:
    stop_actions: true
    target:
    entity_id:
    - automation.xxx 12345
  • delay:
    hours: 0
    minutes: 0
    seconds: 2
    milliseconds: 0
  • service: automation.turn_on
    data: {}
    target:
    entity_id:
    - automation.xxx 12345
    mode: single
    icon: mdi:reload

Any idea why i got this problem? I transferred HA from raspberry pi to my Synology Virtual machine. Maybe there was a problem?

I’m on 2023.5.0

Regards

Matthias

3 Likes

Nobody will have any if you don’t show your automations and define what “doesn’t work” means to you.
Crystal balls are even harder to find than RPI4 those days…

No automation is working. I don’t think it’s a problem with the automations itself.

  • Zigfred (Zigbee) Switch with hue Lamps
  • Zigfred (Zigbee) Switch WOL to my computer
  • Pixel Alarm Clock to trigger my morning routine
  • Unifi Doorbell to trigger Sonos sound

Here a few automations:

alias: Zigfred Küche
description: “”
trigger:

  • device_id: 277edcef67415e7e7d73088b98a80f98
    domain: zha
    platform: device
    type: remote_button_short_press
    subtype: button_1
    id: Taste1
  • device_id: 277edcef67415e7e7d73088b98a80f98
    domain: zha
    platform: device
    type: remote_button_short_press
    subtype: button_2
    id: Taste2
  • device_id: 277edcef67415e7e7d73088b98a80f98
    domain: zha
    platform: device
    type: remote_button_short_press
    subtype: button_3
    id: Taste3
  • device_id: 277edcef67415e7e7d73088b98a80f98
    domain: zha
    platform: device
    type: remote_button_short_press
    subtype: button_4
    id: Taste4
    condition: []
    action:
  • choose:
    • conditions:
      • condition: trigger
        id: Taste2
        sequence:
      • type: toggle
        device_id: 277edcef67415e7e7d73088b98a80f98
        entity_id: light.siglis_zigfred_uno_light_8
        domain: light
    • conditions:
      • condition: trigger
        id: Taste4
        sequence:
      • service: light.toggle
        data: {}
        target:
        entity_id: light.silicon_labs_ezsp_zha_kuche_zha_group_0x0006
    • conditions:
      • condition: trigger
        id: Taste1
        sequence:
      • service: media_player.media_play_pause
        data: {}
        target:
        device_id: 242bdeb7270cc9cacf464db4487ae2ae
    • conditions:
      • condition: trigger
        id: Taste3
        sequence:
      • service: light.toggle
        data: {}
        target:
        entity_id: light.whirlpool
        mode: single

alias: Standheizung wird druch Wecker getriggert
description: “”
trigger:

  • platform: time
    at: sensor.pixel_7_pro_next_alarm_2
    condition:
  • condition: numeric_state
    entity_id: sensor.signify_netherlands_b_v_sml004_temperature_3
    below: 10
    action:
  • type: turn_on
    device_id: 281381eddb9e1bae33d4987062c405c2
    entity_id: switch.passat_parking_heater_heating
    domain: switch
    mode: restart

alias: Erinnerung Abfall
description: “”
trigger:

  • platform: time
    at: “06:30:00”
    condition:
  • condition: numeric_state
    entity_id: sensor.abfall_kehricht
    below: 1
    action:
  • service: notify.mobile_app_pixel_7_pro
    data:
    message: heute Kehricht rausstellen!
  • service: notify.mobile_app_in2023
    data:
    message: heute Kehricht rausstellen!
    mode: single

alias: Unifi Doorbell Trigger Sonos Sound
description: “”
trigger:

  • platform: state
    entity_id:
    • binary_sensor.turglocke_doorbell
      to: “on”
      for:
      hours: 0
      minutes: 0
      seconds: 0
      condition: []
      action:
  • service: sonos.snapshot
    data:
    entity_id: all
    with_group: true
  • service: media_player.volume_set
    data:
    volume_level: 0.5
    target:
    entity_id:
    - media_player.sonos_move
    - media_player.wintergarten
    - media_player.wohnzimmer
  • service: media_player.play_media
    entity_id:
    • media_player.sonos_move
    • media_player.wintergarten
    • media_player.wohnzimmer
      data:
      media_content_id: media-source://media_source/local/sounds_sounds_ring_button_Chime.mp3
      media_content_type: audio/mpeg
      metadata:
      title: sounds_sounds_ring_button_Chime.mp3
      thumbnail: null
      media_class: music
      children_media_class: null
      navigateIds:
      • {}
      • media_content_type: app
        media_content_id: media-source://media_source
  • delay:
    hours: 0
    minutes: 0
    seconds: 2
    milliseconds: 0
  • service: sonos.restore
    data:
    entity_id: all
    with_group: true
    mode: single

I have the same problem since the last weeks.

I reinstalled everything new. Also all ZHA Devices. Failure still exist.

Is this a Problem of the Synology Virtual Machine?

Hi,

I have the same or similar problem.

Since some time, probably after an update, my automations which are based on switches do not work anymore after reboot.

I can see in the automation view that when I click a button of a switch the text triggered and I can run the automation manually and the Action works but not via the switch / button (zigbee).

When I change something in the automation and save it, then it works until I restart Ha and then it does not work anymore

1 Like

Hi there,

Did someone else have found a solution for this exact problem? I also have this when triggering automations from Switches. After a reboot the automations with switches stop working until i change something in this automation and save it. Then it will work until the next reboot and it is broken.
I’m looking at the restart of the automations work-a-round. I haven’t tried this yet but it would temp.solve this problem for me as well.

Kind regards,

Dirk

1 Like

I have tried the work-a-round bij disabling and enabling the automations after a Home assistant reboot. This kinda works, but not always reliable.
I’ve observed that the automations give errors complaining about that the device did not respond.

Stopped because an error was encountered at August 4, 2023 at 11:47:10 PM (runtime: 15.33 seconds)

Failed to send request: device did not respond

This happens often, resulting in the automations to “lock and wait for timeout”. The automations run for about 15 seconds…

If the automations work correctly, they all run in about 0.36 seconds.

To be sure, i’ve checked all my zigbee/wifi devices. They have all great signal quality and respond immediately when triggered manually. They never fail manually. Just when using a switch automation, it’s like a mess…

I’ve the same issue. After reboot I have to open the automation and do a trigger. After that they will work until restart. Does anyone found a solution?

I don’t have a solution but I’m facing the same issue, so next time I’ll try the script. I’m using the Container version, Core 2023.11.2, Frontend 20231030.2.

This is how it happened for me: I’m using Conbee II with deCONZ for all zigbee devices. Last time deCONZ crashed and I had to reboot the Pi. I have started the deCONZ container after HA was already running. All the devices and entities were there, and I could control the lamps using the dashboard. The switches even registered the button presses. It was just the automations that were not triggering.

First time this happened to me, I have recreated triggers for all automations. This time I realized that they start working even if I just disable/enable them one by one (but I was hoping to see a way to do this for all of them at once). So I’m happy to see there’s this script to try next time.

I am expriencing the same issue. Automations trigger but the actions do not work after a restart. Recreating the action verbatim has helped, I’ll try disable/enable next time. This seems a prevalent issue, it would be great for this kind of basic functionality to become solid.

Any news or ideas regarding this issue?

I too have the same problem but for me this is happening for a long time already.

I am running the OVA image on my Synology and I am also using Conbee II USB stick with deconz add on.

Every time I restart the VM all of the buttons stopped working. At first I have recreated automations. Then I also noticed I just had to change and save the automation to make it work again. And then I noticed deactivating and activating also did the trick sometimes (not every time).

What’s really weird is when I edit the automation and then press the button I it even says that the button was pressed but nothing happens. When I click run automation from the menu everything works.

So basically the same problem everybody else has.

Additional information:
When I restart the VM I have to manually go into settings and attach the USB stick after starting the VM. Every restart it gets disconnected. And I also have set the deconz addon to manual start because I think I had some issues when the USB stick was not connected when the stick wasn’t already connected.

I’d be really nice if someone had some insights into why it’s not working.

1 Like

I am experiencing the very same issue. Yesterday we had some trouble with our internet connection and I restarted the Home Assistant Docker container on our Synology DS220+. After the restart the ZHA intergration (SkyConnect) failed to setup. I physically disconnected the SkyConnect USB stick and connected it again and the intergration was working again.

Nonetheless, none of our Ikea wall switches worked. The solution for now seems to be this for us:

Go to automations → open an automation where the switch isn’t working → Disable one action → Save → Enable that action again → Save again. Now the button/switch on the wall is working again. I restarted Home Assistant in the UI to see if it’s still working after a restart and everything is still working fine.

I don’t dare to restart the container to test if it’s still working after that since this is taking a lot of time.

I guess it’s time to switch from a Docker Container to the Home Assistant Yellow…

Have the same problem since months.
I put so many hours into this, including complete reinstall and what not.
Automations with zigbee/deconz just stop working for no reason.
Adding something to it (that does not do anything) and SAVE it, get it back working.
After reboot: Not working again. Delete the above dummy entry and SAVE again - it’s working till next reboot.
Looks like it’s getting worse every with update.
It’s just not reliable on so many levels now.

Homeassistant once was really a good working software, those days are over, I guess. Sad.

BTW - I’m running it on a RasPi

The fastest workaround I found, if you have a ton of automations like me, is to go to the “automations-page” and disable all zigbee/deconz containing automations. Reload the page and activate them again.
Until the next reboot, though …

1 Like

Got the same problem. No solution this far?

Well I have switched from running Home Assistant in a docker container on our Synology NAS with a SkyConnect stick to a Home Assistant Yellow device and I haven’t had any issues anymore! It’s way more expensive but it’s worth every penny to me. I have been solving many problems that took many hours of my time while using Home Assistant in a docker container and since we have made the switch to the HA Yellow it’s been a trouble free experience for over a month now!

Same problem. Isn’t there finally a solution to this?

I just had the same issue pop up with a simple script I have to turn the lights on if a person is detected after dark.

I am fairly new to automations/scripts in Home Assistant. I have a simple script that will turn on the front door light for 3 minutes if a person is detected and it is dark outside. I only set the script up a few days ago and it worked perfectly since I did. However, I did an update to Home Assistant (OVA on an old box in the basement) and had to shut the server down for unrelated maintenance. After rebooting the server and ensuring that the VM was up and running, my wife decided to test the automation as she had not seen it work since I set it up. Imagine her disappointment when she went outside and nothing happened!

I investigated and found that the camera the script should call was correctly reporting whether there was a person present and if it was dark outside. I manually triggered the light in question from the HA app and via the Lutron switch that controls the light, all no problem. When I reviewed the script traces, I found no entries despite the camera showing that there was a person present and it was dark out.

After manually triggering the script by selecting “run” on the 3 dot menu, the script seems to work without issue again.

Script:

alias: Front Door Light Person Detection After Dark
sequence:
  - wait_for_trigger:
      - type: turned_on
        platform: device
        device_id: [id of person detection sensor from camera]
        entity_id: [id of person detection sensor from camera]
        domain: binary_sensor
      - type: turned_on
        platform: device
        device_id: [id of darkness sensor from camera]
        entity_id: [id of darkness sensor from camera]
        domain: binary_sensor
  - service: light.turn_on
    metadata: {}
    data:
      brightness_pct: 100
    target:
      device_id: [id of Lutron Switch]
  - delay:
      hours: 0
      minutes: 3
      seconds: 0
      milliseconds: 0
  - service: light.turn_off
    metadata: {}
    data: {}
    target:
      device_id: [id of Lutron Switch]
description: ''
icon: mdi:lightbulb-on
mode: restart

Related information from the “Step Details” section of “Traces” from the successful run of the script after manually triggering the script (note that there were no entries in this section before manually triggering the script):

Executed: July 24, 2024 at 23:30:20
Result:

wait:
  remaining: null
  trigger:
    id: '0'
    idx: '0'
    alias: null
    platform: device
    entity_id: binary_sensor.driveway_person_detected
    from_state:
      entity_id: binary_sensor.driveway_person_detected
      state: 'off'
      attributes:
        attribution: *******
        icon: mdi:walk
        friendly_name: Driveway Person detected
      last_changed: '2024-07-25T05:25:35.637576+00:00'
      last_reported: '2024-07-25T05:25:35.637780+00:00'
      last_updated: '2024-07-25T05:25:35.637576+00:00'
      context:
        id: [camera id]
        parent_id: null
        user_id: null
    to_state:
      entity_id: binary_sensor.driveway_person_detected
      state: 'on'
      attributes:
        event_id: [camera id]
        event_score: 36
        attribution: ******
        icon: mdi:walk
        friendly_name: Driveway Person detected
      last_changed: '2024-07-25T05:32:34.798146+00:00'
      last_reported: '2024-07-25T05:32:34.798146+00:00'
      last_updated: '2024-07-25T05:32:34.798146+00:00'
      context:
        id: [id]
        parent_id: null
        user_id: null
    for: null
    attribute: null
    description: state of binary_sensor.driveway_person_detected

Current HA info:

  • Core 2024.7.3
  • Supervisor 2024.06.2
  • Operating System 12.3
  • Frontend 20240710.0

As stated above, this is the OVA which is currently running in VirtualBox on an Ubuntu host.

It would be really nice to figure out what is going on here. If scripts and automations are not able to be relied upon after an update or a system reboot, I’m not sure how much trust I can put into automating systems in my home. The unreliability will also dramatically reduce the WAF.

I just wanted to respond that I think that the I haven’t seen the issue in a while, maybe after upgrading, but I’m not 100% sure (the uptime is now 100+ days so I haven’t rebooted in a while). I’m currently running Core 2024.7.2 / Frontend 20240710.0 (this is the container version running on a very low-end Orange Pi One / Armbian). If it happens again, I’ll post an update.