I want to use the delay function in an automation but I would like that delay to be controlled be a home assistant sensor. This is my current code:
- then:
- if:
condition:
lambda: |-
return id(feed_interval).state > 0
then:
- wait_until:
condition:
- binary_sensor.is_off: feeder_running
- switch.turn_off: feeder_on
- delay: id(feed_interval).state
- switch.turn_on_induction: feeder_on
Is there a way to make this work? I have givent the home assistant sensor a device_class of duration but so far no luck