Problem since automation mode update

Ever since the changes to HA that added the mode switch to automations, I have been having an automation that is failing and I haven’t been able to fix it. I have 2 automations, one that turns on our water heater 4 set times per day and another automation that turns it off after 30 minutes no matter the time. It turns it off after 30 mins even if it was started manually.

Ever since the changes to automations that added the mode differences, my start up timer has been failing for two out of the 4 run times each morning. The automation isn’t even complex. It was generated completely with the visual tool. No hand editing needed. Although there is one goof in the output that I thought may have been the culprit but maybe not. The automation turns my water heater on at 5:10, 6:45, 7:20 and 12:00 (noon). Only the 7:20 and noon ones have been firing ever since the update to HA.

Here is the exerpt of my automations.yaml. Oddly enough when I open and save the automation from configuration/automations/WaterHeater-TurnOnSchedule, the yaml that gets generated does not have single quotes ONLY on the 5:10 time. All the other times have single quotes. I added the single quotes below in an attempt to get it to run, but it still is not. I have also tried SINGLE and RESTART modes. Both fail.

- id: '1574911629511'
  alias: WaterHeater-TurnOnSchedule
  description: ''
  trigger:
  - at: '05:10'
    platform: time
  - at: '6:45'
    platform: time
  - at: '7:20'
    platform: time
  - at: '12:00'
    platform: time
  condition: []
  action:
  - device_id: 04484329265e4e819bb4df990fa0087d
    domain: switch
    entity_id: switch.jasco_products_unknown_type_4f44_id_3032_switch
    type: turn_on
  mode: single

Delete the leading zero from '05:10'

  trigger:
  - at: '5:10'
    platform: time
  - at: '6:45'
    platform: time
  - at: '7:20'
    platform: time
  - at: '12:00'
    platform: time

You can also write it like this:

  trigger:
  - platform: time
    at: 
    - '5:10'
    - '6:45'
    - '7:20'
    - '12:00'

Ok, I’ve tried it a few days with both versions of the changes you suggested… removing the 0 in 05:10 first. No change for a few days. Then tried it moving the times to all one block in your 2nd version. Same thing. It still seems like the schedule completely misses the first two firings of the schedule. What log file can I look in to see if it is the zwave not communicating or if the schedule simply isn’t doing what it’s supposed to do?

Just in case anyone didn’t know. Cold showers in the morning are a hoot. You should try it some time.

Any hints on how I can diagnose why the triggers are no longer firing reliably?

maybe indenting…
I have an automation

    trigger:
    - platform: time
      at:
        - '07:00:00'
        - '07:15:00'
        - '08:00:00'
        - '12:00:00'
        - '12:30:00'
        - '13:30:00'
        - '18:30:00'
        - '19:00:00'
        - '20:00:00'

Works perfectly.

Even though it was built by the system itself? I did not create the yaml and did not modify it until someone suggested removing the 0 on the 5:10 and putting the schedules together. I’ll paste in my entire automations script… because it may actually be the part that shuts it down that is the problem instead of the part that fires it. I’m getting desperate so pasting the whole thing so maybe we can find issue before my wife disowns me for taking cold showers. There are only 2 automations that deal with water heater. The one that turns off ensures that no matter how it starts, it should only run for 30 minutes.

- id: '1574872609329'
  alias: WaterHeater-OffAfter30Mins
  description: ''
  trigger:
  - entity_id: switch.jasco_products_unknown_type_4f44_id_3032_switch
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - delay: 00:30:00
  - device_id: 04484329265e4e819bb4df990fa0087d
    domain: switch
    entity_id: switch.jasco_products_unknown_type_4f44_id_3032_switch
    type: turn_off
  mode: restart
- id: '1574911629511'
  alias: WaterHeater-TurnOnSchedule
  description: ''
  trigger:
  - platform: time
    at:
    - '5:10'
    - '6:45'
    - '7:20'
    - '12:00'
  condition: []
  action:
  - device_id: 04484329265e4e819bb4df990fa0087d
    domain: switch
    entity_id: switch.jasco_products_unknown_type_4f44_id_3032_switch
    type: turn_on
  mode: single
