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.