Эх сурвалжийг харах

doc and conf for hass/snips

Martin 7 жил өмнө
parent
commit
bda539bd33

+ 11 - 0
hass-snips-readme.txt

@@ -0,0 +1,11 @@
+Snips
+    Install: https://docs.snips.ai/articles/raspberrypi/manual-setup
+
+    Getting snips-audio-server to run:
+        I found that for pulse to run as the _snips, it needs to write to ~/.config/pulse, but /etc/passwd defines the home dir
+        of _snips as /var/empty. Create /home/snips and change the home dir of _snips to that in /etc/passwd. Also change the owner 
+        of the dir to _snips.
+        
+Connecting Snips to HASS:
+    https://www.home-assistant.io/components/snips/
+    

+ 162 - 0
hass/confs/configuration.yaml

@@ -0,0 +1,162 @@
+homeassistant:
+  # Name of the location where Home Assistant is running
+  name: Home
+  # Location required to calculate the time the sun rises and sets
+  latitude: 52.1187
+  longitude: 5.0994
+  # Impacts weather/sunrise data (altitude above sea level in meters)
+  elevation: 0
+  # metric for Metric, imperial for Imperial
+  unit_system: metric
+  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
+  time_zone: Europe/Dublin
+  # Customization file
+  customize: !include customize.yaml
+
+# Configure a default setup of Home Assistant (frontend, api, etc)
+default_config:
+
+# Show the introduction message on startup.
+#introduction:
+
+# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
+# http:
+#   base_url: example.duckdns.org:8123
+
+sensor:
+  # Weather prediction
+  #  - platform: yr
+  # - platform: time_date
+  #   display_options:
+  #     - 'time'
+
+mqtt:
+  broker: localhost
+
+#tts:
+#  - platform: google
+
+media_player:
+  - platform: kodi
+    host: tv
+    port: 8080
+    tcp_port: 9090
+    username: kodi
+    password: kodi
+    timeout: 10
+    enable_websocket: false
+
+script:
+  # kodi_play_artist:
+  #   sequence:
+  #     - service: system_log.write
+  #       data_template:
+  #         message: >
+  #           play {{artist_name}}
+  #     - service: snips.say
+  #       data_template:
+  #         text: >
+  #           Playing {{artist_name}}
+  #     - service: media_player.play_media
+  #       data:
+  #         entity_id: "media_player.kodi"
+  #         media_content_type: "music"
+  #         media_content_id: "/mnt/nas/music/misc/15-seconds-of-silence.mp3"
+  #     - service: media_player.clear_playlist
+  #       data:
+  #         entity_id: "media_player.kodi"
+  #     - service: media_player.kodi_add_to_playlist
+  #       data_template:
+  #         entity_id: "media_player.kodi"
+  #         media_type: "ALBUM"
+  #         media_name: "ALL"
+  #         artist_name: >
+  #           {{artist_name}}
+  #     - service: media_player.media_next_track
+  #       data:
+  #         entity_id: "media_player.kodi"
+  #     - service: system_log.write
+  #       data:
+  #         message: done
+
+
+snips:
+intent_script:
+  # hello:
+    # - service: persistent_notification.create
+    #   data:
+    #     message: ":-)"
+    #     title: "Hello Miranda!"
+    #     notification_id: "hello-notification"
+    # action:
+    #   - service: script.kodi_play_artist
+    #     data:
+    #       a: "1"
+    #       b: "2"
+
+  timeNow:
+    action:
+      - service: snips.say
+        data_template:
+          text: >
+            {{now().hour % 12}} {{now().minute}}
+      
+  bye:
+    action:
+      - service: homeassistant.restart
+
+  playArtist:
+    action:
+      - service: system_log.write
+        data_template:
+          message: >
+            Playing {{artist_name}}...
+      - service: snips.say
+        data_template:
+          text: >
+            Playing {{artist_name}}
+      - service: media_player.play_media
+        data:
+          entity_id: "media_player.kodi"
+          media_content_type: "music"
+          media_content_id: "/mnt/nas/music/misc/15-seconds-of-silence.mp3"
+      - service: media_player.clear_playlist
+        data:
+          entity_id: "media_player.kodi"
+      - service: media_player.kodi_add_to_playlist
+        data_template:
+          entity_id: "media_player.kodi"
+          media_type: "ALBUM"
+          media_name: "ALL"
+          artist_name: >
+            {{artist_name}}
+      - service: media_player.media_next_track
+        data:
+          entity_id: "media_player.kodi"
+      - service: system_log.write
+        data:
+          message: Done.
+
+  speakerInterrupt:
+    action:
+      - service: media_player.media_stop
+        data:
+          entity_id: "media_player.kodi"
+
+  nextSong:
+    action:
+      - service: media_player.media_next_track
+        data:
+          entity_id: "media_player.kodi"
+
+  turnOffTV:
+    action:
+      - service: media_player.kodi_call_method
+        data:
+          entity_id: media_player.kodi
+          method: System.Shutdown
+
+
+group: !include groups.yaml
+automation: !include automations.yaml
+#script: !include scripts.yaml