- id: '1574950547846'
  alias: Enviro-HeatOn
  description: ''
  trigger:
  - at: 05:00
    platform: time
  condition:
  - condition: numeric_state
    entity_id: sensor.dark_sky_temperature
    below: 61
  action:
  - service: climate.set_hvac_mode
    data:
      entity_id: climate.thepad
      hvac_mode: heat
- id: '1574951447019'
  alias: Enviro-CoolOn
  description: ''
  trigger:
  - at: '21:30'
    platform: time
  condition:
  - above: '40'
    condition: numeric_state
    entity_id: sensor.dark_sky_temperature
  action:
  - data:
      entity_id: climate.thepad
      hvac_mode: cool
    service: climate.set_hvac_mode
- id: '1574954574863'
  alias: Enviro-UpperLimit
  description: ''
  trigger:
  - above: '72'
    entity_id: sensor.indoor_temp_at_therm
    platform: numeric_state
  condition:
  - condition: state
    entity_id: climate.thepad
    state: heat
  - condition: or
    conditions:
    - condition: state
      entity_id: climate.thepad
      state: 'off'
  action:
  - condition: state
    entity_id: climate.thepad
    state: cool
- id: '1574954670306'
  alias: Enviro-LowerLimit
  description: ''
  trigger:
  - below: '60'
    entity_id: sensor.indoor_temp_at_therm
    platform: numeric_state
  condition:
  - condition: state
    entity_id: climate.thepad
    state: cool
  - condition: or
    conditions:
    - condition: state
      entity_id: climate.thepad
      state: 'off'
  action:
  - condition: state
    entity_id: climate.thepad
    state: heat
- id: '1575050299039'
  alias: Outlet-Node3-TurtleOn
  description: ''
  trigger:
  - at: 07:00
    platform: time
  condition: []
  action:
  - device_id: de2f89e1d6964e89835cb52e650f2dff
    domain: switch
    entity_id: switch.swturtleaquarium_switch
    type: turn_on
- id: '1575050391055'
  alias: Outlet-Node3-TurtleOff
  description: ''
  trigger:
  - at: '18:30'
    platform: time
  condition: []
  action:
  - device_id: de2f89e1d6964e89835cb52e650f2dff
    domain: switch
    entity_id: switch.swturtleaquarium_switch
    type: turn_off
- id: '1575238764144'
  alias: Light-PoolTable-MotionOn
  description: ''
  trigger:
  - device_id: 951bd5768a1a4f26985c34bdfe681df8
    domain: binary_sensor
    entity_id: binary_sensor.zooz_zse18_motion_sensor_sensor
    platform: device
    type: turned_on
  condition:
  - condition: device
    device_id: 1c2d58d16dc549468555b1c287f94649
    domain: switch
    entity_id: switch.inovelli_unknown_type_ff00_id_ff01_switch
    type: is_off
  - below: 10
    condition: device
    device_id: e239105c0c0b4ab3bffe641afed69ae1
    domain: sensor
    entity_id: sensor.devmotionkitchen_luminance
    type: is_value
  action:
  - device_id: 1c2d58d16dc549468555b1c287f94649
    domain: switch
    entity_id: switch.inovelli_unknown_type_ff00_id_ff01_switch
    type: turn_on
  - alias: ''
    data:
      entity_id: input_boolean.pooltable_manual
    service: input_boolean.turn_on
- id: '1575338269366'
  alias: test2
  description: ''
  trigger:
  - device_id: 4cf4d1c8424346eb8ccd2919f5c38234
    domain: binary_sensor
    entity_id: binary_sensor.zooz_zse18_motion_sensor_sensor
    for:
      hours: 0
      minutes: 0
      seconds: 2
    platform: device
    type: turned_on
  condition: []
  action:
  - device_id: 5d979156e79845a6a372a5374bb13d14
    domain: switch
    entity_id: switch.aeon_labs_zw096_smart_switch_6_switch
    type: turn_on
