I have a SW-420 vibration sensor. When powered one light is always on. When it detects vibration another light goes on, then goes off when it “clears”.
About half the time it just doesnt “clear” even though all vibration has clearly stopped (and the second light goes out)
I don’t have your specific sensor, but I expect it to output low for vibration and high when stable. So if you don’t invert your binary sensor, your delayed on/off are working as opposite.
Thanks Karosm for the very thorough and informative response!
I’ll start by saying i’m reusing code from a youtube project I found. I purchased these chips:
They say they are " This is D1 mini, it is a mini NodeMcu Lua WiFi board based on ESP-8266EX."
Not much other info on them. I’ve tried a couple of different board definitions. This seemed to work.
I’ll invert the sensor, but the delayed on off shouldn’t really be a problem, at worst it would wait a second before turning on, etc.
Esphome/ha show it sometimes clears, and sometimes remains in ‘detected’ mode even though there is absolutely no vibration.
On esphome or in home assistant?
Did you look at esphome logs?
Toi verify voltage, disconnect data output between sensor and esp. Measure voltage between sensor gnd and output while still and while vibrated (LED on)
I have it set at the lowest possible sensitivity setting. It I turn it all the way clockwise, both lights are lit and it remains ‘detected’ permanently. If I turn it all the way anticlockwise, it will go off and report clear.
Current behavior - one light always on.
If I shake it second light comes on, it reads ‘detected’
Now one of two things happens - once it stops moving it either remains with both lights on (detected) or one light goes off and it behaves correctly.
If it remains with both lights on if I tap it with a pencil - even the slightest tap - , the light will then go off and it moves to clear.
This issue repeats.