Template OFFSET for SUN trigger in Automation

Template OFFSET for SUN trigger in Automation, any ideas?

Automation:
- alias: Irrigate Pots at Sunrise
  trigger:
    platform: sun
    event: sunrise
    # Time offset, to start action once Lawn irrigation duration has elapsed 
    offset: '00:{{states.input_slider.lawn_irrigation_duration.state|round(0)}}:00'
  condition:
    #To do its not raining today
  action:
    service: homeassistant.turn_on
    entity_id: script.pot_irrigation_timer

Error:

ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: offset 00:{{states.input_slider.lawn_irrigation_duration.state|round(0)}}:00 should be format ‘HH:MM’ or ‘HH:MM:SS’ for dictionary value @ data[‘trigger’][0][‘offset’]. Got None.

We need more info… what are you trying to do?

What is the “states.input_slider.lawn_irrigation_duration.state|round(0)”?? Is this a set amount of time? Is this a changing value? Just what is it?

Obviously this should be a number like the error statement gives… Would a delay work?

@Partybug Hi Scott, yes the slider is a variable value hence the templating.

I’m not sure if this is unsupported or an error in my code?

As for the code, the only thing I have close to that is this:
‘/home/hass/.homeassistant/GFChime/GrandFatherChime{{ now().strftime("%I") }}.wav’
This puts a number in the name so that the correct file is played for that particular hour.

My guess is that {{states.input_slider.lawn_irrigation_duration.state|round(0)}} is not returning a number. Have you tried removing the pipe and the round section? What about removing the last state? I’m not a coding guy :frowning:

Good Luck
Scott