- id: '1575609534598'
  alias: Light-PoolTable-MotionOffAfter5
  description: ''
  trigger:
  - device_id: 951bd5768a1a4f26985c34bdfe681df8
    domain: binary_sensor
    entity_id: binary_sensor.zooz_zse18_motion_sensor_sensor
    for:
      hours: 0
      minutes: 5
      seconds: 0
    platform: device
    type: turned_off
  condition:
  - condition: device
    device_id: 1c2d58d16dc549468555b1c287f94649
    domain: switch
    entity_id: switch.inovelli_unknown_type_ff00_id_ff01_switch
    type: is_on
  - condition: state
    entity_id: input_boolean.pooltable_manual
    state: 'on'
  action:
  - data:
      entity_id: input_boolean.pooltable_manual
    service: input_boolean.turn_off
  - device_id: 1c2d58d16dc549468555b1c287f94649
    domain: switch
    entity_id: switch.inovelli_unknown_type_ff00_id_ff01_switch
    type: turn_off
- id: '1575662749544'
  alias: Test Notify
  description: ''
  trigger:
  - device_id: e239105c0c0b4ab3bffe641afed69ae1
    domain: binary_sensor
    entity_id: binary_sensor.devicemotionkitchen_sensor
    platform: device
    type: turned_on
  condition: []
  action:
  - data:
      message: Motion in Kitchen
      title: Motion in Kitchen
    service: persistent_notification.create
- id: '1575758271863'
  alias: Light-OutdoorGarageTrigger
  description: ''
  trigger:
  - above: '4'
    entity_id: sensor.homeseer_technologies_hs_fls100_floodlight_sensor_burglar
    platform: numeric_state
  condition:
  - below: '50'
    condition: numeric_state
    entity_id: sensor.homeseer_technologies_hs_fls100_floodlight_sensor_luminance
  action:
  - device_id: 9359d56540114fd3ab0a93d85daf5a89
    domain: switch
    entity_id: switch.homeseer_technologies_hs_fls100_floodlight_sensor_switch
    type: turn_on
  - device_id: b51fb2feddd540dfbdcffcebd4528d75
    domain: switch
    entity_id: switch.inovelli_unknown_type_ff00_id_ff01_switch_2
    type: turn_on
- id: '1575851346360'
  alias: Light-KitchenMotionOn
  description: ''
  trigger:
  - device_id: e239105c0c0b4ab3bffe641afed69ae1
    domain: binary_sensor
    entity_id: binary_sensor.devmotionkitchen_sensor
    platform: device
    type: turned_on
  condition:
  - condition: device
    device_id: 559f5b34484a49c78f7372a147adc3ce
    domain: switch
    entity_id: switch.aeon_labs_zw132_dual_nano_switch_switch_2
    type: is_off
  action:
  - device_id: 559f5b34484a49c78f7372a147adc3ce
    domain: switch
    entity_id: switch.aeon_labs_zw132_dual_nano_switch_switch_2
    type: turn_on
- id: '1575851383131'
  alias: Light-KitchenOffAfter10
  description: ''
  trigger:
  - device_id: e239105c0c0b4ab3bffe641afed69ae1
    domain: binary_sensor
    entity_id: binary_sensor.devmotionkitchen_sensor
    for:
      hours: 0
      minutes: 5
      seconds: 0
    platform: device
    type: turned_off
  condition: []
  action:
  - device_id: 559f5b34484a49c78f7372a147adc3ce
    domain: switch
    entity_id: switch.aeon_labs_zw132_dual_nano_switch_switch_2
    type: turn_off
- id: '1575852169310'
  alias: Light-MotionOutdoorGarageOffAfter5
  description: ''
  trigger:
  - below: '4'
    entity_id: sensor.homeseer_technologies_hs_fls100_floodlight_sensor_burglar
    for: 00:05:00
    platform: numeric_state
  condition: []
  action:
  - device_id: 9359d56540114fd3ab0a93d85daf5a89
    domain: switch
    entity_id: switch.homeseer_technologies_hs_fls100_floodlight_sensor_switch
    type: turn_off
  - device_id: b51fb2feddd540dfbdcffcebd4528d75
    domain: switch
    entity_id: switch.inovelli_unknown_type_ff00_id_ff01_switch_2
    type: turn_off
