From e42b91487cd6eae0d8013b99c511648ac73e8098 Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Fri, 27 Mar 2020 20:12:15 +0200 Subject: [PATCH] Add switch for pihole --- config/configuration.yaml | 1 + config/lovelace/07_system.yaml | 25 +++++++++++++------------ config/packages/modules/security.yaml | 20 +++++++++----------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/config/configuration.yaml b/config/configuration.yaml index 126e225..0fdffdf 100644 --- a/config/configuration.yaml +++ b/config/configuration.yaml @@ -95,6 +95,7 @@ logger: logs: homeassistant.components.shell_command: debug homeassistant.components.amcrest: error + homeassistant.components.switch.pihole_temp_disable: critical zigpy.util: error # diff --git a/config/lovelace/07_system.yaml b/config/lovelace/07_system.yaml index 6b31dfa..77bf8de 100644 --- a/config/lovelace/07_system.yaml +++ b/config/lovelace/07_system.yaml @@ -144,44 +144,45 @@ cards: - type: vertical-stack cards: - type: entities - title: Pi Hole + title: Pi-Hole entities: - - script.disable_pi_hole_5 - - script.enable_pi_hole + - switch.pihole_temp_disable + - type: horizontal-stack cards: - - type: "custom:mini-graph-card" + - type: custom:mini-graph-card name: Total queries font_size: 75 - icon: "mdi:radio-tower" + icon: mdi:radio-towe line_color: var(--accent-color) line_width: 8 entities: - sensor.pi_hole_dns_queries_today - - type: "custom:mini-graph-card" + - type: custom:mini-graph-card name: Queries blocked font_size: 75 - icon: "mdi:stop-circle" + icon: mdi:stop-circle line_color: var(--accent-color) line_width: 8 entities: - - sensor.pi_hole_ads_blocked_today + - entity: sensor.pi_hole_ads_blocked_today + icon: mdi:pi-hole - type: horizontal-stack cards: - - type: "custom:mini-graph-card" + - type: custom:mini-graph-card name: Percent blocked font_size: 75 - icon: "mdi:percent" + icon: mdi:percent line_color: var(--accent-color) line_width: 8 entities: - sensor.pi_hole_ads_percentage_blocked_today - - type: "custom:mini-graph-card" + - type: custom:mini-graph-card name: Seen clients font_size: 75 - icon: "mdi:devices" + icon: mdi:devices line_color: var(--accent-color) line_width: 8 entities: diff --git a/config/packages/modules/security.yaml b/config/packages/modules/security.yaml index b2ba67d..de70147 100644 --- a/config/packages/modules/security.yaml +++ b/config/packages/modules/security.yaml @@ -36,18 +36,16 @@ switch: turn_off: service: script.security_camera_off -script: - disable_pi_hole_5: - alias: Security · Disable Pi Hole for 5 mins - sequence: - - service: pi_hole.disable - data: - duration: 5 - enable_pi_hole: - alias: Security · Enable Pi Hole - sequence: - - service: pi_hole.enable + - platform: command_line + switches: + pihole_temp_disable: + friendly_name: "Pi-Hole pause for 5 mins" + command_on: !secret pihole_disable_5 + command_off: !secret pihole_enable + command_state: !secret pihole_status + value_template: '{{ value_json.status == "disabled" }}' +script: security_camera_on: alias: Security camera · Turn on sequence: