Automation > Wait for time to pass > use helper

With automations, we can currently use a helper as a trigger time:

image

It would be beneficial to also make a helper available for the Actions ‘Delay - wait for time to pass’
This would remove the need to edit the YAML
image

eg like so:
image

Out of curiosity, how are you currently employing an Input Datetime as the value for a delay?

I can see how an Input Number would be useful (because it merely contains a numeric value) but an Input Datetime contains a datetime object.

Actually, Im using numbers for that too. So yes, the option of perhaps date/time or just Number helper would be better.
You get into the situation where you have a raw number - eg is it an hour / minute / second if applied as a number, hence the idea for a time.

An Input Datetime can contain time only or date and time. Neither represents a duration but a point in time.

I can see how a time-only Input Datetime might be used for delay. If you specify 01:35 it would be interpreted as a delay of 1 hour and 35 minutes (although you wouldn’t be able to set anything lower than 1 minute). An Input Datetime with date and time would require special handling; the date portion would have to be ignored because it’s unusable for delay. However, it would be an awkward choice because, in the UI, you would be obliged to set a time and an unused date.

If the goal is to make it easier to configure delay graphically, it may be best to limit it to choosing an Input Number. However, it would then need a default time unit. For example, if the default is seconds then the the Input Number’s value is in seconds.

Yes, an Hour / Minute / Second radio selection would be most logical for a user interface based on a number helper

I had something similar in mind when requesting this helper - Helper for time duration

I used a script with a delay using template value.

My case:

sequence:
  - type: turn_on
    device_id: 41344c9ecba1fbfaeaca0316f92e7fd6
    entity_id: switch.ventilador
    domain: switch
  - delay: '{{ states(''input_number.temporizador_ventilador'') | multiply(60) | int }}'
  - type: turn_off
    device_id: 41344c9ecba1fbfaeaca0316f92e7fd6
    entity_id: switch.ventilador
    domain: switch
mode: restart
alias: 'Temporizador ventilador '
icon: mdi:fan-clock

image

1 Like