Switch with counting option and long press detection
Posted: 24 Nov 2016, 09:30
Hello everybody.
First I would like to say hello everybody, I'm new here
I will start making my intelligent house based on Domoticz, I have plans to use esp module to control lights, devices and other things.
To control light I planning to use simple pushbutton.
As we know switch imput in espeasy return only two values 0 and 1
whether it is possible to make it to count, so that they can take the values 0,1,2,3... e.t.c.?
I want to use only one button to control set lighting
This is an example:
First press -> first lamp on, second off, third off
second press -> first lamp off, second on, third on
third press -> all on
fourth press -> all off
I will control that using simple rule.
Second question.
Is there is possibility to detect long press lasting longer than 1 sec, that to return a different value?
All best,
Kamil
First I would like to say hello everybody, I'm new here

I will start making my intelligent house based on Domoticz, I have plans to use esp module to control lights, devices and other things.
To control light I planning to use simple pushbutton.
As we know switch imput in espeasy return only two values 0 and 1
whether it is possible to make it to count, so that they can take the values 0,1,2,3... e.t.c.?
I want to use only one button to control set lighting
This is an example:
First press -> first lamp on, second off, third off
second press -> first lamp off, second on, third on
third press -> all on
fourth press -> all off
I will control that using simple rule.
Second question.
Is there is possibility to detect long press lasting longer than 1 sec, that to return a different value?
All best,
Kamil