]> git.giorgioravera.it Git - homeassistant.git/commitdiff
change name to folder scripts automations and groups
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Thu, 21 May 2020 15:10:31 +0000 (17:10 +0200)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Thu, 21 May 2020 15:10:31 +0000 (17:10 +0200)
64 files changed:
automation/away_mode.yaml [deleted file]
automation/climate.yaml [deleted file]
automation/day.yaml [deleted file]
automation/doors.yaml [deleted file]
automation/energy.yaml [deleted file]
automation/home_assistant.yaml [deleted file]
automation/media_player.yaml [deleted file]
automation/night.yaml [deleted file]
automation/speech.yaml [deleted file]
automation/startup.yaml [deleted file]
automation/test_mode.yaml [deleted file]
automation/themes.yaml [deleted file]
automation/update_notifications.yaml [deleted file]
automations/away_mode.yaml [new file with mode: 0644]
automations/climate.yaml [new file with mode: 0644]
automations/day.yaml [new file with mode: 0644]
automations/doors.yaml [new file with mode: 0644]
automations/energy.yaml [new file with mode: 0644]
automations/home_assistant.yaml [new file with mode: 0644]
automations/media_player.yaml [new file with mode: 0644]
automations/night.yaml [new file with mode: 0644]
automations/speech.yaml [new file with mode: 0644]
automations/startup.yaml [new file with mode: 0644]
automations/test_mode.yaml [new file with mode: 0644]
automations/themes.yaml [new file with mode: 0644]
automations/update_notifications.yaml [new file with mode: 0644]
binary_sensor/doors.yaml [deleted file]
binary_sensor/doors.yaml.disabled [new file with mode: 0644]
group/climate.yaml [deleted file]
group/covers.yaml [deleted file]
group/doors.yaml [deleted file]
group/lights.yaml [deleted file]
group/lights_bathroom.yaml [deleted file]
group/lights_livingroom.yaml [deleted file]
group/people.yaml [deleted file]
group/shelly.yaml [deleted file]
groups/climate.yaml [new file with mode: 0644]
groups/covers.yaml [new file with mode: 0644]
groups/doors.yaml [new file with mode: 0644]
groups/lights.yaml [new file with mode: 0644]
groups/lights_bathroom.yaml [new file with mode: 0644]
groups/lights_livingroom.yaml [new file with mode: 0644]
groups/people.yaml [new file with mode: 0644]
groups/shelly.yaml [new file with mode: 0644]
script/audio.yaml [deleted file]
script/climate.yaml [deleted file]
script/covers.yaml.disabled [deleted file]
script/home_assistant.yaml [deleted file]
script/media_player.yaml [deleted file]
script/notify.yaml [deleted file]
script/shelly.yaml [deleted file]
script/speech_engine.yaml [deleted file]
scripts/audio.yaml [new file with mode: 0644]
scripts/climate.yaml [new file with mode: 0644]
scripts/covers.yaml.disabled [new file with mode: 0644]
scripts/home_assistant.yaml [new file with mode: 0644]
scripts/media_player.yaml [new file with mode: 0644]
scripts/notify.yaml [new file with mode: 0644]
scripts/shelly.yaml [new file with mode: 0644]
scripts/speech_engine.yaml [new file with mode: 0644]
sensor/switch.yaml [deleted file]
sensor/switch.yaml.disabled [new file with mode: 0644]
sensor/xiaomi.yaml [deleted file]
sensor/xiaomi.yaml.disabled [new file with mode: 0644]

