From 152931c052633d1f794747c4101dad67305b99a1 Mon Sep 17 00:00:00 2001 From: ccostan Date: Sun, 15 Apr 2018 11:13:49 -0400 Subject: [PATCH] Closes #347 - House know can account for business trips and late poker nights. --- config/automation/good_night.yaml | 22 +++++++++++---- .../kitchen_lights_and_accents.yaml | 8 ++++++ config/automation/master_bath_accents.yaml | 4 +-- config/packages/landscape_lighting.yaml | 28 +++++++++++++------ config/packages/twitter.yaml | 2 +- config/script/tweet.yaml | 3 +- 6 files changed, 48 insertions(+), 19 deletions(-) diff --git a/config/automation/good_night.yaml b/config/automation/good_night.yaml index 2ab6efb2..879e4094 100755 --- a/config/automation/good_night.yaml +++ b/config/automation/good_night.yaml @@ -21,12 +21,22 @@ - condition: state entity_id: input_boolean.guest_mode state: 'off' - - condition: state - entity_id: binary_sensor.sleepnumber_carlo_carlo_is_in_bed - state: 'on' - - condition: state - entity_id: binary_sensor.sleepnumber_carlo_stacey_is_in_bed - state: 'on' + - condition: or + conditions: + - condition: state + entity_id: binary_sensor.sleepnumber_carlo_carlo_is_in_bed + state: 'on' + - condition: state + entity_id: device_tracker.carlo + state: 'not_home' + - condition: or + conditions: + - condition: state + entity_id: binary_sensor.sleepnumber_carlo_stacey_is_in_bed + state: 'on' + - condition: state + entity_id: device_tracker.stacey + state: 'not_home' action: - service: input_boolean.turn_off diff --git a/config/automation/kitchen_lights_and_accents.yaml b/config/automation/kitchen_lights_and_accents.yaml index 12743bf2..f8a243bf 100755 --- a/config/automation/kitchen_lights_and_accents.yaml +++ b/config/automation/kitchen_lights_and_accents.yaml @@ -44,9 +44,17 @@ - condition: state entity_id: binary_sensor.sleepnumber_carlo_carlo_is_in_bed state: 'off' + - condition: state + entity_id: device_tracker.carlo + state: 'not_home' + - condition: or + conditions: - condition: state entity_id: binary_sensor.sleepnumber_carlo_stacey_is_in_bed state: 'off' + - condition: state + entity_id: device_tracker.stacey + state: 'not_home' - condition: or conditions: - condition: state diff --git a/config/automation/master_bath_accents.yaml b/config/automation/master_bath_accents.yaml index bb958276..e0564da0 100755 --- a/config/automation/master_bath_accents.yaml +++ b/config/automation/master_bath_accents.yaml @@ -34,8 +34,8 @@ - service: switch.turn_on entity_id: switch.master_bathroom_accents - wait_template: >- - {{ not is_state('binary_sensor.sleepnumber_carlo_stacey_is_in_bed', 'off') }} + {{ not is_state('binary_sensor.sleepnumber_carlo_stacey_is_in_bed', 'off') or is_state('device_tracker.stacey', 'not_home')}} - wait_template: >- - {{ not is_state('binary_sensor.sleepnumber_carlo_carlo_is_in_bed', 'off') }} + {{ not is_state('binary_sensor.sleepnumber_carlo_carlo_is_in_bed', 'off') or is_state('device_tracker.carlo', 'not_home') }} - service: switch.turn_off entity_id: switch.master_bathroom_accents diff --git a/config/packages/landscape_lighting.yaml b/config/packages/landscape_lighting.yaml index a383ceb2..a15b8e89 100755 --- a/config/packages/landscape_lighting.yaml +++ b/config/packages/landscape_lighting.yaml @@ -8,16 +8,16 @@ homeassistant: switch.back_landscaping: friendly_name: 'Back Landscaping' icon: mdi:flower - + hidden: False switch.front_landscaping: friendly_name: 'Front Landscaping' icon: mdi:flower - + hidden: False group.landscaping: friendly_name: 'Landscaping Lights' - + hidden: False #------------------------------------------- group: @@ -43,12 +43,22 @@ automation: - condition: state entity_id: sun.sun state: 'below_horizon' - - condition: state - entity_id: binary_sensor.sleepnumber_carlo_carlo_is_in_bed - state: 'on' - - condition: state - entity_id: binary_sensor.sleepnumber_carlo_stacey_is_in_bed - state: 'on' + - condition: or + conditions: + - condition: state + entity_id: binary_sensor.sleepnumber_carlo_carlo_is_in_bed + state: 'on' + - condition: state + entity_id: device_tracker.carlo + state: 'not_home' + - condition: or + conditions: + - condition: state + entity_id: binary_sensor.sleepnumber_carlo_stacey_is_in_bed + state: 'on' + - condition: state + entity_id: device_tracker.stacey + state: 'not_home' action: - service: switch.turn_off diff --git a/config/packages/twitter.yaml b/config/packages/twitter.yaml index 522b8a2c..ae226cfc 100755 --- a/config/packages/twitter.yaml +++ b/config/packages/twitter.yaml @@ -258,7 +258,7 @@ automation: pick: >- {% set pick = [ "minecraft", - "solar", "solar", + "solar", "solar", "solar", "robot", "robot", "robot", "robot", "robot", "robot", "robot", "robot", "robot","robot","robot","robot", "door", "door", "door", "weather", "weather", "weather", "weather", "weather", diff --git a/config/script/tweet.yaml b/config/script/tweet.yaml index 65a9149b..af35601e 100755 --- a/config/script/tweet.yaml +++ b/config/script/tweet.yaml @@ -19,7 +19,8 @@ tweet_engine_setup: "solar": [ "I am keeping track of the current #Tesla stock price. It is ${{ states('sensor.tesla')|round }}. #Solar", - "The #ChevyBolt was charged for about {{ states.sensor.bolt_charging_time.attributes.value|replace('m', '') }} minutes in the last 7 days." + "The #ChevyBolt was charged for about {{ states.sensor.bolt_charging_time.attributes.value|replace('m', '') }} minutes in the last 7 days.", + "The Official Diecast P85 Model S Red (https://amzn.to/2Hkkl0S) link - Out of stock like the originals. :)" ], "robot": [