Skip to content

Commit

Permalink
Changed traveltimes to built in google travel time
Browse files Browse the repository at this point in the history
  • Loading branch information
eifinger committed Jun 27, 2018
1 parent 199bf28 commit 97fa1be
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 28 deletions.
4 changes: 4 additions & 0 deletions group.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 0 additions & 9 deletions input_number.yaml
Original file line number Diff line number Diff line change
@@ -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
56 changes: 37 additions & 19 deletions sensor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 97fa1be

Please sign in to comment.