Dear Community (-wizzards ) i have a question concerning about a sensor time calcultaion.
Helper:
input_datetime.gewenste_aankomsttijd
What I want to do is the following.
I want to specify a hour & minutes in input_datetime helper (no date only hours and minutes);
Than I want to take the minutes that the waze_travel_time from my home to the destination (Lego Store):
- platform: template
sensors:
type - platform: waze_travel_time
name: naarlegostore
origin: 51.15922736431498, 4.139082944514981
destination: 51.224295996914464, 4.501470432630029
region: 'EU'or paste code here
This gives me the minutes
So what I want to know: what code do I use to substract the minutes I receive from the waze sensor from the hours stated in the helper?
- platform: template
sensors:
theoretisch_vertrek_min:
value_template: >
{{% set minutes = states('sensor.naarlegostore') | int %}
{{ (state_attr('input_datetime.input_datetime.gewenste_aankomsttijd', 'timestamp')) -
(minutes * 60) | timestamp_custom('%H:%M', false) }}
But that doesn’t seem to work.
Any wizard advice ?