From c330f2ae39b2544b1b5151508876ec443c0f4366 Mon Sep 17 00:00:00 2001 From: Giorgio Ravera Date: Mon, 25 Feb 2019 14:00:00 +0100 Subject: [PATCH] Speech script improvement --- automation/ciao.yaml.disabled | 17 ----------------- customizations/script.yaml | 12 +++++++++--- script/speech_engine.yaml | 27 +++++++++++++++++++++++++++ ui-lovelace.yaml | 6 ++++++ 4 files changed, 42 insertions(+), 20 deletions(-) delete mode 100644 automation/ciao.yaml.disabled diff --git a/automation/ciao.yaml.disabled b/automation/ciao.yaml.disabled deleted file mode 100644 index 06cae166..00000000 --- a/automation/ciao.yaml.disabled +++ /dev/null @@ -1,17 +0,0 @@ -###################################################################### -# Switch off all covers -###################################################################### - -- alias: "ciao" - trigger: - - platform: time - at: '15:48:00' - - condition: [] - - action: - - service: script.speech_engine - data_template: - message: >- - {% set ora = now().strftime('%H') %} - "Sono le {{ ora }} e tutto va bene" diff --git a/customizations/script.yaml b/customizations/script.yaml index 2621654c..f951c8bc 100644 --- a/customizations/script.yaml +++ b/customizations/script.yaml @@ -2,11 +2,17 @@ # Script Customizations ###################################################################### -script.notify_text_internal: - hidden: true - script.homeassistant_restart: icon: mdi:home-assistant script.homeassistant_clearlog: icon: mdi:file-document + +script.notify_text_internal: + hidden: true + +script.speech_engine: + icon: mdi:text-to-speech + +script.speech_status: + icon: mdi:voice \ No newline at end of file diff --git a/script/speech_engine.yaml b/script/speech_engine.yaml index 50d60b9f..f23cd64a 100644 --- a/script/speech_engine.yaml +++ b/script/speech_engine.yaml @@ -80,6 +80,14 @@ speech_engine: {% endif %} {%- endmacro -%} + {# Location Status #} + {%- macro status_location() -%} + {% set giorgio_position = states('device_tracker.google_maps_115265981849847357125') %} + {% set laura_position = states('device_tracker.google_maps_103158638433668748797') %} + La posizione di Giorgio è {{ giorgio_position }}. + La posizione di Laura è {{ laura_position }}. + {%- endmacro -%} + {# *********************************************** #} {# ******************* Message ******************* #} {# *********************************************** #} @@ -93,11 +101,30 @@ speech_engine: {% if enable_status is defined %} {% if enable_status | int == 1 %} + {{ status_covers() }} + + {{ status_location() }} {{ status_car() }} + {% endif %} {% endif %} {# generic message #} {{ message }} + +###################################################################### +# Script: Speech Status +# +# Operations: +# - script.speech_engine +###################################################################### + +speech_status: + alias: Pronuncia Stato + sequence: + - service: script.speech_engine + data: + enable_greeting: 1 + enable_status: 1 diff --git a/ui-lovelace.yaml b/ui-lovelace.yaml index b918e82f..8cc546ce 100644 --- a/ui-lovelace.yaml +++ b/ui-lovelace.yaml @@ -71,6 +71,12 @@ views: - input_boolean.home_mode_day - input_boolean.home_mode_night - input_boolean.home_mode_away + + - type: entities + title: Controlli Vari + show_header_toggle: false + entities: + - script.speech_status ###################################################################### # Covers -- 2.47.3