Automations Turned Off

Is there a way of ensuring that automations stay on all the time, my automations shut down all at once at 4:07AM, and never came back up again, I suspect there was internet unavailability because everything else was also unavailable from that time.

I use the following in Automations.yaml

 #energy meter automation

  - alias: 'EnergyMeter_on'
    trigger:
     platform: time
     minutes: 6
    action:
     - service: switch.turn_on
       entity_id: switch.EnergyMeter
  - alias: 'EnergyMeter_off'
    trigger:
     platform: time
     minutes: 5
    action:
     - service: switch.turn_off
       entity_id: switch.EnergyMeter
  - alias: 'EnergyMeter_on2'
    trigger:
     platform: time
     minutes: 35
    action:
     - service: switch.turn_on
       entity_id: switch.EnergyMeter
  - alias: 'EnergyMeter_off2'
    trigger:
     platform: time
     minutes: 34
    action:
     - service: switch.turn_off
       entity_id: switch.EnergyMeter

       #tsakibedswitch automation
  - alias: 'tsakibed_on'
    trigger:
     platform: time
     at: '17:00:00'
    action:
     - service: switch.turn_on
       entity_id: switch.Tsakibed
  - alias: 'tsakibed_off'
    trigger:
     platform: time
     at: '23:30:00'
    action:
     - service: switch.turn_off
       entity_id: switch.Tsakibed
  - alias: 'tsakibed_on2'
    trigger:
     platform: time
     at: '05:00:00'
    action:
     - service: switch.turn_on
       entity_id: switch.Tsakibed
  - alias: 'tsakibed_off2'
    trigger:
     platform: time
     at: '07:00:00'
    action:
     - service: switch.turn_off
       entity_id: switch.Tsakibed

Not sure why automation would switch off when there is not internet, maybe your system rebooted? You could set initial_state to make sure they are running.

1 Like

I put this under homeassistant: in my configuration.yaml:

  customize_domain:
    automation:
      initial_state: 'on'
1 Like

Sorted with initial state, thank you

I have this problem too occasionally. Usually my automations stay on after a restart, but occasionally a day starts and no automations are running, looks like they all got switched off somehow.

Surely initial_state: 'on' shouldn’t be necessary here? Unless default behaviour is all automations switch “off” after every restart?

Same problem here today (after a reboot)… All my automations off (HA 0.90.1)…

Same here… when I start HA now my automations are all off, this was never the case before… started after a reboot… tried turning them on and they magically turn back off.

I have the same issue…

Sometimes, all automations turn off.
I noticed it today and can show these 2 logs that happened at the same time the automations turned off:

1st

## Log Details (WARNING)

Fri May 17 2019 13:45:50 GMT+0200 (Midden-Europese zomertijd)

Ended unfinished session (id=6 from 2019-05-17 11:43:42.360833)

2nd

Log Details (ERROR)
Fri May 17 2019 13:45:55 GMT+0200 (Midden-Europese zomertijd)
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 215, in async_update_ha_state
    "No entity id specified for entity {}".format(self.name))
homeassistant.exceptions.NoEntitySpecifiedError: No entity id specified for entity i5

This is what is causing it.

You are restarting before HA is fully loaded.

Using initial_state will prevent this from happening.

Oh, I set the initial_state now.

Is there a way to check what caused the reboot?
I am running hass in a docker container on a rpi with rasbian lite.