This is Blueprint will monitor a person or persons, and when they ‘enter’ or ‘leave’ the zone or zones you pick, it will trigger an action for both enter and leave phases. Yes, it will watch multiple people and multiple zones at the same time!
- 2023-08-07: Updates for Home Assistant 2023.8
- Selector syntax change
- Condition Selector addition (where applicable)
- MQTT Discovery name changes (where applicable)
- Clean-up code formatting
- 2023-05-11: Fix for some devices that think home is spelled Home. (IOS I think…)
- Fix Typo’s in header and title. May affect your calling Automation (M not H)
- 2023-03-01.1: Minor adjustments to sample script files for smoother operation
- 2023-03-01: First release!
Type of blueprint: AUTOMATION
What if I am having problems getting it going?
You can contact me for help, see the links below.
Why do I need this?
I use this BluePrint to follow family members around during their day so that the family members at home know where their loved ones are. I used this to eliminate over 2 dozen separate Automations and Scripts in my Home set-up. The multiple person/multiple zone watch ability is the key.
The monitored areas need to be set up as zones in Home Assistant. SEE:
The person needs LAT/LOG software running to report their location. I use Life360, but the Home Assistant App running on their phone will also work. There are likely other location monitoring methods but I am not acquainted with any of them. SEE:
- LAT/LOG software running to report person GPS location
- The Person Integration has to have people set-up in Home Assistant
- Zones set-up in Home Assistant to monitor
people2monitor/name: Person or People to follow Select the Person you want this BP to trigger on for this action. Multiples are allowed. zone2monitor/name: Zone to watch Select the Zone you want this BP to trigger on when this person enters or leaves it. Multiples are allowed. hold_period/name: Hold Period Sometimes devices want to disconnect and connect often. Home Assistant deals with this using a considered-on or considered-off time. This is the same thing. enter_action/name: Enter the Zone Action Build the action here that you want to happen when they enter this zone. Samples and examples below. leave_action/name: Leave the Zone Action Build the action here that you want to happen when they leave this zone. Samples and examples below. jump_action/name: Jump known zone to known zone Action Build the action here that you want to happen when both the zone they left and the zone they entered is known, but not the same zone. enable_time/name: Time of day to begin action(s) Set this for the time of day you want to allow action(s) to begin. disable_time/name: Time of day to end action(s) Set this for the time of day you want action(s) to end. weekday/name: Day of the week to allow action(s) Change options if you want to include or exclude any specific day. additional_conditions: Extra conditions you may want to add to this automation (Example: Home occupied, TV on, etc)
For further information, reference these links.
I have created a sample script as one possible example of how to do this. I grabs values from the Automation itself and generates a Persistent Notification that the trigger person entered or left the triggered zone. The notification is set to clear itself. You can use this as-is or use it to help you write the exact action you want to take when the Automation calls for it.
Sample file here: Sample file containing Persistent Notification sample code
For this to work you will need Persistent Notification Integration. You must have this integration enabled on your system to run the automation, since the these notifications are generated by this integration. This should be activated in your HA Instance by default, so unless you tweaked the default configuration, you’re good to go.
I have created a sample script as one possible example of how to do this. I grabs values from the Automation itself and generates a TTS message that the trigger person entered or left the triggered zone. It will also play an MP3 file that you provide to make the announcement more fun. You can use this as-is or use it to help you write the exact action you want to take when the Automation calls for it.
Sample file here: Sample file containing cloud_say & media_player sample code
Here is a link to the free sound file I used, but PLEASE download it to your local system and play it from there, don’t try to run it live from my Github. That just isn’t going to work properly and that’s not the kind of bandwidth usage I signed up for.
For this to work you can use the provided Home Assistant integration(s) or install another TTS Integration. There are many available.
If you are troubleshooting and you want to see more traces back when doing so, here is a TIP I’ve found.
Manually edit the automation created with the ui editor (or manually with a text editor) and add the following to have this automation contain 10 traces instead of the normal 5. Then if the automation is triggering often, you can see the last 10 traces to help you decide what the issue is.
HA Docs on this here.
trace: stored_traces: 10
Updates will be published on my GIT repository with the rest of my Home Assistant Blueprint collection.
There is not an official version control system for Blueprints. However I have found something that comes pretty close. It is not perfect, but for MOST Blueprints, it does just fine. I encourage you to check this script out and use it to easily check if I have updated this blueprint. koter84 Blueprint Update Script
Direct link to download Blueprint:
What are we Fixing Today Homepage / Website: https://www.WhatAreWeFixing.Today/
Channel Link URL: (WhatAreWeFixingToday) https://bit.ly/WhatAreWeFixingTodaysYT
Discord Guild: (Sir_Goodenough#9683) WhatAreWeFixingToday?
Buy me Coffee: Sir GoodEnough
PayPal one-off donation link: PayPal.Me