Doubleclick on Shelly1

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Tecumseh
Normal user
Posts: 28
Joined: 30 Sep 2016, 09:42

Doubleclick on Shelly1

#1 Post by Tecumseh » 20 Jan 2019, 16:00

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?

User avatar
grovkillen
Core team member
Posts: 3144
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Doubleclick on Shelly1

#2 Post by grovkillen » 20 Jan 2019, 16:12

What does the log say?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Tecumseh
Normal user
Posts: 28
Joined: 30 Sep 2016, 09:42

Re: Doubleclick on Shelly1

#3 Post by Tecumseh » 20 Jan 2019, 17:21

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

User avatar
grovkillen
Core team member
Posts: 3144
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Doubleclick on Shelly1

#4 Post by grovkillen » 20 Jan 2019, 18:33

Do you have the double click activated? And have you experimented with the denounce time?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Tecumseh
Normal user
Posts: 28
Joined: 30 Sep 2016, 09:42

Re: Doubleclick on Shelly1

#5 Post by Tecumseh » 20 Jan 2019, 19:11

Double click is activated and not yet tried the de-bounce time settings. What does it do exactly?

User avatar
grovkillen
Core team member
Posts: 3144
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Doubleclick on Shelly1

#6 Post by grovkillen » 20 Jan 2019, 20:09

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).
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Tecumseh
Normal user
Posts: 28
Joined: 30 Sep 2016, 09:42

Re: Doubleclick on Shelly1

#7 Post by Tecumseh » 21 Jan 2019, 00:05

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?

User avatar
grovkillen
Core team member
Posts: 3144
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Doubleclick on Shelly1

#8 Post by grovkillen » 21 Jan 2019, 07:06

Yes it could be a bug you found. Please report it to the GitHub page.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests