This probably seems like something that should be very easy but for some reason I can’t figure it out. I’ve been trying to automatically turn on the lights when coming home but so far nothing I’ve tried worked and hoped someone here could help me.
A Home Assistant docker container runs on my server which is always on and uses swag for a reverse proxy which works as I can control things without wifi. My phone has the app and I’ve enabled location sensors (not high accuracy mode), geolocation is enabled as well but the state is unknown, don’t know why, it’s a OnePlus 7t pro phone, the entity for this is HD1913. Also have an Asus router integration, which shows my phone entity as OnePlus-7TPro. Added both these entities to “track device” under people/me. And I’ve set the zone for home to 250 meters in the configuration.yaml. The map in the Home Assistant app correctly shows where I’m at when not home.
Here are screenshots of the automations I use, tried it multiple ways in the hope one would work: Imgur: The magic of the Internet
They all work when triggering them manually but they’ve never worked automatically. The logbook for these entities does seem to know when I come home… If anyone has any idea of what could be going wrong that would be great and very helpful.
Once I’ve removed the sun part when coming home during the day and then they did work, I was however using my GPS as well. I think perhaps this happens because my phone goes to sleep and then doesn’t update my location in Home Assistant, however then it is strange that the logbook does show me coming home correctly.
For example this weekend I came home from a concert and told Google Home to turn on my living room lights at 4:45 (meaning I was already in my house at this point). The HA logbook entity for my phone, HD1913, shows me coming home at 4:42 and 56 seconds, so it would have a good two minutes to turn on my lights but it didn’t. My OnePlus-7TPro entity does however show me coming home at 4:47 which makes sense as it uses wifi.
Just now looked at debug automation and it says this:
So it seems the sun part is failing for some reason, sunrise was at 5:30 that day according to the logbook.
Any help on getting this to work would be greatly appreciated.