ha: add ntfy rest_command and Core update alert automation
- Add rest_command.ntfy_grafana_alerts in configuration.yaml (POST to https://ntfy.goattw.net/grafana-alerts) - Add ha_core_version_update_alert automation in automations.yaml Triggers on update.home_assistant_core_update installed_version change Sends high-priority ntfy alert with old→new version and browser hard-refresh reminder (Ctrl+Shift+R / Cmd+Shift+R)
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
- id: '1770778485341'
|
||||
alias: Frigate Notifications (0.14.0.2w)
|
||||
description: ''
|
||||
use_blueprint:
|
||||
path: SgtBatten/Stable.yaml
|
||||
input:
|
||||
base_url: https://ha.goattw.net
|
||||
notify_device: 77ce3c5e3add8ea306c1a8e28477809a
|
||||
camera:
|
||||
- camera.front_porch
|
||||
tap_action: https://ha.goattw.net/api/frigate/notifications/{{id}}/clip.mp4
|
||||
- id: diun_image_update
|
||||
alias: Diun - Docker Image Update Notification
|
||||
description: Sends a mobile notification when Diun detects a new Docker image version
|
||||
triggers:
|
||||
- platform: webhook
|
||||
webhook_id: diun_image_update
|
||||
allowed_methods:
|
||||
- POST
|
||||
actions:
|
||||
- data:
|
||||
title: "\U0001F433 Docker Image Update"
|
||||
message: '{{ trigger.json.message }}'
|
||||
action: notify.mobile_app_tomcell
|
||||
- id: ha_core_version_update_alert
|
||||
alias: HA Core Update - ntfy Alert
|
||||
description: "ntfy to grafana-alerts when Core installed_version changes; includes old/new version and hard-refresh reminder"
|
||||
triggers:
|
||||
- platform: state
|
||||
entity_id: update.home_assistant_core_update
|
||||
attribute: installed_version
|
||||
conditions:
|
||||
- condition: template
|
||||
value_template: >-
|
||||
{{ trigger.from_state is not none
|
||||
and trigger.to_state is not none
|
||||
and trigger.from_state.attributes.get('installed_version') not in [none, '']
|
||||
and trigger.to_state.attributes.get('installed_version') not in [none, '']
|
||||
and trigger.from_state.attributes['installed_version'] != trigger.to_state.attributes['installed_version'] }}
|
||||
actions:
|
||||
- action: rest_command.ntfy_grafana_alerts
|
||||
data:
|
||||
title: "HA Core Updated: {{ trigger.to_state.attributes['installed_version'] }}"
|
||||
message: >-
|
||||
Core auto-updated: {{ trigger.from_state.attributes['installed_version'] }} → {{ trigger.to_state.attributes['installed_version'] }}.
|
||||
Hard-refresh your browser: Ctrl+Shift+R (Win/Linux) or Cmd+Shift+R (Mac) to clear frontend cache.
|
||||
priority: high
|
||||
tags: warning,house
|
||||
@@ -0,0 +1,27 @@
|
||||
# Loads default set of integrations. Do not remove.
|
||||
default_config:
|
||||
|
||||
# Load frontend themes from the themes folder
|
||||
frontend:
|
||||
themes: !include_dir_merge_named themes
|
||||
|
||||
automation: !include automations.yaml
|
||||
script: !include scripts.yaml
|
||||
scene: !include scenes.yaml
|
||||
http:
|
||||
use_x_forwarded_for: true
|
||||
trusted_proxies:
|
||||
- 192.168.99.0/24 # <--- Trusts ANY device on your home network (Router, Server, Laptop)
|
||||
- 172.16.0.0/12 # <--- Trusts all Docker containers
|
||||
- 127.0.0.1 # <--- Localhost
|
||||
|
||||
rest_command:
|
||||
ntfy_grafana_alerts:
|
||||
url: https://ntfy.goattw.net/grafana-alerts
|
||||
method: POST
|
||||
content_type: "text/plain"
|
||||
payload: "{{ message }}"
|
||||
headers:
|
||||
Title: "{{ title | default('Home Assistant') }}"
|
||||
Priority: "{{ priority | default('default') }}"
|
||||
Tags: "{{ tags | default('house') }}"
|
||||
Reference in New Issue
Block a user