Midnitte / Home-AssistantConfig

Configuration for my Home Assistant
0 stars 0 forks source link

Travel Time Sensor #1

Closed Midnitte closed 5 years ago

Midnitte commented 5 years ago

Create/Fix Travel Time Sensor that combines the current time with the Waze travel time (or could that perhaps be done as a data_template?).

Perhaps convert both to Unix seconds, add them, then convert back?

Midnitte commented 5 years ago

Something akin to: {{ as_timestamp(states.calendar.nathan_tech_shop.attributes.end_time) - as_timestamp(now()) | timestamp_local }}

Midnitte commented 5 years ago

{{ (as_timestamp(states.calendar.work.attributes.start_time) - states.sensor.google_travel_time__transit.attributes.duration.split(" ")[0] | int *3600 + states.sensor.google_travel_time__transit.attributes.duration.split(" ")[2] | int *60 | int) | timestamp_local}}

https://community.home-assistant.io/t/how-to-calculate-subtract-two-date-time-from-eachother/8197/10

Midnitte commented 5 years ago

Perhaps '{{ (as_timestamp(now()) + states.sensor.chris_time_from_work | int *3600 | timestamp_local}}' ?