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?
Long press button delay
Moderators: grovkillen, Stuntteam, TD-er
Re: Long press button delay
There is a mishap in your code, the endif is missing after timerSet,1,1
Documentation on rules is here: https://espeasy.readthedocs.io/en/lates ... Rules.html
And besides the timerSet command there is also a timerSet_ms that has a milliseconds argument instead of a seconds argument, giving finer control.
The complete list of commands is here: https://espeasy.readthedocs.io/en/lates ... mmand.html
You could also react to the event value 10 or 11 when the longpress is activated, as documented in the comboboxes on the Switch settings.
Documentation on rules is here: https://espeasy.readthedocs.io/en/lates ... Rules.html
Code: Select all
on sw1#value1 do
if [sw1#value1] = 0
timerSet, 1, 1
endif
endon
on rules#timer=1 do
if [sw1#value1] = 1
...
else
...
endif
endon
The complete list of commands is here: https://espeasy.readthedocs.io/en/lates ... mmand.html
You could also react to the event value 10 or 11 when the longpress is activated, as documented in the comboboxes on the Switch settings.
/Ton (PayPal.me)
Who is online
Users browsing this forum: No registered users and 89 guests