From 2feaf71d003e45c0003d7e9f8197c0b01171f81f Mon Sep 17 00:00:00 2001 From: Brian King Date: Thu, 7 Mar 2019 14:30:53 -0600 Subject: [PATCH] Automation for updating google maps travel automation Re: #173 --- ...update-google-maps-travel-time-sensor.yaml | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 automation/update-google-maps-travel-time-sensor.yaml diff --git a/automation/update-google-maps-travel-time-sensor.yaml b/automation/update-google-maps-travel-time-sensor.yaml new file mode 100644 index 0000000..4d96b1e --- /dev/null +++ b/automation/update-google-maps-travel-time-sensor.yaml @@ -0,0 +1,43 @@ +- id: update_morning_commute_sensor + alias: "Commute - Update morning commute sensor" + initial_state: 'on' + trigger: + - platform: time_pattern + minutes: '/10' + condition: + - condition: time + after: '09:30:00' + before: '11:30:00' + - condition: time + weekday: + - mon + - tue + - wed + - thu + - fri + action: + - service: homeassistant.update + data: + entity_id: sensor.home_to_kinna_work + +- id: update_evening_commute_sensor + alias: "Commute - Update evening commute sensor" + initial_state: 'on' + trigger: + - platform: time_pattern + minutes: '/10' + condition: + - condition: time + after: '17:00:00' + before: '18:30:00' + - condition: time + weekday: + - mon + - tue + - wed + - thu + - fri + action: + - service: homeassistant.update + data: + entity_id: sensor.kinna_work_to_home