#Time zone bug with automations?

1 messages · Page 1 of 1 (latest)

marsh citrus
#

TL;DR
Automation supposed to be triggered 00:00 (midnight) actually triggers 02:00 (two hours past midnight).

Description
I have set up an automation in the Home Assistant frontend to turn my lights off at midnight:

#

The automation looks like this in the /var/lib/automations.yaml file:

- id: [REDACTED]
  alias: Midnight auto OFF
  description: ''
  triggers:
  - trigger: time
    at: 00:00:00
  conditions: []
  actions:
  - type: turn_off
    device_id: [REDACTED]
    entity_id: [REDACTED]
    domain: light
    metadata:
      secondary: false
  mode: single

However, the automation is actually triggered two hours past midnight. At first I thought that my time zone settings were faulty, so I checked a few steps:

1) I made sure my time zone settings in the OS were correct by running `timedatectl` to check both time and time zone. It is showing the *correct* time.
```
               Local time: Sun 2025-05-18 12:28:22 CEST
       Universal time: Sun 2025-05-18 10:28:22 UTC
             RTC time: Sun 2025-05-18 10:28:22
            Time zone: Europe/Stockholm (CEST, +0200)
System clock synchronized: yes
          NTP service: active
      RTC in local TZ: no

```
2) I made sure the time zone settings in Home Assistant were correct. According to the frontend the settings correspond to my *correct* time zone and time:
#

The logs for the triggering of the automation inside the Home Assistant frontend actually logs the event at the correct real-world time:

#

Setup
Hardware: Raspberry Pi 5 16GB
Home Assistant Core: 2025.5.1
Home Assistant Frontend: 20250509.0
OS: EndeavourOS (headless, up to date as per 2025-05-18)

Question
Could this be a bug, or have I mis-configured something? If it is the latter, anyone have an idea where to look?

severe plaza
#

The image of the settings shows the problem. The server is set to Atlantic/Rekjavik time. That’s the time zone all the automations will use.

#

That dialog is used to select the time zone for your browser to use, which is useful when you are traveling and want to choose between your home’s time zone or the time zone you are currently in

marsh citrus
#

@severe plaza Thank you for the response! So, just to confirm; The setting in the frontend only affects the frontend, not the Home Assistant core? That is interesting. Why is the frontend reporting the server time zone as Atlantic/Reykjavik when running timedatectl from the Linux terminal tells me the server is Europe/Stockholm? Some inconsistent setting somewhere?

severe plaza
#

In HA go to Settings > System > General

#

That is where you set HA’s time zone

marsh citrus
#

@severe plaza Amazing! Thanks! That was the issue! However, I am a bit confused as to why HA does not select my local time zone as per the OS by default? It seems to do that for the frontend, but not the core.

severe plaza
#

It will select your location during setup/onboarding via IP address geolocation. After onboarding I don’t think it is ever changed again, though I’m not 100% certain on that

marsh citrus
#

Ah, that makes sense. I remember it set my location way out in the bushes during setup for some reason.

severe plaza
#

Yep that would have done it