New to the home automation community! I’m trying to set up my first automation but it’s not working unfortunately. What I want is when it’s dark and I arrive home, the light in the hall (Hue) is automatically turned on. When I come home, nothing happens. Here is the YAML:
alias: Light on upon arrival
description: Turns on the light in the hall when I arrive.
trigger:
- platform: zone
entity_id: person.jos_d
zone: zone.home
event: enter
condition:
- condition: state
entity_id: sun.sun
state: below_horizon
- condition: device
type: is_off
device_id: 647d1ab8b39a3c55f22f719c6fc17eb2
entity_id: 94ff322dbc127f161bbb1aab494af707
domain: light
action:
- service: light.turn_on
metadata: {}
data:
rgb_color:
- 255
- 255
- 0
target:
device_id: 647d1ab8b39a3c55f22f719c6fc17eb2
mode: single
Thank you in advance for any support, appreciate it!
Thanks for the help so far guys! I indeed noticed in the automation trace that something is off with my mobile device. It is connected but I just went away to another city and it still shows in the logbook that I’ve been at home for the entire time. Before I left, I tried logging out and back in on my mobile app (was a tip I read somewhere) but that didn’t help. Any clue why HA doesn’t detect my phone leaving the zone?
Do you have nabucasa subscription? If so, open the HA app on your phone, go to settings then to “Companion app”, then go to manage sensors and then check your geolocations to make sure it is enabled.
Also, the geolocation sensor is useful as the entity will show you where the phone has traveled and its present location. For instance, you can set a work zone, once you enter the zone you can have HA trigger something on or off once in the zone. Or flash the lights once your kids enter the school zone. And, if you lose your phone, you can track its location through the desktop HA.