]> git.giorgioravera.it Git - homeassistant.git/commitdiff
Modification to logbook, history,recorder and alarms
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Mon, 11 Mar 2019 22:23:37 +0000 (23:23 +0100)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Mon, 11 Mar 2019 22:23:37 +0000 (23:23 +0100)
configuration.yaml
history.yaml [new file with mode: 0644]
logbook.yaml [new file with mode: 0644]
recorder.yaml
script/alarm.yaml [new file with mode: 0644]
script/audio.yaml
script/mqtt.yaml [deleted file]
script/notify.yaml
script/shelly.yaml [new file with mode: 0644]

index 729ad8d9f8beb71fe0a40e854fc171d2ec0da3ca..50cf5a800158752f5c3678563ead95777f517cd3 100644 (file)
@@ -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 (file)
index 0000000..5a920f8
--- /dev/null
@@ -0,0 +1,14 @@
+######################################################################\r
+# History Configuration\r
+######################################################################\r
+\r
+exclude:\r
+  entities:\r
+    - sensor.time\r
+    - sensor.time_date\r
+  domains:\r
+    - automation\r
+    - group\r
+    - input_boolean\r
+    - input_text\r
+    #- script
\ No newline at end of file
diff --git a/logbook.yaml b/logbook.yaml
new file mode 100644 (file)
index 0000000..cca4e87
--- /dev/null
@@ -0,0 +1,14 @@
+######################################################################\r
+# Logbook Configuration\r
+######################################################################\r
+\r
+exclude:\r
+  entities:\r
+    - sensor.time\r
+    - sensor.time_date\r
+  domains:\r
+    - automation\r
+    - group\r
+    - input_boolean\r
+    - input_text\r
+    #- script\r
index fa1500e842803268de21c947577f0f99df67a1e2..bb8b374be5fdfc36bfaafd06c7d6e733201d9ab3 100644 (file)
@@ -5,7 +5,10 @@
 purge_keep_days: 30\r
 purge_interval: 1\r
 exclude:\r
+  entities:\r
+    - sensor.time\r
+    - sensor.time_date\r
   domains:\r
     - automation\r
     - group\r
-    - script
\ No newline at end of file
+    #- script\r
diff --git a/script/alarm.yaml b/script/alarm.yaml
new file mode 100644 (file)
index 0000000..474748e
--- /dev/null
@@ -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'
index 78726ef535cdcfa68b2851314f3fce296ca7cfc5..d37425c9f87f065c7245ead86350a94b27ba0c11 100644 (file)
@@ -5,6 +5,7 @@
 #         1 -> bell'affare\r
 #\r
 # Operations:\r
+# - script.volume_manager\r
 # - media_player.play_media\r
 ######################################################################\r
 \r
@@ -15,9 +16,14 @@ laura_voice:
       entity_id: input_boolean.speech_notifications\r
       state: 'on'\r
   \r
-    - service: script.notify_volume_manager\r
+    - service: script.volume_manager\r
       data_template:\r
-        media_player: "{{ media_player }}"\r
+        media_player: >-\r
+          {# Check Null Input #}\r
+          {% if media_player | length == 0 %}\r
+            {% set media_player = 'media_player.google_home' %}\r
+          {% endif %}\r
+          {{ media_player }}\r
         volume_level: "{{ volume_level }}"\r
 \r
     - service: media_player.play_media\r
diff --git a/script/mqtt.yaml b/script/mqtt.yaml
deleted file mode 100644 (file)
index d8417ca..0000000
+++ /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'
index c6e8d3ea9326dc39e2ce337185a46c6238aeec60..fa4b33e13aa538d2e5b2c01d77c6acfd26628216 100644 (file)
@@ -69,7 +69,7 @@ notify_text:
 # - media_player.volume_set\r
 ######################################################################\r
 \r
-notify_volume_manager:\r
+volume_manager:\r
   alias: Gestione Volume\r
   sequence:\r
     - service: media_player.volume_set\r
@@ -126,7 +126,7 @@ notify_voice:
       entity_id: input_boolean.speech_notifications\r
       state: 'on'\r
   \r
-    - service: script.notify_volume_manager\r
+    - service: script.volume_manager\r
       data_template:\r
         media_player: "{{ media_player }}"\r
         volume_level: "{{ volume_level }}"\r
diff --git a/script/shelly.yaml b/script/shelly.yaml
new file mode 100644 (file)
index 0000000..195c2e5
--- /dev/null
@@ -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'