#Time conditions are in UTC

33 messages · Page 1 of 1 (latest)

livid condor
#

I created an automation that has a time condition many months ago, and it was working great. However, now I notice it's not triggering, because somewhere along the way, the time condition changed to UTC. If I go Settings, my time zone is set correctly. If I go to the Template developer tool and put in {{ now() }}, the output is correct and in my timezone.

Here's the yaml:

alias: Activate Morning Scene
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.second_floor_motion
    to: "on"
condition:
  - condition: time
    before: "07:30:00"
    after: "04:00:00"
    weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
  - condition: state
    entity_id: input_boolean.allow_morning_automation
    state: "on"
action:
  - data: {}
    action: script.morning_scene
  - data: {}
    target:
      entity_id: input_boolean.allow_morning_automation
    action: input_boolean.turn_off
mode: single

Is there any way to tell my condition to use my correct timezone? Thanks!

buoyant lintel
#

How did you verify the automation is using UTC time?

dense dragon
#

Time triggers and conditions are in whatever timezone HA is set to

livid condor
#

i've looked at the Trace, and the trace is absolutely showing UTC time. I got up at 6:30am, but the time in the trace was utc. My settings page shows pacific

#

Settings -> General shows pacific. I just clicked update again, but it hasn't changed in years

buoyant lintel
#

Huh, that’s weird. How are you running HA? HAOS? Container? Something else?

sullen bison
#

share the trace

livid condor
dense dragon
#

Why not set the container timezone to local time then?

livid condor
#

trying to load this morning's trace now

livid condor
dense dragon
#
    volumes:
...
      - /usr/share/zoneinfo/Europe/London:/etc/localtime:ro
#

That's mine

livid condor
#

as soon as this trace loads and i can see the behavior is the same, i'll change the container timezone

#

this is my trace timeline from this morning. Note that is ~5:00am Pacific

#

or 5:44am i guess

#

er, wait. actually. that's the wrong trace i think

#

okay, let me go trigger that sensor now and THEN see what the trace looks like

#

alright, maybe i was misreading or maybe something changed, or maybe i'm a dumbass. but the trace just now looks good, with the correct timezone

long oxide
#

FYI, traces show the raw times, so they will always be in UTC

#

@livid condor ^

#

The ui will show your local times, not in utc

livid condor
#

oh dammit

#

wait

#

oh a side note, i have no idea why loading traces is so slow for me now

#

ok, so the UI which shows the trace, like i pasted above, appears to be local time. and that local time appears to be correct

long oxide
#

Yep, if you view from the UI, local. View from raw trace (text file) it will be utc

livid condor
#

aha, that's what i didn't know about. didn't know there's a raw trace file somewhere. good to know

long oxide
#

3 dots, download trace

livid condor
#

for now, this automation appears to be working correctly. if it doesn't do the right thing in the morning, i'll look at stuff then

dense dragon
#

It's 08:11 on the wall clock

long oxide