diff --git a/automation/away_mode.yaml b/automation/away_mode.yaml
deleted file mode 100644 (file)
index 64bc9c3..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-######################################################################
-# Away Mode: Enable Action
-######################################################################
-
-- alias: "Modalità Vacanza: Azione on"
-  initial_state: 'on'
-
-  trigger:
-    - platform: state
-      entity_id: input_boolean.home_mode_away
-      to: 'on'
-
-  action:
-    - service: script.notify_voice
-      data_template:
-        message: "Modalità vacanza abilitata"
-
-######################################################################
-# Away Mode: Disable Action
-######################################################################
-
-- alias: "Modalità Vacanza: Azione off"
-  initial_state: 'on'
-
-  trigger:
-    # Manual Disable
-    - platform: state
-      entity_id: input_boolean.home_mode_away
-      to: 'off'
-    # Back home
-    - platform: state
-      entity_id: group.residents
-      to: 'home'
-    # End of Away Period
-    - platform: template
-      value_template: "{{ states('sensor.time_date') == (state_attr('input_datetime.away_mode_end', 'timestamp') | int | timestamp_custom('%H:%M, %Y-%m-%d', true)) }}"
-
-  action:
-    - service: script.notify_voice
-      data_template:
-        message: "Modalità vacanza disabilitata"
-    - service: input_boolean.turn_off
-      data:
-        entity_id: input_boolean.home_mode_away
diff --git a/automation/climate.yaml b/automation/climate.yaml
deleted file mode 100644 (file)
index 4f14a9e..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-######################################################################
-# Climate: Weekly Schedule
-# - script.climate_daily_schedule
-######################################################################
-
-- alias: "Termosifoni: Schedulazione giornaliera feriale"
-  initial_state: 'off'
-
-  trigger:
-    - platform: time
-      at: '06:30:00'
-    - platform: time
-      at: '07:30:00'
-    - platform: time
-      at: '09:00:00'
-    - platform: time
-      at: '18:30:00'
-    - platform: time
-      at: '22:00:00'
-#    - platform: state
-#      entity_id: input_boolean.home_mode_away
-#      to: 'off'
-
-  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: script.climate_daily_schedule
-      data_template:
-        entity_id: climate.cucina_termostato_cucina
-        temp1: 20
-        temp2: 18
-        temp3: 20
-        temp4: 20.5
-        temp5: 16
-
-    - service: script.climate_daily_schedule
-      data_template:
-        entity_id: climate.sala_termostato_sala
-        temp1: 18
-        temp2: 18
-        temp3: 19.5
-        temp4: 20
-        temp5: 16
-
-    - service: script.climate_daily_schedule
-      data_template:
-        entity_id: climate.bagno_termostato_bagno
-        temp1: 19
-        temp2: 18
-        temp3: 19
-        temp4: 19.5
-        temp5: 16
-
-    - service: script.climate_daily_schedule
-      data_template:
-        entity_id: climate.studio_termostato_studio
-        temp1: 18
-        temp2: 18
-        temp3: 19.5
-        temp4: 20
-        temp5: 16
-
-    - service: script.climate_daily_schedule
-      data_template:
-        entity_id: climate.camera_termostato_camera
-        temp1: 19
-        temp2: 18
-        temp3: 19
-        temp4: 19.5
-        temp5: 16
-
-######################################################################
-# Climate: Away Mode
-# - climate.set_operation_mode
-# - climate.set_temperature
-######################################################################
-
-- alias: "Termosifoni: Modalità vacanza"
-  initial_state: 'off'
-
-  trigger:
-    - platform: state
-      entity_id: input_boolean.home_mode_away
-      to: 'on'
-    - platform: state
-      entity_id: input_boolean.home_mode_away
-      to: 'off'
-
-  condition: []
-
-  action:
-    - service: script.climate_away_mode
-      data_template:
-        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.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/automation/day.yaml b/automation/day.yaml
deleted file mode 100644 (file)
index 35e77a2..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-######################################################################
-# Wake Up Giorgio
-# - Every working day it opens Studio Cover
-######################################################################
-
-- alias: "Risveglio Giorgio"
-  #initial_state: 'on'
-
-  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_cucina
-#          - cover.tapparella_sala
-          - cover.tapparella_studio
-        position: 85
diff --git a/automation/doors.yaml b/automation/doors.yaml
deleted file mode 100644 (file)
index d66b7ef..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-######################################################################
-# Home Door: Switch on Lights
-#
-# Actions:
-# - light.turn_on
-# - delay
-#
-# Note: delay is necessary to avoid multiple opening in 5 minutes
-######################################################################
-
-- alias: "Porta Casa: Accendi Luce Corridoio"
-  initial_state: 'on'
-
-  trigger:
-    - platform: state
-      entity_id: binary_sensor.porta_casa
-      to: 'on'
-
-  condition:
-     - condition: numeric_state
-       entity_id: sun.sun
-       value_template: "{{ state_attr('sun.sun', 'elevation') }}"
-       below: -10
-
-  action:
-    - delay: 00:00:01
-    - service: light.turn_on
-      entity_id: light.luce_corridoio
-    - delay: '00:05:00'
diff --git a/automation/energy.yaml b/automation/energy.yaml
deleted file mode 100644 (file)
index 6151b2d..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-######################################################################
-# Energy: Power Consumption Notifications
-######################################################################
-
-- alias: "Allarme Consumo Energetico"
-  initial_state: 'on'
-
-  trigger:
-    - platform: numeric_state
-      entity_id: sensor.potenza_istantanea
-      above: 2950
-
-  action:
-    service: script.notify_all
-    data_template:
-      title: "Home Assistant - Allarme Consumo Energetico"
-      message: "Consumo energetico elevato ({{ states.sensor.potenza_istantanea.state }})."
-      enable_persistent: 0
-      volume_level: 0.4
diff --git a/automation/home_assistant.yaml b/automation/home_assistant.yaml
deleted file mode 100644 (file)
index 5ea0785..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-######################################################################
-# Home Assistant: Management of the Home Mode Button
-######################################################################
-
-- alias: "Home Assistant: Cambio modalità On"
-  initial_state: '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"
-  initial_state: 'on'
-
-  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 >= 8 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"
-  initial_state: 'on'
-
-  trigger:
-    - platform: time
-      at: '08: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 >= 8 and now().strftime('%H')|int < 23 %}
-            input_boolean.home_mode_day
-          {% else %}
-            input_boolean.home_mode_night
-          {% endif %}
-    
-    - service: script.volume_manager
-
-######################################################################
-# Home Assistant: Management of Speech Notifications
-######################################################################
-
-- alias: "Home Assistant: Gestione notifiche vocali"
-  initial_state: 'on'
-
-  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 trigger.to_state.state == 'on' %}
-          input_boolean.turn_off
-        {% else %}
-          input_boolean.turn_on
-        {% endif %}
-      data:
-        entity_id: input_boolean.speech_notifications
-
-######################################################################
-# Home Assistant: Weekly Clean Log
-# - script.homeassistant_clearlog
-######################################################################
-
-- alias: "Home Assistant: Pulitura settimanale log"
-  initial_state: 'on'
-
-  trigger: 
-    - platform: time
-      at: '00:00:00'
-
-  condition:
-    - condition: time
-      weekday: [mon]
-
-  action:
-    - service: script.homeassistant_clearlog
diff --git a/automation/media_player.yaml b/automation/media_player.yaml
deleted file mode 100644 (file)
index dcb4901..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-######################################################################
-# Google Home: speeak message
-# - script.notify_voice
-######################################################################
-
-- alias: "Google Home: Pronuncia testo"
-  initial_state: 'on'
-
-  trigger:
-    - platform: state
-      entity_id: input_text.google_home_speak
-
-  condition: []
-
-  action:
-    - service: script.speech_engine
-      data_template:
-        media_player: "media_player.google_home"
-        message: "{{ trigger.to_state.state }}"
diff --git a/automation/night.yaml b/automation/night.yaml
deleted file mode 100644 (file)
index 99870b4..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-######################################################################
-# Night Time
-# - Switch off all covers
-######################################################################
-
-- alias: "Modalità Notte"
-  initial_state: 'off'
-
-  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.tapparella_globale
-        position: 15
-
-    - service: cover.set_cover_position
-      data:
-        entity_id: cover.tapparella_camera
-        position: 0
diff --git a/automation/speech.yaml b/automation/speech.yaml
deleted file mode 100644 (file)
index 5d9acdd..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-######################################################################
-# Welcome message
-#
-# Operations:
-# - script.speech_engine
-######################################################################
-
-- alias: Saluto di benvenuto
-  initial_state: 'on'
-
-  trigger:
-    - platform: zone
-      entity_id:
-        - person.giorgio
-        - person.laura
-        # - person.anna
-      zone: zone.home
-      event: enter
-#    - platform: state
-#      entity_id: 
-#        - device_tracker.s9
-#        - device_tracker.a5
-#      to: 'home'
-#      for: '00:00:30'
-
-  condition: []
-
-  action:
-#    - wait_template: >-
-#        {# Giorgio #}
-#        {% if trigger.entity_id == 'person.giorgio' %}
-#          {% if is_state('device_tracker.s9', 'home') %}
-#            true
-#          {% else %}
-#            false
-#          {% endif %}
-#        
-#        {# Laura #}
-#        {% elif trigger.entity_id == 'person.laura' %}
-#          {% if is_state('device_tracker.a5', 'home') %}
-#            true
-#          {% else %}
-#            false
-#          {% endif %}
-#        
-#        {# Anna #}
-#        {% elif trigger.entity_id == 'person.anna' %}
-#          {% if is_state('device_tracker.a3', 'home') %}
-#            true
-#          {% else %}
-#            false
-#          {% endif %}
-#       
-#        {# Others #}
-#        {% else %}
-#          false
-#        {% endif %}
-#
-#      timeout: '00:30:00'
-#      continue_on_timeout: 'false'
-
-    - wait_template: "{{ is_state('binary_sensor.porta_casa', 'on') }}"
-      timeout: '00:30:00'
-      continue_on_timeout: 'false'
-
-    - delay: 00:00:05
-
-    - service: script.speech_engine
-      data_template:
-        message: !include ../templates/welcome_message.yaml
-        enable_greeting: 0
-
-######################################################################
-# Hourly message
-#
-# Operations:
-# - script.speech_engine
-######################################################################
-
-- alias: "Saluto orario"
-  initial_state: 'off'
-  
-  trigger:
-    - platform: time
-      at: '12:00:00'
-
-  condition: []
-
-  action:
-    - service: script.speech_engine
-      data_template:
-        message: >- 
-          {% set hour = now().strftime('%H') %}
-          "Sono le {{ hour }} e tutto va bene."
diff --git a/automation/startup.yaml b/automation/startup.yaml
deleted file mode 100644 (file)
index 446f798..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-######################################################################\r
-# Startup Automation: Restart on Error\r
-######################################################################\r
-\r
-- alias: "Startup: Restart on Error"\r
-\r
-  trigger:\r
-    - platform: homeassistant\r
-      event: start\r
-  \r
-  action:\r
-    - delay: 00:00:60\r
-    - condition: state\r
-      entity_id: persistent_notification.invalid_config\r
-      state: 'notifying'\r
-    - service: script.homeassistant_restart\r
-\r
-######################################################################\r
-# Startup Automation: Google Sync\r
-######################################################################\r
-\r
-- alias: "Startup: Google Sync"\r
-\r
-  trigger:\r
-    - platform: homeassistant\r
-      event: start\r
-\r
-  action:\r
-    - service: script.homeassistant_google_home_sync\r
diff --git a/automation/test_mode.yaml b/automation/test_mode.yaml
deleted file mode 100644 (file)
index 1b970c5..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-######################################################################
-# Test Mode: Enable Action
-######################################################################
-
-- alias: "Modalità Test: Azione on"
-  initial_state: 'on'
-
-  trigger:
-    - platform: state
-      entity_id: input_boolean.test_mode
-      to: 'on'
-
-  action:\r
-
-    - service: automation.turn_off
-      entity_id: automation.startup_restart_on_error
-
-    - service: automation.turn_off
-      entity_id: automation.startup_google_sync
-
-######################################################################
-# Test Mode: Disable Action
-######################################################################
-
-- alias: "Modalità Test: Azione off"
-  initial_state: 'on'
-
-  trigger:
-    - platform: state
-      entity_id: input_boolean.test_mode
-      to: 'off'
-
-  action:
-    - service: automation.turn_on
-      entity_id: automation.startup_restart_on_error
-
-    - service: automation.turn_on
-      entity_id: automation.startup_google_sync
diff --git a/automation/themes.yaml b/automation/themes.yaml
deleted file mode 100644 (file)
index 6cba55e..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-######################################################################
-# Themes: Management of Day/Night Mode
-######################################################################
-
-- alias: "Temi: Modalità giorno/Notte"
-  initial_state: 'on'
-
-  trigger:
-    - platform: state
-      entity_id: input_boolean.home_mode_day
-      to: 'on'
-    - platform: state
-      entity_id: input_boolean.home_mode_night
-      to: 'on'
-    - platform: state
-      entity_id: input_boolean.home_mode_away
-      to: 'on'
-
-  action:
-    - service: frontend.set_theme
-      data_template:
-        name: >-
-          {% if trigger.entity_id == 'input_boolean.home_mode_day' %}
-            default
-          {% endif %}
-          {% if trigger.entity_id == 'input_boolean.home_mode_night' %}
-            darkish
-          {% endif %}
-          {% if trigger.entity_id == 'input_boolean.home_mode_away' %}
-            reeder_dark
-          {% endif %}
diff --git a/automation/update_notifications.yaml b/automation/update_notifications.yaml
deleted file mode 100644 (file)
index 965642e..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-######################################################################\r
-# Update Notification: Home Assistant\r
-######################################################################\r
-\r
-- alias: "Update Notification: Home Assistant"\r
-  initial_state: 'on'\r
-\r
-  trigger:\r
-    - platform: state\r
-      entity_id: binary_sensor.updater\r
-      to: 'on'\r
-\r
-    - platform: homeassistant\r
-      event: start\r
-\r
-  condition:\r
-    condition: state\r
-    entity_id: binary_sensor.updater\r
-    state: 'on'\r
-\r
-  action:\r
-    - delay: '00:00:5'\r
-    - service: script.notify_text\r
-      data_template:\r
-        title: "Home Assistant - Aggiornamento"\r
-        message: "E' disponibile un aggiornamento per Home Assistant {{ state_attr('binary_sensor.updater', 'newest_version') }}. {{now().strftime('%Y-%m-%d %I:%M %p')}}"\r
-        notification_id: "update"\r
-        enable_persistent: 1\r
-    \r
-    - service: input_boolean.turn_on\r
-      entity_id: input_boolean.update\r
-\r
-######################################################################\r
-# Update Notification: Shelly\r
-######################################################################\r
-\r
-- alias: "Update Notification: Shelly"\r
-  initial_state: 'on'\r
-\r
-  trigger:\r
-    - platform: state\r
-      entity_id: group.shelly\r
-      to: 'on'\r
-      \r
-    - platform: homeassistant\r
-      event: start\r
-      \r
-  condition:\r
-    condition: state\r
-    entity_id: group.shelly\r
-    state: 'on'\r
-\r
-  action:\r
-    - delay: '00:00:10'\r
-    - service: script.notify_text\r
-      data_template:\r
-        title: "Shelly - Aggiornamento"\r
-        message: "Sono disponibili aggiornamenti per i dispositivi Shelly"\r
-        notification_id: "update"\r
-        enable_persistent: 1\r
-\r
-    - service: input_boolean.turn_on\r
-      entity_id: input_boolean.update\r
-\r
-######################################################################\r
-# Update Notification: HACS\r
-######################################################################\r
-\r
-- alias: "Update Notification: HACS"\r
-  initial_state: 'on'\r
-\r
-  trigger:\r
-    - platform: numeric_state\r
-      entity_id: sensor.hacs\r
-      above: 0\r
-\r
-  action:\r
-    - delay: '00:00:15'\r
-    - service: script.notify_text\r
-      data_template:\r
-        title: "HACS - Aggiornamento"\r
-        message: "Sono disponibili aggiornamenti per i moduli HACS"\r
-        notification_id: "update"\r
-        enable_persistent: 1\r
-\r
-    - service: input_boolean.turn_on\r
-      entity_id: input_boolean.update\r
-\r
-######################################################################\r
-# Update: Aknowledge update\r
-#\r
-# Actions:\r
-# - persistent_notification.dismiss\r
-######################################################################\r
-- alias: "Update: Riconoscimento Aggiornamenti"\r
-  initial_state: 'on'\r
-\r
-  trigger:\r
-    platform: state\r
-    entity_id: input_boolean.update\r
-    to: 'off'\r
-\r
-  action:\r
-    - service: persistent_notification.dismiss\r
-      data_template:\r
-        notification_id: "update"\r
diff --git a/automations/away_mode.yaml b/automations/away_mode.yaml
new file mode 100644 (file)
index 0000000..64bc9c3
--- /dev/null
@@ -0,0 +1,44 @@
+######################################################################
+# Away Mode: Enable Action
+######################################################################
+
+- alias: "Modalità Vacanza: Azione on"
+  initial_state: 'on'
+
+  trigger:
+    - platform: state
+      entity_id: input_boolean.home_mode_away
+      to: 'on'
+
+  action:
+    - service: script.notify_voice
+      data_template:
+        message: "Modalità vacanza abilitata"
+
+######################################################################
+# Away Mode: Disable Action
+######################################################################
+
+- alias: "Modalità Vacanza: Azione off"
+  initial_state: 'on'
+
+  trigger:
+    # Manual Disable
+    - platform: state
+      entity_id: input_boolean.home_mode_away
+      to: 'off'
+    # Back home
+    - platform: state
+      entity_id: group.residents
+      to: 'home'
+    # End of Away Period
+    - platform: template
+      value_template: "{{ states('sensor.time_date') == (state_attr('input_datetime.away_mode_end', 'timestamp') | int | timestamp_custom('%H:%M, %Y-%m-%d', true)) }}"
+
+  action:
+    - service: script.notify_voice
+      data_template:
+        message: "Modalità vacanza disabilitata"
+    - service: input_boolean.turn_off
+      data:
+        entity_id: input_boolean.home_mode_away
diff --git a/automations/climate.yaml b/automations/climate.yaml
new file mode 100644 (file)
index 0000000..4f14a9e
--- /dev/null
@@ -0,0 +1,122 @@
+######################################################################
+# Climate: Weekly Schedule
+# - script.climate_daily_schedule
+######################################################################
+
+- alias: "Termosifoni: Schedulazione giornaliera feriale"
+  initial_state: 'off'
+
+  trigger:
+    - platform: time
+      at: '06:30:00'
+    - platform: time
+      at: '07:30:00'
+    - platform: time
+      at: '09:00:00'
+    - platform: time
+      at: '18:30:00'
+    - platform: time
+      at: '22:00:00'
+#    - platform: state
+#      entity_id: input_boolean.home_mode_away
+#      to: 'off'
+
+  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: script.climate_daily_schedule
+      data_template:
+        entity_id: climate.cucina_termostato_cucina
+        temp1: 20
+        temp2: 18
+        temp3: 20
+        temp4: 20.5
+        temp5: 16
+
+    - service: script.climate_daily_schedule
+      data_template:
+        entity_id: climate.sala_termostato_sala
+        temp1: 18
+        temp2: 18
+        temp3: 19.5
+        temp4: 20
+        temp5: 16
+
+    - service: script.climate_daily_schedule
+      data_template:
+        entity_id: climate.bagno_termostato_bagno
+        temp1: 19
+        temp2: 18
+        temp3: 19
+        temp4: 19.5
+        temp5: 16
+
+    - service: script.climate_daily_schedule
+      data_template:
+        entity_id: climate.studio_termostato_studio
+        temp1: 18
+        temp2: 18
+        temp3: 19.5
+        temp4: 20
+        temp5: 16
+
+    - service: script.climate_daily_schedule
+      data_template:
+        entity_id: climate.camera_termostato_camera
+        temp1: 19
+        temp2: 18
+        temp3: 19
+        temp4: 19.5
+        temp5: 16
+
+######################################################################
+# Climate: Away Mode
+# - climate.set_operation_mode
+# - climate.set_temperature
+######################################################################
+
+- alias: "Termosifoni: Modalità vacanza"
+  initial_state: 'off'
+
+  trigger:
+    - platform: state
+      entity_id: input_boolean.home_mode_away
+      to: 'on'
+    - platform: state
+      entity_id: input_boolean.home_mode_away
+      to: 'off'
+
+  condition: []
+
+  action:
+    - service: script.climate_away_mode
+      data_template:
+        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.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/automations/day.yaml b/automations/day.yaml
new file mode 100644 (file)
index 0000000..35e77a2
--- /dev/null
@@ -0,0 +1,30 @@
+######################################################################
+# Wake Up Giorgio
+# - Every working day it opens Studio Cover
+######################################################################
+
+- alias: "Risveglio Giorgio"
+  #initial_state: 'on'
+
+  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_cucina
+#          - cover.tapparella_sala
+          - cover.tapparella_studio
+        position: 85
diff --git a/automations/doors.yaml b/automations/doors.yaml
new file mode 100644 (file)
index 0000000..d66b7ef
--- /dev/null
@@ -0,0 +1,29 @@
+######################################################################
+# Home Door: Switch on Lights
+#
+# Actions:
+# - light.turn_on
+# - delay
+#
+# Note: delay is necessary to avoid multiple opening in 5 minutes
+######################################################################
+
+- alias: "Porta Casa: Accendi Luce Corridoio"
+  initial_state: 'on'
+
+  trigger:
+    - platform: state
+      entity_id: binary_sensor.porta_casa
+      to: 'on'
+
+  condition:
+     - condition: numeric_state
+       entity_id: sun.sun
+       value_template: "{{ state_attr('sun.sun', 'elevation') }}"
+       below: -10
+
+  action:
+    - delay: 00:00:01
+    - service: light.turn_on
+      entity_id: light.luce_corridoio
+    - delay: '00:05:00'
diff --git a/automations/energy.yaml b/automations/energy.yaml
new file mode 100644 (file)
index 0000000..6151b2d
--- /dev/null
@@ -0,0 +1,19 @@
+######################################################################
+# Energy: Power Consumption Notifications
+######################################################################
+
+- alias: "Allarme Consumo Energetico"
+  initial_state: 'on'
+
+  trigger:
+    - platform: numeric_state
+      entity_id: sensor.potenza_istantanea
+      above: 2950
+
+  action:
+    service: script.notify_all
+    data_template:
+      title: "Home Assistant - Allarme Consumo Energetico"
+      message: "Consumo energetico elevato ({{ states.sensor.potenza_istantanea.state }})."
+      enable_persistent: 0
+      volume_level: 0.4
diff --git a/automations/home_assistant.yaml b/automations/home_assistant.yaml
new file mode 100644 (file)
index 0000000..5ea0785
--- /dev/null
@@ -0,0 +1,129 @@
+######################################################################
+# Home Assistant: Management of the Home Mode Button
+######################################################################
+
+- alias: "Home Assistant: Cambio modalità On"
+  initial_state: '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"
+  initial_state: 'on'
+
+  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 >= 8 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"
+  initial_state: 'on'
+
+  trigger:
+    - platform: time
+      at: '08: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 >= 8 and now().strftime('%H')|int < 23 %}
+            input_boolean.home_mode_day
+          {% else %}
+            input_boolean.home_mode_night
+          {% endif %}
+    
+    - service: script.volume_manager
+
+######################################################################
+# Home Assistant: Management of Speech Notifications
+######################################################################
+
+- alias: "Home Assistant: Gestione notifiche vocali"
+  initial_state: 'on'
+
+  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 trigger.to_state.state == 'on' %}
+          input_boolean.turn_off
+        {% else %}
+          input_boolean.turn_on
+        {% endif %}
+      data:
+        entity_id: input_boolean.speech_notifications
+
+######################################################################
+# Home Assistant: Weekly Clean Log
+# - script.homeassistant_clearlog
+######################################################################
+
+- alias: "Home Assistant: Pulitura settimanale log"
+  initial_state: 'on'
+
+  trigger: 
+    - platform: time
+      at: '00:00:00'
+
+  condition:
+    - condition: time
+      weekday: [mon]
+
+  action:
+    - service: script.homeassistant_clearlog
diff --git a/automations/media_player.yaml b/automations/media_player.yaml
new file mode 100644 (file)
index 0000000..dcb4901
--- /dev/null
@@ -0,0 +1,19 @@
+######################################################################
+# Google Home: speeak message
+# - script.notify_voice
+######################################################################
+
+- alias: "Google Home: Pronuncia testo"
+  initial_state: 'on'
+
+  trigger:
+    - platform: state
+      entity_id: input_text.google_home_speak
+
+  condition: []
+
+  action:
+    - service: script.speech_engine
+      data_template:
+        media_player: "media_player.google_home"
+        message: "{{ trigger.to_state.state }}"
diff --git a/automations/night.yaml b/automations/night.yaml
new file mode 100644 (file)
index 0000000..99870b4
--- /dev/null
@@ -0,0 +1,28 @@
+######################################################################
+# Night Time
+# - Switch off all covers
+######################################################################
+
+- alias: "Modalità Notte"
+  initial_state: 'off'
+
+  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.tapparella_globale
+        position: 15
+
+    - service: cover.set_cover_position
+      data:
+        entity_id: cover.tapparella_camera
+        position: 0
diff --git a/automations/speech.yaml b/automations/speech.yaml
new file mode 100644 (file)
index 0000000..5d9acdd
--- /dev/null
@@ -0,0 +1,94 @@
+######################################################################
+# Welcome message
+#
+# Operations:
+# - script.speech_engine
+######################################################################
+
+- alias: Saluto di benvenuto
+  initial_state: 'on'
+
+  trigger:
+    - platform: zone
+      entity_id:
+        - person.giorgio
+        - person.laura
+        # - person.anna
+      zone: zone.home
+      event: enter
+#    - platform: state
+#      entity_id: 
+#        - device_tracker.s9
+#        - device_tracker.a5
+#      to: 'home'
+#      for: '00:00:30'
+
+  condition: []
+
+  action:
+#    - wait_template: >-
+#        {# Giorgio #}
+#        {% if trigger.entity_id == 'person.giorgio' %}
+#          {% if is_state('device_tracker.s9', 'home') %}
+#            true
+#          {% else %}
+#            false
+#          {% endif %}
+#        
+#        {# Laura #}
+#        {% elif trigger.entity_id == 'person.laura' %}
+#          {% if is_state('device_tracker.a5', 'home') %}
+#            true
+#          {% else %}
+#            false
+#          {% endif %}
+#        
+#        {# Anna #}
+#        {% elif trigger.entity_id == 'person.anna' %}
+#          {% if is_state('device_tracker.a3', 'home') %}
+#            true
+#          {% else %}
+#            false
+#          {% endif %}
+#       
+#        {# Others #}
+#        {% else %}
+#          false
+#        {% endif %}
+#
+#      timeout: '00:30:00'
+#      continue_on_timeout: 'false'
+
+    - wait_template: "{{ is_state('binary_sensor.porta_casa', 'on') }}"
+      timeout: '00:30:00'
+      continue_on_timeout: 'false'
+
+    - delay: 00:00:05
+
+    - service: script.speech_engine
+      data_template:
+        message: !include ../templates/welcome_message.yaml
+        enable_greeting: 0
+
+######################################################################
+# Hourly message
+#
+# Operations:
+# - script.speech_engine
+######################################################################
+
+- alias: "Saluto orario"
+  initial_state: 'off'
+  
+  trigger:
+    - platform: time
+      at: '12:00:00'
+
+  condition: []
+
+  action:
+    - service: script.speech_engine
+      data_template:
+        message: >- 
+          {% set hour = now().strftime('%H') %}
+          "Sono le {{ hour }} e tutto va bene."
diff --git a/automations/startup.yaml b/automations/startup.yaml
new file mode 100644 (file)
index 0000000..446f798
--- /dev/null
@@ -0,0 +1,29 @@
+######################################################################\r
+# Startup Automation: Restart on Error\r
+######################################################################\r
+\r
+- alias: "Startup: Restart on Error"\r
+\r
+  trigger:\r
+    - platform: homeassistant\r
+      event: start\r
+  \r
+  action:\r
+    - delay: 00:00:60\r
+    - condition: state\r
+      entity_id: persistent_notification.invalid_config\r
+      state: 'notifying'\r
+    - service: script.homeassistant_restart\r
+\r
+######################################################################\r
+# Startup Automation: Google Sync\r
+######################################################################\r
+\r
+- alias: "Startup: Google Sync"\r
+\r
+  trigger:\r
+    - platform: homeassistant\r
+      event: start\r
+\r
+  action:\r
+    - service: script.homeassistant_google_home_sync\r
diff --git a/automations/test_mode.yaml b/automations/test_mode.yaml
new file mode 100644 (file)
index 0000000..1b970c5
--- /dev/null
@@ -0,0 +1,38 @@
+######################################################################
+# Test Mode: Enable Action
+######################################################################
+
+- alias: "Modalità Test: Azione on"
+  initial_state: 'on'
+
+  trigger:
+    - platform: state
+      entity_id: input_boolean.test_mode
+      to: 'on'
+
+  action:\r
+
+    - service: automation.turn_off
+      entity_id: automation.startup_restart_on_error
+
+    - service: automation.turn_off
+      entity_id: automation.startup_google_sync
+
+######################################################################
+# Test Mode: Disable Action
+######################################################################
+
+- alias: "Modalità Test: Azione off"
+  initial_state: 'on'
+
+  trigger:
+    - platform: state
+      entity_id: input_boolean.test_mode
+      to: 'off'
+
+  action:
+    - service: automation.turn_on
+      entity_id: automation.startup_restart_on_error
+
+    - service: automation.turn_on
+      entity_id: automation.startup_google_sync
diff --git a/automations/themes.yaml b/automations/themes.yaml
new file mode 100644 (file)
index 0000000..6cba55e
--- /dev/null
@@ -0,0 +1,31 @@
+######################################################################
+# Themes: Management of Day/Night Mode
+######################################################################
+
+- alias: "Temi: Modalità giorno/Notte"
+  initial_state: 'on'
+
+  trigger:
+    - platform: state
+      entity_id: input_boolean.home_mode_day
+      to: 'on'
+    - platform: state
+      entity_id: input_boolean.home_mode_night
+      to: 'on'
+    - platform: state
+      entity_id: input_boolean.home_mode_away
+      to: 'on'
+
+  action:
+    - service: frontend.set_theme
+      data_template:
+        name: >-
+          {% if trigger.entity_id == 'input_boolean.home_mode_day' %}
+            default
+          {% endif %}
+          {% if trigger.entity_id == 'input_boolean.home_mode_night' %}
+            darkish
+          {% endif %}
+          {% if trigger.entity_id == 'input_boolean.home_mode_away' %}
+            reeder_dark
+          {% endif %}
diff --git a/automations/update_notifications.yaml b/automations/update_notifications.yaml
new file mode 100644 (file)
index 0000000..965642e
--- /dev/null
@@ -0,0 +1,106 @@
+######################################################################\r
+# Update Notification: Home Assistant\r
+######################################################################\r
+\r
+- alias: "Update Notification: Home Assistant"\r
+  initial_state: 'on'\r
+\r
+  trigger:\r
+    - platform: state\r
+      entity_id: binary_sensor.updater\r
+      to: 'on'\r
+\r
+    - platform: homeassistant\r
+      event: start\r
+\r
+  condition:\r
+    condition: state\r
+    entity_id: binary_sensor.updater\r
+    state: 'on'\r
+\r
+  action:\r
+    - delay: '00:00:5'\r
+    - service: script.notify_text\r
+      data_template:\r
+        title: "Home Assistant - Aggiornamento"\r
+        message: "E' disponibile un aggiornamento per Home Assistant {{ state_attr('binary_sensor.updater', 'newest_version') }}. {{now().strftime('%Y-%m-%d %I:%M %p')}}"\r
+        notification_id: "update"\r
+        enable_persistent: 1\r
+    \r
+    - service: input_boolean.turn_on\r
+      entity_id: input_boolean.update\r
+\r
+######################################################################\r
+# Update Notification: Shelly\r
+######################################################################\r
+\r
+- alias: "Update Notification: Shelly"\r
+  initial_state: 'on'\r
+\r
+  trigger:\r
+    - platform: state\r
+      entity_id: group.shelly\r
+      to: 'on'\r
+      \r
+    - platform: homeassistant\r
+      event: start\r
+      \r
+  condition:\r
+    condition: state\r
+    entity_id: group.shelly\r
+    state: 'on'\r
+\r
+  action:\r
+    - delay: '00:00:10'\r
+    - service: script.notify_text\r
+      data_template:\r
+        title: "Shelly - Aggiornamento"\r
+        message: "Sono disponibili aggiornamenti per i dispositivi Shelly"\r
+        notification_id: "update"\r
+        enable_persistent: 1\r
+\r
+    - service: input_boolean.turn_on\r
+      entity_id: input_boolean.update\r
+\r
+######################################################################\r
+# Update Notification: HACS\r
+######################################################################\r
+\r
+- alias: "Update Notification: HACS"\r
+  initial_state: 'on'\r
+\r
+  trigger:\r
+    - platform: numeric_state\r
+      entity_id: sensor.hacs\r
+      above: 0\r
+\r
+  action:\r
+    - delay: '00:00:15'\r
+    - service: script.notify_text\r
+      data_template:\r
+        title: "HACS - Aggiornamento"\r
+        message: "Sono disponibili aggiornamenti per i moduli HACS"\r
+        notification_id: "update"\r
+        enable_persistent: 1\r
+\r
+    - service: input_boolean.turn_on\r
+      entity_id: input_boolean.update\r
+\r
+######################################################################\r
+# Update: Aknowledge update\r
+#\r
+# Actions:\r
+# - persistent_notification.dismiss\r
+######################################################################\r
+- alias: "Update: Riconoscimento Aggiornamenti"\r
+  initial_state: 'on'\r
+\r
+  trigger:\r
+    platform: state\r
+    entity_id: input_boolean.update\r
+    to: 'off'\r
+\r
+  action:\r
+    - service: persistent_notification.dismiss\r
+      data_template:\r
+        notification_id: "update"\r
diff --git a/binary_sensor/doors.yaml b/binary_sensor/doors.yaml
deleted file mode 100644 (file)
index 0ed9ae2..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-######################################################################
-# Xiaomi MiJia Door & Window Contact Sensor (MCCGQ01LM)
-######################################################################
-
-- platform: "mqtt"
-  name: "Porta Casa"
-  state_topic: "zigbee2mqtt/main_door"
-  availability_topic: "zigbee2mqtt/bridge/state"
-  payload_on: false
-  payload_off: true
-  value_template: "{{ value_json.contact }}"
-  device_class: "door"
-
-######################################################################
-# Xiaomi Aqara Door & Window Contact Sensor (MCCGQ11LM)
-######################################################################
-
-- platform: "mqtt"
-  name: "Porta Casa 2"
-  state_topic: "zigbee2mqtt/spare_door"
-  availability_topic: "zigbee2mqtt/bridge/state"
-  payload_on: false
-  payload_off: true
-  value_template: "{{ value_json.contact }}"
-  device_class: "door"
diff --git a/binary_sensor/doors.yaml.disabled b/binary_sensor/doors.yaml.disabled
new file mode 100644 (file)
index 0000000..0ed9ae2
--- /dev/null
@@ -0,0 +1,25 @@
+######################################################################
+# Xiaomi MiJia Door & Window Contact Sensor (MCCGQ01LM)
+######################################################################
+
+- platform: "mqtt"
+  name: "Porta Casa"
+  state_topic: "zigbee2mqtt/main_door"
+  availability_topic: "zigbee2mqtt/bridge/state"
+  payload_on: false
+  payload_off: true
+  value_template: "{{ value_json.contact }}"
+  device_class: "door"
+
+######################################################################
+# Xiaomi Aqara Door & Window Contact Sensor (MCCGQ11LM)
+######################################################################
+
+- platform: "mqtt"
+  name: "Porta Casa 2"
+  state_topic: "zigbee2mqtt/spare_door"
+  availability_topic: "zigbee2mqtt/bridge/state"
+  payload_on: false
+  payload_off: true
+  value_template: "{{ value_json.contact }}"
+  device_class: "door"
diff --git a/group/climate.yaml b/group/climate.yaml
deleted file mode 100644 (file)
index 8f68f5d..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-######################################################################
-# Group Climate
-######################################################################
-
-climate:
-  name: Termostato
-  icon: mdi:thermometer
-  entities:
-    - sensor.termostato_cucina
-    - sensor.termostato_sala
-    - sensor.termostato_bagno
-    - sensor.termostato_studio
-    - sensor.termostato_camera
diff --git a/group/covers.yaml b/group/covers.yaml
deleted file mode 100644 (file)
index e9b86c4..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-######################################################################
-# Group Covers
-######################################################################
-
-covers:
-  name: Tapparelle
-  #icon: mdi:window-closed
-  icon: mdi:window-shutter
-  entities:
-    - cover.tapparella_cucina
-    - cover.tapparella_sala
-    - cover.tapparella_studio
-    - cover.tapparella_camera
diff --git a/group/doors.yaml b/group/doors.yaml
deleted file mode 100644 (file)
index 263b1e3..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-######################################################################
-# Group Lights
-######################################################################
-
-doors:
-  name: Porte
-  icon: mdi:door
-  entities:
-    - binary_sensor.porta_casa
diff --git a/group/lights.yaml b/group/lights.yaml
deleted file mode 100644 (file)
index 30bf7dc..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-######################################################################
-# Group Lights
-######################################################################
-
-lights:
-  name: Luci
-  icon: mdi:lightbulb
-  entities:
-    - light.luce_cucina
-    - light.luce_corridoio
-    - light.luce_sala
-    - light.luce_divano
-    - light.luce_bagno
-    - light.luce_specchio
-    - light.luce_studio
-    - light.luce_camera
-    - light.luce_balcone
diff --git a/group/lights_bathroom.yaml b/group/lights_bathroom.yaml
deleted file mode 100644 (file)
index fb3207e..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-######################################################################
-# Group Lights Bathroom
-######################################################################
-
-lights_bathroom:
-  name: Luci Bagno
-  icon: mdi:lightbulb
-  entities:
-    - light.luce_bagno
-    - light.luce_specchio
diff --git a/group/lights_livingroom.yaml b/group/lights_livingroom.yaml
deleted file mode 100644 (file)
index 10ca103..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-######################################################################
-# Group Lights Livingroom
-######################################################################
-
-lights_livingroom:
-  name: Luci Sala
-  icon: mdi:lightbulb
-  entities:
-    - light.luce_sala
-    - light.luce_divano
-#    - light.luce_divano_bianca
diff --git a/group/people.yaml b/group/people.yaml
deleted file mode 100644 (file)
index 9c9559e..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-######################################################################
-# People
-######################################################################
-
-people:
-  name: Persone
-  icon: mdi:account-multiple
-  entities:
-    # Giorgio
-    - person.giorgio
-    # Laura
-    - person.laura
-    # Anna
-    - person.anna
-    # Assunta
-    - person.assunta
-
-######################################################################
-# Residents
-######################################################################
-
-residents:
-  name: Abitanti Casa
-  icon: mdi:account-multiple
-  entities:
-    # Giorgio
-    - person.giorgio
-    # Laura
-    - person.laura
-    # Anna
-    #- person.anna
-    # Assunta
-    #- person.assunta
diff --git a/group/shelly.yaml b/group/shelly.yaml
deleted file mode 100644 (file)
index be32020..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-######################################################################
-# Group Shelly Devices
-######################################################################
-
-shelly:
-  name: Shelly Devices
-  #icon: mdi:thermometer
-  entities:
-    - sensor.shelly1_status
-    - sensor.shelly2_status
-    - sensor.shelly3_status
-    - sensor.shelly4_status
-    - sensor.shelly5_status
-    - sensor.shelly6_status
-    - sensor.shelly7_status
-    - sensor.shelly8_status
-    - sensor.shelly9_status
-    - sensor.shelly10_status
-    - sensor.shelly11_status
-    - sensor.shellybulb_status
-    - sensor.shellyem_status
-    - sensor.shellydw_status
-    - sensor.shellyplugs_status
diff --git a/groups/climate.yaml b/groups/climate.yaml
new file mode 100644 (file)
index 0000000..8f68f5d
--- /dev/null
@@ -0,0 +1,13 @@
+######################################################################
+# Group Climate
+######################################################################
+
+climate:
+  name: Termostato
+  icon: mdi:thermometer
+  entities:
+    - sensor.termostato_cucina
+    - sensor.termostato_sala
+    - sensor.termostato_bagno
+    - sensor.termostato_studio
+    - sensor.termostato_camera
diff --git a/groups/covers.yaml b/groups/covers.yaml
new file mode 100644 (file)
index 0000000..e9b86c4
--- /dev/null
@@ -0,0 +1,13 @@
+######################################################################
+# Group Covers
+######################################################################
+
+covers:
+  name: Tapparelle
+  #icon: mdi:window-closed
+  icon: mdi:window-shutter
+  entities:
+    - cover.tapparella_cucina
+    - cover.tapparella_sala
+    - cover.tapparella_studio
+    - cover.tapparella_camera
diff --git a/groups/doors.yaml b/groups/doors.yaml
new file mode 100644 (file)
index 0000000..263b1e3
--- /dev/null
@@ -0,0 +1,9 @@
+######################################################################
+# Group Lights
+######################################################################
+
+doors:
+  name: Porte
+  icon: mdi:door
+  entities:
+    - binary_sensor.porta_casa
diff --git a/groups/lights.yaml b/groups/lights.yaml
new file mode 100644 (file)
index 0000000..30bf7dc
--- /dev/null
@@ -0,0 +1,17 @@
+######################################################################
+# Group Lights
+######################################################################
+
+lights:
+  name: Luci
+  icon: mdi:lightbulb
+  entities:
+    - light.luce_cucina
+    - light.luce_corridoio
+    - light.luce_sala
+    - light.luce_divano
+    - light.luce_bagno
+    - light.luce_specchio
+    - light.luce_studio
+    - light.luce_camera
+    - light.luce_balcone
diff --git a/groups/lights_bathroom.yaml b/groups/lights_bathroom.yaml
new file mode 100644 (file)
index 0000000..fb3207e
--- /dev/null
@@ -0,0 +1,10 @@
+######################################################################
+# Group Lights Bathroom
+######################################################################
+
+lights_bathroom:
+  name: Luci Bagno
+  icon: mdi:lightbulb
+  entities:
+    - light.luce_bagno
+    - light.luce_specchio
diff --git a/groups/lights_livingroom.yaml b/groups/lights_livingroom.yaml
new file mode 100644 (file)
index 0000000..10ca103
--- /dev/null
@@ -0,0 +1,11 @@
+######################################################################
+# Group Lights Livingroom
+######################################################################
+
+lights_livingroom:
+  name: Luci Sala
+  icon: mdi:lightbulb
+  entities:
+    - light.luce_sala
+    - light.luce_divano
+#    - light.luce_divano_bianca
diff --git a/groups/people.yaml b/groups/people.yaml
new file mode 100644 (file)
index 0000000..9c9559e
--- /dev/null
@@ -0,0 +1,33 @@
+######################################################################
+# People
+######################################################################
+
+people:
+  name: Persone
+  icon: mdi:account-multiple
+  entities:
+    # Giorgio
+    - person.giorgio
+    # Laura
+    - person.laura
+    # Anna
+    - person.anna
+    # Assunta
+    - person.assunta
+
+######################################################################
+# Residents
+######################################################################
+
+residents:
+  name: Abitanti Casa
+  icon: mdi:account-multiple
+  entities:
+    # Giorgio
+    - person.giorgio
+    # Laura
+    - person.laura
+    # Anna
+    #- person.anna
+    # Assunta
+    #- person.assunta
diff --git a/groups/shelly.yaml b/groups/shelly.yaml
new file mode 100644 (file)
index 0000000..be32020
--- /dev/null
@@ -0,0 +1,23 @@
+######################################################################
+# Group Shelly Devices
+######################################################################
+
+shelly:
+  name: Shelly Devices
+  #icon: mdi:thermometer
+  entities:
+    - sensor.shelly1_status
+    - sensor.shelly2_status
+    - sensor.shelly3_status
+    - sensor.shelly4_status
+    - sensor.shelly5_status
+    - sensor.shelly6_status
+    - sensor.shelly7_status
+    - sensor.shelly8_status
+    - sensor.shelly9_status
+    - sensor.shelly10_status
+    - sensor.shelly11_status
+    - sensor.shellybulb_status
+    - sensor.shellyem_status
+    - sensor.shellydw_status
+    - sensor.shellyplugs_status
diff --git a/script/audio.yaml b/script/audio.yaml
deleted file mode 100644 (file)
index f4658f5..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-######################################################################
-# Script: Laura
-# Inputs: 
-# - type:
-#         1 -> bell'affare
-#         2 -> belan
-#         3 -> una schifezza
-#         3 -> ma che schifo è?
-#
-# Operations:
-# - script.volume_manager
-# - media_player.play_media
-######################################################################
-
-laura_voice:
-  alias: Voce Laura
-  sequence:
-    - condition: state
-      entity_id: input_boolean.speech_notifications
-      state: 'on'
-
-    - wait_template: >-
-        {% if media_player | length == 0 %}
-          {% set media_player = 'media_player.google_home' %}
-        {% endif %}
-        {{ not is_state(media_player, 'playing') }}
-
-    - service: script.volume_manager
-      data_template:
-        media_player: >-
-          {# Check Null Input #}
-          {% if media_player | length == 0 %}
-            {% set media_player = 'media_player.google_home' %}
-          {% endif %}
-          {{ media_player }}
-        volume_level: "{{ volume_level }}"
-
-    - service: media_player.play_media
-      data_template:
-        entity_id: >-
-          {# Check Null Input #}
-          {% if media_player | length == 0 %}
-            {% set media_player = 'media_player.google_home' %}
-          {% endif %}
-          {{ media_player }}
-        media_content_type: 'audio/mp4'
-        media_content_id: >-
-          {%- macro set_type() -%}
-            {{ range(1,5,1) | random }}
-          {%- endmacro -%}
-          {% if type is not defined %}
-            {% set type = set_type() %}
-          {% endif %}
-          https://home.giorgioravera.it/local/audio/laura/{{type}}.mp3
-
-laura_voice_1:
-  alias: Voce Laura 1
-  sequence:
-  - service: script.laura_voice
-    data:
-      type: '1'
-
-laura_voice_2:
-  alias: Voce Laura 2
-  sequence:
-  - service: script.laura_voice
-    data:
-      type: '2'
-
-laura_voice_3:
-  alias: Voce Laura 3
-  sequence:
-  - service: script.laura_voice
-    data:
-      type: '3'
-
-laura_voice_4:
-  alias: Voce Laura 4
-  sequence:
-  - service: script.laura_voice
-    data:
-      type: '4'
-
-######################################################################
-# Script: Babu Frik
-# Inputs: 
-# - type:
-#         1 -> I'm babu frik
-#         2 -> heheeee
-#
-# Operations:
-# - script.volume_manager
-# - media_player.play_media
-######################################################################
-
-babu_voice:
-  alias: Voce Babu
-  sequence:
-    - condition: state
-      entity_id: input_boolean.speech_notifications
-      state: 'on'
-
-    - wait_template: >-
-        {% if media_player | length == 0 %}
-          {% set media_player = 'media_player.google_home' %}
-        {% endif %}
-        {{ not is_state(media_player, 'playing') }}
-
-    - service: script.volume_manager
-      data_template:
-        media_player: >-
-          {# Check Null Input #}
-          {% if media_player | length == 0 %}
-            {% set media_player = 'media_player.google_home' %}
-          {% endif %}
-          {{ media_player }}
-        volume_level: "{{ volume_level }}"
-
-    - service: media_player.play_media
-      data_template:
-        entity_id: >-
-          {# Check Null Input #}
-          {% if media_player | length == 0 %}
-            {% set media_player = 'media_player.google_home' %}
-          {% endif %}
-          {{ media_player }}
-        media_content_type: 'audio/mp4'
-        media_content_id: >-
-          {% if type is not defined %}
-            {% set type = 1 %}
-          {% endif %}
-          https://home.giorgioravera.it/local/audio/babu/{{type}}.mp3
-
-babu_voice_1:
-  alias: Voce Babu 1
-  sequence:
-  - service: script.babu_voice
-    data:
-      type: '1'
-
-babu_voice_2:
-  alias: Voce Babu 2
-  sequence:
-  - service: script.babu_voice
-    data:
-      type: '2'
diff --git a/script/climate.yaml b/script/climate.yaml
deleted file mode 100644 (file)
index 704c5d7..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-######################################################################
-# Climate: Daily Schedule
-# Inputs:
-# - entity_id
-# - temp1
-# - temp2
-# - temp3
-# - temp4
-# - temp5
-#
-# Operations:
-# - climate.set_temperature
-######################################################################
-
-climate_daily_schedule:
-  alias: "Termosifoni: Schedulazione giornaliera"
-  sequence:
-    - service: climate.set_temperature
-      data_template:
-        entity_id: "{{ entity_id }}"
-        temperature: >-
-          {% set current_date_string = now().strftime("%H%M") %}
-          {% set time1_string = "0630" %}
-          {% set time2_string = "0730" %}
-          {% set time3_string = "0900" %}
-          {% set time4_string = "1830" %}
-          {% set time5_string = "2200" %}
-          {% if ((current_date_string|int) >= (time1_string|int)) and ((current_date_string|int) < (time2_string|int)) %}
-            {{ temp1 }}
-          {% elif ((current_date_string|int) >= (time2_string|int)) and ((current_date_string|int) < (time3_string|int)) %}
-            {{ temp2 }}
-          {% elif ((current_date_string|int) >= (time3_string|int)) and ((current_date_string|int) < (time4_string|int)) %}
-            {{ temp3 }}
-          {% elif ((current_date_string|int) >= (time4_string|int)) and ((current_date_string|int) < (time5_string|int)) %}
-            {{ temp4 }}
-          {% else %}
-            {{ temp5 }}
-          {% endif %}
-
-######################################################################
-# Climate: Away Mode On
-# Inputs:
-# - entity_id
-# - mode
-#
-# Operations:
-# - climate.set_operation_mode
-# - climate.set_temperature
-######################################################################
-
-climate_away_mode_on:
-  alias: "Termosifoni: Attviva Modalità vacanza"
-  sequence:
-    - service: climate.set_preset_mode
-      data_template:
-        entity_id: "{{ entity_id }}"
-        preset_mode: manual
-    - delay: '00:00:5'
-    - service: climate.set_temperature
-      data_template:
-        entity_id: "{{ entity_id }}"
-        temperature: 5
-    - delay: '00:00:5'
-    - service: climate.set_preset_mode
-      data_template:
-        entity_id: "{{ entity_id }}"
-        preset_mode: vacation
-    - delay: '00:00:5'
-    - service: climate.set_preset_mode
-      data_template:
-        entity_id: "{{ entity_id }}"
-        preset_mode: vacation
-
-######################################################################
-# Climate: Away Mode Off
-# Inputs:
-# - entity_id
-# - mode
-#
-# Operations:
-# - climate.set_operation_mode
-# - climate.set_temperature
-######################################################################
-
-climate_away_mode_off:
-  alias: "Termosifoni: Disattiva Modalità vacanza"
-  sequence:
-    - service: climate.set_preset_mode
-      data_template:
-        entity_id: "{{ entity_id }}"
-        preset_mode: auto
diff --git a/script/covers.yaml.disabled b/script/covers.yaml.disabled
deleted file mode 100644 (file)
index d6aaa8a..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-######################################################################
-# All Covers Operation
-# Inputs:
-# - modus
-#
-# Operations:
-# - cover.{{modus}}_cover
-######################################################################
-
-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
-# Inputs:
-# - position
-#
-# Operations:
-# - cover.set_cover_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/home_assistant.yaml b/script/home_assistant.yaml
deleted file mode 100644 (file)
index 4b0d41e..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-######################################################################
-# Home Assistant: Restart
-# - shell_command.docker_restart
-######################################################################
-
-homeassistant_restart:
-  alias: "Riavvia Home Assistant"
-  sequence:
-    - service: shell_command.docker_restart
-
-######################################################################
-# Home Assistant: Ricarica Script
-# - script.reload
-######################################################################
-
-homeassistant_reload_scripts:
-  alias: "Ricarica Script"
-  sequence:
-    - service: script.reload
-
-######################################################################
-# Home Assistant: Ricarica Automazioni
-# - script.reload
-######################################################################
-
-homeassistant_reload_automations:
-  alias: "Ricarica Automazioni"
-  sequence:
-    - service: automation.reload
-
-######################################################################
-# Home Assistant: Clear Log
-# - tts.clear_cache
-# - system_log.clear
-# - recorder.purge
-######################################################################
-
-homeassistant_clearlog:
-  alias: "Pulisci Log"
-  sequence:
-    - service: tts.clear_cache
-    - service: system_log.clear
-    - service: recorder.purge
-      data:
-        keep_days: 0
-
-######################################################################
-# Home Assistant: Sync with Google Home
-# - google_assistant.request_sync
-######################################################################
-
-homeassistant_google_home_sync:
-  alias: "Sincronizza Google Home"
-  sequence:
-    - service: google_assistant.request_sync
-      data:
-        agent_user_id: !secret google_agent
diff --git a/script/media_player.yaml b/script/media_player.yaml
deleted file mode 100644 (file)
index 0a6258b..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-######################################################################
-# Script: TV Sala Toggle
-# Inputs:
-# - tv
-#
-# Operations:
-# -  script.turn_on
-######################################################################
-
-tv_sala_toggle:
-  alias: "TV Sala: Accendi/Spegni"
-  sequence:
-    - service: script.turn_on
-      data_template:
-        entity_id: >-
-          {% if is_state('media_player.tv_sala', 'on') %}
-            script.tv_sala_off
-          {% else %}
-            script.tv_sala_on
-          {% endif %}
-
-######################################################################
-# Script: TV Sala On
-# Inputs:
-# - tv
-#
-# Operations:
-# -  script.turn_on
-######################################################################
-
-tv_sala_on:
-  alias: "TV Sala: Accendi"
-  sequence:
-    #- service: shell_command.bravia_tvpower
-    - service: media_player.toggle
-      entity_id: media_player.tv_sala
-
-######################################################################
-# Script: TV Sala Off
-# Inputs:
-# - tv
-#
-# Operations:
-# -  script.turn_on
-######################################################################
-
-tv_sala_off:
-  alias: "TV Sala: Spegni"
-  sequence:
-    #- service: shell_command.bravia_poweroff
-    - service: media_player.toggle
-      entity_id: media_player.tv_sala
diff --git a/script/notify.yaml b/script/notify.yaml
deleted file mode 100644 (file)
index 5c7382c..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-######################################################################
-# Script: Text Notification
-# Inputs:
-# - title
-# - message
-# - notification_id
-# - enable_persistent
-#
-# Operations:
-# - notify.mail
-# - notify.push
-# - persistent_notification.create (if enable_persistent)
-######################################################################
-
-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 is defined %}
-          {% if enable_persistent | int == 1 %}
-            true
-          {% else %}
-            false
-          {% endif %}
-        {% else %}
-          false
-        {% endif %}
-
-    - service: persistent_notification.create
-      data_template:
-       title: "{{ title }}"
-       message: "{{ message }}"
-       notification_id: >-
-         {# Check Null Input #}
-         {% if notification_id | length == 0 %}
-           {% set notification_id = 'generic' %}
-         {% endif %}
-         {{ notification_id }}
-
-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 }}"
-        notification_id: "{{ notification_id }}"
-        enable_persistent: "{{ enable_persistent }}"
-
-######################################################################
-# Script: Volume Manager
-# Input:
-# - media_player
-# - volume_level
-#
-# Operations:
-# - media_player.volume_set
-######################################################################
-
-volume_manager:
-  alias: Gestione Volume
-  sequence:
-    - 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.60 %}
-          {% 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 %}
-
-######################################################################
-# Script: Voice Notification
-# Input:
-# - media_player
-# - volume_level
-# - language
-# - message
-#
-# Operations:
-# - script.notify_volume_manager
-# - tts.google_translate_say
-######################################################################
-
-notify_voice:
-  alias: Notifiche vocali
-  sequence:
-    - condition: state
-      entity_id: input_boolean.speech_notifications
-      state: 'on'
-      
-    - wait_template: >-
-        {% if media_player | length == 0 %}
-          {% set media_player = 'media_player.google_home' %}
-        {% endif %}
-        {{ not is_state(media_player, 'playing') }}
-  
-    - service: script.volume_manager
-      data_template:
-        media_player: "{{ media_player }}"
-        volume_level: "{{ volume_level }}"
-
-    - service: tts.google_translate_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 }}"
-        
-    - service: script.volume_manager
-
-######################################################################
-# Script: Global Notification (Text+Voice)
-# Inputs:
-# - title
-# - media_player
-# - volume_level
-# _ language
-# - message
-# - notification_id
-# - 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 }}"
-        notification_id: "{{ notification_id }}"
-        enable_persistent: "{{ enable_persistent }}"
-
-    - service: script.notify_voice
-      data_template:
-        media_player: "{{ media_player }}"
-        volume_level: "{{ volume_level }}"
-        language: "{{ language }}"
-        message: "{{ message }}"
diff --git a/script/shelly.yaml b/script/shelly.yaml
deleted file mode 100644 (file)
index d9b3ae4..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-######################################################################
-# Shelly: Upgrade
-# - mqtt.publish
-######################################################################
-
-shelly_upgrade:
-  alias: "Shelly: Aggiornamento Firmware"
-  sequence:
-    # Shelly 2 Tapparella Cucina
-    - service: mqtt.publish
-      data:
-        topic: 'shellies/shellyswitch-55980F/command'
-        payload: 'update_fw'
-        
-    # Shelly 2 Tapparella Sala
-    - service: mqtt.publish
-      data:
-        topic: 'shellies/shellyswitch25-6919BD/command'
-        payload: 'update_fw'
-
-    # Shelly 2 Tapparella Studio
-    - service: mqtt.publish
-      data:
-        topic: 'shellies/shellyswitch-13572B/command'
-        payload: 'update_fw'
-
-    # Shelly 2 Tapparella Camera
-    - service: mqtt.publish
-      data:
-        topic: 'shellies/shellyswitch-559C49/command'
-        payload: 'update_fw'
-
-    # Shelly 1 Luce Corridoio
-    - service: mqtt.publish
-      data:
-        topic: 'shellies/shelly1-24D1EE/command'
-        payload: 'update_fw'
-
-    # Shelly 1 Luce Cucina
-    - service: mqtt.publish
-      data:
-        topic: 'shellies/shelly1-93B27D/command'
-        payload: 'update_fw'
-
-    # Shelly 1 Luce Sala
-    - service: mqtt.publish
-      data:
-        topic: 'shellies/shelly1-C426F9/command'
-        payload: 'update_fw'
-
-    # Shelly Bulb Luce Divano
-    - service: mqtt.publish
-      data:
-        topic: 'shellies/shellybulb-BC8610/command'
-        payload: 'update_fw'
-
-    # Shelly 2.5 Luci Bagno
-    - service: mqtt.publish
-      data:
-        topic: 'shellies/shellyswitch25-7457D8/command'
-        payload: 'update_fw'
-
-    # Shelly 1 Luce Studio
-    - service: mqtt.publish
-      data:
-        topic: 'shellies/shelly1-59E18C/command'
-        payload: 'update_fw'
-
-    # Shelly Dimmer Luce Camera
-    - service: mqtt.publish
-      data:
-        topic: 'shellies/shellydimmer-D46CF2/command'
-        payload: 'update_fw'
-
-    # Shelly 1 Luce Balcone
-    - service: mqtt.publish
-      data:
-        topic: 'shellies/shelly1-C423C8/command'
-        payload: 'update_fw'
-
-    # Shelly EM
-    - service: mqtt.publish
-      data:
-        topic: 'shellies/shellyem-B9E1A0/command'
-        payload: 'update_fw'
-
-    # Shelly Door/Window
-    - service: mqtt.publish
-      data:
-        topic: 'shellies/shellydw-B88F53/command'
-        payload: 'update_fw'
-        
-    # Shelly Plug S
-    - service: mqtt.publish
-      data:
-        topic: 'shellies/shellyplug-s-7A31CB/command'
-        payload: 'update_fw'
-
-#    # Shelly 1 TBD
-#    - service: mqtt.publish
-#      data:
-#        topic: 'shellies/shelly1-24D1A8/command'
-#        payload: 'update_fw'
-
-######################################################################
-# Shelly: Reboot
-# - shell_command.shelly_reboot
-######################################################################
-shelly_reboot:
-  alias: "Shelly: Riavvia Dispositivi"
-  sequence:
-    - service: shell_command.shelly_reboot
diff --git a/script/speech_engine.yaml b/script/speech_engine.yaml
deleted file mode 100644 (file)
index 3c55765..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-######################################################################
-# Script: Speech Engine
-# Inputs:
-# - media_player
-# - volume_level
-# - message
-# - enable_greeting
-# - enable_status
-# - enable_location
-# - location_people_start
-# - location_people_num
-# - enable_car
-#
-# Operations:
-# - script.notify_voice (greeting + message)
-######################################################################
-
-speech_engine:
-  alias: Speech Engine
-  sequence: 
-    - service: script.notify_voice
-      data_template:
-        media_player: "{{ media_player }}"
-        volume_level: "{{ volume_level }}"
-        message: !include ../templates/speech_message.yaml
-
-######################################################################
-# Script: Speech Status
-#
-# Operations:
-# - script.speech_engine
-######################################################################
-
-speech_status:
-  alias: Stato Casa
-  sequence: 
-    - service: script.speech_engine
-      data:
-        enable_greeting: 1
-        enable_status: 1
-
-######################################################################
-# Speech Consumption
-#
-# Operations:
-# - script.speech_engine
-######################################################################
-
-speech_consumption:
-  alias: Consumo Energetico
-  sequence:
-    - service: script.speech_engine
-      data_template:
-        message: >-
-          "Il consumo istantaneo è pari a {{ states.sensor.potenza_istantanea.state }} watt"
diff --git a/scripts/audio.yaml b/scripts/audio.yaml
new file mode 100644 (file)
index 0000000..f4658f5
--- /dev/null
@@ -0,0 +1,146 @@
+######################################################################
+# Script: Laura
+# Inputs: 
+# - type:
+#         1 -> bell'affare
+#         2 -> belan
+#         3 -> una schifezza
+#         3 -> ma che schifo è?
+#
+# Operations:
+# - script.volume_manager
+# - media_player.play_media
+######################################################################
+
+laura_voice:
+  alias: Voce Laura
+  sequence:
+    - condition: state
+      entity_id: input_boolean.speech_notifications
+      state: 'on'
+
+    - wait_template: >-
+        {% if media_player | length == 0 %}
+          {% set media_player = 'media_player.google_home' %}
+        {% endif %}
+        {{ not is_state(media_player, 'playing') }}
+
+    - service: script.volume_manager
+      data_template:
+        media_player: >-
+          {# Check Null Input #}
+          {% if media_player | length == 0 %}
+            {% set media_player = 'media_player.google_home' %}
+          {% endif %}
+          {{ media_player }}
+        volume_level: "{{ volume_level }}"
+
+    - service: media_player.play_media
+      data_template:
+        entity_id: >-
+          {# Check Null Input #}
+          {% if media_player | length == 0 %}
+            {% set media_player = 'media_player.google_home' %}
+          {% endif %}
+          {{ media_player }}
+        media_content_type: 'audio/mp4'
+        media_content_id: >-
+          {%- macro set_type() -%}
+            {{ range(1,5,1) | random }}
+          {%- endmacro -%}
+          {% if type is not defined %}
+            {% set type = set_type() %}
+          {% endif %}
+          https://home.giorgioravera.it/local/audio/laura/{{type}}.mp3
+
+laura_voice_1:
+  alias: Voce Laura 1
+  sequence:
+  - service: script.laura_voice
+    data:
+      type: '1'
+
+laura_voice_2:
+  alias: Voce Laura 2
+  sequence:
+  - service: script.laura_voice
+    data:
+      type: '2'
+
+laura_voice_3:
+  alias: Voce Laura 3
+  sequence:
+  - service: script.laura_voice
+    data:
+      type: '3'
+
+laura_voice_4:
+  alias: Voce Laura 4
+  sequence:
+  - service: script.laura_voice
+    data:
+      type: '4'
+
+######################################################################
+# Script: Babu Frik
+# Inputs: 
+# - type:
+#         1 -> I'm babu frik
+#         2 -> heheeee
+#
+# Operations:
+# - script.volume_manager
+# - media_player.play_media
+######################################################################
+
+babu_voice:
+  alias: Voce Babu
+  sequence:
+    - condition: state
+      entity_id: input_boolean.speech_notifications
+      state: 'on'
+
+    - wait_template: >-
+        {% if media_player | length == 0 %}
+          {% set media_player = 'media_player.google_home' %}
+        {% endif %}
+        {{ not is_state(media_player, 'playing') }}
+
+    - service: script.volume_manager
+      data_template:
+        media_player: >-
+          {# Check Null Input #}
+          {% if media_player | length == 0 %}
+            {% set media_player = 'media_player.google_home' %}
+          {% endif %}
+          {{ media_player }}
+        volume_level: "{{ volume_level }}"
+
+    - service: media_player.play_media
+      data_template:
+        entity_id: >-
+          {# Check Null Input #}
+          {% if media_player | length == 0 %}
+            {% set media_player = 'media_player.google_home' %}
+          {% endif %}
+          {{ media_player }}
+        media_content_type: 'audio/mp4'
+        media_content_id: >-
+          {% if type is not defined %}
+            {% set type = 1 %}
+          {% endif %}
+          https://home.giorgioravera.it/local/audio/babu/{{type}}.mp3
+
+babu_voice_1:
+  alias: Voce Babu 1
+  sequence:
+  - service: script.babu_voice
+    data:
+      type: '1'
+
+babu_voice_2:
+  alias: Voce Babu 2
+  sequence:
+  - service: script.babu_voice
+    data:
+      type: '2'
diff --git a/scripts/climate.yaml b/scripts/climate.yaml
new file mode 100644 (file)
index 0000000..704c5d7
--- /dev/null
@@ -0,0 +1,91 @@
+######################################################################
+# Climate: Daily Schedule
+# Inputs:
+# - entity_id
+# - temp1
+# - temp2
+# - temp3
+# - temp4
+# - temp5
+#
+# Operations:
+# - climate.set_temperature
+######################################################################
+
+climate_daily_schedule:
+  alias: "Termosifoni: Schedulazione giornaliera"
+  sequence:
+    - service: climate.set_temperature
+      data_template:
+        entity_id: "{{ entity_id }}"
+        temperature: >-
+          {% set current_date_string = now().strftime("%H%M") %}
+          {% set time1_string = "0630" %}
+          {% set time2_string = "0730" %}
+          {% set time3_string = "0900" %}
+          {% set time4_string = "1830" %}
+          {% set time5_string = "2200" %}
+          {% if ((current_date_string|int) >= (time1_string|int)) and ((current_date_string|int) < (time2_string|int)) %}
+            {{ temp1 }}
+          {% elif ((current_date_string|int) >= (time2_string|int)) and ((current_date_string|int) < (time3_string|int)) %}
+            {{ temp2 }}
+          {% elif ((current_date_string|int) >= (time3_string|int)) and ((current_date_string|int) < (time4_string|int)) %}
+            {{ temp3 }}
+          {% elif ((current_date_string|int) >= (time4_string|int)) and ((current_date_string|int) < (time5_string|int)) %}
+            {{ temp4 }}
+          {% else %}
+            {{ temp5 }}
+          {% endif %}
+
+######################################################################
+# Climate: Away Mode On
+# Inputs:
+# - entity_id
+# - mode
+#
+# Operations:
+# - climate.set_operation_mode
+# - climate.set_temperature
+######################################################################
+
+climate_away_mode_on:
+  alias: "Termosifoni: Attviva Modalità vacanza"
+  sequence:
+    - service: climate.set_preset_mode
+      data_template:
+        entity_id: "{{ entity_id }}"
+        preset_mode: manual
+    - delay: '00:00:5'
+    - service: climate.set_temperature
+      data_template:
+        entity_id: "{{ entity_id }}"
+        temperature: 5
+    - delay: '00:00:5'
+    - service: climate.set_preset_mode
+      data_template:
+        entity_id: "{{ entity_id }}"
+        preset_mode: vacation
+    - delay: '00:00:5'
+    - service: climate.set_preset_mode
+      data_template:
+        entity_id: "{{ entity_id }}"
+        preset_mode: vacation
+
+######################################################################
+# Climate: Away Mode Off
+# Inputs:
+# - entity_id
+# - mode
+#
+# Operations:
+# - climate.set_operation_mode
+# - climate.set_temperature
+######################################################################
+
+climate_away_mode_off:
+  alias: "Termosifoni: Disattiva Modalità vacanza"
+  sequence:
+    - service: climate.set_preset_mode
+      data_template:
+        entity_id: "{{ entity_id }}"
+        preset_mode: auto
diff --git a/scripts/covers.yaml.disabled b/scripts/covers.yaml.disabled
new file mode 100644 (file)
index 0000000..d6aaa8a
--- /dev/null
@@ -0,0 +1,40 @@
+######################################################################
+# All Covers Operation
+# Inputs:
+# - modus
+#
+# Operations:
+# - cover.{{modus}}_cover
+######################################################################
+
+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
+# Inputs:
+# - position
+#
+# Operations:
+# - cover.set_cover_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/scripts/home_assistant.yaml b/scripts/home_assistant.yaml
new file mode 100644 (file)
index 0000000..4b0d41e
--- /dev/null
@@ -0,0 +1,57 @@
+######################################################################
+# Home Assistant: Restart
+# - shell_command.docker_restart
+######################################################################
+
+homeassistant_restart:
+  alias: "Riavvia Home Assistant"
+  sequence:
+    - service: shell_command.docker_restart
+
+######################################################################
+# Home Assistant: Ricarica Script
+# - script.reload
+######################################################################
+
+homeassistant_reload_scripts:
+  alias: "Ricarica Script"
+  sequence:
+    - service: script.reload
+
+######################################################################
+# Home Assistant: Ricarica Automazioni
+# - script.reload
+######################################################################
+
+homeassistant_reload_automations:
+  alias: "Ricarica Automazioni"
+  sequence:
+    - service: automation.reload
+
+######################################################################
+# Home Assistant: Clear Log
+# - tts.clear_cache
+# - system_log.clear
+# - recorder.purge
+######################################################################
+
+homeassistant_clearlog:
+  alias: "Pulisci Log"
+  sequence:
+    - service: tts.clear_cache
+    - service: system_log.clear
+    - service: recorder.purge
+      data:
+        keep_days: 0
+
+######################################################################
+# Home Assistant: Sync with Google Home
+# - google_assistant.request_sync
+######################################################################
+
+homeassistant_google_home_sync:
+  alias: "Sincronizza Google Home"
+  sequence:
+    - service: google_assistant.request_sync
+      data:
+        agent_user_id: !secret google_agent
diff --git a/scripts/media_player.yaml b/scripts/media_player.yaml
new file mode 100644 (file)
index 0000000..0a6258b
--- /dev/null
@@ -0,0 +1,52 @@
+######################################################################
+# Script: TV Sala Toggle
+# Inputs:
+# - tv
+#
+# Operations:
+# -  script.turn_on
+######################################################################
+
+tv_sala_toggle:
+  alias: "TV Sala: Accendi/Spegni"
+  sequence:
+    - service: script.turn_on
+      data_template:
+        entity_id: >-
+          {% if is_state('media_player.tv_sala', 'on') %}
+            script.tv_sala_off
+          {% else %}
+            script.tv_sala_on
+          {% endif %}
+
+######################################################################
+# Script: TV Sala On
+# Inputs:
+# - tv
+#
+# Operations:
+# -  script.turn_on
+######################################################################
+
+tv_sala_on:
+  alias: "TV Sala: Accendi"
+  sequence:
+    #- service: shell_command.bravia_tvpower
+    - service: media_player.toggle
+      entity_id: media_player.tv_sala
+
+######################################################################
+# Script: TV Sala Off
+# Inputs:
+# - tv
+#
+# Operations:
+# -  script.turn_on
+######################################################################
+
+tv_sala_off:
+  alias: "TV Sala: Spegni"
+  sequence:
+    #- service: shell_command.bravia_poweroff
+    - service: media_player.toggle
+      entity_id: media_player.tv_sala
diff --git a/scripts/notify.yaml b/scripts/notify.yaml
new file mode 100644 (file)
index 0000000..5c7382c
--- /dev/null
@@ -0,0 +1,197 @@
+######################################################################
+# Script: Text Notification
+# Inputs:
+# - title
+# - message
+# - notification_id
+# - enable_persistent
+#
+# Operations:
+# - notify.mail
+# - notify.push
+# - persistent_notification.create (if enable_persistent)
+######################################################################
+
+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 is defined %}
+          {% if enable_persistent | int == 1 %}
+            true
+          {% else %}
+            false
+          {% endif %}
+        {% else %}
+          false
+        {% endif %}
+
+    - service: persistent_notification.create
+      data_template:
+       title: "{{ title }}"
+       message: "{{ message }}"
+       notification_id: >-
+         {# Check Null Input #}
+         {% if notification_id | length == 0 %}
+           {% set notification_id = 'generic' %}
+         {% endif %}
+         {{ notification_id }}
+
+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 }}"
+        notification_id: "{{ notification_id }}"
+        enable_persistent: "{{ enable_persistent }}"
+
+######################################################################
+# Script: Volume Manager
+# Input:
+# - media_player
+# - volume_level
+#
+# Operations:
+# - media_player.volume_set
+######################################################################
+
+volume_manager:
+  alias: Gestione Volume
+  sequence:
+    - 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.60 %}
+          {% 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 %}
+
+######################################################################
+# Script: Voice Notification
+# Input:
+# - media_player
+# - volume_level
+# - language
+# - message
+#
+# Operations:
+# - script.notify_volume_manager
+# - tts.google_translate_say
+######################################################################
+
+notify_voice:
+  alias: Notifiche vocali
+  sequence:
+    - condition: state
+      entity_id: input_boolean.speech_notifications
+      state: 'on'
+      
+    - wait_template: >-
+        {% if media_player | length == 0 %}
+          {% set media_player = 'media_player.google_home' %}
+        {% endif %}
+        {{ not is_state(media_player, 'playing') }}
+  
+    - service: script.volume_manager
+      data_template:
+        media_player: "{{ media_player }}"
+        volume_level: "{{ volume_level }}"
+
+    - service: tts.google_translate_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 }}"
+        
+    - service: script.volume_manager
+
+######################################################################
+# Script: Global Notification (Text+Voice)
+# Inputs:
+# - title
+# - media_player
+# - volume_level
+# _ language
+# - message
+# - notification_id
+# - 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 }}"
+        notification_id: "{{ notification_id }}"
+        enable_persistent: "{{ enable_persistent }}"
+
+    - service: script.notify_voice
+      data_template:
+        media_player: "{{ media_player }}"
+        volume_level: "{{ volume_level }}"
+        language: "{{ language }}"
+        message: "{{ message }}"
diff --git a/scripts/shelly.yaml b/scripts/shelly.yaml
new file mode 100644 (file)
index 0000000..d9b3ae4
--- /dev/null
@@ -0,0 +1,112 @@
+######################################################################
+# Shelly: Upgrade
+# - mqtt.publish
+######################################################################
+
+shelly_upgrade:
+  alias: "Shelly: Aggiornamento Firmware"
+  sequence:
+    # Shelly 2 Tapparella Cucina
+    - service: mqtt.publish
+      data:
+        topic: 'shellies/shellyswitch-55980F/command'
+        payload: 'update_fw'
+        
+    # Shelly 2 Tapparella Sala
+    - service: mqtt.publish
+      data:
+        topic: 'shellies/shellyswitch25-6919BD/command'
+        payload: 'update_fw'
+
+    # Shelly 2 Tapparella Studio
+    - service: mqtt.publish
+      data:
+        topic: 'shellies/shellyswitch-13572B/command'
+        payload: 'update_fw'
+
+    # Shelly 2 Tapparella Camera
+    - service: mqtt.publish
+      data:
+        topic: 'shellies/shellyswitch-559C49/command'
+        payload: 'update_fw'
+
+    # Shelly 1 Luce Corridoio
+    - service: mqtt.publish
+      data:
+        topic: 'shellies/shelly1-24D1EE/command'
+        payload: 'update_fw'
+
+    # Shelly 1 Luce Cucina
+    - service: mqtt.publish
+      data:
+        topic: 'shellies/shelly1-93B27D/command'
+        payload: 'update_fw'
+
+    # Shelly 1 Luce Sala
+    - service: mqtt.publish
+      data:
+        topic: 'shellies/shelly1-C426F9/command'
+        payload: 'update_fw'
+
+    # Shelly Bulb Luce Divano
+    - service: mqtt.publish
+      data:
+        topic: 'shellies/shellybulb-BC8610/command'
+        payload: 'update_fw'
+
+    # Shelly 2.5 Luci Bagno
+    - service: mqtt.publish
+      data:
+        topic: 'shellies/shellyswitch25-7457D8/command'
+        payload: 'update_fw'
+
+    # Shelly 1 Luce Studio
+    - service: mqtt.publish
+      data:
+        topic: 'shellies/shelly1-59E18C/command'
+        payload: 'update_fw'
+
+    # Shelly Dimmer Luce Camera
+    - service: mqtt.publish
+      data:
+        topic: 'shellies/shellydimmer-D46CF2/command'
+        payload: 'update_fw'
+
+    # Shelly 1 Luce Balcone
+    - service: mqtt.publish
+      data:
+        topic: 'shellies/shelly1-C423C8/command'
+        payload: 'update_fw'
+
+    # Shelly EM
+    - service: mqtt.publish
+      data:
+        topic: 'shellies/shellyem-B9E1A0/command'
+        payload: 'update_fw'
+
+    # Shelly Door/Window
+    - service: mqtt.publish
+      data:
+        topic: 'shellies/shellydw-B88F53/command'
+        payload: 'update_fw'
+        
+    # Shelly Plug S
+    - service: mqtt.publish
+      data:
+        topic: 'shellies/shellyplug-s-7A31CB/command'
+        payload: 'update_fw'
+
+#    # Shelly 1 TBD
+#    - service: mqtt.publish
+#      data:
+#        topic: 'shellies/shelly1-24D1A8/command'
+#        payload: 'update_fw'
+
+######################################################################
+# Shelly: Reboot
+# - shell_command.shelly_reboot
+######################################################################
+shelly_reboot:
+  alias: "Shelly: Riavvia Dispositivi"
+  sequence:
+    - service: shell_command.shelly_reboot
diff --git a/scripts/speech_engine.yaml b/scripts/speech_engine.yaml
new file mode 100644 (file)
index 0000000..3c55765
--- /dev/null
@@ -0,0 +1,55 @@
+######################################################################
+# Script: Speech Engine
+# Inputs:
+# - media_player
+# - volume_level
+# - message
+# - enable_greeting
+# - enable_status
+# - enable_location
+# - location_people_start
+# - location_people_num
+# - enable_car
+#
+# Operations:
+# - script.notify_voice (greeting + message)
+######################################################################
+
+speech_engine:
+  alias: Speech Engine
+  sequence: 
+    - service: script.notify_voice
+      data_template:
+        media_player: "{{ media_player }}"
+        volume_level: "{{ volume_level }}"
+        message: !include ../templates/speech_message.yaml
+
+######################################################################
+# Script: Speech Status
+#
+# Operations:
+# - script.speech_engine
+######################################################################
+
+speech_status:
+  alias: Stato Casa
+  sequence: 
+    - service: script.speech_engine
+      data:
+        enable_greeting: 1
+        enable_status: 1
+
+######################################################################
+# Speech Consumption
+#
+# Operations:
+# - script.speech_engine
+######################################################################
+
+speech_consumption:
+  alias: Consumo Energetico
+  sequence:
+    - service: script.speech_engine
+      data_template:
+        message: >-
+          "Il consumo istantaneo è pari a {{ states.sensor.potenza_istantanea.state }} watt"
diff --git a/sensor/switch.yaml b/sensor/switch.yaml
deleted file mode 100644 (file)
index 135b29e..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-######################################################################\r
-# WXKG01LM - Xiaomi MiJia wireless switch\r
-######################################################################\r
-\r
-- platform: "mqtt"\r
-  name: "Pulsante: Stato"\r
-  state_topic: "zigbee2mqtt/wireless_switch"\r
-  availability_topic: "zigbee2mqtt/bridge/state"\r
-  icon: "mdi:toggle-switch"\r
-  value_template: "{{ value_json.click }}"\r
diff --git a/sensor/switch.yaml.disabled b/sensor/switch.yaml.disabled
new file mode 100644 (file)
index 0000000..135b29e
--- /dev/null
@@ -0,0 +1,10 @@
+######################################################################\r
+# WXKG01LM - Xiaomi MiJia wireless switch\r
+######################################################################\r
+\r
+- platform: "mqtt"\r
+  name: "Pulsante: Stato"\r
+  state_topic: "zigbee2mqtt/wireless_switch"\r
+  availability_topic: "zigbee2mqtt/bridge/state"\r
+  icon: "mdi:toggle-switch"\r
+  value_template: "{{ value_json.click }}"\r
diff --git a/sensor/xiaomi.yaml b/sensor/xiaomi.yaml
deleted file mode 100644 (file)
index 9dd97ce..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-######################################################################
-# MCCGQ01LM - Xiaomi MiJia door & window contact sensor
-######################################################################
-
-- platform: "mqtt"
-  name: "Porta Casa: Batteria"
-  state_topic: "zigbee2mqtt/main_door"
-  availability_topic: "zigbee2mqtt/bridge/state"
-  unit_of_measurement: "%"
-  device_class: "battery"
-  value_template: "{{ value_json.battery }}"
-
-- platform: "mqtt"
-  name: "Porta Casa: Stato Link"
-  state_topic: "zigbee2mqtt/main_door"
-  availability_topic: "zigbee2mqtt/bridge/state"
-  unit_of_measurement: "%"
-  value_template: "{{ value_json.linkquality }}"
-
-######################################################################
-# MCCGQ11LM - Xiaomi Aqara door & window contact sensor
-######################################################################
-
-- platform: "mqtt"
-  name: "Porta Casa 2: Batteria"
-  state_topic: "zigbee2mqtt/spare_door"
-  availability_topic: "zigbee2mqtt/bridge/state"
-  unit_of_measurement: "%"
-  device_class: "battery"
-  value_template: "{{ value_json.battery }}"
-
-- platform: "mqtt"
-  name: "Porta Casa 2: Stato Link"
-  state_topic: "zigbee2mqtt/spare_door"
-  availability_topic: "zigbee2mqtt/bridge/state"
-  unit_of_measurement: "%"
-  value_template: "{{ value_json.linkquality }}"
-
-######################################################################
-# WXKG01LM - Xiaomi MiJia wireless switch
-######################################################################
-
-- platform: "mqtt"
-  name: "Pulsante: Batteria"
-  state_topic: "zigbee2mqtt/wireless_switch"
-  availability_topic: "zigbee2mqtt/bridge/state"
-  unit_of_measurement: "%"
-  device_class: "battery"
-  value_template: "{{ value_json.battery }}"
-
-- platform: "mqtt"
-  name: "Pulsante: Stato Link"
-  state_topic: "zigbee2mqtt/wireless_switch"
-  availability_topic: "zigbee2mqtt/bridge/state"
-  unit_of_measurement: "-"
-  value_template: "{{ value_json.linkquality }}"
diff --git a/sensor/xiaomi.yaml.disabled b/sensor/xiaomi.yaml.disabled
new file mode 100644 (file)
index 0000000..9dd97ce
--- /dev/null
@@ -0,0 +1,56 @@
+######################################################################
+# MCCGQ01LM - Xiaomi MiJia door & window contact sensor
+######################################################################
+
+- platform: "mqtt"
+  name: "Porta Casa: Batteria"
+  state_topic: "zigbee2mqtt/main_door"
+  availability_topic: "zigbee2mqtt/bridge/state"
+  unit_of_measurement: "%"
+  device_class: "battery"
+  value_template: "{{ value_json.battery }}"
+
+- platform: "mqtt"
+  name: "Porta Casa: Stato Link"
+  state_topic: "zigbee2mqtt/main_door"
+  availability_topic: "zigbee2mqtt/bridge/state"
+  unit_of_measurement: "%"
+  value_template: "{{ value_json.linkquality }}"
+
+######################################################################
+# MCCGQ11LM - Xiaomi Aqara door & window contact sensor
+######################################################################
+
+- platform: "mqtt"
+  name: "Porta Casa 2: Batteria"
+  state_topic: "zigbee2mqtt/spare_door"
+  availability_topic: "zigbee2mqtt/bridge/state"
+  unit_of_measurement: "%"
+  device_class: "battery"
+  value_template: "{{ value_json.battery }}"
+
+- platform: "mqtt"
+  name: "Porta Casa 2: Stato Link"
+  state_topic: "zigbee2mqtt/spare_door"
+  availability_topic: "zigbee2mqtt/bridge/state"
+  unit_of_measurement: "%"
+  value_template: "{{ value_json.linkquality }}"
+
+######################################################################
+# WXKG01LM - Xiaomi MiJia wireless switch
+######################################################################
+
+- platform: "mqtt"
+  name: "Pulsante: Batteria"
+  state_topic: "zigbee2mqtt/wireless_switch"
+  availability_topic: "zigbee2mqtt/bridge/state"
+  unit_of_measurement: "%"
+  device_class: "battery"
+  value_template: "{{ value_json.battery }}"
+
+- platform: "mqtt"
+  name: "Pulsante: Stato Link"
+  state_topic: "zigbee2mqtt/wireless_switch"
+  availability_topic: "zigbee2mqtt/bridge/state"
+  unit_of_measurement: "-"
+  value_template: "{{ value_json.linkquality }}"