Home assistant checking if internet connection is online

@Andy_Allsopp, how did you get this chart? It looks great.

As said here…a ping sensor to a host nearby f.e. the dns server of you isp?

It’s the custom uptime card. I pair it with a ping sensor that looks to Google’s DNS server.

type: custom:uptime-card
entity: binary_sensor.internet_reachable
hours_to_show: 48
title_adaptive_color: true
status_adaptive_color: true
icon: mdi:web
update_interval: 30
severity: 10
icon_adaptive_color: true
tooltip_adaptive_color: true
alias:
  ok: Connected
  ko: Disconnected
4 Likes

thanks a lot.
just implemented it.
Even for a beginner like me, with a little research and effort, it take 20 minutes tops.

1 Like

For those still searching, here’s what I did :

  1. Creation of a binary sensor in configuration.yaml
    see here for details : Ping (ICMP) - Home Assistant
# Test internet connection
binary_sensor:
  - platform: ping
    name: Internet #(or whatever you want to name it)
    host: 8.8.8.8
    scan_interval: 60
  1. install custom:uptime-card in HACS
    Instructions here GitHub - dylandoamaral/uptime-card: Minimalistic uptime card for Home Assistant Lovelace UI

  2. Create a custom dashboard in the Lovelace config.
    In your Home Assistant home page, click the menu at the top right, click Configure UI.

http://192.168.xx.xx:8123/lovelace/default_view?edit=1

Click the menu again, then click Raw config editor.
Add the following :

      - type: custom:uptime-card
        entity: binary_sensor.internet
        hours_to_show: 168
        title_adaptive_color: true
        status_adaptive_color: true
        icon: mdi:web
        update_interval: 30
        severity: 10
        icon_adaptive_color: true
        tooltip_adaptive_color: true
        alias:
          ok: Connected
          ko: Disconnected
        resources:
          - url: /local/uptime-card.js
          - type: module

A lot of customization exist for this board, please check here for details.

3 Likes