Checking if a device is On-Line

Checking if a device is On-Line

Hi everyone,

In modern homes there are many electronic devices such as IP cameras, routers and access points Wi-Fi among the others.

Having all these devices is certainly useful but they could suddenly become useless without a centralized monitoring to check if they are On-Line.

Home Assistant can also help us in such activity, let's see how.

Hardware configuration

  1. IP camera correctly configured. In this article we saw how to add a Foscam IP camera.
  2. Some other IP device such as access point or whatever.

Software configuration

  1. Home Assistant. I'm currently running version the latest version 2022.9.7.

Home Assistant code (yaml) / procedure

In order to check if all my devices are On-Line, I use the Ping Binary Sensor.

This is the code you have to add in your configuration.yaml file:

binary_sensor:
  - platform: ping
    name: DeviceA
    host: DeviceIP address
    count: 5
    scan_interval: 60        

Some specifics about the code / steps above

  1. count: is the number of packages to be sent (maximum of 100).
  2. The default polling interval time for the ping platform is 5 minutes. It's possible to overwrite this settings just using the scan_interval parameter (seconds).
  3. As soon as the ping binary sensor has been configured, the following entity binary_sensor.deviceA will become available.
  4. The state of the entity will be ON / OFF based on the ping result plus a set of attributes as per the image below:

No alt text provided for this image

Of course, as we have seen in previous articles, this new entity can be used in automations.

Thank you so much for reading. 🙏 I hope you have enjoyed this article.

I'm available for any feedback so, feel free to contact me or share your thoughts in the comments section below.

Your feedbacks will be very appreciated!

Meanwhile, if you liked this article share it or subscribe to my newsletter about Home Assistant to read all previous episodes and still up to date on latest news.

To view or add a comment, sign in

Insights from the community

Others also viewed

Explore topics