Hey!
I am trying to trigger an automation notification at a “sensor time” minus a “input_datetime” value.
The automation is ok but I cant seem to figure out how to get the time calculation to be correct with a “input_datetime” value.
My current templating is as below and this is working, but the “offset” time is in the code not taken from an input_datetime value:
{{ as_timestamp(strptime(state_attr("binary_sensor.iss", "next_rise") - timedelta( hours = 3, minutes = 20 ), "%H%M")) | timestamp_custom("%H:%M") }}
How can I replace
“timedelta( hours = 3, minutes = 20 ), “%H%M”)) | timestamp_custom(”%H:%M")"
with
“as_timestamp(states.input_datetime.iss_paminnare) | int | timestamp_custom(”%H:%M")"
Below does not work…
{{ as_timestamp(strptime(state_attr("binary_sensor.iss", "next_rise") - as_timestamp(states.input_datetime.iss_paminnare) | int | timestamp_custom("%H:%M") }}
This way I can set a time for the offset trigger from the sensor time to send a notification when ISS is above my position.
Any help would be appreciated