Can't make a basic timed automation work

Hello,

First time playing around with the automation tool. I’m trying to turn on a shelly plug S at a specific hour.
Here is the automation created from the GUI :


- id: "1666186557463"
  alias: test plug
  trigger:
    - platform: time
      at: "16:12:00"
  action:
    - type: turn_on
      device_id: ef54789f677045b1bb50ebb769ecdbf0
      entity_id: switch.shellyplug_s_5b0ab1
      domain: switch
  mode: single

but this automation doesn’t work (I’ve reloaded the automation file).

When I use the “run” button, to force the automation to run, it’s working.
But it doesn’t work by itself at the specified time. Which let me think the “action” part is correct, but not the “trigger” part. But I don’t know what’s wrong with the trigger part.

Any tip would be appreciated.

If you set a Time Trigger to trigger at a specific time and it fails to trigger at the scheduled time then it implies Home Assistant’s internal clock might not be synchronized to the actual time.

Go to Settings > System > General and ensure the Timezone is set correctly.

Go to Developer Tools > Template and enter the following template:

{{ now() | as_local }}

Ensure it reports the current date, time, and timezone offset.

Indeed, for some reason, the timezone was not set in the settings. The automation is now working like a charm.

I didn’t think to check the timezone from the GUI, I did check via SSH, and “date” was returning the correct value.

Thank you very much for your fast reply!

1 Like