Add delay_on delay_off in GUI for helper of a template binary sensor

I recognise the need to keep the GUI simple, but there is also a need to encourage more to be done with the GUI for the widest user base.

A good new feature would be to add delay on/off into the GUI for a template helper. Holding the state is useful for creating picture element conditions, which can be edited in the GUI,

I beieve this would be a good next step, simplifying the creation of these templates by using the GUI but without adding complexity.

A sensor is a sensor - you can’t freeze the state. Your FR sounds more like a variable.

Have you looked at something like Variables+History from HACS? You can set it up to hold the previous state(s) of a sensor.

Can you elaborate on use cases for this? When would you use it, as opposed to for instance a threshold sensor? And I do not mean where (the picture element) but what kind of sensor and why?

As a good example, it would be a very simple way to implement a motion sensor that holds detected, giving consistency between icons on a picture element and any automation. This can be done in YAML, but the GUI provides a good way to a novice to achieve this as it’s a really common thing to do. Not all motion sensors are used to turn on a light, they could trigger anything.

Likewise, some sensors have the threshold set within them and just supply on/off to home assistant and so are therefore a binary sensor. I have a light sensor that triggers on/off, based on a preset threshold within but does not provide the light level to home assistant.

A switch is another example, you may wish to hold for a moment after turned off the switch (for example to leave the room).

As this feature request is for a binary_sensor, a threshold sensor makes no sense since a binary sensor is just on/off.

If multiple automations use these sensors, changing just one place to alter a delay is also a simplification.

1 Like

Makes sense. I thought I didn’t use it anywhere but now you mention this, I use them too. Don’t forget to vote yourself!

Thank you. Yes, I found exactly the same as i forgot how useful the delay_on/off is.

It is a very elegant solution, which i feel would benefit users who don’t want to dabble in YAML, it is powerful yet simple to understand the concept.

I believe the UI would significantly benefit by this addition, any complexity of new features to the UI is far outweighed by the overall simplification for less experienced users yet powerful.

This feature is aready availble in YAML for template binary sensors, it’s called delay_on, delay_off. It’s just not shown in the UI yet.

Therefore, “freezing a state” of a binary sensor is a feature already and yes you can, I and others use these currently and it’s really powerful. There is no need for a variable, a variable adds complexlity and that goes against the reason for this feature request.

For clarity, this feature request is simply to add these two options to the UI. Under the covers, home assistant already supports this.

1 Like

I would love to see the option for delay on//off in the ui now that the templating helper has grown in its options. I want to move away from directly editing config file where possible.

1 Like

+1 for adding this.