- id: '1588720466870'
  alias: MonAutomations
  description: ''
  trigger:
  - entity_id: automation.light_pooltable_motionoffafter5
    for: 02:00:00
    from: 'on'
    platform: state
    to: 'off'
  - entity_id: automation.light_pooltable_motionon
    for: 02:00:00
    from: 'on'
    platform: state
    to: 'off'
  - at: '21:45:00'
    platform: time
  condition: []
  action:
  - data: {}
    entity_id: automation.light_pooltable_motionoffafter5
    service: automation.turn_on
  - data: {}
    entity_id: automation.light_pooltable_motionon
    service: automation.turn_on
  - device_id: 1c2d58d16dc549468555b1c287f94649
    domain: switch
    entity_id: switch.inovelli_unknown_type_ff00_id_ff01_switch
    type: turn_off
- id: '1588720979017'
  alias: ChargeBatteries
  description: ''
  trigger:
  - at: '21:00'
    platform: time
  - at: '23:59'
    platform: time
  condition: []
  action:
  - device_id: 988a511ba36d42dc84d79115f38fcc0f
    domain: switch
    entity_id: switch.zooz_zen25_s2_double_plug_switch_4
    type: toggle
- id: '1588721175141'
  alias: ChargeBatteries-Off
  description: ''
  trigger:
  - at: '20:00'
    platform: time
  condition: []
  action:
  - device_id: 988a511ba36d42dc84d79115f38fcc0f
    domain: switch
    entity_id: switch.zooz_zen25_s2_double_plug_switch_4
    type: turn_off

OMG…
Have you checked the logbook to see if the automation is even being triggered? Maybe one of the other ones is killing it.
In my Lovelace I show last_triggered on an entities card for some of my automations if I want to see when it was last_triggered. Maybe try that.
Seems like nothing is wrong with your time triggers to me and the leading ‘0’ isn’t an issue.

History shows it being triggered. MOST of the time, only the 7:30 and noon one trigger though. The other 2 rarely trigger. This automation worked perfectly before the addition of the other types of automation restart stuff they did. It started acting wonky with that release.

makes no sense.
did you try adding the extra space in the times like my example?

Which space do you mean?

my times are indented 2 extra spaces to yours.

I’ll try it and let you know in a day or two! If I’m alive heheh.

1 Like

Ok… first attempt yielded safe mode. I copied and pasted (including spaces) directly from what you posted starting with trigger and replaced mine from trigger down and then just edited the times. That yielded a safe mode on reboot. So I had to tweak your spacing just a touch or it wouldnt validate or boot on my system. Here is what I wound up with.

But now I am back to it partially working. Today it only fired at noon.

  trigger:
   - platform: time
     at:
      - '05:10:00'
      - '06:45:00'
      - '07:20:00'
      - '12:00:00'

Are you not checking the configuration (Configuration > Server Controls > Check Configuration) before you run Reload Automations?


I’m intrigued by the fact that something so simple as Time Trigger is causing so much trouble. :thinking:

I just tested this and it works perfectly:

- alias: Example 1
  trigger:
    platform: time
    at:
      - '15:52:00'
      - '15:54:00'
      - '15:56:00'
  action:
    service: persistent_notification.create
    data:
      title: "{{ now().timestamp()|timestamp_local() }}"
      message: "{{ trigger.now }}"

Adjust the scheduled times, save it, run Check Configuration. It should pass. If it fails, there may be something wrong with where or how you are storing automations.

I also am intrigued by this. Especially since it was working before the Home assistant upgrade that added the new automation modes. Yesterday I completely deleted the automation in question and re-added it 100% using the wizard, except I used the “edit as YAML” option for the trigger times. Screenshot is here.

This morning already at least two of the times have failed to fire off. The little blip on the graph is me rebooting the server between when two of these events should have fired.

When the original automation was “yielding safe mode”, did you run Check Configuration prior to executing Reload Automations?

Also, is there anything reported in Logs?