How to make automation for light + pir sensor triger 5x then lights go to on

How to make automation for light + pir sensor?

When pir sensor is triggered 5x times then light is go on?

just for my information, can u explain briefly about the purpose of this ?

Hi,

I need just the example. The light is fan in my situation. Fan must turn on ater pir sensor is triggered 5x.

You could set up a kind of “timer” as a input_number. On each trigger you update the value to be the previous + 1. In another automation you check if the value is 5, turn on the fan and reset the input_value to 0.

@ashwin can you post an example?

Take a look at the documentation:


There is also a counter component you might find useful.

Thanks, all for the tips. I think I will try to find the solution using node-red.