commit a5dbf57e656bfc431b50d8201bf0bfce31782584 Author: Correl Roush Date: Thu Mar 22 21:01:46 2018 -0400 Initial commit diff --git a/.HA_VERSION b/.HA_VERSION new file mode 100644 index 0000000..884e557 --- /dev/null +++ b/.HA_VERSION @@ -0,0 +1 @@ +0.65.6 \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8423b03 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +.uuid +secrets.yaml +known_devices.yaml +zones.yaml + +tts/ + +*.conf +*.db +*.log +*.sqlite +*.pickle \ No newline at end of file diff --git a/automations.yaml b/automations.yaml new file mode 100644 index 0000000..d44336e --- /dev/null +++ b/automations.yaml @@ -0,0 +1,61 @@ +- action: + - data: + group_name: Living room + scene_name: Bright + service: hue.hue_activate_scene + alias: Correl's Home + condition: + - after: sunset + before: sunrise + condition: sun + id: '1521648884156' + trigger: + - entity_id: device_tracker.homeassistant_pixel + event: enter + platform: zone + zone: zone.home +- action: + - data: + group_name: Living room + scene_name: Stephanie + service: hue.hue_activate_scene + alias: Stephanie's Home + condition: [] + id: '1521649963712' + trigger: + - entity_id: device_tracker.stephaniesiphone + from: not_home + platform: state + to: home +- action: + - data: {} + service: script.good_morning + alias: Good morning + condition: + - after: '6:00' + before: '12:00' + condition: time + id: '1521686674842' + trigger: + - entity_id: light.living_room + from: 'off' + platform: state + to: 'on' +- action: + - delay: '00:00:05' + - service: script.sonos_tts + data_template: + message: >- + Welcome home, + {{ states + | selectattr("entity_id", "in", + states.group.phones.attributes.entity_id) + | selectattr('state', 'eq', 'home') + | map(attribute='attributes.friendly_name') + | join(' and ')}}! + alias: Welcome home + trigger: + - entity_id: group.phones + platform: state + from: not_home + to: home diff --git a/configuration.yaml b/configuration.yaml new file mode 100644 index 0000000..b139119 --- /dev/null +++ b/configuration.yaml @@ -0,0 +1,91 @@ +homeassistant: + # Name of the location where Home Assistant is running + name: Home + # Location required to calculate the time the sun rises and sets + latitude: !secret home_latitude + longitude: !secret home_longitude + # Impacts weather/sunrise data (altitude above sea level in meters) + elevation: !secret home_elevation + # metric for Metric, imperial for Imperial + unit_system: imperial + # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones + time_zone: America/New_York + # Customization file + customize: !include customize.yaml + +# Show links to resources in log and frontend +# introduction: + +# Enables the frontend +frontend: + +# Enables configuration UI +config: + +http: + # Secrets are defined in the file secrets.yaml + api_password: !secret http_password + # Uncomment this if you are using SSL/TLS, running in Docker container, etc. + base_url: hass.phoenixinquis.is-a-geek.org + server_port: 8199 + +# Checks for available updates +# Note: This component will send some information about your system to +# the developers to assist with development of Home Assistant. +# For more information, please see: +# https://home-assistant.io/blog/2016/10/25/explaining-the-updater/ +updater: + # Optional, allows Home Assistant developers to focus on popular components. + # include_used_components: true + +# Discover some devices automatically +discovery: + +# Allows you to issue voice commands from the frontend in enabled browsers +conversation: + +# Enables support for tracking state changes over time +history: + +# View all events in a logbook +logbook: + +# Enables a map showing the location of tracked devices +map: + +# Track the sun +sun: + +# Text to speech +tts: + # - platform: google + - platform: amazon_polly + aws_access_key_id: !secret aws_access_key_id + aws_secret_access_key: !secret aws_secret_access_key + region_name: us-east-1 + voice: Salli + +# Cloud +cloud: + +mqtt: + embedded: + +device_tracker: + - platform: owntracks + - platform: nmap_tracker + hosts: + - 192.168.1.0/24 + exclude: + - 192.168.1.172 + track_new_devices: false + +weather: + - platform: darksky + api_key: !secret darksky_api_key + +zone: !include zones.yaml +group: !include groups.yaml +automation: !include automations.yaml +script: !include scripts.yaml +scene: !include scenes.yaml diff --git a/customize.yaml b/customize.yaml new file mode 100644 index 0000000..e69de29 diff --git a/entity_registry.yaml b/entity_registry.yaml new file mode 100644 index 0000000..e3b12d7 --- /dev/null +++ b/entity_registry.yaml @@ -0,0 +1,36 @@ +media_player.den: + name: + platform: sonos + unique_id: RINCON_000E58B651FD01400 +media_player.living_room: + name: Living Room Chromecast + platform: cast + unique_id: 57080e2b-9058-2bdf-6c47-5320d59c2dbd +light.sofa: + name: + platform: hue + unique_id: 00:17:88:01:02:ca:f6:7a-0b +light.candle: + name: + platform: hue + unique_id: 00:17:88:01:03:6b:55:dc-0b +light.standing_lamp: + name: + platform: hue + unique_id: 00:17:88:01:02:8e:88:8b-0b +light.stephanies_nightstand: + name: + platform: hue + unique_id: 00:17:88:01:02:f7:0c:8c-0b +light.correls_nightstand: + name: + platform: hue + unique_id: 00:17:88:01:02:f7:0c:ba-0b +media_player.plex_firefox: + name: + platform: plex + unique_id: 048uoi153vqsg5t6i2sggy6b +media_player.plex_ps4: + name: Plex on PS4 + platform: plex + unique_id: x1dr5086xz69xlhfmy8hcris diff --git a/groups.yaml b/groups.yaml new file mode 100644 index 0000000..8817437 --- /dev/null +++ b/groups.yaml @@ -0,0 +1,70 @@ +default_view: + view: yes + icon: mdi:home + entities: + - group.phones + - sun.sun + - weather.dark_sky + +Lights: + view: yes + name: Lights + entities: + - group.livingroom_lights + - group.bedroom_lights + +Entertainment: + view: yes + name: Entertainment + entities: + - group.plex + - group.sonos + - group.chromecast + - group.consoles + +livingroom_lights: + name: Living Room + entities: + - light.sofa + - light.candle + - scene.bright + - scene.energize + - scene.stephanie + +bedroom_lights: + name: Bedroom + entities: + - light.correls_nightstand + - light.stephanies_nightstand + - light.standing_lamp + - scene.colorful + - scene.dawn + - scene.morning + +consoles: + name: Gaming Consoles + entities: + - device_tracker.PS3 + - device_tracker.PS4 + - device_tracker.WiiU + +plex: + name: Plex + entities: + - media_player.plex_ps4 + +sonos: + name: Sonos + entities: + - media_player.den + +chromecast: + name: Chromecast + entities: + - media_player.living_room + +phones: + name: Phones + entities: + - device_tracker.homeassistant_pixel + - device_tracker.StephaniesIphone diff --git a/scenes.yaml b/scenes.yaml new file mode 100644 index 0000000..d8f6d94 --- /dev/null +++ b/scenes.yaml @@ -0,0 +1,60 @@ +- name: Bright + entities: + light.living_room: + state: on + brightness: 254 + xy_color: [0.4575,0.4099] +- name: Stephanie + entities: + light.living_room: + state: on + brightness: 254 + xy_color: [0.2413,0.1204] +- name: Energize + entities: + light.living_room: + state: on + brightness: 254 + xy_color: [0.3146,0.3303] +- name: Dawn + entities: + light.standing_lamp: + state: on + brightness: 1 + xy_color: [0.6042, 0.3739] + light.correls_nightstand: + state: on + brightness: 1 + xy_color: [0.2376, 0.1186] + light.stephanies_nightstand: + state: on + brightness: 1 + xy_color: [0.2376, 0.1186] +- name: Morning + entities: + light.standing_lamp: + state: on + brightness: 254 + xy_color: [0.3769, 0.3639] + light.correls_nightstand: + state: on + brightness: 203 + xy_color: [0.2698, 0.295] + light.stephanies_nightstand: + state: on + brightness: 1 + xy_color: [0.2698, 0.295] +- name: Colorful + entities: + light.standing_lamp: + state: on + brightness: 212 + xy_color: [0.451,0.3803] + light.correls_nightstand: + state: on + brightness: 212 + xy_color: [0.55,0.263] + light.stephanies_nightstand: + state: on + brightness: 212 + xy_color: [0.3788,0.5431] diff --git a/scripts.yaml b/scripts.yaml new file mode 100644 index 0000000..5dd9873 --- /dev/null +++ b/scripts.yaml @@ -0,0 +1,58 @@ +sonos_tts: + alias: "Sonos TTS script - Testing" + sequence: + - service: media_player.sonos_snapshot + data_template: + entity_id: "{{ sonos_entity|default('media_player.den') }}" + - service: media_player.sonos_unjoin + data_template: + entity_id: "{{ sonos_entity|default('media_player.den') }}" + - service: media_player.volume_set + data_template: + entity_id: "{{ sonos_entity|default('media_player.den') }}" + volume_level: "{{ volume|default(0.5) }}" + - service: media_player.play_media + data: + entity_id: media_player.den + media_content_id: https://hass.phoenixinquis.is-a-geek.org/local/chime.ogg + media_content_type: music + - delay: '00:00:03' + - service: tts.amazon_polly_say + data_template: + entity_id: "{{ sonos_entity|default('media_player.den') }}" + message: "{{ message }}" + - delay: "{{ delay|default('00:00:00') }}" + - wait_template: "{{ is_state(sonos_entity|default('media_player.den'), 'playing') }}" + timeout: '00:00:05' + - wait_template: "{{ not is_state(sonos_entity|default('media_player.den'), 'playing') }}" + timeout: '00:02:00' + - service: media_player.sonos_restore + data_template: + entity_id: "{{ sonos_entity|default('media_player.den') }}" +good_morning: + alias: Good morning! + sequence: + - service: script.sonos_tts + data_template: + message: >- + Good morning! + {% if is_state('device_tracker.homeassistant_pixel', 'home') %} + Hi Correl! + {% endif %} + {% if is_state('device_tracker.stephaniesiphone', 'home') %} + Hi Stephanie! + {% endif %} + + Today's forecast is + {{ states.weather.dark_sky.attributes.daily_forecast_summary }}. + Right now, the weather is + {{ states.weather.dark_sky.state}} at + {{ states.weather.dark_sky.attributes.temperature }} + degrees, + {{ states.weather.dark_sky.attributes.hourly_forecast_summary }}. + + {{ [ 'I hope you''re ready for an interesting day!', + 'Get ready, today should be a fun one!', + 'Get out there and kick some butt!', + + ] | random }} diff --git a/www/chime.ogg b/www/chime.ogg new file mode 100644 index 0000000..a1a810c Binary files /dev/null and b/www/chime.ogg differ