Add Backup Notifications
This commit is contained in:
parent
e732c632cf
commit
55f36c8e57
35
automations/backups.yaml
Normal file
35
automations/backups.yaml
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
- alias: Backup Error
|
||||||
|
trigger:
|
||||||
|
- platform: state
|
||||||
|
entity_id: binary_sensor.backup_error_occured
|
||||||
|
to: 'on'
|
||||||
|
action:
|
||||||
|
- service: notify.telegram_group
|
||||||
|
data:
|
||||||
|
title: '*Backup-Problem:*'
|
||||||
|
message: 'Es gab Fehler beim *Erstellen* des Backups! Bitte prüfen!'
|
||||||
|
- service: notify.telegram_group
|
||||||
|
data:
|
||||||
|
message: 'Anbei die Log-Datei :)'
|
||||||
|
data:
|
||||||
|
document:
|
||||||
|
file: /backuplogs/run.err.log
|
||||||
|
caption: Backup Creation Log
|
||||||
|
|
||||||
|
- alias: Backup Sync Error
|
||||||
|
trigger:
|
||||||
|
- platform: state
|
||||||
|
entity_id: binary_sensor.backup_sync_error_occured
|
||||||
|
to: 'on'
|
||||||
|
action:
|
||||||
|
- service: notify.telegram_group
|
||||||
|
data:
|
||||||
|
title: '*Backup-Problem:*'
|
||||||
|
message: 'Es gab Fehler beim *Synchronisieren* des Backups! Bitte prüfen!'
|
||||||
|
- service: notify.telegram_group
|
||||||
|
data:
|
||||||
|
message: 'Anbei die Log-Datei :)'
|
||||||
|
data:
|
||||||
|
document:
|
||||||
|
file: /backuplogs/sync.err.log
|
||||||
|
caption: Backup Sync Log
|
@ -6,6 +6,8 @@ homeassistant:
|
|||||||
unit_system: metric
|
unit_system: metric
|
||||||
time_zone: Europe/Berlin
|
time_zone: Europe/Berlin
|
||||||
# customize: !include_dir_merge_named customizations/
|
# customize: !include_dir_merge_named customizations/
|
||||||
|
whitelist_external_dirs:
|
||||||
|
- /backuplogs
|
||||||
|
|
||||||
http:
|
http:
|
||||||
ip_ban_enabled: true
|
ip_ban_enabled: true
|
||||||
@ -93,6 +95,7 @@ mqtt:
|
|||||||
telegram_bot:
|
telegram_bot:
|
||||||
- platform: broadcast
|
- platform: broadcast
|
||||||
api_key: !secret telegram_bot
|
api_key: !secret telegram_bot
|
||||||
|
parse_mode: markdown
|
||||||
allowed_chat_ids:
|
allowed_chat_ids:
|
||||||
- !secret telegram_chat_fb
|
- !secret telegram_chat_fb
|
||||||
- !secret telegram_chat_group
|
- !secret telegram_chat_group
|
||||||
@ -140,6 +143,20 @@ binary_sensor:
|
|||||||
name: YiHome1 Alarm
|
name: YiHome1 Alarm
|
||||||
payload_on: 1
|
payload_on: 1
|
||||||
payload_off: 0
|
payload_off: 0
|
||||||
|
- platform: command_line
|
||||||
|
name: backup_error_occured
|
||||||
|
command: 'if [ `wc -l < /backuplogs/run.err.log` -eq 0 ]; then echo 0; else echo 1; fi'
|
||||||
|
payload_on: 1
|
||||||
|
payload_off: 0
|
||||||
|
scan_interval: 1800
|
||||||
|
device_class: 'problem'
|
||||||
|
- platform: command_line
|
||||||
|
name: backup_sync_error_occured
|
||||||
|
command: 'if [ `wc -l < /backuplogs/sync.err.log` -eq 0 ]; then echo 0; else echo 1; fi'
|
||||||
|
payload_on: 1
|
||||||
|
payload_off: 0
|
||||||
|
scan_interval: 1800
|
||||||
|
device_class: 'problem'
|
||||||
|
|
||||||
weather:
|
weather:
|
||||||
- platform: openweathermap
|
- platform: openweathermap
|
||||||
|
Loading…
Reference in New Issue
Block a user