Long press button delay
Posted: 22 Nov 2021, 06:56
Hello! I'm new to using EspEasy. I've been trying to figure it out for a few days, but I can not do anything. My task is simple. There is 1 switch. With this switch I want to operate 2 relays. By means of short and long pressing of the button. Switch is a simple press button. I can do it with the help of this rule:
on sw1#value1 do
if [sw1#value1] = 0
timerSet, 1, 1
endon
on rules#timer=1 do
if [sw1#value1] = 1
...
else
...
endif
endon
But there is a problem - too long delay with a short press. A whole second. And it's very inconvenient. I have read that for timerSet you can not use a value of less than 1 second. I read about the delay function. I'm trying to use it instead of timerSet, but nothing happens. Maybe someone can help me?
on sw1#value1 do
if [sw1#value1] = 0
timerSet, 1, 1
endon
on rules#timer=1 do
if [sw1#value1] = 1
...
else
...
endif
endon
But there is a problem - too long delay with a short press. A whole second. And it's very inconvenient. I have read that for timerSet you can not use a value of less than 1 second. I read about the delay function. I'm trying to use it instead of timerSet, but nothing happens. Maybe someone can help me?