Template binary sensors support delay_on and delay_off when defined in YAML.
These are useful options in many cases, like when creating a binary sensor that shows the state of a washing machine or similar where the power consumption varies throughout the cycle to prevent it from switching to false too early, or to indicate when there hasn’t been detected any motion for x amount of time across all motion sensors. I could go on and on!
delay_on/delay_off are not possible to set in UI. WTH not?
No, it is better than that…with this WTH, we could do all in the UI (mind you, we already have the other options available for the threshold in the UI)
like this:
1- create threshold binary with upper/lower limit and hysteresis in the UI
hahaha just noticed this:
2- create template binary based on the threshold binary from 1, and add delay_on/off in the UI (this WTH)
I agree that all options should be available in the UI but thats not the case right now and with this WTH it would only solve the issue for binary_sensor.
However, there are (probably) also other template helpers with options not available in the UI and if thats the case, you have to create the whole sensor in YAML. That has the disadvanteage, that the sensor has no unique ID, which means you can’t rename it, add labels etc. and it doesn’t seem to be possible to connect it to a device.
First, if you look over the past year or more of monthly update blogs you might notice that only 1 or 2 people are contributing the majority of the effort to the overhaul of the Template integration step-by-step. When only a couple people are willing and/or able to work on a large project, it takes more time for things to happen.
Second, one of the goals of having helpers in the UI was to make it easier for new users to set them up. In some related discussions, it had been decided that adding “advanced” options to Helpers would go against that goal since each additional configuration field adds complexity and possible sources of confusion. Apparently, that stance has been relaxed a little since an “Advanced options” section was added to template helpers in 2025.8. Currently, only one field, “availability”, has been added to that section. We may see other advanced configuration options added… if someone has the ability and will to go through the discussion and PR process. Even then, new additions may need to wait until currently scheduled changes are completed.
As someone who spends a lot of time helping new users here on the forum, I would prefer the helpers stay simple… The process of helping people debug the UI config flows is often slow and frustrating for both sides because we’re limited to written descriptions and sharing screenshots. When the config flow gets more complex, that is exacerbated and the efficiency and utility of YAML configuration becomes apparent.