Add automation to re-enable Pi-hole after 60 minutes of being off in pihole_ha.yaml

master
Carlo Costanzo 1 day ago
parent 8cddd46dd9
commit c9359daa6e

@ -7,6 +7,7 @@
# Keep Pi-hole blocking on docker_10 and docker_14 in lockstep. # Keep Pi-hole blocking on docker_10 and docker_14 in lockstep.
# ------------------------------------------------------------------- # -------------------------------------------------------------------
# Notes: Uses switch.pi_hole + switch.pi_hole_2 from the Pi-hole integration. # Notes: Uses switch.pi_hole + switch.pi_hole_2 from the Pi-hole integration.
# Notes: Auto re-enables Pi-hole after 60 minutes of being off.
###################################################################### ######################################################################
automation: automation:
@ -61,3 +62,20 @@ automation:
target: target:
entity_id: switch.pi_hole entity_id: switch.pi_hole
mode: single mode: single
- id: pihole_auto_reenable_after_60_minutes
alias: "Pi-hole HA - Auto Re-enable After 60 Minutes"
description: "Turn Pi-hole back on after it has been off for 60 minutes."
trigger:
- platform: state
entity_id:
- switch.pi_hole
- switch.pi_hole_2
to: "off"
for:
hours: 1
action:
- service: switch.turn_on
data:
entity_id: "{{ trigger.entity_id }}"
mode: single

Loading…
Cancel
Save

Powered by TurnKey Linux.