Problem with rule for Axa Remote [SOLVED]

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
ManS-H
Normal user
Posts: 279
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Problem with rule for Axa Remote [SOLVED]

#1 Post by ManS-H » 29 Aug 2021, 11:28

I'm using the Wemos D1 mini to control my Axa Remote by relays.
I use the following rules for opening and closing the window.
on wcraam-open do
gpio,0,0 // relay on
timerSet 1,2 // 2 seconds timer
endon

on Rules#Timer=1 do
gpio,0,1 // relay off
endon

on wcraam-dicht do
gpio,5,0 // relay on
timerSet 2,2 // 2 seconds timer
endon

on Rules#Timer=2 do
gpio,5,1 // relay off
endon

Now I want to activate the "Stop function" and my question is how can I combine both rules to one new rule with the name wcraam-stop and a pause of 20 seconds between both rules.
I have tried several possibilities but my knowledge is too limited to get this done.
Who can help me to make this possible.
Last edited by ManS-H on 29 Aug 2021, 13:08, edited 1 time in total.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Problem with rule for Axa Remote

#2 Post by TD-er » 29 Aug 2021, 11:38

Hmm this might get a bit complicated very easily when adding new combinations, but I guess just a stop may be managable.

I do see that we might benefit from a new feature to schedule events at a specific time.

Code: Select all

on wcraam-open do
  gpio,0,0 // relay on
  timerSet 1,2 // 2 seconds timer
endon

on Rules#Timer=1 do
  gpio,0,1 // relay off
endon

on wcraam-dicht do
  gpio,5,0 // relay on
  timerSet 2,2 // 2 seconds timer
endon

on Rules#Timer=2 do
  gpio,5,1 // relay off
endon

on wcraam-stop do
  asyncevent,wcraam-open
  timerSet 3,20 // 20 seconds timer
endon

on Rules#Timer=3 do
  asyncevent,wcraam-dicht
endon

User avatar
ManS-H
Normal user
Posts: 279
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: Problem with rule for Axa Remote

#3 Post by ManS-H » 29 Aug 2021, 13:07

Thanks TD-er,
That was the solution, asyncevent.
I control AXA with three relays for each command one relay, so i changed the code a bit. And this works as a charm.

Code: Select all

on wcraam-open do
  gpio,0,0 // relay on
  timerSet 1,2 // 2 seconds timer
endon

on Rules#Timer=1 do
  gpio,0,1 // relay off
endon

on wcraam-dicht do
  gpio,4,0 // relay on
  timerSet 2,2 // 2 seconds timer
endon

on Rules#Timer=2 do
  gpio,4,1 // relay off
endon

on wcraam-open/stop do
  gpio,5,0 // relay on
  timerSet 3,2 // 2 seconds timer
endon

on Rules#Timer=3 do
  gpio,5,1 // relay off
endon

on wcraam-stop do
  asyncevent,wcraam-open
  timerSet 4,20 // 20 seconds timer
endon

on Rules#Timer=4 do
  asyncevent,wcraam-open/stop
endon


TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Problem with rule for Axa Remote [SOLVED]

#4 Post by TD-er » 29 Aug 2021, 15:29

Great :)
I wonder if using a slash will ever lead to issues in an event 'name', but I guess it will not really be a problem.

User avatar
ManS-H
Normal user
Posts: 279
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: Problem with rule for Axa Remote [SOLVED]

#5 Post by ManS-H » 29 Aug 2021, 18:47

TD-er wrote: 29 Aug 2021, 15:29 Great :)
I wonder if using a slash will ever lead to issues in an event 'name', but I guess it will not really be a problem.
No problem at all
ESPEasy-1.jpg
ESPEasy-1.jpg (64.82 KiB) Viewed 6142 times

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Problem with rule for Axa Remote [SOLVED]

#6 Post by TD-er » 29 Aug 2021, 19:02

Well you can send events via more ways than just the rules.
For example via HTTP.
Not sure what will happen if you try to send an event command via HTTP, since a slash can be part of an URL.
But I am not sure it can also be used as a GET parameter.

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests