cannot get %eventvalue% to work

Moderators: Voyager, BertB, rtenklooster, Stuntteam, grovkillen, TD-er

Post Reply
Message
Author
bartv
Normal user
Posts: 6
Joined: 13 Jan 2018, 20:07

cannot get %eventvalue% to work

#1 Post by bartv » 13 Jan 2018, 20:18

Hello forum,

using a sonoff module,
I put in rules as shown below.
when running " http://sonoff-12/control?cmd=event,TimerOn" in my browser
the LED is lit for 10 seconds, everything ok.
but when putting " http://sonoff-12/control?cmd=event,remoteTimerControl=5" in my browser
the LED blink shortly, sometimes very short, sometimes half a second.
It looks to me that the eventvalue is not forwarded ?
Pls help !

Regards, Bart

Code: Select all

// LED off/on
on LedOff do
  gpio,13,1
endon
on LedOn do
  gpio,13,0
endon

on remoteTimerControl do
   event LedOn
   timerSet,1,%eventvalue%
 endon

on rules#timer=1 do
  event LedOff
endon

on TimerOn do
  event LedOn
  timerset,2,10
endon

on rules#timer=2 do
  event LedOff
endon

User avatar
grovkillen
Normal user
Posts: 2075
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: cannot get %eventvalue% to work

#2 Post by grovkillen » 13 Jan 2018, 21:00

Try this :

Code: Select all

on remoteTimerControl do
  timerSet,1,%eventvalue%
   event LedOn
 endon
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Sponsor ESP Easy, we need you :idea: :idea: :idea:

bartv
Normal user
Posts: 6
Joined: 13 Jan 2018, 20:07

Re: cannot get %eventvalue% to work

#3 Post by bartv » 14 Jan 2018, 01:03

hello grovkillen, thanks for your reply,

but, nope, doesn't change a thing.
still irregular times between +/- 0.2 and 1 second.
reboot and power-off/on also doesn't help after changing rules (just to be sure)
behavior stays the same.

Bart

bartv
Normal user
Posts: 6
Joined: 13 Jan 2018, 20:07

Re: cannot get %eventvalue% to work

#4 Post by bartv » 14 Jan 2018, 01:05

oh, and tried to have the rule with %eventvalue% as first line in Rules,
so eventvalue is on second line, but that didn't help either.

Bart

User avatar
vader
Normal user
Posts: 241
Joined: 21 Mar 2017, 17:35

Re: cannot get %eventvalue% to work

#5 Post by vader » 14 Jan 2018, 21:41

Take this version without any stupid rules....

"http://sonoff-12/control?cmd=longpulse+13%2C0%2C10" (example for 10 seconds)

Change the "10" to your needed value of seconds to turn LED on and that was it....

bartv
Normal user
Posts: 6
Joined: 13 Jan 2018, 20:07

Re: cannot get %eventvalue% to work

#6 Post by bartv » 15 Jan 2018, 20:47

Hello Vader,

yep that works!!

Still it is strange why eventvalue does not work
I cannot find the error in what i'm doing, but also nobody with the same problem using google.
It's very unlikely i'm the only one ;-)

But, for now, i can use your solution to what i'm creating, so thank you !!

Bart

User avatar
vader
Normal user
Posts: 241
Joined: 21 Mar 2017, 17:35

Re: cannot get %eventvalue% to work

#7 Post by vader » 15 Jan 2018, 22:00

No problem, man. I have all that already behind me. And sometimes it's better not to be an engineer for simple solutions.... :D

This works also:
http://sonoff-12/control?cmd=event,remoteTimerControl=5

on remoteTimerControl do
longpulse,13,0,%eventvalue%
endon

bartv
Normal user
Posts: 6
Joined: 13 Jan 2018, 20:07

Re: cannot get %eventvalue% to work

#8 Post by bartv » 16 Jan 2018, 06:20

Hello Vader,

I'm sorry, but the rule you propose

on remoteTimerControl do
longpulse,13,0,%eventvalue%
event LedOn
endon

has exactly the same result as my initial rule, it works, but the length of the timer is not correctly set.
The led now is lit for a short while, few tenths of a second, up to half a second.
so eventvalue is not passed through in this case either.

Bart

User avatar
grovkillen
Normal user
Posts: 2075
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: cannot get %eventvalue% to work

#9 Post by grovkillen » 16 Jan 2018, 06:35

bartv wrote:
16 Jan 2018, 06:20
Hello Vader,

I'm sorry, but the rule you propose

