From 5defb5cff44d0fbd997d0592f21401e895b99845 Mon Sep 17 00:00:00 2001 From: Jeffrey Stone Date: Sat, 28 Jan 2017 09:30:56 -0500 Subject: [PATCH] Lots of updates: - Updated .gitignore to explicitly allow files and folders but block everything else. - Added automations for Kat's Phone - Updated Kat's Phone used in Tracking - Added Google Time to Home for Kat - Reducing the messages being sent to pushbullet. --- .gitignore | 8 ++++ automation.yaml | 7 +++- automations/kat_home_enter.yaml | 10 +++++ automations/kat_home_leave.yaml | 10 +++++ automations/kat_work_enter.yaml | 10 +++++ automations/kat_work_leave.yaml | 10 +++++ customize.yaml | 2 +- devices.yaml | 67 +++++++++++++++++++++++++++++++++ groups.yaml | 2 +- input_select.yaml | 9 +++++ scenes.yaml | 16 ++++++++ scripts.yaml | 5 +++ scripts/inside_all_off.yaml | 3 +- scripts/inside_all_on.yaml | 3 +- scripts/outside_all_off.yaml | 3 +- scripts/outside_all_on.yaml | 5 +-- scripts/refresh_devices.yaml | 2 +- sensors/devices.yaml | 4 +- sensors/google_travel_time.yaml | 7 +++- switches/garage.yaml | 7 ++++ 20 files changed, 173 insertions(+), 17 deletions(-) create mode 100644 automations/kat_home_enter.yaml create mode 100644 automations/kat_home_leave.yaml create mode 100644 automations/kat_work_enter.yaml create mode 100644 automations/kat_work_leave.yaml create mode 100644 devices.yaml create mode 100644 input_select.yaml create mode 100644 scenes.yaml create mode 100644 scripts.yaml create mode 100644 switches/garage.yaml diff --git a/.gitignore b/.gitignore index 33662f5..4643ff8 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,9 @@ /* +!/alexa +!/automations +!/lights +!/scripts +!/sensors +!/switches +!*.yaml +!README.md diff --git a/automation.yaml b/automation.yaml index 602ecad..b16fba6 100644 --- a/automation.yaml +++ b/automation.yaml @@ -19,5 +19,8 @@ #- !include automations/jeff_driving.yaml #- !include automations/jeff_walking.yaml #- !include automations/jeff_driving.yaml -# Zone - +# Kat +- !include automations/kat_work_enter.yaml +- !include automations/kat_work_leave.yaml +- !include automations/kat_home_enter.yaml +- !include automations/kat_home_leave.yaml diff --git a/automations/kat_home_enter.yaml b/automations/kat_home_enter.yaml new file mode 100644 index 0000000..f6d682d --- /dev/null +++ b/automations/kat_home_enter.yaml @@ -0,0 +1,10 @@ +alias: "Kat Arrives Home" +trigger: + platform: zone + event: enter + zone: zone.home + entity_id: device_tracker.katheriesiphone_2 +action: + - service: notify.notify + data: + message: "Kat arrived home" diff --git a/automations/kat_home_leave.yaml b/automations/kat_home_leave.yaml new file mode 100644 index 0000000..49c753c --- /dev/null +++ b/automations/kat_home_leave.yaml @@ -0,0 +1,10 @@ +alias: "Kat Leaves Home" +trigger: + platform: zone + event: leave + zone: zone.home + entity_id: device_tracker.katheriesiphone_2 +action: + - service: notify.notify + data: + message: "Kat left home" diff --git a/automations/kat_work_enter.yaml b/automations/kat_work_enter.yaml new file mode 100644 index 0000000..7a574ac --- /dev/null +++ b/automations/kat_work_enter.yaml @@ -0,0 +1,10 @@ +alias: "Kat Arrives Home" +trigger: + platform: zone + event: enter + zone: zone.zoo_atlanta + entity_id: device_tracker.katheriesiphone_2 +action: + - service: notify.notify + data: + message: "Kat arrived at Zoo Atlanta" diff --git a/automations/kat_work_leave.yaml b/automations/kat_work_leave.yaml new file mode 100644 index 0000000..5952e35 --- /dev/null +++ b/automations/kat_work_leave.yaml @@ -0,0 +1,10 @@ +alias: "Kat Leaves Home" +trigger: + platform: zone + event: leave + zone: zone.home + entity_id: device_tracker.katheriesiphone_2 +action: + - service: notify.notify + data: + message: "Kat left Zoo Atlanta" diff --git a/customize.yaml b/customize.yaml index f1234c6..4053828 100644 --- a/customize.yaml +++ b/customize.yaml @@ -86,7 +86,7 @@ sensor.jeff_ett_home: friendly_name: "Jeffs ETA Home" icon: mdi:car -device_tracker.katherinestonesiphone: +device_tracker.katheriesiphone_2: #icon: mdi:human-female entity_picture: !secret KAT_ICON friendly_name: Kat diff --git a/devices.yaml b/devices.yaml new file mode 100644 index 0000000..d89467e --- /dev/null +++ b/devices.yaml @@ -0,0 +1,67 @@ +- platform: template + sensors: + amazon_dot_lr: + friendly_name: 'Amazon Dot LR' + value_template: "{{ 'Online' if is_state('device_tracker.kindlecdf98981f', 'home') else 'Offline' }}" + + circle: + friendly_name: 'Disney Circle' + value_template: "{{ 'Online' if is_state('device_tracker.circle', 'home') else 'Offline' }}" + + tycho: + friendly_name: 'tycho' + value_template: "{{ 'Online' if is_state('device_tracker.jarvis', 'home') else 'Offline' }}" + + tightbeam: + friendly_name: 'tightbeam' + value_template: "{{ 'Online' if is_state('device_tracker.tightbeam', 'home') else 'Offline' }}" + + appletv: + friendly_name: 'Apple Tv' + value_template: "{{ 'Online' if is_state('device_tracker.appletv', 'home') else 'Offline' }}" + + xboxone: + friendly_name: 'xboxone' + value_template: "{{ 'Online' if is_state('device_tracker.xboxone', 'home') else 'Offline' }}" + + chromecast: + friendly_name: 'Chromecast' + value_template: "{{ 'Online' if is_state('device_tracker.chromecast', 'home') else 'Offline' }}" + + smartthings: + friendly_name: 'SmartThings' + value_template: "{{ 'Online' if is_state('device_tracker.d052a8170fef', 'home') else 'Offline' }}" + + samsungtv: + friendly_name: 'Samsung Tv' + value_template: "{{ 'Online' if is_state('device_tracker.c4731ecec013', 'home') else 'Offline' }}" + + honeywell: + friendly_name: 'Honeywell' + value_template: "{{ 'Online' if is_state('device_tracker.gateway2f3bca', 'home') else 'Offline' }}" + + router: + friendly_name: 'Asus Router' + value_template: "{{ 'Online' if is_state('device_tracker.routerasuscom', 'home') else 'Offline' }}" + + kat_mini: + friendly_name: "Kat's Mini" + value_template: "{{ 'Online' if is_state('device_tracker.katherinesmini', 'home') else 'Offline' }}" + + jeff_iphone_batt: + unit_of_measurement: '%' + value_template: >- + {%- if states.device_tracker.jeffreysiphone.attributes.battery %} + {{ states.device_tracker.jeffreysiphone.attributes.battery | round(1) }} + {% else %} + {{ states.sensor.jeff_iphone_batt.state }} + {%- endif %} + + kat_iphone_batt: + unit_of_measurement: '%' + value_template: >- + {%- if states.device_tracker.katheriesiphone_2.attributes.battery %} + {{ states.device_tracker.katheriesiphone_2.attributes.battery | round(1) }} + {% else %} + {{ states.sensor.kat_iphone_batt.state }} + {%- endif %} \ No newline at end of file diff --git a/groups.yaml b/groups.yaml index 68e26ff..8c76d42 100644 --- a/groups.yaml +++ b/groups.yaml @@ -50,7 +50,7 @@ Jeff Trackers: - device_tracker.jeffreysiphone Katherine: - - device_tracker.katherinestonesiphone + - device_tracker.katheriesiphone_2 - sensor.kat_iphone_batt Thermostat: diff --git a/input_select.yaml b/input_select.yaml new file mode 100644 index 0000000..9499c96 --- /dev/null +++ b/input_select.yaml @@ -0,0 +1,9 @@ +jeff_status: + name: Jeff Status + options: + - driving + - stationary + - sleeping + - walking + - moving + initial: stationary \ No newline at end of file diff --git a/scenes.yaml b/scenes.yaml new file mode 100644 index 0000000..a264188 --- /dev/null +++ b/scenes.yaml @@ -0,0 +1,16 @@ +- name: livingroom normal + entities: + light.tower_lamp: + state: on + brightness: 100 +- name: livingroom dim + entities: + light.tower_lamp: + state: on + brightness: 40 +- name: livingroom night + entities: + light.tower_lamp: + state: on + brightness: 10 + diff --git a/scripts.yaml b/scripts.yaml new file mode 100644 index 0000000..298397a --- /dev/null +++ b/scripts.yaml @@ -0,0 +1,5 @@ +refresh_devices: !include scripts/refresh_devices.yaml +inside_all_on: !include scripts/inside_all_on.yaml +outside_all_on: !include scripts/outside_all_on.yaml +inside_all_off: !include scripts/inside_all_off.yaml +outside_all_off: !include scripts/outside_all_off.yaml \ No newline at end of file diff --git a/scripts/inside_all_off.yaml b/scripts/inside_all_off.yaml index 8582246..4e95b2b 100644 --- a/scripts/inside_all_off.yaml +++ b/scripts/inside_all_off.yaml @@ -8,5 +8,4 @@ sequence: entity_id: switch.tower_lamp - service: notify.notify data: - title: 'Turning inside lights off' - message: "Inside lights are off!" \ No newline at end of file + message: "Inside lights are off" diff --git a/scripts/inside_all_on.yaml b/scripts/inside_all_on.yaml index b5edde7..738d042 100644 --- a/scripts/inside_all_on.yaml +++ b/scripts/inside_all_on.yaml @@ -11,5 +11,4 @@ sequence: entity_id: scene.livingroom_normal - service: notify.notify data: - title: 'Inside lights are on' - message: "Inside lights are on!" \ No newline at end of file + message: "Inside lights are on" diff --git a/scripts/outside_all_off.yaml b/scripts/outside_all_off.yaml index eb0ee52..3037c63 100644 --- a/scripts/outside_all_off.yaml +++ b/scripts/outside_all_off.yaml @@ -17,5 +17,4 @@ sequence: entity_id: switch.front_porch_right - service: notify.notify data: - title: 'Outside lights are off' - message: "Outside lights are off!" \ No newline at end of file + message: "Outside lights are off" diff --git a/scripts/outside_all_on.yaml b/scripts/outside_all_on.yaml index 25b3b48..a681769 100644 --- a/scripts/outside_all_on.yaml +++ b/scripts/outside_all_on.yaml @@ -14,8 +14,7 @@ sequence: entity_id: switch.front_porch_left - service: switch.turn_on data: - entity_id: switch.front_porch_right + entity_id: switch.front_porch_right - service: notify.notify data: - title: 'Outside lights are on' - message: "Outside lights are on!" \ No newline at end of file + message: "Outside lights are on" diff --git a/scripts/refresh_devices.yaml b/scripts/refresh_devices.yaml index c51878f..09f16f7 100644 --- a/scripts/refresh_devices.yaml +++ b/scripts/refresh_devices.yaml @@ -2,4 +2,4 @@ sequence: - service: mqtt.publish data: topic: "owntracks/owntracks/jeffreysphone/cmd" - payload_template: '{"_type":"cmd","action":"reportLocation"}' \ No newline at end of file + payload_template: '{"_type":"cmd","action":"reportLocation"}' diff --git a/sensors/devices.yaml b/sensors/devices.yaml index a183edf..d89467e 100644 --- a/sensors/devices.yaml +++ b/sensors/devices.yaml @@ -60,8 +60,8 @@ kat_iphone_batt: unit_of_measurement: '%' value_template: >- - {%- if states.device_tracker.katherinestonesiphone.attributes.battery %} - {{ states.device_tracker.katherinestonesiphone.attributes.battery | round(1) }} + {%- if states.device_tracker.katheriesiphone_2.attributes.battery %} + {{ states.device_tracker.katheriesiphone_2.attributes.battery | round(1) }} {% else %} {{ states.sensor.kat_iphone_batt.state }} {%- endif %} \ No newline at end of file diff --git a/sensors/google_travel_time.yaml b/sensors/google_travel_time.yaml index 8064c7d..1b9ed4e 100644 --- a/sensors/google_travel_time.yaml +++ b/sensors/google_travel_time.yaml @@ -2,4 +2,9 @@ name: "Jeff ETT Home" api_key: !secret google_api origin: device_tracker.owntracks_jeffreysphone - destination: zone.home \ No newline at end of file + destination: zone.home +- platform: google_travel_time + name: "Kat ETT Home" + api_key: !secret google_api + origin: device_tracker.katheriesiphone_2 + destination: zone.home diff --git a/switches/garage.yaml b/switches/garage.yaml new file mode 100644 index 0000000..c3e7ce7 --- /dev/null +++ b/switches/garage.yaml @@ -0,0 +1,7 @@ +- platform: mqtt + name: "Garage Door" + state_topic: "smartthings/Garage Door/door" + command_topic: "smartthings/Garage Door/door" + payload_on: "open" + payload_off: "closed" + retain: true