[Solved] Automation is not triggered by time

Hello,

I have this simple automation

- id: '1700081566928'
  alias: Stern aus
  description: ''
  trigger:
  - platform: time
    at: 07:15:00
  - platform: time
    at: '23:00:00'
  condition: []
  action:
  - service: switch.turn_off
    data: {}
    target:
      entity_id: switch.steckdose_flur_eg_2
  mode: single

It is configured via GUI and it is shown properly in GUI.
Also, it is loaded according to the log (set to debug for automations)

2023-11-16 17:13:29.309 INFO (MainThread) [homeassistant.components.automation.stern_an] Initialized trigger Stern An
2023-11-16 17:12:02.340 DEBUG (MainThread) [homeassistant.components.automation.stern_an] Loaded automation automation.stern_an with state True from state storage last state <state automation.stern_an=on; id=1700150284308, last_triggered=None, mode=single, current=0, friendly_name=Stern An @ 2023-11-16T17:05:46.411777+01:00>

When I trigger it manually, it works. But it is not triggered at the time.
I have checked the timezone and at least the times from the log are my local TZ.

What could be my mistake?

Greetings,
Hendrik

Hello,

the same automation does trigger, when I use a state trigger. So, I have isolated the issue to be related to the time-trigger.

Any Idea?

Greetings,
Hendrik

First, please format your YAML properly for the forum so it can be debugged, see item 11 in this post:

https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371/3

At first glance it looks right but until it’s shown between triple ticks it’s hard to know if the YAML is problematic

For example, here’s a random one of mine:

alias: "Schedule: 9:00pm Set Temperature"
description: ""
trigger:
  - platform: time
    at: "21:00:00"
condition: []
action:
  - service: climate.set_temperature
    data:
      temperature: 60
      target:
        entity_id: climate.honeywell_thermostat
mode: single

The thing I see in yours is single quotes for the time but let’s see what your actual YAML looks like after formatting. Also debug by setting it a few minutes ahead of now and see what the trace says in the automation.

1 Like

Hello,

thanks for your reply. I have edited my initial post. Thanks for the pointer.

I see that I had no quotes around the first time.
But I got no error message on this.

However, I see now in the logs, that it has been working for a while now - without me changing anything. I am not sure what helped…

Greetings,
Hendrik