on remoteTimerControl do
longpulse,13,0,%eventvalue%
event LedOn
endon

has exactly the same result as my initial rule, it works, but the length of the timer is not correctly set.
The led now is lit for a short while, few tenths of a second, up to half a second.
so eventvalue is not passed through in this case either.

Bart
He didn't propose this part :

on remoteTimerControl do
longpulse,13,0,%eventvalue%
event LedOn
endon

I think you misunderstand the long pulse command, it will (given the example above, using state 0) turn the led off and when the given time is up turn it back on. No need for the event you added.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Sponsor ESP Easy, we need you :idea: :idea: :idea:

User avatar
vader
Normal user
Posts: 241
Joined: 21 Mar 2017, 17:35

Re: cannot get %eventvalue% to work

#10 Post by vader » 16 Jan 2018, 09:24

bartv wrote:
16 Jan 2018, 06:20
Hello Vader,

I'm sorry, but the rule you propose

on remoteTimerControl do
longpulse,13,0,%eventvalue%
event LedOn
endon

has exactly the same result as my initial rule, it works, but the length of the timer is not correctly set.
The led now is lit for a short while, few tenths of a second, up to half a second.
so eventvalue is not passed through in this case either.

Bart
My rule is only 3 lines long, yours has 4! "event LedOn" is nonsense, because you are already turning on the LED with "13,0" (inversed logic). I have tested the rule on my test board and it works like it should be. So %eventvalue% works....

bartv
Normal user
Posts: 6
Joined: 13 Jan 2018, 20:07

Re: cannot get %eventvalue% to work

#11 Post by bartv » 16 Jan 2018, 22:49

helle grovkillen & vader,

you're correct , my mistake, i apologize.

I used cut&paste, and now these 3 lines are the only lines in Rules.

on remoteTimerControl do
longpulse,13,0,%eventvalue%
endon

saved/reboot/check if really ok, 60 characters.

did use : http://sonoff-12/control?cmd=event,remoteTimerControl=5
same behaviour. It wil not create a stable pulse for 5 seconds, just a short blink

using http://sonoff-12/control?cmd=longpulse+13%2C0%2C5
response is : (JSON filter in Firefox)
log "GPIO 13 Pulse set for 5 S"
plugin 1
pin 13
mode "output"
state 0

and the LED is lit for 5 seconds

tested firefox and internet explorer on windows10
espeasy
Build: 120
Core Version: 2_3_0
for some reason eventvalue will not work.

Bart

User avatar
vader
Normal user
Posts: 241
Joined: 21 Mar 2017, 17:35

Re: cannot get %eventvalue% to work

#12 Post by vader » 17 Jan 2018, 08:59

Ok Windows 10 is a virus of its own.... :mrgreen: But, why are you using that old version of ESPeasy (R120)? You should try R147 or better 2.xx.

User avatar
grovkillen
Normal user
Posts: 2075
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: cannot get %eventvalue% to work

#13 Post by grovkillen » 17 Jan 2018, 09:06

vader wrote:
17 Jan 2018, 08:59
Ok Windows 10 is a virus of its own.... :mrgreen: But, why are you using that old version of ESPeasy (R120)? You should try R147 or better 2.xx.
I have a hate/love relation with Windows. I used to be full fledged Ubuntu until Windows 10, I have always used Windows at work and script stuff so when Windows 10 turned out pretty decent and I got a new computer, and Microsoft gave all cracked Windows 8.1 users free upgrade to Windows 10 I jumped ship.

But on topic: yes we are on the verge of releasing the next version and have stopped active support of R120 (even though it's still the official release). Give us a few more months and 2.0.0 will be replacing R120 as the official version. In the meantime please help us find bugs. New features are also welcomed but will most likely have to wait until 2.1.0 (or if you are daring, use the nightly builds of "mega").
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Sponsor ESP Easy, we need you :idea: :idea: :idea:

User avatar
vader
Normal user
Posts: 241
Joined: 21 Mar 2017, 17:35

Re: cannot get %eventvalue% to work

#14 Post by vader » 17 Jan 2018, 09:15

@grovkillen: Micro$oft lives from user are not seeing what crap they use... :lol:

User avatar
grovkillen
Normal user
Posts: 2075
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: cannot get %eventvalue% to work

#15 Post by grovkillen » 17 Jan 2018, 09:20

vader wrote:
17 Jan 2018, 09:15
@grovkillen: Micro$oft lives from user are not seeing what crap they use... :lol:
I agree, and swallow the bait at the same time :roll:
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests