From 47f4801fcaa3bde33dbbe6c7ffc4e6e9e971444c Mon Sep 17 00:00:00 2001 From: CCOSTAN Date: Thu, 13 Oct 2016 16:07:27 +0000 Subject: [PATCH] Update Nest automations to go local. --- Todo.md | 19 +++++++++++++++++++ automation/upstairs_motion_ifttt.yaml | 16 ++++++++++++---- sensor/nest.yaml | 11 +++++++++++ 3 files changed, 42 insertions(+), 4 deletions(-) create mode 100755 sensor/nest.yaml diff --git a/Todo.md b/Todo.md index 0a88058b..976545e1 100755 --- a/Todo.md +++ b/Todo.md @@ -5,6 +5,25 @@ * Put Dash Buttons out there. * Put door sensor on garage door +binary_sensor: + - platform: template + sensors: + upstairs_away_mode: + entity_id: climate.upstairs + value_template: "{{ is_state_attr('climate.upstairs', 'away_mode', 'on') }}" + +automation: + - alias: Trigger When Away + trigger: + - platform: state + entity_id: binary_sensor.upstairs_away_mode + to: 'on' + condition: + ... + action: + ... + + ### Future Ideas diff --git a/automation/upstairs_motion_ifttt.yaml b/automation/upstairs_motion_ifttt.yaml index b464a92d..fbf86ed8 100755 --- a/automation/upstairs_motion_ifttt.yaml +++ b/automation/upstairs_motion_ifttt.yaml @@ -1,15 +1,20 @@ -# Uses the Nest thermostat to turn on lights and turn them off. +# Uses the Nest thermostat to turn on lights and turn them off upstairs. - alias: 'Upstairs Light Turn on' trigger: - platform: event event_type: upstairs_light_on + - platform: state + entity_id: binary_sensor.upstairs_away_mode + to: 'off' condition: - condition: state + - condition: state entity_id: sun.sun state: 'below_horizon' - + - condition: time + before: '23:45' + action: service: light.turn_on entity_id: group.upstairs @@ -18,7 +23,10 @@ trigger: - platform: event event_type: upstairs_light_off - + - platform: state + entity_id: binary_sensor.upstairs_away_mode + to: 'on' + action: service: light.turn_off entity_id: group.upstairs \ No newline at end of file diff --git a/sensor/nest.yaml b/sensor/nest.yaml new file mode 100755 index 00000000..1859c611 --- /dev/null +++ b/sensor/nest.yaml @@ -0,0 +1,11 @@ +- platform: template + sensors: + upstairs_away_mode: + entity_id: climate.upstairs + value_template: "{{ is_state_attr('climate.upstairs', 'away_mode', 'on') }}" + +- platform: template + sensors: + upstairs_away_mode: + entity_id: climate.downstairs + value_template: "{{ is_state_attr('climate.downstairs', 'away_mode', 'on') }}" \ No newline at end of file