This Blueprint monitors device_tracker entities that you choose & notifies you if they go offline. Then it gives you the opportunity to devise an action to deal with it. It started as a pfSense centered project but any device_tracker that has a state of home when it is running and something else when it is not available will work with this.
Changelog
- 2023-03-01: Add Author Tag. Bump HA required Version to 2023-3-0
- 2022-02-12: Added 4 levels of optional delay to make this useful for firing restarts.
-
- Redid the Instruction file to new format.
-
- Added sample code
to turn this into an entity restart machine.
- Added sample code
-
- This update will work with an automation created with the last version.
- 2022-12-12: Add Update Method Note, minor code change.
-
- Name of Blueprint may have changed meaing you have to re-download with a new link.
-
- If name changed, it is similar. Variables have not changed.
-
2022-12-10:
First Released Version.
About this blueprint
Type of blueprint: AUTOMATION
Why do I need this?
In it’s simplest form, this blueprint will monitor an entity and put up a persistent notification that the entity is no longer home.
This is intended to be used with pfSense HACS Integration: GitHub - travisghansen/hass-pfsense: pfSense integration with Home Assistant. However it could be used with any device tracker that reports
home
when the device is up and something else when it isn’t.It will create a persistent notification when triggered. Triggers / notifications can be enabled for a time period each day and/or for specific days of the week. There is also the ability to roll 4 levels of your own specific notification or other action as action statements. These are optional and default to doing nothing when you start.
I use this blueprint to drive a restart automation to make sure my MOCA adapters that feed my garage stay connected. They are a bit finicky. That code is included here for you to use or work from if you like.
I also found that Home Assistant has created a blueprint to send actionable persistent notifications to your phone, so I reference that here to be helpful if you are looking for that. If you want to send these notifications to a mobile device, i suggest you look at Home Assistant Actionable Notification Script Blueprint. to use in conjunction with my blueprint.
Configuration
Requirements
Standard Home Assistant setup version 2022.11.0 or better.
Persistent Notification Integration Required
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.
Persistent Notification Integration Docs
Input fields
trackees:/name: Devices to Track ✯ REQUIRED ✯
This is the entity you want to monitor. Multiples are allowed.
gone_for:/name: Time delay before reporting outage 1st time
and
alt_notify:/name: Manual Notifications Level 1
There are levels 1 > 4 of these inputs and are set inert at the
start. They are used for you to add your own actions at times that
you pick after the flip from status ```home```. They are intended
to have increasing time delays as you use level 1, then level 2,
etc, as the default times suggest.
Left as-is they will have no visible action.
notification_id:/name: Optional Notification ID
See instructions explaining this. It is not required & is blank
in most use cases.
skip_p_notifcation:/name: Choose to send persistent notification (or not)
If you don't want the notifications at all, here you can turn them off.
notify_enable_time:\name: Time of day to begin notifications
Set this for the time of day you want to allow notifications to begin.
Leave as is to always be enabled.
notify_disable_time:/name: Time of day to end notifications
Set this for the time of day you want notificatons to end.
Leave as is to always be enabled.
weekday:/name: Day of the week to allow notifications
Change options if you want to include or exclude any specific day.
All days are selected by default.
Installation example
Once you have the entities created or decided upon you can build the Automation. To build the automation:
- Click on ‘Create Automation’
and ‘Use Blueprint’
- Add a Description so you can tell what this one is for
- Use the Drop-downs to select the Entities for the listed purposes.
- Set the time-frame that the automation will be active. Default is always on.
- Select the device you want to monitor.
- Write the yaml scripting to perform your own actions, or just use the persistent notification that’s already written for you.
Version Updates
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
Please Click the
at the end of this top Post if you find this Useful
Software to Download
HA link to download blueprint:
Direct link to download Blueprint: https://github.com/SirGoodenough/HA_Blueprints/blob/master/Automations/Device_tracker_Monitor_and_Notifier.yaml
Example from my Configuration to use this as a Restart Tool
I use thie blueprint to keep the 2 MOCA adapters feeding my garage connected. Here is a file with a static sample of this code:
Sample Code for entity restart
You can also find this in a live version on my [Home Assistant Config repo]
(GitHub - SirGoodenough/Home-Assistant-Config: My HA Configuration... This is what I run for production in my house.) if you want to browse for other nuggets.
Helpful HINTS for alternate set-ups
Here are some of the variables you might want if writing you’re own notification thru notify, pushbullet, texting, notify, telegram, or whatever:
Name of the triggered entity:
{{ states[trigger.to_state.entity_id].name }}
State of the triggered entity:
{{ states[trigger.to_state.entity_id].state }}
Friendy_name of the triggered entity:
{{ states[trigger.to_state.entity_id].friendly_name }}
Others are available if you look at the persistent_notification because it shows you all that are available from that sensor:
![]()
Troubleshooting tip
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.
alias: aaaaaaa office Fan Test
description: 'See how to increase the number of Traces available''
trace:
stored_traces: 10
use_blueprint:
.....
All My Blueprints
Here is a list of each of my blueprints, a quick description and jump links to the Blueprints Exchange post…
Scripts
Broadlink on Script Blueprint
This is a SCRIPT Blueprint that uses my Broadlink RM3 to turn my TV on and get it into the correct mode, Pushes remote buttons in sequence.
Tasmota EZ Button Blueprint
This Script Blueprint generates 3 Buttons to help you manage your Tasmota installed base. Restart All, Update a few, and Update all.
Play Media File Script Blueprint Blueprint
This is a SCRIPT Blueprint. This provides a way to play canned media files with the big long list of YAML entries but keep the main script or automation clean.
TTS All Message Blueprint
This script can use any of the 11 integrated TTS Platforms in Home Assistant to send a message to a media player.
Automations
Auto Fan Control Blueprint
This Blueprint is for controlling a 3 speed fan based on a temperature sensor. Both fan% control & MQTT fan control versions.
Door Open TTS Cloud-Say Message Blueprint
This Blueprint is a TTS.cloud-say version of another Door Announcer I found in the HA Blueprint Exchange.
Keypad Lock or puzzle Box Tool Blueprint
This Blueprint accepts 5 actions & when done in the right order, flips an input_boolean.
Zigbee2MQTT - Xiaomi Cube Controller Blueprint
This Blueprint uses a Zigbee2MQTT built sensor to sort out the multitude of commands from the Xiaomi Magic Cube Remote.
Zigbee2MQTT - ZemiSmart ZM-RM02 Controller Blueprint
This Blueprint uses the Z2M (Zigbee2MQTT) imported Action sensor to sort out the 18 commands from the ZemiSmart ZM-RM02 Controller.
ZHA - Xiaomi Cube Controller Blueprint
This Blueprint uses a ZHA built sensor to sort out the 38(+54) commands from the Xiaomi Magic Cube Remote.
Device_tracker Monitor & Notifier
This Blueprint Monitor’s device_tracker entities that you choose & notifies you if they go offline. Then it gives you the opportunity to devise an action to deal with it.
Humidifier Water Throttle Control
This blueprint monitors a humidity sensor & by determining the error from the goal, sends info to a humidifier as to how long to flow the water. This saves water & has a minimal effect on function. Requires a Sonoff SV, Generic hygrostat Integration, & a suitable humidifier.
Person_Alert_Blueprint
This 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!
Contact Links or see my other work
What are we Fixing Today Homepage / Website: https://www.WhatAreWeFixing.Today/
Channel Link URL: (WhatAreWeFixingToday) What are we fixing today? - YouTube
Discord Guild: (Sir_Goodenough#9683) WhatAreWeFixingToday?
If you want to support me
Buy me Coffee: Sir GoodEnough
PayPal one-off donation link: PayPal.Me
#WhatAreWeFixingToday
#SirGoodEnough