Repeat button push multiple times preventing loops

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
rgroothuis
Posts: 347
Joined: Friday 03 April 2015 17:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Repeat button push multiple times preventing loops

Post by rgroothuis »

I've a garage door opener, remote control, which sends a signal to the main system to open the door.
Many times one push is not enough, I believe the RF signal is not strong enough and therefore I need to push the button multiple times.
Because of this I want to repeat the button push multiple times within the script, but how can I prevent that Domoticz is getting into an end-less loop?

Would something like:

Garagedeur.switchOn().checkFirst().repeatAfterSec(4, 3).silent()

be the solution?
rgroothuis
Posts: 347
Joined: Friday 03 April 2015 17:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Repeat button push multiple times preventing loops

Post by rgroothuis »

Any suggestions on how to fix this? Even with the silent() option I end up in an end less loop.
rrozema
Posts: 470
Joined: Thursday 26 October 2017 13:37
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Delft
Contact:

Re: Repeat button push multiple times preventing loops

Post by rrozema »

Would choosing a more reliable technology for your switches be an option? Because repeating the button push is only a workaround and your results may vary: for example, how many pushes is enough: if the 1st push doesn't arrive is there any guarantee the 2nd or even a 3rd will? May be you can replace the RF switch by an inplant module with a relay or something similar?
rrozema
Posts: 470
Joined: Thursday 26 October 2017 13:37
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Delft
Contact:

Re: Repeat button push multiple times preventing loops

Post by rrozema »

Code: Select all

Garagedeur.switchOn().checkFirst().repeatAfterSec(4, 3).silent()
You've probably already tried it and found that checkFirst() is only executed once before the repeatAfterSec is executed. I.e. checkFirst is only used once and not for every repeat as you seem to think. As I wrote above, better fix the cause instead of trying to find a work around.
rgroothuis
Posts: 347
Joined: Friday 03 April 2015 17:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Repeat button push multiple times preventing loops

Post by rgroothuis »

rrozema wrote: Sunday 09 January 2022 23:58 Would choosing a more reliable technology for your switches be an option? Because repeating the button push is only a workaround and your results may vary: for example, how many pushes is enough: if the 1st push doesn't arrive is there any guarantee the 2nd or even a 3rd will? May be you can replace the RF switch by an inplant module with a relay or something similar?
Thanks for the good suggestion, I wish this was possible. The garagedoor/system is not owned by me, it is a centralised controlled system, I only have the remote controls. And I cannot place the remote control at a location closer by unfortunately. No the family are pushing the open button many times and after 4 to 5 times the door opens, don't understand why it doesn't work in one go. But I want to see if I can repeat it automatically 4 or 5 times, hence the question.
rgroothuis
Posts: 347
Joined: Friday 03 April 2015 17:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Repeat button push multiple times preventing loops

Post by rgroothuis »

rrozema wrote: Monday 10 January 2022 0:10

Code: Select all

Garagedeur.switchOn().checkFirst().repeatAfterSec(4, 3).silent()
You've probably already tried it and found that checkFirst() is only executed once before the repeatAfterSec is executed. I.e. checkFirst is only used once and not for every repeat as you seem to think. As I wrote above, better fix the cause instead of trying to find a work around.
Should I remove the checkFirst?

My experience at the moment is that the silent() option is not working as expected. It is still triggering the DZvent script to be executed. I expect that with the silent option the script is not triggered anymore. Of course this could be due to the fact I'm also using the checkFirst option. I can remove that of course. Any suggestions?
rrozema
Posts: 470
Joined: Thursday 26 October 2017 13:37
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Delft
Contact:

Re: Repeat button push multiple times preventing loops

Post by rrozema »

rgroothuis wrote: Tuesday 11 January 2022 10:18
rrozema wrote: Sunday 09 January 2022 23:58 Would choosing a more reliable technology for your switches be an option? Because repeating the button push is only a workaround and your results may vary: for example, how many pushes is enough: if the 1st push doesn't arrive is there any guarantee the 2nd or even a 3rd will? May be you can replace the RF switch by an inplant module with a relay or something similar?
Thanks for the good suggestion, I wish this was possible. The garagedoor/system is not owned by me, it is a centralised controlled system, I only have the remote controls. And I cannot place the remote control at a location closer by unfortunately. No the family are pushing the open button many times and after 4 to 5 times the door opens, don't understand why it doesn't work in one go. But I want to see if I can repeat it automatically 4 or 5 times, hence the question.
Maybe you can improve your remote control's antenna? You could try holding/taping a piece of wire to it while you operate it, as an experiment :-)?
rrozema
Posts: 470
Joined: Thursday 26 October 2017 13:37
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Delft
Contact:

Re: Repeat button push multiple times preventing loops

Post by rrozema »

rgroothuis wrote: Tuesday 11 January 2022 10:20
rrozema wrote: Monday 10 January 2022 0:10

Code: Select all

Garagedeur.switchOn().checkFirst().repeatAfterSec(4, 3).silent()
You've probably already tried it and found that checkFirst() is only executed once before the repeatAfterSec is executed. I.e. checkFirst is only used once and not for every repeat as you seem to think. As I wrote above, better fix the cause instead of trying to find a work around.
Should I remove the checkFirst?

My experience at the moment is that the silent() option is not working as expected. It is still triggering the DZvent script to be executed. I expect that with the silent option the script is not triggered anymore. Of course this could be due to the fact I'm also using the checkFirst option. I can remove that of course. Any suggestions?
Removing the .checkFirst() is worth a try: it doesn't do you any good anyway. I am not sure if the combination repeatAfterSec(...).silent() can be expected to work though. I wouldn't know where to look this up even, other than in the code, which I gave a short try, but gave up quickly...
rgroothuis
Posts: 347
Joined: Friday 03 April 2015 17:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Repeat button push multiple times preventing loops

Post by rgroothuis »

Thanks rrozema for your response, indeed creating an better antenna is a good suggestion, will check this and give it a try. Need to understand the frequency first to be able to determine the size/format of the antenna, next challenge :-)

Yes, I will give it a try by removing the .checkFirst(). I will share the outcome when the test is done. Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest