Binary Sensor Delay: can't get it to work

I feel really dumb at the moment. I am trying to develop a time delay sensor for several devices.
Here is the very simple template code snippet:
template:
-binary_sensor:
-name: ‘bstest’
delay_off: 00:00:10
{{states(‘light.dimmable_led_light_bulb’) }}

I responds instantaneously when I switch the bulb from on to off rather that reporting ‘on’ for an additional 10 seconds and then reporting off.
Anyone willing to take pity on me and explain?

Thanks

Please format your code correctly: see section 11 here:

Times should be in quotes, so delay_off: "00:00:10". What’s that state template all about?

Post the correctly-formatted code — all of the relevant code, not just a snippet if you mean that’s less than the full sensor code — and we’ll advise further.

1 Like

Is the state variable missing, or is that due to copy&past?