Smooth out Vibration sensor

Hi,

I have a Zigbee vibration sensor which I have connected to a generator. Doing this will allow my to do 2 things.

  1. Tell if the generator is running
  2. tell how long the generator has run since the last reset. (when I filled it up)

The problem is that the vibration sensor is not 100% consistent and it will regularly say that the sensor is clear.

Would I would like to do it create a mirror sensor which will say that is it detected it the vibration sensor has been tripped over the last the last minute (or x time)

I have seen this done with a power monitor to smooth out the amps but I can’t find this.

Thanks for any help.
Gordon.

The way to do it will be to create a template binary_sensor. See here:

@sparkydave thanks for this, it worked very well. Just need ti tune it now so I get the best coverage.

Just following up. This didn’t work very well. as a vibration sensor doesn’t really support this detecting vibrations for long periods of time.

Since this is a generator I added a spare meross smart switch to the generator and check how long the voltage is available to monitor how long it is running. But the generator startup has very dirty power and the plug doesn’t start. I need to get a hold of a esp32 and put it behind a usb plug but I can’t get one on the solomon islands.

How did you setup the template binary sensor? By setting it up with the correct “delay off” you should be able to essentially remove the occasions of the physical sensor showing “not detected”.