Files
Home-AssistantConfig/config/packages/speedtest.yaml
Carlo Costanzo c464073a0d Standardizing on Headers for all YAML files.
- Updated comments in various YAML configuration files to provide clearer descriptions of functionalities and integrations.
- Improved documentation for alarm, alexa_media_player, backups, blink, cbyge, climate, finance, fridge, garadget, glances, hass_agent_homepc, holiday, ios, landscape_lighting, lightning, logger, medicine, nfc_tags, noonhome, office_motion, phynplus, powerwall, printer, processmonitor, proxmox, rachio, rheem_econet, roku, sleepiq, space, speedtest, stats, superbowl, vacuum, wireless, and youtube packages.
- Added relevant links and issue references where applicable to enhance user guidance and support.
2025-11-29 13:17:07 -05:00

80 lines
3.0 KiB
YAML

#-------------------------------------------
# @CCOSTAN
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
# Speedtest Alerts - Notify when internet speeds drop.
#-------------------------------------------
######################################################################
## Alerts if download/upload fall below thresholds.
######################################################################
# For more info or questions, visit https://www.vcloudinfo.com/click-here
automation:
- alias: "Notify Carlo if Internet Speed is Slow"
id: notify-carlo-slow-internet-speed
description: "Sends a notification to Carlo's phone if download or upload speed falls below 400 Mbps."
trigger:
- platform: numeric_state
entity_id: sensor.speedtest_download
below: 300
- platform: numeric_state
entity_id: sensor.speedtest_upload
below: 300
condition:
- condition: state
entity_id: group.bed
state: 'off'
- condition: template # Checks to make sure the system hasn't been restarted in the past 10 minutes
value_template: >-
{% set uptime = states('sensor.ha_uptime') | as_datetime %}
{% set now = now() %}
{{ (now - uptime).total_seconds() / 60 >= 10 }}
action:
- service: script.notify_engine
data:
title: "⚠️ Internet Speed Alert"
value1: >-
Download: {{ states('sensor.speedtest_download') }} Mbps,
Upload: {{ states('sensor.speedtest_upload') }} Mbps.
value2: "One or both speeds are below 300 Mbps."
who: "carlo"
group: "information"
level: "active"
mode: single
- alias: "Notify Carlo if Internet Speed is Restored"
id: notify-carlo-internet-speed-restored
description: "Sends a notification to Carlo's phone when download and upload speeds are back above 300/300 Mbps."
trigger:
- platform: numeric_state
entity_id: sensor.speedtest_download
above: 300
- platform: numeric_state
entity_id: sensor.speedtest_upload
above: 300
condition:
- condition: numeric_state
entity_id: sensor.speedtest_download
above: 300
- condition: numeric_state
entity_id: sensor.speedtest_upload
above: 300
- condition: template # Checks to make sure the system hasn't been restarted in the past 10 minutes
value_template: >-
{% set uptime = states('sensor.ha_uptime') | as_datetime %}
{% set now = now() %}
{{ (now - uptime).total_seconds() / 60 >= 10 }}
action:
- service: script.notify_engine
data:
title: "✅ Internet Speed Restored"
value1: >-
Download: {{ states('sensor.speedtest_download') }} Mbps,
Upload: {{ states('sensor.speedtest_upload') }} Mbps.
value2: "Internet speeds are back to normal."
who: "parents"
group: "information"
level: "active"
mode: single