From fba70771684e46ad781c3ad56fb57b9999faf207 Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Fri, 27 Mar 2020 22:27:06 +0200 Subject: [PATCH] Add networking tab. Add IFTTT for alexa. Add Mikrotik integration --- config/configuration.yaml | 4 +- config/lovelace/07_network.yaml | 55 +++++++++++++++++++ .../{07_system.yaml => 08_system.yaml} | 48 +--------------- .../{08_covid_19.yaml => 09_covid_19.yaml} | 0 .../lovelace/{09_test.yaml => 10_test.yaml} | 0 config/packages/modules/ifttt.yaml | 11 ++++ config/packages/modules/networking.yaml | 21 +++++++ config/packages/modules/security.yaml | 13 ----- config/ui-lovelace.yaml | 7 ++- 9 files changed, 94 insertions(+), 65 deletions(-) create mode 100644 config/lovelace/07_network.yaml rename config/lovelace/{07_system.yaml => 08_system.yaml} (76%) rename config/lovelace/{08_covid_19.yaml => 09_covid_19.yaml} (100%) rename config/lovelace/{09_test.yaml => 10_test.yaml} (100%) create mode 100644 config/packages/modules/ifttt.yaml create mode 100644 config/packages/modules/networking.yaml diff --git a/config/configuration.yaml b/config/configuration.yaml index 0fdffdf..9839a8a 100644 --- a/config/configuration.yaml +++ b/config/configuration.yaml @@ -93,9 +93,9 @@ updater: logger: default: warning logs: - homeassistant.components.shell_command: debug + homeassistant.components.shell_command: error homeassistant.components.amcrest: error - homeassistant.components.switch.pihole_temp_disable: critical + homeassistant.components.switch.pihole_temp_disable: error zigpy.util: error # diff --git a/config/lovelace/07_network.yaml b/config/lovelace/07_network.yaml new file mode 100644 index 0000000..e0cbe25 --- /dev/null +++ b/config/lovelace/07_network.yaml @@ -0,0 +1,55 @@ +title: Network +path: network +icon: "mdi:server-network" +badges: [] +cards: + - type: entities + entities: + - sensor.fast_com_download + + - type: vertical-stack + cards: + - type: entities + title: Pi-Hole + entities: + - switch.pihole_temp_disable + + - type: horizontal-stack + cards: + - type: custom:mini-graph-card + name: Total queries + font_size: 75 + icon: mdi:radio-towe + line_color: var(--accent-color) + line_width: 8 + entities: + - sensor.pi_hole_dns_queries_today + - type: custom:mini-graph-card + name: Queries blocked + font_size: 75 + icon: mdi:stop-circle + line_color: var(--accent-color) + line_width: 8 + entities: + - entity: sensor.pi_hole_ads_blocked_today + icon: mdi:pi-hole + + - type: horizontal-stack + cards: + - type: custom:mini-graph-card + name: Percent blocked + font_size: 75 + icon: mdi:percent + line_color: var(--accent-color) + line_width: 8 + entities: + - sensor.pi_hole_ads_percentage_blocked_today + + - type: custom:mini-graph-card + name: Seen clients + font_size: 75 + icon: mdi:devices + line_color: var(--accent-color) + line_width: 8 + entities: + - sensor.pi_hole_seen_clients diff --git a/config/lovelace/07_system.yaml b/config/lovelace/08_system.yaml similarity index 76% rename from config/lovelace/07_system.yaml rename to config/lovelace/08_system.yaml index 77bf8de..e0c9e84 100644 --- a/config/lovelace/07_system.yaml +++ b/config/lovelace/08_system.yaml @@ -8,6 +8,7 @@ cards: show_header_toggle: false entities: - automation.youtube_download_latest_pds + - automation.ifttt_call_service - type: custom:fold-entity-row head: @@ -140,50 +141,3 @@ cards: entity: sensor.motion_1_power - type: custom:battery-entity entity: sensor.motion_2_power - - - type: vertical-stack - cards: - - type: entities - title: Pi-Hole - entities: - - switch.pihole_temp_disable - - - type: horizontal-stack - cards: - - type: custom:mini-graph-card - name: Total queries - font_size: 75 - icon: mdi:radio-towe - line_color: var(--accent-color) - line_width: 8 - entities: - - sensor.pi_hole_dns_queries_today - - type: custom:mini-graph-card - name: Queries blocked - font_size: 75 - icon: mdi:stop-circle - line_color: var(--accent-color) - line_width: 8 - entities: - - entity: sensor.pi_hole_ads_blocked_today - icon: mdi:pi-hole - - - type: horizontal-stack - cards: - - type: custom:mini-graph-card - name: Percent blocked - font_size: 75 - icon: mdi:percent - line_color: var(--accent-color) - line_width: 8 - entities: - - sensor.pi_hole_ads_percentage_blocked_today - - - type: custom:mini-graph-card - name: Seen clients - font_size: 75 - icon: mdi:devices - line_color: var(--accent-color) - line_width: 8 - entities: - - sensor.pi_hole_seen_clients diff --git a/config/lovelace/08_covid_19.yaml b/config/lovelace/09_covid_19.yaml similarity index 100% rename from config/lovelace/08_covid_19.yaml rename to config/lovelace/09_covid_19.yaml diff --git a/config/lovelace/09_test.yaml b/config/lovelace/10_test.yaml similarity index 100% rename from config/lovelace/09_test.yaml rename to config/lovelace/10_test.yaml diff --git a/config/packages/modules/ifttt.yaml b/config/packages/modules/ifttt.yaml new file mode 100644 index 0000000..63be74e --- /dev/null +++ b/config/packages/modules/ifttt.yaml @@ -0,0 +1,11 @@ +automation: + - alias: IFTTT · Call service + trigger: + platform: event + event_type: ifttt_webhook_received + event_data: + action: "call-service" + action: + - service_template: "{{ trigger.event.data.service }}" + data_template: + entity_id: "{{ trigger.event.data.entity_id }}" diff --git a/config/packages/modules/networking.yaml b/config/packages/modules/networking.yaml new file mode 100644 index 0000000..e5dda13 --- /dev/null +++ b/config/packages/modules/networking.yaml @@ -0,0 +1,21 @@ +fastdotcom: + +mikrotik: + - name: Mikrotik + host: !secret mikrotik_host + username: !secret mikrotik_username + password: !secret mikrotik_password + +pi_hole: + - host: !secret pihole_host + api_key: !secret pihole_api_key + +switch: + - 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" }}' diff --git a/config/packages/modules/security.yaml b/config/packages/modules/security.yaml index de70147..dc071b9 100644 --- a/config/packages/modules/security.yaml +++ b/config/packages/modules/security.yaml @@ -8,10 +8,6 @@ amcrest: - motion_detected - online -pi_hole: - - host: !secret pihole_host - api_key: !secret pihole_api_key - binary_sensor: - platform: template sensors: @@ -36,15 +32,6 @@ switch: turn_off: service: script.security_camera_off - - 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 diff --git a/config/ui-lovelace.yaml b/config/ui-lovelace.yaml index 9f7065c..6fb597b 100644 --- a/config/ui-lovelace.yaml +++ b/config/ui-lovelace.yaml @@ -16,6 +16,7 @@ views: - !include lovelace/04_bathroom.yaml - !include lovelace/05_hallway.yaml - !include lovelace/06_media.yaml - - !include lovelace/07_system.yaml - - !include lovelace/08_covid_19.yaml - - !include lovelace/09_test.yaml + - !include lovelace/07_network.yaml + - !include lovelace/08_system.yaml + - !include lovelace/09_covid_19.yaml + - !include lovelace/10_test.yaml