State Changes twice or X times?

So lately I have been getting a lot of triggers from my Vibration Sensor. Single triggers possibly caused by gusts of wind? Large truck? Or so…

I plan to setup a Piston in order to take care or it. Everythjng is set up however I cannot figure out how to set it to trigger if for example the state changes 2 times of 3 times.

I see that i can use IF “Active” for 1 minute. However the way the vibration sensor works is more like bursts.

I would use a variable. Do a search here.

I am assuming but that you mean:

On state change X=X+1

If X = 2 then TRIGGER.

If after 5 minutes X is SAME then X=0.

I think its a bit of an overkill. Am i assuming wrong? Isn’t there perhaps an easier way of doing it?

Yeah, something like that.

I don’t worry about ease of setup… What’s most reliable for the use case.

1 Like

Wonderful! Thanks. Will test it soon.

It didn’t work. Instead it waited until it hit 3 vibrations in a row and then it triggered. Regardless there was hours in between.

So I opted for this instead:

However I am unsure my if my logic is correct. Will it clear every 5 minutes? Or will it run every time and every time it will wait 5 minutes and clesr the variable, causing it to never trigger? Please advice. Is this the proper way to add a wait time?

I didn’t work. Whatam I doing wrong? Is that not the way to clear tge variable after 5 minutes?

But what about restting it? I want to reset the variable IF there is no 3 consecutive motions in 5 minutes.

How do i setup the does NOT change?

Also lost me abit with black circles and dots lol

How’s this?

Should it be in an AND or perhaps in a THEN IF? The not changes part.

This seems to make more sense: