From 117eed3c7a95ab58a610ce343c72e7907ffd12cb Mon Sep 17 00:00:00 2001 From: Giorgio Ravera Date: Mon, 11 Mar 2019 23:23:37 +0100 Subject: [PATCH] Modification to logbook, history,recorder and alarms --- configuration.yaml | 20 ++----------- history.yaml | 14 +++++++++ logbook.yaml | 14 +++++++++ recorder.yaml | 5 +++- script/alarm.yaml | 47 +++++++++++++++++++++++++++++++ script/audio.yaml | 10 +++++-- script/notify.yaml | 4 +-- script/{mqtt.yaml => shelly.yaml} | 2 +- 8 files changed, 93 insertions(+), 23 deletions(-) create mode 100644 history.yaml create mode 100644 logbook.yaml create mode 100644 script/alarm.yaml rename script/{mqtt.yaml => shelly.yaml} (97%) diff --git a/configuration.yaml b/configuration.yaml index 729ad8d9..50cf5a80 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -62,24 +62,10 @@ discovery: conversation: # Enables support for tracking state changes over time -history: - exclude: - domains: - - automation - - group - - input_boolean - - input_text - - script - +history: !include history.yaml + # View all events in a logbook -logbook: - exclude: - domains: - - automation - - group - - input_boolean - - input_text - - script +logbook: !include logbook.yaml # Log Management logger: !include logger.yaml diff --git a/history.yaml b/history.yaml new file mode 100644 index 00000000..5a920f88 --- /dev/null +++ b/history.yaml @@ -0,0 +1,14 @@ +###################################################################### +# History Configuration +###################################################################### + +exclude: + entities: + - sensor.time + - sensor.time_date + domains: + - automation + - group + - input_boolean + - input_text + #- script \ No newline at end of file diff --git a/logbook.yaml b/logbook.yaml new file mode 100644 index 00000000..cca4e874 --- /dev/null +++ b/logbook.yaml @@ -0,0 +1,14 @@ +###################################################################### +# Logbook Configuration +###################################################################### + +exclude: + entities: + - sensor.time + - sensor.time_date + domains: + - automation + - group + - input_boolean + - input_text + #- script diff --git a/recorder.yaml b/recorder.yaml index fa1500e8..bb8b374b 100644 --- a/recorder.yaml +++ b/recorder.yaml @@ -5,7 +5,10 @@ purge_keep_days: 30 purge_interval: 1 exclude: + entities: + - sensor.time + - sensor.time_date domains: - automation - group - - script \ No newline at end of file + #- script diff --git a/script/alarm.yaml b/script/alarm.yaml new file mode 100644 index 00000000..474748e3 --- /dev/null +++ b/script/alarm.yaml @@ -0,0 +1,47 @@ +###################################################################### +# Alarm: Start Alarm +# +# Operations: +# - script.notify_text +# - media_player.volume_set +# - media_player.play_media +###################################################################### + +start_alarm: + alias: "Attiva Allarme" + sequence: + - service: script.notify_text + data_template: + title: "Allarme" + message: "Rilevato allarme" + enable_persistent: 1 + + - service: media_player.volume_set + data_template: + entity_id: 'media_player.google_home' + volume_level: 0.5 + + - service: media_player.play_media + data_template: + entity_id: 'media_player.google_home' + media_content_type: 'audio/mp4' + media_content_id: 'https://home.giorgioravera.it/local/audio/alarm.mp3' + +###################################################################### +# Alarm: Stop Alarm +# +# Operations: +# - media_player.media_stop +# - script.volume_manager +###################################################################### + +stop_alarm: + alias: "Interrompi Allarme" + sequence: + - service: media_player.media_stop + data_template: + entity_id: 'media_player.google_home' + + - service: script.volume_manager + data_template: + media_player: 'media_player.google_home' diff --git a/script/audio.yaml b/script/audio.yaml index 78726ef5..d37425c9 100644 --- a/script/audio.yaml +++ b/script/audio.yaml @@ -5,6 +5,7 @@ # 1 -> bell'affare # # Operations: +# - script.volume_manager # - media_player.play_media ###################################################################### @@ -15,9 +16,14 @@ laura_voice: entity_id: input_boolean.speech_notifications state: 'on' - - service: script.notify_volume_manager + - service: script.volume_manager data_template: - media_player: "{{ media_player }}" + 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 diff --git a/script/notify.yaml b/script/notify.yaml index c6e8d3ea..fa4b33e1 100644 --- a/script/notify.yaml +++ b/script/notify.yaml @@ -69,7 +69,7 @@ notify_text: # - media_player.volume_set ###################################################################### -notify_volume_manager: +volume_manager: alias: Gestione Volume sequence: - service: media_player.volume_set @@ -126,7 +126,7 @@ notify_voice: entity_id: input_boolean.speech_notifications state: 'on' - - service: script.notify_volume_manager + - service: script.volume_manager data_template: media_player: "{{ media_player }}" volume_level: "{{ volume_level }}" diff --git a/script/mqtt.yaml b/script/shelly.yaml similarity index 97% rename from script/mqtt.yaml rename to script/shelly.yaml index d8417ca8..195c2e5e 100644 --- a/script/mqtt.yaml +++ b/script/shelly.yaml @@ -1,5 +1,5 @@ ###################################################################### -# MQTT: Shelly Upgrade +# Shelly: Upgrade # - mqtt.publish ###################################################################### -- 2.47.3