Send notification if and when a network device loses connectivity

This blueprint monitors a group of network devices and sends a notification message to a specified mobile app if and when a device from the group loses network connectivity.

Get started

Click the badge to import this Blueprint: (needs Home Assistant Core 2021.3 or higher)

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Or import this Blueprint by using the forum topic / Gist URL:

The devices to be monitored are organised in a group, e.g. like this (in groups.yaml):

servers:
  name: server connectivity
  all: true
  entities:
    - binary_sensor.abc
    - binary_sensor.xyz

In turn, these binary sensors are configured to use the “ping” platform (in configuration.yaml):

# Binary sensors
binary_sensor:
  - platform: ping
    name: abc
    host: aa.bb.cc.dd
  - platform: ping
    name: xyz
    host: ww.xx.yy.zz

Replace “abc”, “xyz” and “aa.bb.cc.dd”, “ww.xx.yy.zz”, respectively, with the names and hostnames/IP addresses of your network devices to be monitored.

6 Likes

Maybe it’s better to put the blueprint on Github Gist, then you can also add a my button on your topic :wink:

Ok, thanks. Done!

I’ve updated your topic and I will include your blueprint in the community highlight :smiley:

What´s the advantage of this blueprint compared to a manual automation when having network devices already available as device_tracker entities e. g. by router integration (so not based on ping sensors)?

Don´t all those ping sensors put additional (but of course minimal) traffic to the network and devices?

Anyway I guess nice and pretty helpful especially for beginners without any existing “network monitoring system”.

It’s useful when you want to monitor network devices as a group, and you may have several of such groups, and you can’t or don’t want to use your router integration for this purpose. Sure, you can create manual automations, but then you can then do that for any blueprint.

Not all of the network devices are tracked by a router - some of these are remote devices outside your home network. And, yes, sure, additional pinging causes additional network traffic, but that’s rather minimal.

And, yes, this is meant as a quick-and-dirty solution to the network device tracking problem, which doesn’t require anything else.

What changes do I need to make for this to be on a per entity basis?

The easiest way to achieve this would be to define a group comprising just a single entity. Alternatively, you could change the selector from the current group domain to a binary sensor with a suitable device class (probably “connectivity”).

1 Like

Having some issues and it’s totally me!
This is my groups.yaml

servers:
  name: StefsPhoneGroup
  all: true
  entities:
    - binary_sensor.stefsphone

and this is the entry in my config yaml

# Binary sensors
binary_sensor:
  - platform: ping
    name: stefsphone
    host: 192.168.5.158

When I go to blueprints and select server group - there is no group… What am I doing wrong here? I can see the group when browsing and it shows the history of the device just fine.

What do I need to do to make the group available to the blueprint?

Thanks

Seems this only works if ALL the devices in the group fail. Is that the intention?

The behaviour is controlled by the “all:true” lines in the groups.yaml file.
Details for the configuration can be found here:
https://www.home-assistant.io/integrations/group/#configuration-variables
“Set this to true if the group state should only turn on if all grouped entities are on .”

This means the group state should be off as soon as one or more of the devices in the group fail.

1 Like

Thank you, that was very helpful.