- service: script.speech_engine
data_template:
- message: !include ../templates/welcome_message.yaml
+ message: !include ../template_messages/welcome.yaml
enable_greeting: 0
######################################################################
automation: !include automations.yaml
automation manual: !include_dir_merge_list automations/
-# Assist pipeline
-# assist_pipeline:
-
# Backup
backup:
# Enables configuration UI
config:
-# Conversation
-conversation:
-
# Counter
counter: !include_dir_merge_named counters/
frontend:
themes: !include_dir_merge_named themes
+# Hardware
+# hardware:
+
# Home Assistant Alerts
homeassistant_alerts:
# Image upload
image_upload:
-# Hardware
-# hardware:
-
# Inputs
input_boolean: !include_dir_merge_named input_boolean/
input_button: !include_dir_merge_named input_button/
schedule:
# Scene
-#scene: !include_dir_merge_list scenes.yaml
+# scene: !include_dir_merge_list scenes.yaml
# Scripts
script: !include scripts.yaml
script manual: !include_dir_merge_named scripts/
# Stream
-#stream:
+# stream:
# Track the sun
sun:
# Discover DHCP requests for supported devices and services.
dhcp:
+# Auto detection is based on the system routing next hop for the mDNS broadcast address
+network:
+
# Simple Service Discovery Protocol (SSDP)
ssdp:
# Zero-configuration networking (zeroconf)
zeroconf:
+######################################################################
+# Voice Interface
+######################################################################
+
+# Assist pipeline
+# assist_pipeline:
+
+# Allows you to issue voice commands from the frontend in enabled browsers
+# conversation:
+
######################################################################
# Additional Components
######################################################################
# Covers
cover: !include_dir_merge_list cover/
-# Allows you to issue voice commands from the frontend in enabled browsers
-#conversation:
-
# Device Tracker
device_tracker: !include_dir_merge_list device_tracker/
# Text to speech
tts: !include components/tts.yaml
+# Templates
+template: !include_dir_merge_list template/
+
# Wake on Lan
wake_on_lan:
data_template:
media_player: "{{ media_player }}"
volume_level: "{{ volume_level }}"
- message: !include ../templates/speech_message.yaml
+ message: !include ../template_messages/speech.yaml
######################################################################
# Script: Speech Status
--- /dev/null
+######################################################################
+# Speech Engine Message
+######################################################################
+
+>-
+ {# *********************************************** #}
+ {# ***************** Check Input ***************** #}
+ {# *********************************************** #}
+ {% if enable_greeting is not defined %}
+ {% set enable_greeting=false %}
+ {% endif %}
+ {% if enable_status is not defined %}
+ {% set enable_status=false %}
+ {% endif %}
+ {% if enable_consumption is not defined %}
+ {% set enable_consumption=false %}
+ {% endif %}
+ {% if enable_location is not defined %}
+ {% set enable_location=false %}
+ {% endif %}
+ {% if location_people_start is not defined %}
+ {% set location_people_start=1 %}
+ {% endif %}
+ {% if location_people_num is not defined %}
+ {% set location_people_num=2 %}
+ {% endif %}
+ {% if enable_car is not defined %}
+ {% set enable_car=false %}
+ {% endif %}
+
+ {# *********************************************** #}
+ {# ******************** Macro ******************** #}
+ {# *********************************************** #}
+
+ {# Greeting Message #}
+ {%- macro greeting() -%}
+ {% if now().strftime('%H')|int >= 7 and now().strftime('%H')|int < 12 %}
+ Buongiorno.
+ {% elif now().strftime('%H')|int >= 12 and now().strftime('%H')|int < 17 %}
+ Buonpomeriggio.
+ {% elif now().strftime('%H')|int >= 17 and now().strftime('%H')|int < 23 %}
+ Buonasera.
+ {% else %}
+ Buonanotte.
+ {% endif %}
+ {%- endmacro -%}
+
+ {# Time & Date #}
+ {%- macro time_and_date() -%}
+ {% set hour = now().strftime('%H') %}
+ {% set min = now().strftime('%M') %}
+ {% set day = now().strftime('%d') %}
+ {% set mounth = now().strftime('%B')|replace('January', 'Gennaio')
+ |replace('February', 'Febbraio')
+ |replace('March', 'Marzo')
+ |replace('April', 'Aprile')
+ |replace('May', 'Maggio')
+ |replace('June', 'Giugno')
+ |replace('July', 'Luglio')
+ |replace('August', 'Agosto')
+ |replace('September', 'Settembre')
+ |replace('October', 'Ottobre')
+ |replace('November', 'Novembre')
+ |replace('December', 'Dicembre') %}
+ {% set year = now().strftime('%Y') %}
+ Sono le {{ hour }} e {{ min }} del {{ day }} {{ mounth }} {{ year }}
+ {%- endmacro -%}
+
+ {# Door Status #}
+ {%- macro status_door() -%}
+ {% for entity_id in states.group.doors.attributes.entity_id %}
+ {% set name = state_attr(entity_id, 'friendly_name') %}
+ {% if is_state(entity_id, 'off') %}
+ La {{ name }} è chiusa.
+ {% else %}
+ La {{ name }} è aperta.
+ {% endif %}
+ {%- endfor %}
+ {%- endmacro -%}
+
+ {# Lights Status #}
+ {%- macro status_lights() -%}
+ {% for entity_id in states.group.lights.attributes.entity_id %}
+ {% set name = state_attr(entity_id, 'friendly_name') %}
+ {% if is_state(entity_id, 'off') %}
+ La {{ name }} è spenta.
+ {% else %}
+ La {{ name }} è accesa.
+ {% endif %}
+ {%- endfor %}
+ {%- endmacro -%}
+
+ {# Covers Status #}
+ {%- macro status_covers() -%}
+ {% for entity_id in states.group.covers.attributes.entity_id %}
+ {% set name = state_attr(entity_id, 'friendly_name') %}
+ {% set perc = state_attr(entity_id, 'current_position') %}
+ {% if perc | int < 25 %}
+ La {{ name }} è chiusa.
+ {% else %}
+ La {{ name }} è aperta al {{ perc }} percento.
+ {% endif %}
+ {%- endfor %}
+ {%- endmacro -%}
+
+ {# Temperature Status #}
+ {%- macro status_temperature() -%}
+ {% for entity_id in states.group.temperature.attributes.entity_id %}
+ {% set name = state_attr(entity_id, 'friendly_name') %}
+ {% set temp = states(entity_id) %}
+ La {{ name }} è {{ temp }} gradi.
+ {%- endfor %}
+ {%- endmacro -%}
+
+ {# Consumption Status #}
+ {%- macro status_consumption() -%}
+ "Il consumo istantaneo è pari a {{ states.sensor.shelly_em_channel_1_power.state }} watt"
+ {%- endmacro -%}
+
+ {# Location Status #}
+ {%- macro status_location(start, num) -%}
+ {% for entity_id in states.group.people.attributes.entity_id %}
+ {% set name = state_attr(entity_id, 'friendly_name') %}
+ {% if is_state(entity_id, 'not_home') %}
+ {% set source = state_attr(entity_id, 'source') %}
+ {% set position = state_attr(source, 'address')|replace('Province of', 'Provincia di') %}
+ {% elif is_state(entity_id, 'home') %}
+ {% set position = "casa" %}
+ {% else %}
+ {% set position = states(entity_id) %}
+ {% endif %}
+
+ {% if (loop.index >= start|int) and (loop.index < num|int+start|int) %}
+ La posizione di {{ name }} è {{ position }}.
+ {% endif %}
+ {%- endfor %}
+ {%- endmacro -%}
+
+ {# Car Status #}
+ {%- macro status_car() -%}
+ {% if is_state('device_tracker.ff590mr_device_tracker', 'home') %}
+ {% set car_position = "in garage" %}
+ {% else %}
+ {% set car_position = "fuori" %}
+ {% endif %}
+ {% if is_state('binary_sensor.ff590mr_locked', 'off') %}
+ {% set car_lock = "chiusa" %}
+ {% else %}
+ {% set car_lock = "aperta" %}
+ {% endif %}
+ {% if is_state('binary_sensor.ff590mr_windows_closed_2', 'off') %}
+ {% set car_windows = "chiusi" %}
+ {% else %}
+ {% set car_windows = "aperti" %}
+ {% endif %}
+ La Mercedes si trova {{ car_position }}. è {{ car_lock }} con i finestrini {{ car_windows }}.
+ Il livello del carburante è {{ states('sensor.ff590mr_fuel_level') }} percento.
+ {% if is_state('binary_sensor.ff590mr_low_brake_fluid_warning', 'on') or
+ is_state('binary_sensor.ff590mr_low_coolant_level_warning', 'on') or
+ is_state('binary_sensor.ff590mr_low_wash_water_warning', 'on') or
+ is_state('binary_sensor.ff590mr_tire_warning', 'on') %}
+ Sono inoltre presenti allarmi.
+ {% endif %}
+ {%- endmacro -%}
+
+ {# End Message #}
+ {%- macro end_message() -%}
+ {% if enable_status == true %}
+ {{ [
+ "Spero che il report ti abbia soddisfatto!",
+ "Il report è concluso.",
+ "Alla prossima!",
+ "Buon proseguimento!",
+ "Non ho altro da comunicare."
+ ] | random }}
+ {% endif %}
+ {%- endmacro -%}
+
+ {# *********************************************** #}
+ {# ******************* Message ******************* #}
+ {# *********************************************** #}
+
+ {# Greeting Message #}
+ {% if enable_greeting == true %}
+ {{ greeting() }}
+ {% endif %}
+
+ {# Home Status #}
+ {% if enable_status == true %}
+
+ {{ time_and_date() }}
+
+ {{ status_door() }}
+
+ {{ status_lights() }}
+
+ {{ status_covers() }}
+
+ {{ status_temperature() }}
+
+ {% endif %}
+
+ {% if (enable_status == true) or (enable_consumption == true) %}
+ {{ status_consumption() }}
+ {% endif %}
+
+ {# Location Status #}
+ {% if (enable_status == true) or (enable_location == true) %}
+ {{ status_location(location_people_start, location_people_num) }}
+ {% endif %}
+
+ {# Car Status #}
+ {% if (enable_status == true) or (enable_car == true) %}
+ {{ status_car() }}
+ {% endif %}
+
+ {# generic message #}
+ {{ message }}
+
+ {# end message #}
+ {{ end_message() }}
--- /dev/null
+######################################################################
+# Speech Engine Message
+######################################################################
+
+>-
+ {% set name = state_attr(trigger.entity_id, 'friendly_name') %}
+ {%- macro greeting_sentence(name) -%}
+ {{ [
+ "Ciao " ~ name + " è un piacere rivederti a casa",
+ "Finalmente a casa " ~ name + "!",
+ "Indovina chi è a casa? " ~ name + "!",
+ name + " è ora a casa!",
+ "Che bello! " ~ name + " è a casa",
+ name + " sei a casa!",
+ "Il sistema di domotica Casa Ravera-Testa notifica che " ~ name + " è a casa!",
+ "Annuncio: " ~ name + " è ora a casa!",
+ "Rilevo una presenza! " ~ name + " è a casa!",
+ "Ciao " ~ name + " che la forza sia con te",
+ "Sento un tremito nella forza! " ~ name + " è a casa",
+ "Sento un interferenza nella Forza! " ~ name + " è qui",
+ "Menomale che sei qui " ~ name + "! Mi sentivo solo",
+ "Menomale che sei qui " ~ name + "! La casa è vuota senza di te!",
+ "Ciao " ~ name + "! Casa è sempre la casa!"
+ ] | random }}
+ {%- endmacro -%}
+ {{ greeting_sentence(name) }}
+++ /dev/null
-######################################################################
-# Speech Engine Message
-######################################################################
-
->-
- {# *********************************************** #}
- {# ***************** Check Input ***************** #}
- {# *********************************************** #}
- {% if enable_greeting is not defined %}
- {% set enable_greeting=false %}
- {% endif %}
- {% if enable_status is not defined %}
- {% set enable_status=false %}
- {% endif %}
- {% if enable_consumption is not defined %}
- {% set enable_consumption=false %}
- {% endif %}
- {% if enable_location is not defined %}
- {% set enable_location=false %}
- {% endif %}
- {% if location_people_start is not defined %}
- {% set location_people_start=1 %}
- {% endif %}
- {% if location_people_num is not defined %}
- {% set location_people_num=2 %}
- {% endif %}
- {% if enable_car is not defined %}
- {% set enable_car=false %}
- {% endif %}
-
- {# *********************************************** #}
- {# ******************** Macro ******************** #}
- {# *********************************************** #}
-
- {# Greeting Message #}
- {%- macro greeting() -%}
- {% if now().strftime('%H')|int >= 7 and now().strftime('%H')|int < 12 %}
- Buongiorno.
- {% elif now().strftime('%H')|int >= 12 and now().strftime('%H')|int < 17 %}
- Buonpomeriggio.
- {% elif now().strftime('%H')|int >= 17 and now().strftime('%H')|int < 23 %}
- Buonasera.
- {% else %}
- Buonanotte.
- {% endif %}
- {%- endmacro -%}
-
- {# Time & Date #}
- {%- macro time_and_date() -%}
- {% set hour = now().strftime('%H') %}
- {% set min = now().strftime('%M') %}
- {% set day = now().strftime('%d') %}
- {% set mounth = now().strftime('%B')|replace('January', 'Gennaio')
- |replace('February', 'Febbraio')
- |replace('March', 'Marzo')
- |replace('April', 'Aprile')
- |replace('May', 'Maggio')
- |replace('June', 'Giugno')
- |replace('July', 'Luglio')
- |replace('August', 'Agosto')
- |replace('September', 'Settembre')
- |replace('October', 'Ottobre')
- |replace('November', 'Novembre')
- |replace('December', 'Dicembre') %}
- {% set year = now().strftime('%Y') %}
- Sono le {{ hour }} e {{ min }} del {{ day }} {{ mounth }} {{ year }}
- {%- endmacro -%}
-
- {# Door Status #}
- {%- macro status_door() -%}
- {% for entity_id in states.group.doors.attributes.entity_id %}
- {% set name = state_attr(entity_id, 'friendly_name') %}
- {% if is_state(entity_id, 'off') %}
- La {{ name }} è chiusa.
- {% else %}
- La {{ name }} è aperta.
- {% endif %}
- {%- endfor %}
- {%- endmacro -%}
-
- {# Lights Status #}
- {%- macro status_lights() -%}
- {% for entity_id in states.group.lights.attributes.entity_id %}
- {% set name = state_attr(entity_id, 'friendly_name') %}
- {% if is_state(entity_id, 'off') %}
- La {{ name }} è spenta.
- {% else %}
- La {{ name }} è accesa.
- {% endif %}
- {%- endfor %}
- {%- endmacro -%}
-
- {# Covers Status #}
- {%- macro status_covers() -%}
- {% for entity_id in states.group.covers.attributes.entity_id %}
- {% set name = state_attr(entity_id, 'friendly_name') %}
- {% set perc = state_attr(entity_id, 'current_position') %}
- {% if perc | int < 25 %}
- La {{ name }} è chiusa.
- {% else %}
- La {{ name }} è aperta al {{ perc }} percento.
- {% endif %}
- {%- endfor %}
- {%- endmacro -%}
-
- {# Temperature Status #}
- {%- macro status_temperature() -%}
- {% for entity_id in states.group.temperature.attributes.entity_id %}
- {% set name = state_attr(entity_id, 'friendly_name') %}
- {% set temp = states(entity_id) %}
- La {{ name }} è {{ temp }} gradi.
- {%- endfor %}
- {%- endmacro -%}
-
- {# Consumption Status #}
- {%- macro status_consumption() -%}
- "Il consumo istantaneo è pari a {{ states.sensor.shelly_em_channel_1_power.state }} watt"
- {%- endmacro -%}
-
- {# Location Status #}
- {%- macro status_location(start, num) -%}
- {% for entity_id in states.group.people.attributes.entity_id %}
- {% set name = state_attr(entity_id, 'friendly_name') %}
- {% if is_state(entity_id, 'not_home') %}
- {% set source = state_attr(entity_id, 'source') %}
- {% set position = state_attr(source, 'address')|replace('Province of', 'Provincia di') %}
- {% elif is_state(entity_id, 'home') %}
- {% set position = "casa" %}
- {% else %}
- {% set position = states(entity_id) %}
- {% endif %}
-
- {% if (loop.index >= start|int) and (loop.index < num|int+start|int) %}
- La posizione di {{ name }} è {{ position }}.
- {% endif %}
- {%- endfor %}
- {%- endmacro -%}
-
- {# Car Status #}
- {%- macro status_car() -%}
- {% if is_state('device_tracker.ff590mr_device_tracker', 'home') %}
- {% set car_position = "in garage" %}
- {% else %}
- {% set car_position = "fuori" %}
- {% endif %}
- {% if is_state('binary_sensor.ff590mr_locked', 'off') %}
- {% set car_lock = "chiusa" %}
- {% else %}
- {% set car_lock = "aperta" %}
- {% endif %}
- {% if is_state('binary_sensor.ff590mr_windows_closed_2', 'off') %}
- {% set car_windows = "chiusi" %}
- {% else %}
- {% set car_windows = "aperti" %}
- {% endif %}
- La Mercedes si trova {{ car_position }}. è {{ car_lock }} con i finestrini {{ car_windows }}.
- Il livello del carburante è {{ states('sensor.ff590mr_fuel_level') }} percento.
- {% if is_state('binary_sensor.ff590mr_low_brake_fluid_warning', 'on') or
- is_state('binary_sensor.ff590mr_low_coolant_level_warning', 'on') or
- is_state('binary_sensor.ff590mr_low_wash_water_warning', 'on') or
- is_state('binary_sensor.ff590mr_tire_warning', 'on') %}
- Sono inoltre presenti allarmi.
- {% endif %}
- {%- endmacro -%}
-
- {# End Message #}
- {%- macro end_message() -%}
- {% if enable_status == true %}
- {{ [
- "Spero che il report ti abbia soddisfatto!",
- "Il report è concluso.",
- "Alla prossima!",
- "Buon proseguimento!",
- "Non ho altro da comunicare."
- ] | random }}
- {% endif %}
- {%- endmacro -%}
-
- {# *********************************************** #}
- {# ******************* Message ******************* #}
- {# *********************************************** #}
-
- {# Greeting Message #}
- {% if enable_greeting == true %}
- {{ greeting() }}
- {% endif %}
-
- {# Home Status #}
- {% if enable_status == true %}
-
- {{ time_and_date() }}
-
- {{ status_door() }}
-
- {{ status_lights() }}
-
- {{ status_covers() }}
-
- {{ status_temperature() }}
-
- {% endif %}
-
- {% if (enable_status == true) or (enable_consumption == true) %}
- {{ status_consumption() }}
- {% endif %}
-
- {# Location Status #}
- {% if (enable_status == true) or (enable_location == true) %}
- {{ status_location(location_people_start, location_people_num) }}
- {% endif %}
-
- {# Car Status #}
- {% if (enable_status == true) or (enable_car == true) %}
- {{ status_car() }}
- {% endif %}
-
- {# generic message #}
- {{ message }}
-
- {# end message #}
- {{ end_message() }}
+++ /dev/null
-######################################################################
-# Speech Engine Message
-######################################################################
-
->-
- {% set name = state_attr(trigger.entity_id, 'friendly_name') %}
- {%- macro greeting_sentence(name) -%}
- {{ [
- "Ciao " ~ name + " è un piacere rivederti a casa",
- "Finalmente a casa " ~ name + "!",
- "Indovina chi è a casa? " ~ name + "!",
- name + " è ora a casa!",
- "Che bello! " ~ name + " è a casa",
- name + " sei a casa!",
- "Il sistema di domotica Casa Ravera-Testa notifica che " ~ name + " è a casa!",
- "Annuncio: " ~ name + " è ora a casa!",
- "Rilevo una presenza! " ~ name + " è a casa!",
- "Ciao " ~ name + " che la forza sia con te",
- "Sento un tremito nella forza! " ~ name + " è a casa",
- "Sento un interferenza nella Forza! " ~ name + " è qui",
- "Menomale che sei qui " ~ name + "! Mi sentivo solo",
- "Menomale che sei qui " ~ name + "! La casa è vuota senza di te!",
- "Ciao " ~ name + "! Casa è sempre la casa!"
- ] | random }}
- {%- endmacro -%}
- {{ greeting_sentence(name) }}