Skip to content

Commit

Permalink
Next calendar appointment with leavetime
Browse files Browse the repository at this point in the history
  • Loading branch information
eifinger committed Jun 30, 2018
1 parent 6a07a1e commit be413e9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ automation: !include automation.yaml
script: !include scripts.yaml
light: !include light.yaml
input_boolean: !include input_boolean.yaml
#input_number: !include input_number.yaml
input_number: !include input_number.yaml
notify: !include notify.yaml
zone: !include zone.yaml
proximity: !include proximity.yaml
Expand Down
9 changes: 8 additions & 1 deletion group.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ default_view:
- group.occupancy
- group.rooms
- switch.plug_158d00015694c5
- group.next_appointment
- calendar.keifingergooglemailcom

view_lights:
name: Lights
Expand All @@ -34,6 +34,13 @@ view_media_players:
# entities:
# - group.studyroom

view_next_appointment:
name: Nächster Termin
view: yes
icon: mdi:calendar
entities:
- group.next_appointment

view_traveltimes:
name: Reisezeiten
view: yes
Expand Down
6 changes: 6 additions & 0 deletions input_number.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
leave_time_offset:
name: Extra Zeit
initial: 30
min: 0
max: 60
step: 1
3 changes: 1 addition & 2 deletions sensor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@
value_template: "{{ states.calendar.keifingergooglemailcom.attributes.start_time }}"
calc_leave_time:
value_template: '{{ (as_timestamp(states.calendar.keifingergooglemailcom.attributes.start_time) - states.sensor.travel_time_next_appointment_location.attributes.duration.split(" ")[0] | int *3600 - states.sensor.travel_time_next_appointment_location.attributes.duration.split(" ")[2] | int * 60 )| timestamp_custom("%Y-%m-%d %H:%M") }}'
friendly_name: 'Leave Time'
unit_of_measurement: 'time'
friendly_name: Losfahren
#################################################################
## Sun
#################################################################
Expand Down

0 comments on commit be413e9

Please sign in to comment.