I am using the Irrigation Controller integration and have 2 separate programs, one that turns off master valves and the second that then opens 2 valves in a sequence.
The integrations uses input_datetime (just the “time” element) helpers for the start of the programs.
I have one called input_number.irrigation_master_run_time that is for the master valves and one called input_number.program_1_run_time that acts for the 2 valves program.
I am attempting to automatically change the input_number.irrigation_master_run_time to 1 minute before the input_number.program_1_run_time, whenever the latter is changed.
So if the input_number.program_1_run_time is changed to 21:20, the input_number.irrigation_master_run_time is automatically changed to 21:19
I have several related changes in an automation and so want to continue the automation route.
The code in my automation is coded as follows:
service: input_datetime.set_datetime
data:
value: >-
{{ states('input_datetime.program_1_start') | as_datetime - timedelta(minutes=1) }}
target:
entity_id: input_datetime.irrigation_master_start
The code is being run but the input_datetime.irrigation_master_start is unchanged. Any ideas how this should be coded?