I’m new to home assistant and I’m having trouble getting some automations to work. I installed via docker and went through the initial setup. For presence detection, I’m using asuswrt. This is what I have in my configuation.yaml
I see devices listed as home or away correctly, and have added relevant devices to the appropriate persons, which also show home or away correctly.
I set up automations through the gui, and can trigger the actions manually. The following is an example of an automation that doesn’t trigger when my device gets home.
- id: '1576998215828'
alias: Say Hi
description: custom greetings from google home
trigger:
- entity_id: person.me
event: enter
platform: zone
zone: zone.home
condition: []
action:
- data_template:
message: '{{ (''Welcome home. Its good to see you.'', ''Whats shakin-bacon'', ''whats-up... buttercup'' )|random }}'
entity_id: media_player.google_home
service: tts.google_say
In the logbook, I can see people set to away when they leave, and home when they arrive, but there isn’t any reference to the automations. Can anyone point me in the right direction to see why these aren’t working?
That won’t work. your phone will most likely connect to you wifi before you even get to your front door.
Well in my case I haven’t even locked the car or walked to the front door. You need a primary trigger. External motion, front door trigger or both then a condition of a state change presence based on time from not_home to home.
In my case, I notice about a 10 second delay from when my phone connects to when HA reports me as home. I’m hoping this will be enough, but I will figure out how to fine tune the timing, assuming I ever figure out how to trigger the automation in the first place.
So, if I’m understanding this correctly, the automation is triggered when your front door is opened, and the conditions require 300 seconds (milliseconds?) after there is motion at your door and you’re registered as home? I don’t have a front door sensor, so would there be any benefit to using templates over adding something like delay: 00:00:03 to the action?
for:
as is in the example image above that Paulus has
you only need to use a template cause the data you want or need to evalute or render can’t be read directly by HA
assuming your only looking for a state change then you can just use
state as the trigger
entity_id: person.me
from
not_home
to
home
for:
“00:01:00”