I would like to adjust the start time on my car’s block heater based on the forecast low. I would like to start it 30 mins plus 5 minus for each negative Celsius degree. I’m having trouble with the syntax, how do I assign a time value?
my first try at this is
- id: '1700689457882'
alias: NW middle adjust start time
description: ''
trigger:
- platform: state
entity_id:
- input_datetime.nw_middle_truck_drive_time
attribute: timestamp
condition: []
action:
- service: input_datetime.set_datetime
data:
time: "{{ ( state_attr( 'input_datetime.nw_middle_truck_drive_time',
'timestamp') | int
- 1800
- ( ( states( 'sensor.winnipeg_low_temperature' ) | int ) * -300 )
) }}"