From: Giorgio Ravera Date: Tue, 5 Feb 2019 22:10:59 +0000 (+0100) Subject: First Commit X-Git-Url: http://git.giorgioravera.it/?a=commitdiff_plain;h=8b37e37f2ea4f6c7b9833afcb2662ae103c6c9c5;p=homeassistant.git First Commit --- 8b37e37f2ea4f6c7b9833afcb2662ae103c6c9c5 diff --git a/automation/ciao.yaml.disabled b/automation/ciao.yaml.disabled new file mode 100644 index 00000000..06cae166 --- /dev/null +++ b/automation/ciao.yaml.disabled @@ -0,0 +1,17 @@ +###################################################################### +# Switch off all covers +###################################################################### + +- alias: "ciao" + trigger: + - platform: time + at: '15:48:00' + + condition: [] + + action: + - service: script.speech_engine + data_template: + message: >- + {% set ora = now().strftime('%H') %} + "Sono le {{ ora }} e tutto va bene" diff --git a/automation/home_assistant.yaml b/automation/home_assistant.yaml new file mode 100644 index 00000000..031886c4 --- /dev/null +++ b/automation/home_assistant.yaml @@ -0,0 +1,131 @@ +###################################################################### +# Home Assistant: Management of the Home Mode Button +###################################################################### + +- alias: "Home Assistant: Cambio Modalità On" + trigger: + platform: state + entity_id: input_boolean.home_mode_day, + input_boolean.home_mode_night, + input_boolean.home_mode_away + to: 'on' + + action: + - service: input_boolean.turn_off + data_template: + entity_id: > + {% set booleans = [ 'input_boolean.home_mode_day', 'input_boolean.home_mode_night', 'input_boolean.home_mode_away' ] | reject('equalto', trigger.entity_id) %} + {{ booleans | list | join(', ') }} + +- alias: "Home Assistant: Cambio Modalità Off" + trigger: + platform: state + entity_id: input_boolean.home_mode_day, + input_boolean.home_mode_night, + input_boolean.home_mode_away + to: 'off' + + condition: + condition: and + conditions: + - condition: state + entity_id: input_boolean.home_mode_day + state: 'off' + - condition: state + entity_id: input_boolean.home_mode_night + state: 'off' + - condition: state + entity_id: input_boolean.home_mode_away + state: 'off' + + action: + - service: input_boolean.turn_on + data_template: + entity_id: > + {% if now().strftime('%H')|int >= 7 and now().strftime('%H')|int < 23 %} + input_boolean.home_mode_day + {% else %} + input_boolean.home_mode_night + {% endif %} + +###################################################################### +# Home Assistant: Management of Day/Night Mode +###################################################################### + +- alias: "Home Assistant: Modalità Giorno/Notte" + trigger: + - platform: time + at: '07:00:00' + - platform: time + at: '23:00:00' + - platform: homeassistant + event: start + + condition: + condition: state + entity_id: input_boolean.home_mode_away + state: 'off' + + action: + - service: input_boolean.turn_on + data_template: + entity_id: >- + {% if now().strftime('%H')|int >= 7 and now().strftime('%H')|int < 23 %} + input_boolean.home_mode_day + {% else %} + input_boolean.home_mode_night + {% endif %} + +###################################################################### +# Home Assistant: Management of Speech Notifications +###################################################################### + +- alias: "Home Assistant: Gestione notifiche vocali" + trigger: + - platform: state + entity_id: input_boolean.home_mode_night + to: 'on' + - platform: state + entity_id: input_boolean.home_mode_night + to: 'off' + + action: + - service_template: >- + {% if is_state('input_boolean.home_mode_night', 'on') %} + input_boolean.turn_off + {% else %} + input_boolean.turn_on + {% endif %} + data: + entity_id: input_boolean.speech_notifications + +###################################################################### +# Home Assistant: Update Available Notifications +###################################################################### + +- alias: "Home Assistant: Notifica Aggiornamento" + trigger: + - platform: state + entity_id: updater.updater + + action: + service: script.notify_text + data_template: + #message: "Home Assistant {{ states.updater.updater.state }} is now available. {{now().strftime('%Y-%m-%d %I:%M %p')}}" + title: "Home Assistant - Aggiornamento" + message: "E' disponibile un aggiornamento per Home Assistant ({{ states.updater.updater.state }}). {{now().strftime('%Y-%m-%d %I:%M %p')}}" + enable_persistant: true + +###################################################################### +# Home Assistant: Startup Automation +# - Sync with Google Assistant +###################################################################### + +- alias: "Home Assistant: startup automations" + trigger: + - platform: homeassistant + event: start + + action: + - delay: 0:05 + - service: google_assistant.request_sync diff --git a/automation/night_time.yaml b/automation/night_time.yaml new file mode 100644 index 00000000..f2a1f883 --- /dev/null +++ b/automation/night_time.yaml @@ -0,0 +1,21 @@ +###################################################################### +# Night Time +# - Switch off all covers +###################################################################### + +- alias: "Notte: Chiusura Tapparelle" + trigger: + - platform: state + entity_id: input_boolean.home_mode_night + to: 'on' + + condition: [] +# condition: state +# entity_id: input_boolean.home_mode_away +# state: 'off' + + action: + - service: cover.set_cover_position + data: + entity_id: cover.all_covers + position: 10 diff --git a/automation/wakeup_giorgio.yaml b/automation/wakeup_giorgio.yaml new file mode 100644 index 00000000..586de6e6 --- /dev/null +++ b/automation/wakeup_giorgio.yaml @@ -0,0 +1,30 @@ +###################################################################### +# Wake Up Giorgio +# - Every working day it opens Studio Cover +###################################################################### + +- alias: "Risveglio Giorgio" + trigger: + - platform: time + at: '07:00:00' + + condition: + condition: and + conditions: + - condition: state + entity_id: input_boolean.home_mode_away + state: 'off' + + - condition: time + weekday: + - mon + - tue + - wed + - thu + - fri + + action: + - service: cover.set_cover_position + data: + entity_id: cover.tapparella_studio + position: 85 diff --git a/automation/welcome.yaml b/automation/welcome.yaml new file mode 100644 index 00000000..ffc0ab81 --- /dev/null +++ b/automation/welcome.yaml @@ -0,0 +1,54 @@ +###################################################################### +# Welcome message +# - greeting +# - disable away mode +###################################################################### + +- alias: Saluto di benvenuto + trigger: + - platform: state + entity_id: + - device_tracker.giorgio + - device_tracker.laura + to: 'home' +# for: '00:02:00' + + condition: [] + #condition: + #condition: time + #after: '10:00:00' + #before: '23:00:00' + #condition: state + #entity_id: input_boolean.home_mode_night + #state: 'off' + + action: + - service: script.speech_engine + data_template: + language: 'it' + message: > + {% set name = trigger.entity_id.split('.')[1]|replace('_', ' ') %} + {%- macro greeting_sentence(name) -%} + {{ [ + "Ciao " ~ name + " è un piacere rivederti a casa", + "Finalmente a casa " ~ name + "!", + "Indovina chi è a casa? " ~ name + "!", + name + " è ora a casa!", + "Che bello! " ~ name + " è a casa", + name + " sei a casa!", + "Il sistema di domotica Casa Ravera-Testa notifica che " ~ name + " è a casa!", + "Annuncio: " ~ name + " è ora a casa!", + "Rilevo una presenza! " ~ name + " è a casa!", + "Ciao " ~ name + " che la forza sia con te", + "Sento un tremito nella forza! " ~ name + " è a casa", + "Sento un interferenza nella Forza! " ~ name + " è qui", + "Menomale che sei qui " ~ name + "! Mi sentivo solo", + "Menomale che sei qui " ~ name + "! La casa è vuota senza di te!", + "Ciao " ~ name + "! Casa è sempre la casa!", + ] | random }} + {%- endmacro -%} + {{ greeting_sentence(name) }} + + - service: input_boolean.turn_off + data: + entity_id: input_boolean.home_mode_away diff --git a/binary_sensor/home_assistant.yaml b/binary_sensor/home_assistant.yaml new file mode 100644 index 00000000..aa217635 --- /dev/null +++ b/binary_sensor/home_assistant.yaml @@ -0,0 +1,57 @@ +###################################################################### +# Binary Sensor: Home Mode +###################################################################### + +- platform: template + sensors: + home_mode: + friendly_name: Modalità Casa + entity_id: sensor.home_mode + value_template: >- + {{ is_state('sensor.home_mode', 'giorno') + or is_state('sensor.home_mode', 'notte') + or is_state('sensor.home_mode', 'vacanza') }} + icon_template: >- + {% if is_state('sensor.home_mode', 'giorno') %} + mdi:white-balance-sunny + {% elif is_state('sensor.home_mode', 'notte') %} + mdi:weather-night + {% elif is_state('sensor.home_mode', 'vacanza') %} + mdi:airplane-takeoff + {% endif %} + +###################################################################### +# Binary Sensor: Text Notification +###################################################################### + +- platform: template + sensors: + text_notirication: + friendly_name: Notifiche testuali + entity_id: input_boolean.text_notifications + value_template: >- + {{ is_state('input_boolean.text_notifications', 'on') }} + icon_template: >- + {% if is_state('input_boolean.text_notifications', 'on') %} + mdi:message-bulleted + {% else %} + mdi:message-bulleted-off + {% endif %} + +###################################################################### +# Binary Sensor: Speech Notification +###################################################################### + +- platform: template + sensors: + speech_notirication: + friendly_name: Notifiche vocali + entity_id: input_boolean.speech_notifications + value_template: >- + {{ is_state('input_boolean.speech_notifications', 'on') }} + icon_template: >- + {% if is_state('input_boolean.speech_notifications', 'on') %} + mdi:speaker-wireless + {% else %} + mdi:speaker-off + {% endif %} diff --git a/configuration.yaml b/configuration.yaml new file mode 100644 index 00000000..ff592e97 --- /dev/null +++ b/configuration.yaml @@ -0,0 +1,142 @@ +homeassistant: + # Name of the location where Home Assistant is running + name: Casa Ravera-Testa + # Location required to calculate the time the sun rises and sets + latitude: !secret home_latitude + longitude: !secret home_longitude + # Impacts weather/sunrise data (altitude above sea level in meters) + elevation: !secret home_elevation + # metric for Metric, imperial for Imperial + unit_system: metric + # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones + time_zone: Europe/Rome + # Customization folder + customize: !include_dir_merge_named customizations/ + +# Show links to resources in log and frontend +# introduction: + +# Enables the frontend +frontend: + javascript_version: latest + +# Enables configuration UI +config: + +# Uncomment this if you are using SSL/TLS, running in Docker container, etc. +http: + # api_password: !secret http_password + base_url: !secret base_url + # server_port: 80 + # ssl_certificate: /var/lib/homeassistant/.homeassistant/fullchain.pem + # ssl_key: /var/lib/homeassistant/.homeassistant/privkey.pem + use_x_forwarded_for: true + trusted_proxies: 127.0.0.1 + # trusted_networks: + # - 192.168.0.0 + # - 192.168.2.0 + ip_ban_enabled: True + login_attempts_threshold: 3 + +# Lovelace UI Mode +# lovelace: +# mode: yaml + +# Checks for available updates +# Note: This component will send some information about your system to +# the developers to assist with development of Home Assistant. +# For more information, please see: +# https://home-assistant.io/blog/2016/10/25/explaining-the-updater/ +updater: + # Optional, allows Home Assistant developers to focus on popular components. + # include_used_components: true + +# Discover some devices automatically +discovery: +# ignore: +# - roku +# - google_cast + +# Allows you to issue voice commands from the frontend in enabled browsers +conversation: + +# Enables support for tracking state changes over time +history: + exclude: + domains: + - automation + - group + - script + +# View all events in a logbook +logbook: + exclude: + domains: + - automation + - group + - script + +# Enables a map showing the location of tracked devices +map: + +# Track the sun +sun: + +# UPNP +upnp: + port_mapping: false + sensors: true + +# Sensors +sensor: !include_dir_merge_list sensor/ +binary_sensor: !include_dir_merge_list binary_sensor/ + +# Covers +cover: !include_dir_merge_list cover/ + +# Switches +switch: !include_dir_merge_list switch/ + +# Input Boolean +input_boolean: !include_dir_merge_named input_boolean/ + +# Text to speech +tts: + - platform: google + language: it + +# Cloud +# cloud: + +# MQTT +mqtt: + broker: localhost + port: 1883 + client_id: homeassistant + username: !secret mqtt_user + password: !secret mqtt_password + +# EQ3 Max Cube +maxcube: + gateways: + - host: 192.168.0.28 + port: 62910 + +climate: + platform: maxcube + +# Google Assistant +google_assistant: !include google.yaml + +# Zones +zone: !include_dir_list zone/ + +# Device Tracker +device_tracker: !include_dir_merge_list device_tracker/ + +# Notification +notify: !include_dir_merge_list notify/ + +group: !include_dir_merge_named group/ +automation: !include_dir_merge_list automation/ +script: !include_dir_merge_named script/ diff --git a/cover/all_covers.yaml b/cover/all_covers.yaml new file mode 100644 index 00000000..292611dc --- /dev/null +++ b/cover/all_covers.yaml @@ -0,0 +1,30 @@ +- platform: template + covers: + all_covers: + friendly_name: "Tapparelle Globale" + open_cover: + service: script.all_covers_operation + data: + modus: 'open' + close_cover: + service: script.all_covers_operation + data: + modus: 'close' + stop_cover: + service: script.all_covers_operation + data: + modus: 'stop' + set_cover_position: + service: script.all_covers_position + data_template: + position: "{{ position }}" +# value_template: +# icon_template: >- +# {% if is_state('sensor.all_covers', 'open') %} +# mdi:window-open +# {% else %} +# mdi:window-closed +# {% endif %} +# entity_id: +# - cover.bedroom +# - cover.livingroom diff --git a/cover/shelly1.yaml b/cover/shelly1.yaml new file mode 100644 index 00000000..d7dddeb8 --- /dev/null +++ b/cover/shelly1.yaml @@ -0,0 +1,22 @@ +###################################################################### +# Kitchen Cover +###################################################################### + +- platform: mqtt + name: Tapparella Cucina + #state_topic: "shellies/shellyswitch-55980F/roller/0" + command_topic: "shellies/shellyswitch-55980F/roller/0/command" + position_topic: "shellies/shellyswitch-55980F/roller/0/pos" + set_position_topic: "shellies/shellyswitch-55980F/roller/0/command/pos" + qos: 0 + retain: false + payload_open: "open" + payload_close: "close" + payload_stop: "stop" + #state_open: "open" + #state_closed: "close" + #state_stop: "stop" + position_open: 100 + position_closed: 0 + optimistic: false + #value_template: '{{ value.x }}' diff --git a/cover/shelly2.yaml b/cover/shelly2.yaml new file mode 100644 index 00000000..6154947b --- /dev/null +++ b/cover/shelly2.yaml @@ -0,0 +1,22 @@ +###################################################################### +# Living Room Cover +###################################################################### + +- platform: mqtt + name: Tapparella Sala + #state_topic: "shellies/shellyswitch-135454/roller/0" + command_topic: "shellies/shellyswitch-135454/roller/0/command" + position_topic: "shellies/shellyswitch-135454/roller/0/pos" + set_position_topic: "shellies/shellyswitch-135454/roller/0/command/pos" + qos: 0 + retain: false + payload_open: "open" + payload_close: "close" + payload_stop: "stop" + #state_open: "open" + #state_closed: "close" + #state_stop: "stop" + position_open: 100 + position_closed: 0 + optimistic: false + #value_template: '{{ value.x }}' diff --git a/cover/shelly3.yaml b/cover/shelly3.yaml new file mode 100644 index 00000000..d773577e --- /dev/null +++ b/cover/shelly3.yaml @@ -0,0 +1,22 @@ +###################################################################### +# Office Cover +###################################################################### + +- platform: mqtt + name: Tapparella Studio + #state_topic: "shellies/shellyswitch-13572B/roller/0" + command_topic: "shellies/shellyswitch-13572B/roller/0/command" + position_topic: "shellies/shellyswitch-13572B/roller/0/pos" + set_position_topic: "shellies/shellyswitch-13572B/roller/0/command/pos" + qos: 0 + retain: false + payload_open: "open" + payload_close: "close" + payload_stop: "stop" + #state_open: "open" + #state_closed: "close" + #state_stop: "stop" + position_open: 100 + position_closed: 0 + optimistic: false + #value_template: '{{ value.x }}' diff --git a/cover/shelly4.yaml b/cover/shelly4.yaml new file mode 100644 index 00000000..e1a4fdcd --- /dev/null +++ b/cover/shelly4.yaml @@ -0,0 +1,22 @@ +###################################################################### +# Bedroom Cover +###################################################################### + +- platform: mqtt + name: Tapparella Camera + #state_topic: "shellies/shellyswitch-559C49/roller/0" + command_topic: "shellies/shellyswitch-559C49/roller/0/command" + position_topic: "shellies/shellyswitch-559C49/roller/0/pos" + set_position_topic: "shellies/shellyswitch-559C49/roller/0/command/pos" + qos: 0 + retain: false + payload_open: "open" + payload_close: "close" + payload_stop: "stop" + #state_open: "open" + #state_closed: "close" + #state_stop: "stop" + position_open: 100 + position_closed: 0 + optimistic: false + #value_template: '{{ value.x }}' diff --git a/customizations/climate.yaml b/customizations/climate.yaml new file mode 100644 index 00000000..b370bed2 --- /dev/null +++ b/customizations/climate.yaml @@ -0,0 +1,14 @@ +###################################################################### +# MAX EQ3 +###################################################################### + +climate.cucina_termostato_cucina: + friendly_name: Termostato Cucina +climate.sala_termostato_sala: + friendly_name: Termostato Sala +climate.bagno_termostato_bagno: + friendly_name: Termostato Bagno +climate.studio_termostato_studio: + friendly_name: Termostato Studio +climate.camera_termostato_camera: + friendly_name: Termostato Camera diff --git a/customizations/group.yaml b/customizations/group.yaml new file mode 100644 index 00000000..f115c96d --- /dev/null +++ b/customizations/group.yaml @@ -0,0 +1,39 @@ +###################################################################### +# Group Customization for the order view +###################################################################### + +group.default_view: + order: 0 +group.cucina: + order: 1 +group.sala: + order: 2 +group.bagno: + order: 3 +group.studio: + order: 4 +group.camera: + order: 5 + +group.covers: + order: 10 + +group.climate: + order: 11 + +group.people: + order: 12 + +group.network: + order: 13 + +group.weather: + order: 14 + +group.settings: + order: 15 + +group.all_automations: + hidden: false + control: hidden + friendly_name: Automazioni diff --git a/customizations/media_player.yaml b/customizations/media_player.yaml new file mode 100644 index 00000000..0af6d8f0 --- /dev/null +++ b/customizations/media_player.yaml @@ -0,0 +1,17 @@ +###################################################################### +# Media Player Devices +###################################################################### + +# Samsung TV UE46C600 +media_player.ue46c7000_samsung_dtv_rcr: + friendly_name: TV Sala + +# Samsung BD-F6500 +media_player.bdf6500_bdf6500: + friendly_name: Blu-Ray Camera + +# NowTV +media_player.roku_yd00df095157: + friendly_name: NowTV Anna +media_player.roku_yd00dm481414: + friendly_name: NowTV Giorgio diff --git a/customizations/script.yaml b/customizations/script.yaml new file mode 100644 index 00000000..2255f5f4 --- /dev/null +++ b/customizations/script.yaml @@ -0,0 +1,6 @@ +###################################################################### +# Script Customizations +###################################################################### + +script.notify_text_internal: + hidden: true diff --git a/customizations/sensor_network.yaml b/customizations/sensor_network.yaml new file mode 100644 index 00000000..30908f37 --- /dev/null +++ b/customizations/sensor_network.yaml @@ -0,0 +1,19 @@ +###################################################################### +# Speed Test +###################################################################### + +sensor.speedtest_ping: + friendly_name: Ping +sensor.speedtest_download: + friendly_name: Download +sensor.speedtest_upload: + friendly_name: Upload + +###################################################################### +# pfSense +###################################################################### + +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 diff --git a/device_tracker/google.yaml.disabled b/device_tracker/google.yaml.disabled new file mode 100644 index 00000000..b478b680 --- /dev/null +++ b/device_tracker/google.yaml.disabled @@ -0,0 +1,7 @@ +###################################################################### +# Device Tracker: Google +###################################################################### + +- platform: google_maps + username: !secret google_maps_username + password: !secret google_maps_password diff --git a/device_tracker/netgear.yaml.disabled b/device_tracker/netgear.yaml.disabled new file mode 100644 index 00000000..1fecb372 --- /dev/null +++ b/device_tracker/netgear.yaml.disabled @@ -0,0 +1,21 @@ +###################################################################### +# Device Tracker: Netgear +###################################################################### + +- platform: netgear + host: !secret ap1_host + port: !secret ap1_port + username: !secret ap1_username + password: !secret ap1_password + devices: + - s9.giorgioravera.it + - a5.giorgioravera.it +# - a3.giorgioravera.it + + # Seconds between each scan for new devices + interval_seconds: 30 + # Seconds to wait till marking someone as not home after not being seen + consider_home: 180 + new_device_defaults: + track_new_devices: false + hide_if_away: false diff --git a/device_tracker/nmap.yaml b/device_tracker/nmap.yaml new file mode 100644 index 00000000..f4c98fe1 --- /dev/null +++ b/device_tracker/nmap.yaml @@ -0,0 +1,20 @@ +###################################################################### +# Device Tracker: Nmap +###################################################################### + +- platform: nmap_tracker + hosts: + - s9.giorgioravera.it + - a5.giorgioravera.it + - a3.giorgioravera.it + scan_options: " --privileged -sP " + # The number of minutes Nmap will not scan this device + home_interval: 10 + + # Seconds between each scan for new devices + interval_seconds: 60 + # Seconds to wait till marking someone as not home after not being seen + consider_home: 600 + new_device_defaults: + track_new_devices: false + hide_if_away: false diff --git a/device_tracker/ping.yaml.disabled b/device_tracker/ping.yaml.disabled new file mode 100644 index 00000000..c0d17009 --- /dev/null +++ b/device_tracker/ping.yaml.disabled @@ -0,0 +1,18 @@ +###################################################################### +# Device Tracker: Ping +###################################################################### + +- platform: ping + hosts: + giorgio: s9.giorgioravera.it + laura: a5.giorgioravera.it + anna: a3.giorgioravera.it + count: 5 + + # Seconds between each scan for new devices + interval_seconds: 30 + # Seconds to wait till marking someone as not home after not being seen + consider_home: 180 + new_device_defaults: + track_new_devices: false + hide_if_away: false diff --git a/google.yaml b/google.yaml new file mode 100644 index 00000000..02f74d62 --- /dev/null +++ b/google.yaml @@ -0,0 +1,65 @@ +###################################################################### +# Google Home Integration +###################################################################### + +project_id: !secret google_project +api_key: !secret google_api_key +#api_key: !secret google_oauth_key +expose_by_default: false +entity_config: + climate.bagno_termostato_bagno: + name: Termostato Bagno + room: Bagno + expose: true + climate.camera_termostato_camera: + name: Termostato Camera + room: Camera + expose: true + climate.cucina_termostato_cucina: + name: Termostato Cucina + room: Cucina + expose: true + climate.sala_termostato_sala: + name: Termostato Sala + room: Sala + expose: true + climate.studio_termostato_studio: + name: Termostato Studio + room: Studio + expose: true + cover.all_covers: + name: Tapparella Generale + room: Generale + expose: true + cover.tapparella_cucina: + name: Tapparella Cucina + room: Cucina + expose: true + cover.tapparella_sala: + name: Tapparella Sala + room: Sala + expose: true + cover.tapparella_studio: + name: Tapparella Studio + room: Studio + expose: true + cover.tapparella_camera: + name: Tapparella Camera + room: Camera + expose: true + input_boolean.home_mode_away: + name: Modalità Vacanza + room: Generale + expose: true + media_player.bdf6500_bdf6500: + name: Blue-Ray Camera + room: Camera + expose: true + media_player.roku_yd00dm481414: + name: NowTV Giorgio + room: Sala + expose: true + media_player.ue46c7000_samsung_dtv_rcr: + name: TV Sala + room: Sala + expose: true diff --git a/group/climate.yaml b/group/climate.yaml new file mode 100644 index 00000000..8ba2801b --- /dev/null +++ b/group/climate.yaml @@ -0,0 +1,20 @@ +climate: + name: Termostato + view: true + icon: mdi:thermometer + entities: + - sensor.termostato_cucina + - sensor.termostato_sala + - sensor.termostato_bagno + - sensor.termostato_studio + - sensor.termostato_camera + - group.climate2 + +climate2: + name: Termostato + entities: + - climate.cucina_termostato_cucina + - climate.sala_termostato_sala + - climate.bagno_termostato_bagno + - climate.studio_termostato_studio + - climate.camera_termostato_camera diff --git a/group/covers.yaml b/group/covers.yaml new file mode 100644 index 00000000..e5a77687 --- /dev/null +++ b/group/covers.yaml @@ -0,0 +1,20 @@ +covers: + name: Tapparelle + view: true + icon: mdi:window-closed + entities: + - sensor.tapparella_cucina + - sensor.tapparella_sala + - sensor.tapparella_studio + - sensor.tapparella_camera + - group.covers2 + +covers2: + name: Tapparelle + control: hidden + entities: + - cover.all_covers + - cover.tapparella_cucina + - cover.tapparella_sala + - cover.tapparella_studio + - cover.tapparella_camera diff --git a/group/default.yaml b/group/default.yaml new file mode 100644 index 00000000..a5e772d1 --- /dev/null +++ b/group/default.yaml @@ -0,0 +1,61 @@ +default_view: + name: Principale + view: true + icon: mdi:home + entities: + - device_tracker.giorgio + - device_tracker.laura + - sensor.home_mode + - group.cucina + - group.sala + - group.bagno + - group.studio + - group.camera + - group.home_mode + - gorup.all_automations + +cucina: + name: Cucina + control: hidden + entities: + - cover.tapparella_cucina + - climate.cucina_termostato_cucina + - media_player.google_home + +sala: + name: Sala + control: hidden + entities: + - cover.tapparella_sala + - climate.sala_termostato_sala +# - media_player.roku_yd00dm481414 +# - media_player.ue46c7000_samsung_dtv_rcr + +bagno: + name: Bagno + control: hidden + entities: + - climate.bagno_termostato_bagno + +studio: + name: Studio + control: hidden + entities: + - cover.tapparella_studio + - climate.studio_termostato_studio + +camera: + name: Camera + control: hidden + entities: + - cover.tapparella_camera + - climate.camera_termostato_camera +# - media_player.bdf6500_bdf6500 + +home_mode: + name: Modalità Casa + control: hidden + entities: + - input_boolean.home_mode_day + - input_boolean.home_mode_night + - input_boolean.home_mode_away diff --git a/group/network.yaml b/group/network.yaml new file mode 100644 index 00000000..64dd98ec --- /dev/null +++ b/group/network.yaml @@ -0,0 +1,35 @@ +network: + name: Dispositivi di Rete + view: true + icon: mdi:lan + entities: + - group.speedtest + - group.pfsense +# - group.qnap + +speedtest: + name: Speed Test + control: hidden + entities: + - sensor.speedtest_ping + - sensor.speedtest_download + - sensor.speedtest_upload + +pfsense: + name: pfSense + control: hidden + entities: + - sensor.freebsd_router_kbyte_sec_received + - sensor.freebsd_router_kbyte_sec_sent + +#qnap: +# name: QNAP TS-228 Status +# control: hidden +# entities: +# - sensor.nas_status +# - sensor.nas_cpu_usage +# - sensor.nas_memory_usage +# - 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 diff --git a/group/people.yaml b/group/people.yaml new file mode 100644 index 00000000..871b9d19 --- /dev/null +++ b/group/people.yaml @@ -0,0 +1,8 @@ +people: + name: Persone + view: true + icon: mdi:account-multiple + entities: + - device_tracker.giorgio + - device_tracker.laura + - device_tracker.anna diff --git a/group/settings.yaml b/group/settings.yaml new file mode 100644 index 00000000..235df263 --- /dev/null +++ b/group/settings.yaml @@ -0,0 +1,14 @@ +settings: + name: Configurazione + view: true + icon: mdi:settings + entities: + - group.all_automations + - group.ha_settings + +ha_settings: + name: Configurazione Notifiche + control: hidden + entities: + - input_boolean.speech_notifications + - input_boolean.text_notifications \ No newline at end of file diff --git a/group/weather.yaml b/group/weather.yaml new file mode 100644 index 00000000..50dc3ffc --- /dev/null +++ b/group/weather.yaml @@ -0,0 +1,14 @@ +weather: + name: Previsioni Meteo + view: true + icon: mdi:weather-sunny + entities: + - sun.sun + - sensor.yr_symbol +# - sensor.dark_sky_icon +# - sensor.dark_sky_summary +# - sensor.dark_sky_daily_summary +# - sensor.dark_sky_precip_probability +# - sensor.dark_sky_temperature +# - sensor.dark_sky_cloud_coverage +# - sensor.dark_sky_uv_index diff --git a/input_boolean/home_assistant.yaml b/input_boolean/home_assistant.yaml new file mode 100644 index 00000000..bfeb7f98 --- /dev/null +++ b/input_boolean/home_assistant.yaml @@ -0,0 +1,32 @@ +###################################################################### +# Inputs: Home Mode +###################################################################### + +home_mode_day: + name: Giorno + icon: mdi:white-balance-sunny + initial: on + +home_mode_night: + name: Notte + icon: mdi:weather-night + initial: off + +home_mode_away: + name: Vacanza + icon: mdi:airplane-takeoff + initial: off + +###################################################################### +# Inputs: Notification Settings +###################################################################### + +speech_notifications: + name: Notifiche Vocali + icon: mdi:speaker-wireless + initial: on + +text_notifications: + name: Notifiche Testuali + icon: mdi:message-bulleted + initial: on diff --git a/notify/mail.yaml b/notify/mail.yaml new file mode 100644 index 00000000..6f55c536 --- /dev/null +++ b/notify/mail.yaml @@ -0,0 +1,12 @@ +###################################################################### +# Mail Server Integration +###################################################################### + +- name: mail + platform: smtp + server: !secret mail_server + port: 25 + encryption: none + sender: !secret mail_sender + recipient: !secret mail_recipient + sender_name: Casa Ravera-Testa diff --git a/notify/push.yaml b/notify/push.yaml new file mode 100644 index 00000000..588f7c18 --- /dev/null +++ b/notify/push.yaml @@ -0,0 +1,8 @@ +###################################################################### +# Push Notifications +###################################################################### + +- name: push + platform: html5 + gcm_api_key: !secret google_push_key + gcm_sender_id: !secret google_push_id diff --git a/script/all_covers.yaml b/script/all_covers.yaml new file mode 100644 index 00000000..3be63fa8 --- /dev/null +++ b/script/all_covers.yaml @@ -0,0 +1,30 @@ +###################################################################### +# All Covers Operation +###################################################################### + +all_covers_operation: + alias: "Operazioni su tutte le Tapparelle" + sequence: + - service_template: "cover.{{modus}}_cover" + data: + entity_id: + - cover.tapparella_cucina + - cover.tapparella_sala + - cover.tapparella_camera + - cover.tapparella_studio + +###################################################################### +# All Covers Position +###################################################################### + +all_covers_position: + alias: "Imposta posizione a tutte le Tapparelle" + sequence: + - service: cover.set_cover_position + data_template: + entity_id: + - cover.tapparella_cucina + - cover.tapparella_sala + - cover.tapparella_camera + - cover.tapparella_studio + position: '{{ position }}' diff --git a/script/notify.yaml b/script/notify.yaml new file mode 100644 index 00000000..103fec59 --- /dev/null +++ b/script/notify.yaml @@ -0,0 +1,161 @@ +###################################################################### +# Script: Text Notification +# Inputs: +# - title +# - message +# - enable_persistent +# +# Operations: +# - mail +# - browser push +# - enable_persistent notification +###################################################################### + +notify_text_internal: + alias: Notifiche testuali + sequence: + - service: notify.mail + data_template: + title: "{{ title }}" + message: "{{ message }}" + + - service: notify.push + data_template: + title: "{{ title }}" + message: "{{ message }}" + + - condition: template + value_template: >- + {% if enable_persistent %} + true + {% else %} + false + {% endif %} + + - service: persistent_notification.create + data_template: + title: "{{ title }}" + message: "{{ message }}" + +notify_text: + alias: Notifiche testuali + sequence: + - condition: state + entity_id: input_boolean.text_notifications + state: 'on' + + - service: script.notify_text_internal + data_template: + title: >- + {# Check Null Input #} + {% if title | length == 0 %} + {% set title = 'Home Assistant' %} + {% endif %} + {{ title }} + message: "{{ message }}" + enable_persistent: > + {# Check Null Input #} + {% if enable_persistent %} + true + {% else %} + false + {% endif %} + +###################################################################### +# Script: Voice Notification +# - google home +###################################################################### + +notify_voice: + alias: Notifiche vocali + sequence: + - condition: state + entity_id: input_boolean.speech_notifications + state: 'on' + + - service: media_player.volume_set + data_template: + entity_id: >- + {# Check Null Input #} + {% if media_player | length == 0 %} + {% set media_player = 'media_player.google_home' %} + {% endif %} + {{ media_player }} + volume_level: >- + {# Default Values #} + {% set defaultVolume = 0.30 %} + {% set maxDayVolume = 0.50 %} + {% set maxNightVolume = 0.20 %} + + {# Check Null Input #} + {% if volume_level | length == 0 %} + {% set volume_level = defaultVolume %} + {% endif %} + + {# Day/Night mode #} + {% if is_state('input_boolean.home_mode_night', 'off') %} + {% if ((volume_level)|float) > ((maxDayVolume)|float) %} + {{ maxDayVolume }} + {% else %} + {{ volume_level }} + {% endif %} + {% else %} + {% if ((volume_level)|float) > ((maxNightVolume)|float) %} + {{ maxNightVolume }} + {% else %} + {{ volume_level }} + {% endif %} + {% endif %} + + - service: tts.google_say + data_template: + entity_id: >- + {# Check Null Input #} + {% if media_player | length == 0 %} + {% set media_player = 'media_player.google_home' %} + {% endif %} + {{ media_player }} + language: >- + {# Check Null Input #} + {% if language | length == 0 %} + {% set language = 'it' %} + {% endif %} + {{ language }} + message: "{{ message }}" + +###################################################################### +# Script: Global Notification (Text+Voice) +# Inputs: +# - title +# - media_player +# - volume_level +# _ language +# - message +# - enable_persistent +# +# Operations: +# - notify_text +# - notify_voice +###################################################################### + +notify_all: + alias: Notifiche globali (Testo+Voce) + sequence: + - service: script.notify_text + data_template: + title: "{{ title }}" + message: "{{ message }}" + enable_persistent: > + {# Check Null Input #} + {% if enable_persistent %} + true + {% else %} + false + {% endif %} + + - service: script.notify_voice + data_template: + media_player: "{{ media_player }}" + volume_level: "{{ volume_level }}" + language: "{{ language }}" + message: "{{ message }}" diff --git a/script/speech_engine.yaml b/script/speech_engine.yaml new file mode 100644 index 00000000..fe291329 --- /dev/null +++ b/script/speech_engine.yaml @@ -0,0 +1,39 @@ +###################################################################### +# Script: Speech Engine +# Inputs: +# - media_player +# - volume_level +# - message +# - enable_greeting +# +# - announcement +# - welcome_message +###################################################################### + +speech_engine: + alias: Speech Engine + sequence: + - service: script.notify_voice + data_template: + media_player: >- + {{ media_player }} + volume_level: >- + {{ volume_level }} + language: >- + {{ language }} + message: >- + {# greeting message #} + {% if enable_greeting == true %} + {% if now().strftime('%H')|int >= 7 and now().strftime('%H')|int < 12 %} + Buongiorno. + {% elif now().strftime('%H')|int >= 12 and now().strftime('%H')|int < 17 %} + Buonpomeriggio. + {% elif now().strftime('%H')|int >= 17 and now().strftime('%H')|int < 23 %} + Buonasera. + {% else %} + Buonanotte. + {% endif %} + {% endif %} + + {# generic message #} + {{ message }} diff --git a/sensor/climates.yaml b/sensor/climates.yaml new file mode 100644 index 00000000..57548d28 --- /dev/null +++ b/sensor/climates.yaml @@ -0,0 +1,38 @@ +###################################################################### +# Sensor: Temperature from Radiator Thermostat +###################################################################### + +- platform: template + sensors: + termostato_cucina: + friendly_name: "Cucina" + value_template: "{{ state_attr('climate.cucina_termostato_cucina', 'current_temperature') }}" + unit_of_measurement: '°C' + +- platform: template + sensors: + termostato_sala: + friendly_name: "Sala" + value_template: "{{ state_attr('climate.sala_termostato_sala', 'current_temperature') }}" + unit_of_measurement: '°C' + +- platform: template + sensors: + termostato_bagno: + friendly_name: "Bagno" + value_template: "{{ state_attr('climate.bagno_termostato_bagno', 'current_temperature') }}" + unit_of_measurement: '°C' + +- platform: template + sensors: + termostato_studio: + friendly_name: "Studio" + value_template: "{{ state_attr('climate.studio_termostato_studio', 'current_temperature') }}" + unit_of_measurement: '°C' + +- platform: template + sensors: + termostato_camera: + friendly_name: "Camera" + value_template: "{{ state_attr('climate.camera_termostato_camera', 'current_temperature') }}" + unit_of_measurement: '°C' diff --git a/sensor/covers.yaml b/sensor/covers.yaml new file mode 100644 index 00000000..ff51e265 --- /dev/null +++ b/sensor/covers.yaml @@ -0,0 +1,31 @@ +###################################################################### +# Sensor: Cover position +###################################################################### + +- platform: template + sensors: + tapparella_cucina: + friendly_name: "Cucina" + value_template: "{{ state_attr('cover.tapparella_cucina', 'current_position') }}" + unit_of_measurement: '%' + +- platform: template + sensors: + tapparella_sala: + friendly_name: "Sala" + value_template: "{{ state_attr('cover.tapparella_sala', 'current_position') }}" + unit_of_measurement: '%' + +- platform: template + sensors: + tapparella_studio: + friendly_name: "Studio" + value_template: "{{ state_attr('cover.tapparella_studio', 'current_position') }}" + unit_of_measurement: '%' + +- platform: template + sensors: + tapparella_camera: + friendly_name: "Camera" + value_template: "{{ state_attr('cover.tapparella_camera', 'current_position') }}" + unit_of_measurement: '%' diff --git a/sensor/home_assistant.yaml b/sensor/home_assistant.yaml new file mode 100644 index 00000000..2deb7c3f --- /dev/null +++ b/sensor/home_assistant.yaml @@ -0,0 +1,27 @@ +###################################################################### +# Sensor: Home Mode +###################################################################### + +- platform: template + sensors: + home_mode: + friendly_name: Modalità Casa + entity_id: input_boolean.home_mode_day, + input_boolean.home_mode_night, + input_boolean.home_mode_away + value_template: >- + {% if is_state('input_boolean.home_mode_day', 'on') %} + giorno + {% elif is_state('input_boolean.home_mode_night', 'on') %} + notte + {% elif is_state('input_boolean.home_mode_away', 'on') %} + vacanza + {% endif %} + icon_template: >- + {% if is_state('input_boolean.home_mode_day', 'on') %} + mdi:white-balance-sunny + {% elif is_state('input_boolean.home_mode_night', 'on') %} + mdi:weather-night + {% elif is_state('input_boolean.home_mode_away', 'on') %} + mdi:airplane-takeoff + {% endif %} diff --git a/sensor/qnap.yaml.disabled b/sensor/qnap.yaml.disabled new file mode 100644 index 00000000..957acb14 --- /dev/null +++ b/sensor/qnap.yaml.disabled @@ -0,0 +1,15 @@ +###################################################################### +# QNAP Sensor +###################################################################### + +- platform: qnap + host: !secret qnap_host + username: !secret qnap_username + password: !secret qnap_password + monitored_conditions: + - status + - system_temp + - cpu_usage + - memory_percent_used + - drive_temp + - volume_percentage_used \ No newline at end of file diff --git a/sensor/speedtest.yaml b/sensor/speedtest.yaml new file mode 100644 index 00000000..ee108c0e --- /dev/null +++ b/sensor/speedtest.yaml @@ -0,0 +1,15 @@ +###################################################################### +# Speed Test Sensor +###################################################################### + +- platform: speedtest + minute: 0 + hour: + - 0 + - 6 + - 12 + - 18 + monitored_conditions: + - ping + - download + - upload diff --git a/sensor/time.yaml b/sensor/time.yaml new file mode 100644 index 00000000..fbb32890 --- /dev/null +++ b/sensor/time.yaml @@ -0,0 +1,8 @@ +- platform: time_date + display_options: + - 'time' + - 'date' +# - 'date_time' + - 'time_date' +# - 'time_utc' +# - 'beat' diff --git a/sensor/weather.yaml b/sensor/weather.yaml new file mode 100644 index 00000000..cba6e44f --- /dev/null +++ b/sensor/weather.yaml @@ -0,0 +1,53 @@ +###################################################################### +# Weather Sensor +###################################################################### + +- platform: yr + +#- platform: openweathermap +# api_key: !secret openweathermap_key +# forecast: 1 +# latitude: !secret home_latitude +# longitude: !secret home_longitude +# language: it +# monitored_conditions: +# - weather +# - temperature +# - humidity +# - wind_speed +# - pressure +# - rain +# - snow +# - clouds + +- platform: darksky + api_key: !secret darksky_key + forecast: + - 0 + - 1 + - 2 + - 3 + language: it + latitude: !secret home_latitude + longitude: !secret home_longitude + monitored_conditions: + - summary + - icon + - precip_type + - precip_intensity + - precip_probability + - temperature + - dew_point + - wind_speed + - cloud_cover + - humidity + - pressure + - visibility + - minutely_summary + - hourly_summary + - daily_summary + - temperature_high + - temperature_low + - uv_index + units: si + update_interval: 00:30 diff --git a/www/google0c82ce29df72d7c2.html b/www/google0c82ce29df72d7c2.html new file mode 100644 index 00000000..23b3eeaf --- /dev/null +++ b/www/google0c82ce29df72d7c2.html @@ -0,0 +1 @@ +google-site-verification: google0c82ce29df72d7c2.html \ No newline at end of file diff --git a/www/rooms/bagno.jpg b/www/rooms/bagno.jpg new file mode 100644 index 00000000..7567456a Binary files /dev/null and b/www/rooms/bagno.jpg differ diff --git a/www/rooms/camera.jpg b/www/rooms/camera.jpg new file mode 100644 index 00000000..740be2c0 Binary files /dev/null and b/www/rooms/camera.jpg differ diff --git a/www/rooms/cucina.jpg b/www/rooms/cucina.jpg new file mode 100644 index 00000000..a9eb6e08 Binary files /dev/null and b/www/rooms/cucina.jpg differ diff --git a/www/rooms/sala.jpg b/www/rooms/sala.jpg new file mode 100644 index 00000000..b73a09c9 Binary files /dev/null and b/www/rooms/sala.jpg differ diff --git a/www/rooms/studio.jpg b/www/rooms/studio.jpg new file mode 100644 index 00000000..751b2d17 Binary files /dev/null and b/www/rooms/studio.jpg differ diff --git a/www/users/Anna.jpg b/www/users/Anna.jpg new file mode 100644 index 00000000..2a58c844 Binary files /dev/null and b/www/users/Anna.jpg differ diff --git a/www/users/Giorgio.jpg b/www/users/Giorgio.jpg new file mode 100644 index 00000000..1583d340 Binary files /dev/null and b/www/users/Giorgio.jpg differ diff --git a/www/users/Laura.jpg b/www/users/Laura.jpg new file mode 100644 index 00000000..fefcd805 Binary files /dev/null and b/www/users/Laura.jpg differ diff --git a/zone/home.yaml b/zone/home.yaml new file mode 100644 index 00000000..b53b8ce4 --- /dev/null +++ b/zone/home.yaml @@ -0,0 +1,9 @@ +###################################################################### +# Zone: Home +###################################################################### + +name: Casa +latitude: !secret home_latitude +longitude: !secret home_longitude +radius: 50 +icon: mdi:home diff --git a/zone/work.yaml b/zone/work.yaml new file mode 100644 index 00000000..864221a4 --- /dev/null +++ b/zone/work.yaml @@ -0,0 +1,9 @@ +###################################################################### +# Zone Work +###################################################################### + +name: Lavoro +latitude: !secret work_latitude +longitude: !secret work_longitude +radius: 50 +icon: mdi:city