From 6bb01e6626d19e240506a9e711081cccb1a9824c Mon Sep 17 00:00:00 2001 From: Giorgio Ravera Date: Fri, 8 Mar 2019 00:07:04 +0100 Subject: [PATCH] Fixed welcome automation --- automation/speech.yaml | 4 +++- script/speech_engine.yaml | 17 +++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/automation/speech.yaml b/automation/speech.yaml index b15ef80d..9e2d0d79 100644 --- a/automation/speech.yaml +++ b/automation/speech.yaml @@ -57,9 +57,11 @@ false {% endif %} - timeout: '00:10:00' + timeout: '00:30:00' continue_on_timeout: 'false' +# - delay: 00:30 + - service: script.speech_engine data_template: language: 'it' diff --git a/script/speech_engine.yaml b/script/speech_engine.yaml index f23cd64a..f7533883 100644 --- a/script/speech_engine.yaml +++ b/script/speech_engine.yaml @@ -72,7 +72,8 @@ speech_engine: {% else %} {% set car_parkbreak = "non inserito" %} {% endif %} - La Mercedes si trova {{ car_position }}. è {{ car_lock }}, con i finestrini {{ car_windows }} e il freno a mano {{ car_parkbreak }}. + La Mercedes si trova {{ car_position }}. è {{ car_lock }}, con i finestrini {{ car_windows }} e il freno a mano {{ car_parkbreak }}. + Il livello del carburante è {{ states('sensor.ff590mr_tank_level') }} percento. {% if is_state('binary_sensor.ff590mr_warning_breakfluid', 'on') or is_state('binary_sensor.ff590mr_warning_engine_light', 'on') or is_state('binary_sensor.ff590mr_warning_washwater', 'on') %} @@ -82,10 +83,18 @@ speech_engine: {# 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 }}. + {% if is_state('device_tracker.google_maps_115265981849847357125', 'not_home') %} + {% set giorgio_position = 'fuori casa' %} + {% else %} + {% set giorgio_position = states('device_tracker.google_maps_115265981849847357125') %} + {% endif %} La posizione di Laura è {{ laura_position }}. + {% if is_state('device_tracker.google_maps_103158638433668748797', 'not_home') %} + {% set laura_position = 'fuori casa' %} + {% else %} + {% set laura_position = states('device_tracker.google_maps_103158638433668748797') %} + {% endif %} + La posizione di Giorgio è {{ giorgio_position }}. {%- endmacro -%} {# *********************************************** #} -- 2.47.3