#Debounce binary sensor

1 messages · Page 1 of 1 (latest)

wooden thicket
#

I have a binary sensor for my dryer. This sensor is triggered on or off based on the rate of change of a temperature sensor. It works really well and lets me take the laundry out of the dryer earlier than I normally would. The only problem is it occasionally it will flip back on momentarily after turning off.

I'm wondering if there's a way I can prevent the sensor from turning back on if it's just been turned off in the past X minutes.

The time throttle filter looked promising but it doesn't work for binary_sensor. delay_on on a template sensor also isn't sufficient because it will delay the dryer turning on too long for how long I'd need to set the debounce.

carmine belfry
# wooden thicket I have a binary sensor for my dryer. This sensor is triggered on or off based on...

could use a toggle helper and some automations:
have automation to turn it on when sensor switches on

also on the switch off it turns off the automation that turns it on.```
```have automation that triggers when turn on automation has been switched off for x minutes which turns it back on```

so
dryer turns on - automation turns on toggle
dryer turns off - automation turns off toggle and turn on automation
x minutes later - automation turns back on the turn on automation
#

or a different approach simalar to what you tried with delay_on is to use delay_off so that the binary sensor doesnt go off untill its gone through off-on-off. assuming the momentary on is fairly quick after it turns off then it wouldnt add much of a delay

knotty shale
#

Can't you just use a short for at the trigger? That's basically a debounce.

wooden thicket
#

I could maybe on the temperature change trigger but I just don't want to touch it cuz it's dialed in well for the initial turn off at least

#

And yeah could maybe do something with another helper and automations but I guess I was looking for something more elegant

#

I wonder if it's something that could be added to an existing sensor, or maybe I could create one

knotty shale
#

On the currect, I don't think so.

But simply adding a for when you use it is not "another helper and automations"

wooden thicket
#

No that was referencing Michael's comment.

#

I'll take a closer look at for but I think it'll have to much of a delaying effect when turning on

#

Which for my use case doesn't actually matter too much tbf

knotty shale
#

Yeah, there are basically two ways to debounce:

  • When state changed, wait for it to be stable for some time before acting. This can bedone with a for
  • When state changed, act immediately but lock further triggers. You might be able to do this by a delay at the end of an automation and have trigger mode: single. But might be hard if you have more triggers for the automation. In that case I think you'll need some helper.
wooden thicket
#

I think the problem is I only want it to be debounced in one of the two binary directions

#

Well maybe that's not true. I don't really think for is a true debounce equivalent