I am having a problem where it seems Home Assistant and Appdaemon are running under UTC time for automations…
Here is a picture of my dashboard
Here is a sample of my Home assistant log, note date and time:
2019-03-27 20:08:17 INFO (Thread-6) [homeassistant.components.device_tracker.netgear] Scanning
2019-03-27 20:08:17 INFO (Thread-6) [pynetgear] Get attached devices
Here is a sample of my appdaemon log, note date and time:
2019-03-27 20:00:34.146034 INFO camera_motion_detect: Back Porch Light - 10, is now off
2019-03-27 20:00:42.202097 INFO hallway_motion: 8
2019-03-27 20:00:42.210822 INFO hallway_motion: 0
I am on a pi 3+ and newly installed hassbian.
My configuration.yaml
time_zone: America/Los_Angeles
I have scoured through previous problems on here but cannot find a solution. Any help would be appreciated. Thanks
Not sure what your question is, but logs are in UTC time indeed and you can’t change this.
Why would you want the logs in a different timezone? What do you use the logs for except to check that everything is working well?
Thank you. Sorry I was not clear. It appears to me that my automations are being triggered in UTC time, not local time. I will wait another day or two to see what actually happens at sunset and update this if there is still a problem.
not that should not be the case. your automation should trigger at your local time.
Since it shows 13:14 for the local hour when UTC is 20:14, it sounds like your config is correct.
Can you share the automation that doesn’t trigger at the right time?
The automation did not trigger last night, so I don’t have any audit trail, per se, but I will give it one more day without tampering with the code to make sure it is still a problem. Thank you for your interest and concern.
if it didn’t trigger at all, it’s more likely something else than a UTC issue I would have thought.
I’m still happy to have a look at your automation if you wish
Here are my automations (I added the “initial_state: true” after reading some previous posts) because I thought that could be my problem, however I had these same automations in a previous build on a pi3 and had no problems…
- id: '1528743227414'
alias: On at sunset
trigger:
- event: sunset
platform: sun
condition: []
action:
- data:
entity_id: switch.ge_14284_outdoor_smart_switch_switch
service: switch.turn_on
- data:
message: Lights are on at Sunset
service: notify.notify
- data:
entity_id: group.outside_courtyard_lights
service: light.turn_on
initial_state: true
- id: '1528743528497'
alias: Off at 9:00 pm
initial_state: true
trigger:
- at: '21:00:00'
platform: time
condition: []
action:
- data:
entity_id: switch.ge_14284_outdoor_smart_switch_switch
service: switch.turn_off
- data:
entity_id: group.outside_courtyard_lights
service: light.turn_off
- data:
entity_id: group.outside_courtyard_lights
service: light.turn_off
- data:
message: lights are off at 9:00 pm
service: notify.notify
I went back and looked at the logs for March 26 and found that the automation turned on at 7:33, which was after the sun had set, so that could be the problem. As you can see from the log entries, I triggered the automation manually quite a few times before that.
(appdaemon) homeassistant@hassbian:/home/pi $ appdaemon -s "2019-03-27 19:16:00"
FATAL: no configuration directory defined and defaults not present
usage: appdaemon [-h] [-c CONFIG] [-p PIDFILE] [-t TICK] [-s STARTTIME]
[-e ENDTIME] [-i INTERVAL]
[-D {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [-v] [-d]
optional arguments:
-h, --help show this help message and exit
-c CONFIG, --config CONFIG
full path to config directory
-p PIDFILE, --pidfile PIDFILE
full path to PID File
-t TICK, --tick TICK time that a tick in the schedular lasts (seconds)
-s STARTTIME, --starttime STARTTIME
start time for scheduler <YYYY-MM-DD HH:MM:SS>
-e ENDTIME, --endtime ENDTIME
end time for scheduler <YYYY-MM-DD HH:MM:SS>
-i INTERVAL, --interval INTERVAL
multiplier for scheduler tick
-D {DEBUG,INFO,WARNING,ERROR,CRITICAL}, --debug {DEBUG,INFO,WARNING,ERROR,CRITICAL}
debug level
-v, --version show program's version number and exit
-d, --daemon run as a background process
What should be a simple task for the unsophisticated turns into a nightmare