I have the following automation, it’s my last on. How can I get this into node red:
- alias: Set next run time
trigger:
- platform: state
entity_id:
- input_boolean.cycle1_enable
- input_boolean.cycle2_enable
to: 'on'
- platform: state
entity_id:
- input_select.cycle1_schedule_time
- input_select.cycle2_schedule_time
action:
- service: input_datetime.set_datetime
data_template:
entity_id: "{% if trigger.entity_id == 'input_boolean.cycle1_enable' or\n \
\ trigger.entity_id == 'input_select.cycle1_schedule_time' %}\n input_datetime.cycle1_next_run_time\n\
{% else %}\n input_datetime.cycle2_next_run_time\n{% endif %}\n"
date: "{% if trigger.entity_id == 'input_boolean.cycle1_enable' or\n trigger.entity_id\
\ == 'input_select.cycle1_schedule_time' %}\n {% set time = states('input_select.cycle1_schedule_time')\
\ %}\n{% else %}\n {% set time = states('input_select.cycle2_schedule_time')\
\ %}\n{% endif %} {% if now().strftime('%H:%M') < time %}\n {{ as_timestamp(now())\
\ | timestamp_custom(\"%Y-%m-%d\") }}\n{% else %}\n {{ (as_timestamp(now())\
\ + 24 * 3600 ) | timestamp_custom(\"%Y-%m-%d\") }}\n{% endif %}\n"
time: "{% if trigger.entity_id == 'input_boolean.cycle1_enable' or\n trigger.entity_id\
\ == 'input_select.cycle1_schedule_time' %}\n {{ states('input_select.cycle1_schedule_time')\
\ }}\n{% else %}\n {{ states('input_select.cycle2_schedule_time') }}\n{%\
\ endif %}\n"
id: f87180f9951240c2b5bd33128bdf3f2e
I have tried to use the service set_input_date but I get API invalid.
Help appreciated.