From 97fa1be8392013e3fdf420c74f317b385688fcd3 Mon Sep 17 00:00:00 2001 From: Kevin Eifinger Date: Wed, 27 Jun 2018 23:38:13 +0200 Subject: [PATCH] Changed traveltimes to built in google travel time --- group.yaml | 4 ++++ input_number.yaml | 9 -------- sensor.yaml | 56 +++++++++++++++++++++++++++++++---------------- 3 files changed, 41 insertions(+), 28 deletions(-) diff --git a/group.yaml b/group.yaml index ff188327..f1bb9c8b 100644 --- a/group.yaml +++ b/group.yaml @@ -155,6 +155,10 @@ traveltimes: - input_boolean.travel_time_work_from_home - sensor.travel_time_elmo_from_home - input_boolean.travel_time_elmo_from_home + - sensor.travel_time_next_appointment_location + - sensor.travel_time_next_appointment_location_arrival_time + - sensor.travel_time_ikea_from_dom + - sensor.waze_travel_time_ikea_from_dom motion: name: Bewegungsmelder diff --git a/input_number.yaml b/input_number.yaml index dee03407..e69de29b 100644 --- a/input_number.yaml +++ b/input_number.yaml @@ -1,9 +0,0 @@ - travel_time_work_from_home: - min: 0 - max: 120 - travel_time_home_from_work: - min: 0 - max: 120 - travel_time_elmo_from_home: - min: 0 - max: 120 \ No newline at end of file diff --git a/sensor.yaml b/sensor.yaml index 1943f89c..6d764e45 100644 --- a/sensor.yaml +++ b/sensor.yaml @@ -97,33 +97,51 @@ ################################################################# ## Travel Times ################################################################# -#Set by Appdaemon -- platform: template - sensors: - travel_time_work_from_home: - friendly_name: !secret sensor_friendy_name_travel_time_work_from_home - unit_of_measurement: "min" - value_template: "{{ states('input_number.travel_time_work_from_home') | int}}" - travel_time_home_from_work: - friendly_name: !secret sensor_friendy_name_travel_time_home_from_work - unit_of_measurement: "min" - value_template: "{{ states('input_number.travel_time_home_from_work') | int}}" - travel_time_elmo_from_home: - friendly_name: !secret sensor_friendy_name_travel_time_elmo_from_home - unit_of_measurement: "min" - value_template: "{{ states('input_number.travel_time_elmo_from_home') | int}}" - #Google +#Work from Home - platform: google_travel_time - name: Zu Hause -> SVA + name: travel_time_work_from_home api_key: !secret google_maps_api_token origin: zone.home destination: zone.work +#Home from Work +- platform: google_travel_time + name: travel_time_home_from_work + api_key: !secret google_maps_api_token + origin: zone.work + destination: zone.home +#Elmo from Home +- platform: google_travel_time + name: travel_time_elmo_from_home + api_key: !secret google_maps_api_token + origin: zone.home + destination: zone.elmo +#Next Appointment +- platform: google_travel_time + name: travel_time_next_appointment_location + api_key: !secret google_maps_api_token + origin: !secret device_user_one + destination: sensor.cal_next_appointment_location +#Next Appointment with arrival time option +- platform: google_travel_time + name: travel_time_next_appointment_location_arrival_time + api_key: !secret google_maps_api_token + origin: !secret device_user_one + destination: sensor.cal_next_appointment_location + options: + arrival_time: sensor.cal_work_start_time +#compare with waze +- platform: google_travel_time + name: travel_time_ikea_from_dom + api_key: !secret google_maps_api_token + origin: 49.999112, 8.273897 + destination: 50.058128, 8.371457 #Waze - platform: waze_travel_time - origin: !secret waze_home - destination: !secret waze_work + name: waze_travel_time_ikea_from_dom + origin: 49.999112, 8.273897 + destination: 50.058128, 8.371457 region: EU ################################################################# ## Next Appointment