From 284c0d74ace15feabd73dc9c5b9971505bf26637 Mon Sep 17 00:00:00 2001 From: Giorgio Ravera Date: Wed, 13 Feb 2019 16:43:18 +0100 Subject: [PATCH] Modification to DNS sensors --- automation/climate.yaml | 48 +++++++++++++----------------- customizations/sensor_network.yaml | 11 ++++++- group/network.yaml | 10 ++++++- script/climate.yaml | 34 +++++++++++++++++++++ sensor/dns.yaml | 12 ++++---- 5 files changed, 80 insertions(+), 35 deletions(-) diff --git a/automation/climate.yaml b/automation/climate.yaml index b97b124a..4f14a9e2 100644 --- a/automation/climate.yaml +++ b/automation/climate.yaml @@ -97,32 +97,26 @@ condition: [] action: - - service: climate.set_operation_mode + - service: script.climate_away_mode data_template: - entity_id: - - climate.cucina_termostato_cucina - - climate.sala_termostato_sala - - climate.bagno_termostato_bagno - - climate.studio_termostato_studio - - climate.camera_termostato_camera - operation_mode: >- - {% if trigger.to_state.state == 'on' %} - vacation - {% else %} - auto - {% endif %} - - - service: climate.set_temperature + entity_id: climate.cucina_termostato_cucina + + - service: script.climate_away_mode + data_template: + entity_id: climate.sala_termostato_sala + mode: trigger.to_state.state + + - service: script.climate_away_mode data_template: - entity_id: - - climate.cucina_termostato_cucina - - climate.sala_termostato_sala - - climate.bagno_termostato_bagno - - climate.studio_termostato_studio - - climate.camera_termostato_camera - temperature: >- - {% if trigger.to_state.state == 'on' %} - 10 - {% else %} - 19 - {% endif %} + entity_id: climate.bagno_termostato_bagno + mode: trigger.to_state.state + + - service: script.climate_away_mode + data_template: + entity_id: climate.studio_termostato_studio + mode: trigger.to_state.state + + - service: script.climate_away_mode + data_template: + entity_id: climate.camera_termostato_camera + mode: trigger.to_state.state diff --git a/customizations/sensor_network.yaml b/customizations/sensor_network.yaml index 30908f37..046181fd 100644 --- a/customizations/sensor_network.yaml +++ b/customizations/sensor_network.yaml @@ -16,4 +16,13 @@ sensor.speedtest_upload: sensor.freebsd_router_kbyte_sec_received: friendly_name: Traffico in ingresso sensor.freebsd_router_kbyte_sec_sent: - friendly_name: Traffico in uscita \ No newline at end of file + friendly_name: Traffico in uscita + +###################################################################### +# DNS +###################################################################### + +sensor.ip_1: + friendly_name: xraver.dnsduck.org +sensor.ip_2: + friendly_name: xraver2.dnsduck.org diff --git a/group/network.yaml b/group/network.yaml index 64dd98ec..deb7037b 100644 --- a/group/network.yaml +++ b/group/network.yaml @@ -3,10 +3,18 @@ network: view: true icon: mdi:lan entities: + - group.ip - group.speedtest - group.pfsense # - group.qnap +ip: + name: External IP + control: hidden + entities: + - sensor.ip_1 + - sensor.ip_2 + speedtest: name: Speed Test control: hidden @@ -32,4 +40,4 @@ pfsense: # - sensor.nas_volume_used_datavol1 # - sensor.nas_system_temperature # - sensor.nas_temperature_drive_0_1 -# - sensor.nas_temperature_drive_0_2 \ No newline at end of file +# - sensor.nas_temperature_drive_0_2 diff --git a/script/climate.yaml b/script/climate.yaml index 80c20786..f58f5d13 100644 --- a/script/climate.yaml +++ b/script/climate.yaml @@ -36,3 +36,37 @@ climate_daily_schedule: {% else %} {{ temp5 }} {% endif %} + +###################################################################### +# Climate: Away Mode +# Inputs: +# - entity_id +# - mode +# +# Operations: +# - climate.set_operation_mode +# - climate.set_temperature +###################################################################### + +climate_away_mode: + alias: "Termosifoni: Modalità vacanza" + sequence: + - service: climate.set_operation_mode + data_template: + entity_id: "{{ entity_id }}" + operation_mode: >- + {% if mode == 'on' %} + vacation + {% else %} + auto + {% endif %} + - delay: '00:00:30' + - service: climate.set_temperature + data_template: + entity_id: "{{ entity_id }}" + temperature: >- + {% if mode == 'on' %} + 10 + {% else %} + 19 + {% endif %} diff --git a/sensor/dns.yaml b/sensor/dns.yaml index 65ed9148..5fb1b8f4 100644 --- a/sensor/dns.yaml +++ b/sensor/dns.yaml @@ -4,12 +4,12 @@ - platform: dnsip hostname: xraver.duckdns.org - name: hass + name: ip_1 resolver: 8.8.8.8 scan_interval: 1800 - - platform: dnsip - hostname: xraver2.duckdns.org - name: hass - resolver: 8.8.8.8 - scan_interval: 1800 +- platform: dnsip + hostname: xraver2.duckdns.org + name: ip_2 + resolver: 8.8.8.8 + scan_interval: 1800 -- 2.47.3