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
13 Likes
Bacri-FR
(Bacri Fr)
September 13, 2022, 7:31am
24
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
Bacri-FR
(Bacri Fr)
September 17, 2022, 2:27pm
25
For those still searching, here’s what I did :
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
install custom:uptime-card in HACS
Instructions here GitHub - dylandoamaral/uptime-card: Minimalistic uptime card for Home Assistant Lovelace UI
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.
11 Likes
hh93
(Howie Davison)
July 4, 2023, 4:33pm
27
Hi
I followed this thread to the end as I’m looking for a way to reboot my Router when my broadband is disconnected for a certain amount of time.
I have added the ping entity and it seems to work and is registering the uptime.
I have modified my config.yaml -
here’s the code:
`# Example configuration.yaml entry to ping host google DNS with 2 packets every 10 seconds.
binary_sensor:
platform: ping
host: 8.8.8.8
name: “Virgin”
count: 2
scan_interval: 15`
and used the HACS Uptime Card to show the connection of the Broadband over a three day interval
But now I’m stuck with how to trigger a socket to go off and on to reboot the Router. I have a few smart switches on my system so I know how to add a new one just for this purpose.
Nick4
(Nick)
September 11, 2023, 11:57pm
28
Hi Howie, bumped on this topic after browsing/searching for something and saw your issue:
In case you have not solved it yet:
alias: "Internet Down"
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.virgin
to: "off"
condition: []
action:
- service: switch.turn_off
data: {}
target:
entity_id: <your switch>
- delay: 00:00:02
- service: switch.turn_on
data: {}
target:
entity_id: <your switch>
hh93
(Howie Davison)
September 16, 2023, 6:18pm
29
Hi Nick4,
TY, but since I set up the config.yaml with the ping and set it going, the connection hasn’t dropped !
Updated to add my solution using an automation to control a LocalBytes Smart Plug for the router power supply.
It detects the connection has dropped for 55S, warns me it’s rebooting, then cycles the power to the Router over 30S then starts watching again
edlentz
(Ed Lentz)
September 20, 2023, 3:57pm
30
I need a push or a shove to get this going. I think I messed up the sensor and don’t know where or how. I put this into my config.yaml
binary_sensor:
- platform: ping
name: "T-Mobile" #(or whatever you want to name it)
host: 8.8.8.8
scan_interval: 60
Then in the card config on the dashboard I did this
type: custom:uptime-card
entity: binary_sensor.T-Mobile
hours_to_show: 72
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
show:
header: false
The card shows unknown. I think I need to do something with the sensor but am having a brain fart here. Can someone point me in the right direction? I even reloaded the config.yaml.
Thanks
try binary_sensor.t-mobile
If you look in developer tools - states you should be able to find the entity and get the correct entity_id
edlentz
(Ed Lentz)
September 20, 2023, 5:27pm
32
Thanks for the reply Holdestmade
I do not find t-mobile under States in the developer section. Did I need to do something basic to get it to show up?
Thanks
Ed
Assume you have restarted after editing comfig.yaml ?
Did you reload your Ping Binary Sensor config (or just restart HA) after adding it to your config?
edlentz
(Ed Lentz)
September 20, 2023, 5:50pm
36
Where would I reload ping binary sensor config? Sorry
edlentz
(Ed Lentz)
September 20, 2023, 6:06pm
37
apparently a quick reload doesn’t “enable” the sensor but a full restart does the trick. So I am good
Thanks for your time guys!
Ed
exx
October 2, 2023, 9:10am
38
For an one else wanting to do this:
Sir_Goodenough
((SG) WhatAreWeFixing.Today)
January 24, 2024, 5:01pm
39
Malaki86
(Dennis McKinney)
February 8, 2024, 1:13am
40
I hate digging up old posts, but this is along the lines with what I’m trying to do. A bit of reading through the comments and my modem power is now automatically turned off/on if the internet is down for 5 minutes.
The “ping” binary_sensor is not allowed anymore:
Dies funktioniert nicht mehr in Version 2024.6.0. Bitte behebe dies vor dem Upgrade.
It IS still allowed. Only difference is that now you set it up in the UI from the integrations screen instead of using yaml.
1 Like
pdwonline
(When a goat is on the net)
March 13, 2024, 9:30am
43
So you could ask your UPS if there has been a power failure, for example: Connecting UPS to Home Assistant