#Lights on/off - Arrive/Leave home

1 messages · Page 1 of 1 (latest)

tranquil void
#

Hello. I am fairly new to HA. But I like to think I have a good understanding of how it works…

I have tried to set up a simple automation. When I leave home, then the lights off. When I arrive home, turn the lights on (if between a certain time ie. Dark)

However, neither automation appears to be working….

Attached screenshots.

I used Apple HomeKit to do this and it worked just fine (minus the time parameters)

Is it because my phone needs to be on the same network as HA (on raspberry pi) to actually run the automation?

Just an FYI, I ran the test automation and the lights came on/off. So it’s something to do with my device location. I’ve double checked this and my location is set correctly.

Just a side question, can I not control my devices remotely? From the looks of it, the app will only open when on the same network.

Thanks.

snow crescent
#

if the phone has no way to communicate back to HA when it leaves the network, the zone won't update

#

from your comments, it sounds like you haven't set up any sort of remote access that would allow your phone to communicate with HA when it's away from your home network

acoustic whale
#

Also light toggle is not what you want. You should explicitly set on/off

tranquil void
acoustic whale
#

It's unrelated

#

Do you see your phone entering and leaving home?

tranquil void
# acoustic whale Do you see your phone entering and leaving home?

I’ve just gone onto states and it’s not listed. I would have thought when I arrived home and automatically connect to the network it would be able to trigger the lights to come on. I would also think when the phone disconnects from the network it would be able to trigger the lights to go off. Home kit can do it completely fine, not sure why HA can’t….

snow crescent
#

Like I said, if you don't have remote access from your phone to HA, it cannot update the zone

vast sky
#

You could solve with any of these: 1) remote access to HA (HA cloud or tailscale or …) 2) a router integration where you could add your phone as a device tracker so it knows when you’re on WiFi or not 3) you could use HomeKit to set an input Boolean and automate that to a device tracker

#

HomeKit works because your Apple home device and your phone bounce through apple’s cloud

#

(Also just nitpicking your automation, you can just use zone.home state = 0 and > 0 to watch for all people in the home rather than just watching a specific tracker)

orchid aurora
# tranquil void I’ve just gone onto states and it’s not listed. I would have thought when I arri...

I would either use Apple Home to run the automation or use Apple Home to toggle a switch on Home Assistant so you can put the rest of the automation there. I have something similar and chose to put the automation on Apple Home. I am using a webhook on Home Assistant that I call to read random welcome home messages using Piper on Home assistant. If you plan on continuing to use Apple Home, there's nothing wrong with handling some of the automation there.

#

Using a web hook is another option if you don't want there to be a switch. You can call a web hook from Apple Home to home assistant.

tranquil void
#

Yep. I’ve decided to use Apple home to identify my location, I’m going to use the home kit automation as a trigger if you like within HA