I’m in the New York timezone, GMT - 5 hours. I’m using sunrise and sunset for a trigger to turn lights on and off. The script set for 15 minutes before sunset is going off 5 hours early and the same for the one for 15 minutes after sunrise. The log entries for the lights say, “Turned on at 3:06 PM,” not at 8:06 PM. I think this tells me HA is aware of the proper time zone and is in sync with my time zone.
HA is on a Raspberry Pi, using HAOS. If it were Linux, I’d use ssh and check the time and change it or my timezone within the OS if needed, but I’m not sure how to do that with HAOS. Plus, again, HA knows what time it is. So HA knows the correct time and timezone, but the Sun integration does not.
How can I fix this so the sun integration sees the local time? (Also odd is it seems to be working for my latitude, but not the timezone or longitude, so it gets one right but not the other.)
I wasn’t sure how to get to YAML mode (and didn’t want to deal with a huge configuration file!), but when I had the page open for the visual editor and went to File Editor, it came up to that config file. So here’s what I have:
alias: House Night Lights On
description: Turn on lights in the house for overnight
I set my units to imperial, but the temp is still in Celsius. Also, the time, as I said is correct. (Currently 11:40 AM.) However, note it says the sun rose 11 hours ago. That would be 12:40 AM, and it should be about 5:40 AM. So the system time is correct, but the sun time is off.
I was wrong about local sunrise. Here it was 6:21 AM, but when I check Greenwich, it is 5:28 AM. So it does seem as if it’s using data for the wrong time zone. I know sunrise changes depending on latitude, so I’m not sure which city it’s using for its location, but I’m still thinking it’s stuck in GMT.
Note local time is 13:56. small detail, but just after I restarted, and went to this page, I got a phone call and just got back to it to get a screenshot. When this first came up, it said the sun rose 10 seconds ago, which was less than a minute after I restarted. Before this, it was saying sunrise was between Midnight-1 AM. (I’m going by when I saw scripts execute - both the one set for 15 minutes before sunset and the one set for 15 after sunrise.)
I don’t know the system well, but this change in sunrise time to within a minute after the system restarted makes me think that somehow the Sun integration is using the system start as a reference for time.
We got a problem here. I set it a few days ago, before writing these automations. I made sure I saved it. I almost just replied, “Yeah, set it a few days ago.” But it has me in Amsterdam, just like before I changed it to my house in the US.
I tried changing the location, but all I can do is move the map to where I want. There’s no button to click “Save.” I went through Settings->System->General and it tells me to set it in Zone settings. There’s also an EDIT button there. If I got to Zone or click on EDIT it takes me to the same map and, either way, I can move the map to my location, but there’s nothing to click to save the setting. I moved to my location, exited the page, went back and it was in Amsterdam again.
I found, on this thread, that others are having trouble setting the location. I remember when I first set HA up, I had a serious problem with that as well. (It was in another install.) I’m not sure, but I think I finally had to resort to entering coordinates directly somewhere.
Okay, looks like it’s working. I was trying to move the map around to my house and click on my location or center it. There is nothing to indicate the way to specify location is to move the house icon. From my experience (finding this confusing twice) and from what I saw in that other thread, while this may seem straightforward, it’s not. Also, if you live on another continent, dragging that house icon around is a royal pain. It means zooming out 7-10 times, moving nearer your location, positioning the house roughly, then zooming in and, during the zoom-in process, repositioning the house multiple times to have it available but not directly over where you’re zooming.
I can see why a developer would think that’s a good way to set that, but it’s not clear and there are no prompts to explain it.