From: Giorgio Ravera Date: Mon, 11 Mar 2019 22:23:37 +0000 (+0100) Subject: Modification to logbook, history,recorder and alarms X-Git-Url: http://git.giorgioravera.it/?a=commitdiff_plain;h=117eed3c7a95ab58a610ce343c72e7907ffd12cb;p=homeassistant.git Modification to logbook, history,recorder and alarms --- 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/mqtt.yaml b/script/mqtt.yaml deleted file mode 100644 index d8417ca8..00000000 --- a/script/mqtt.yaml +++ /dev/null @@ -1,31 +0,0 @@ -###################################################################### -# MQTT: 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/shellyswitch-135454/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' 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/shelly.yaml b/script/shelly.yaml new file mode 100644 index 00000000..195c2e5e --- /dev/null +++ b/script/shelly.yaml @@ -0,0 +1,31 @@ +###################################################################### +# 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/shellyswitch-135454/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'