Page 1 of 1

Doubleclick on Shelly1

Posted: 20 Jan 2019, 16:00
by Tecumseh
I just received 2 shelly's (1 switch type) and have flashed these with one of the latest nightly builds (ESP_Easy_mega-20190116_normal_ESP8266_1024.bin). Set the switch and some rules to operate the relays, all working fine. Next on my list is to enable the doubleclick feature to assign a different function to this, sadly it does not seem to work for me. Did I set something wrong? Here are my settings:
  • De-bounce(ms): 0
  • Doubleclick event: Active on LOW and HIGH (EVENT=3)
  • Doubleclick max. interval (ms): 1000
For the rules to set a variable I have the following code.

Code: Select all

on Button#Switch=3 do
  if [Variable#Double]=0 do
    TaskvalueSet,2,2,1
    Taskrun,2
  else
    TaskvalueSet,2,2,0
    Taskrun,2
  endif
endon
What am I doing wrong here?

Re: Doubleclick on Shelly1

Posted: 20 Jan 2019, 16:12
by grovkillen
What does the log say?

Re: Doubleclick on Shelly1

Posted: 20 Jan 2019, 17:21
by Tecumseh
I am only getting state 0 or 1, not state 3 for the doubleclick

Code: Select all

5393503: EVENT: Clock#Time=Sun,16:20
5402057: WD   : Uptime 90 ConnectFailures 18 FreeMem 18936
5403289: SW  : GPIO=5 State=1 Output value=1
5403297: EVENT: Button#Switch=1.00
5403320: ACT  : TaskvalueSet,2,1,1
5403330: Command: taskvalueset
5403334: ACT  : gpio,4,1
5403336: SW   : GPIO 4 Set to 1
5406089: SW  : GPIO=5 State=0 Output value=0
5406092: EVENT: Button#Switch=0.00
5406123: ACT  : TaskvalueSet,2,1,0
5406131: Command: taskvalueset
5406136: ACT  : gpio,4,0
5406138: SW   : GPIO 4 Set to 0
5408289: SW  : GPIO=5 State=1 Output value=1
5408292: EVENT: Button#Switch=1.00
5408316: ACT  : TaskvalueSet,2,1,1
5408324: Command: taskvalueset
5408328: ACT  : gpio,4,1
5408330: SW   : GPIO 4 Set to 1
5408589: SW  : GPIO=5 State=0 Output value=0
5408592: EVENT: Button#Switch=0.00
5408621: ACT  : TaskvalueSet,2,1,0
5408630: Command: taskvalueset
5408634: ACT  : gpio,4,0
5408636: SW   : GPIO 4 Set to 0
5411190: SW  : GPIO=5 State=1 Output value=1
5411194: EVENT: Button#Switch=1.00
5411219: ACT  : TaskvalueSet,2,1,1
5411227: Command: taskvalueset
5411232: ACT  : gpio,4,1
5411234: SW   : GPIO 4 Set to 1
5412890: SW  : GPIO=5 State=0 Output value=0
5412898: EVENT: Button#Switch=0.00
5412926: ACT  : TaskvalueSet,2,1,0
5412934: Command: taskvalueset
5412939: ACT  : gpio,4,0
5412941: SW   : GPIO 4 Set to 0
5413289: SW  : GPIO=5 State=1 Output value=1
5413292: EVENT: Button#Switch=1.00
5413315: ACT  : TaskvalueSet,2,1,1
5413323: Command: taskvalueset
5413327: ACT  : gpio,4,1
5413329: SW   : GPIO 4 Set to 1

Re: Doubleclick on Shelly1

Posted: 20 Jan 2019, 18:33
by grovkillen
Do you have the double click activated? And have you experimented with the denounce time?

Re: Doubleclick on Shelly1

Posted: 20 Jan 2019, 19:11
by Tecumseh
Double click is activated and not yet tried the de-bounce time settings. What does it do exactly?

Re: Doubleclick on Shelly1

Posted: 20 Jan 2019, 20:09
by grovkillen
It makes sure the signal isn't missed if the length is to short or long (you will need to experiment with it and look in the log).

Re: Doubleclick on Shelly1

Posted: 21 Jan 2019, 00:05
by Tecumseh
Playing with these setting with an increment of 50 (0-250ms) made no difference until I tried a double double click. After some more checking a triple click does register already. Would this be a bug in the double click option with active on both high and low?

Re: Doubleclick on Shelly1

Posted: 21 Jan 2019, 07:06
by grovkillen
Yes it could be a bug you found. Please report it to the GitHub page.