Page 1 of 1
need help in rules
Posted: 28 Aug 2017, 21:37
by rajbadri
I am trying this in Rules
on GPIO13#value do
if [GPIO13#value] = 0
NeoPixelAll,0,0,255
timerSet 1,30 // 30 sec timer
endon
on Rules#Timer=1 do
NeoPixelAll,0,0,0
endif
endon
but it does not trigger and nothing happens.
Thanks in advance
Re: need help in rules
Posted: 28 Aug 2017, 22:54
by grovkillen
Is your device named "GPIO13" and it's value named "value"?
Re: need help in rules
Posted: 29 Aug 2017, 04:49
by rajbadri
- shot.png (56.32 KiB) Viewed 6123 times
Re: need help in rules
Posted: 29 Aug 2017, 04:51
by rajbadri
I have tried this but does not work
on lock#Switch do
if [lock#Switch]=0
NeoPixelAll,0,0,255
timerSet 1,30 // 30 sec timer
endon
on Rules#Timer=1 do
NeoPixelAll,0,0,0
endif
endon
Re: need help in rules
Posted: 29 Aug 2017, 04:56
by rajbadri
lock is a pushbutton in domoticz which I use to activate gpio13 to 1 and 0
this is the log
- Screen Shot 2017-08-29 at 8.25.18 AM.png (80.64 KiB) Viewed 6121 times
Re: need help in rules
Posted: 29 Aug 2017, 09:31
by grovkillen
rajbadri wrote: ↑29 Aug 2017, 04:51
I have tried this but does not work
on lock#Switch do
if [lock#Switch]=0
NeoPixelAll,0,0,255
timerSet 1,30 // 30 sec timer
endon
on Rules#Timer=1 do
NeoPixelAll,0,0,0
endif
endon
Almost nailed it:
Code: Select all
on lock#Switch do
if [lock#Switch]=0
NeoPixelAll,0,0,255
timerSet 1,30 // 30 sec timer
endif
endon
on Rules#Timer=1 do
NeoPixelAll,0,0,0
endon
You had put the "endif" in the next "on"-sequence. This caused the interpreter to not understanding the code.
Re: need help in rules
Posted: 29 Aug 2017, 11:39
by rajbadri
will try
Thanks
Re: need help in rules
Posted: 30 Aug 2017, 22:31
by toffel969
Should also work like this
Code: Select all
on lock#Switch=0 do
NeoPixelAll,0,0,255
timerSet 1,30 // 30 sec timer
endon
on Rules#Timer=1 do
NeoPixelAll,0,0,0
endo
No if statement required, and find it good practice as additional nested if statement is possible