I want to use push-on (monostable) switch to change radio channels oan on/off via Domoticz. Single click, channel up/turn on, double click channel down, longpress - radio off
The switch setup on the picture below:
The problem is case of double-click, it first generate event value "1" and than "3". And respectively after longpress, it generate "1" and then "11".
Is any way (by rule or script in Domoticz) to eliminate first "1" value event in case of double click or logpress?
Properly recognize click, double click and longpress
Moderators: grovkillen, Stuntteam, TD-er
-
- Normal user
- Posts: 531
- Joined: 07 Jun 2018, 06:47
- Location: Gdynia/Poland
Re: Properly recognize click, double click and longpress
What version of ESPEasy are you using?
/Ton (PayPal.me)
-
- Normal user
- Posts: 531
- Joined: 07 Jun 2018, 06:47
- Location: Gdynia/Poland
Re: Properly recognize click, double click and longpress
ESPEasy_mega-20191208, because this version works perfectly for me, without any HW/SW/Watchdog-reboot. And I will not change anything that works perfectly for me.
Re: Properly recognize click, double click and longpress
Well the rules or switch plugin has not really changed a lot in this regard I think, since end of 2019.
I guess the rules are only a bit more strict now, so what works on the last builds will very likely also work on that build (other way around is not guaranteed)
I guess the rules are only a bit more strict now, so what works on the last builds will very likely also work on that build (other way around is not guaranteed)
-
- Normal user
- Posts: 531
- Joined: 07 Jun 2018, 06:47
- Location: Gdynia/Poland
Re: Properly recognize click, double click and longpress
I solved the problem by using the "inotifywait" command in the Domoticz bash script.
Nevertheless, I leave the following possibility for easyESP developers to consider. E.g. Add a checkbox in the switch definition.
And if this checkbox is checked and if the use of a button with double-click and/or longpress functionality is defined, wait the time defined for double click or longpress (whichever is longer).
And only after this time generate the appropriate result code (event) 1, 3, 10, 11 etc.
This will make it much easier IMO to use the button functionality correctly.
Nevertheless, I leave the following possibility for easyESP developers to consider. E.g. Add a checkbox in the switch definition.
And if this checkbox is checked and if the use of a button with double-click and/or longpress functionality is defined, wait the time defined for double click or longpress (whichever is longer).
And only after this time generate the appropriate result code (event) 1, 3, 10, 11 etc.
This will make it much easier IMO to use the button functionality correctly.
Who is online
Users browsing this forum: No registered users and 134 guests