Trying to create my first automation which is a notification to tell me if my wife leaves home for example. Both her phone and my phone have the hass.io app installed and the service notify.mobile_app_xxx appears in the call service drop down.
I started the automation building by clicking on my device and choosing one of the p
default options to start building the automation
So I was being silly. Two days of fighting before I gave up and then created a Hass.IO forum account and 2 minutes later , I solve it.
The default automation that is created, includes a trigger. Being a newbie, I didn’t know I had to delete it. Messing around with looking at the automation as YAML deleted the trigger and then the automation was saved.
Bear in mind that if you’ve deleted the trigger, your automation will never run. You may want to remove your condition instead, and create a trigger to run the automation when your wife’s phone’s device state changes from home to not home.
Using state, you want to check for a change from “home” to “away”, like this:
platform: state
entity_id: device_tracker.lgus997
from: home
to: away
You can find these states by looking in Developer Tools -> States, which will show the current state for each entity, and you can see historical states in the Logbook.