Binary Sensor Delay: can't get it to work

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.