I’m wondering what’s the best practice to solve my problem.
Basically I would like all sort of automation to triggers when I arrive home or when I leave home or when I’m out of home at 10pm etc.
Ideally I see myself having two different “states” at my home, ether “no one is home” or “someone is home”. I can see those states automatically change with location of cellphones or something.
But since my “home” is not an entity with states I’m wondering how I should advance.
Can I somehow create an artificial entity with those states, or should I create a binary sensor. I have tried to find articles. Could someone as well recommend some reading material how to understand the basics of programming these automation, all i seem to find are short videos that eather set-up home assistant or solve some very specific problem
Here’s what I’m doing in Node red for my two person household. I created one input boolean ‘Nobody is home’ to keep track of an empty house. as an individual moves into or out of the home zone, objects related to them are turned on or off. if the house is empty then everything gets turned off.
why not check the state of zone.home (or whatever you called your home). It should be the number of people in your home - as long as 1) they are running the companion app, or 2) you are monitoring their presence using your router and their phones mac addresses (using the router integration).
This won’t work for guests whose mac addresses you don’t have recorded, but usually you are dealing with people you know when checking presence in your home. My wife and I both run the companion app, sometime when we are away our children might drop by. Using the router integration, their phones mac addresses are included in their people profile - so as soon as their phones connect to my wifi, HA knows they are home and increments zone.home.