rule not triggering for distance SR04 (solved)

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
riker1
Normal user
Posts: 344
Joined: 26 Dec 2017, 18:02

rule not triggering for distance SR04 (solved)

#1 Post by riker1 » 09 Apr 2018, 12:24

Hi

having a distance sensor attached

log is saying:

0843707 : EVENT: Dist_139#Dist_V=152.64
10844706 : SR04 : Distance: 151.78
10844707 : EVENT: Dist_139#Dist_V=151.78


device is defined: with value, also tried state. but as well no trigger

rule for event:
on Dist_139#Dist_V<100.00 do
GPIO,14,1
endon

is not triggering?

what am I doing wrong?

Thanks T
Last edited by riker1 on 23 Apr 2018, 18:53, edited 1 time in total.

riker1
Normal user
Posts: 344
Joined: 26 Dec 2017, 18:02

Re: rule not triggering for distance SR04

#2 Post by riker1 » 23 Apr 2018, 16:32

no hints?

wim16
Normal user
Posts: 88
Joined: 01 May 2017, 20:35

Re: rule not triggering for distance SR04

#3 Post by wim16 » 23 Apr 2018, 17:26

Your rule test on values < 100 but the values in the log are all > 100 so it is correct the rule is not being executed.

riker1
Normal user
Posts: 344
Joined: 26 Dec 2017, 18:02

Re: rule not triggering for distance SR04

#4 Post by riker1 » 23 Apr 2018, 17:49

thanks for checking,

of course I have values lower than 100

still rule not triggered.

any way to check if a rule is tiggered/passed? - debugging ?

rule and execution should show up in log, right?

like
: EVENT: Dist_139#Dist_V=6.03
4665343 : SR04 : Distance: 7.76
4665344 : EVENT: Dist_139#Dist_V=7.76
4666343 : SR04 : Distance: 7.34
4666344 : EVENT: Dist_139#Dist_V=7.34
4667342 : SR04 : Distance: 7.64
4667344 : EVENT: Dist_139#Dist_V=7.64
4668342 : SR04 : Distance: 7.66
4668344 : EVENT: Dist_139#Dist_V=7.66
4669342 : SR04 : Distance: 7.64
4669344 : EVENT: Dist_139#Dist_V=7.64
4670342 : SR04 : Distance: 7.50
4670344 : EVENT: Dist_139#Dist_V=7.50
4671342 : SR04 : Distance: 8.24
4671344 : EVENT: Dist_139#Dist_V=8.24

wim16
Normal user
Posts: 88
Joined: 01 May 2017, 20:35

Re: rule not triggering for distance SR04

#5 Post by wim16 » 23 Apr 2018, 18:16

What if you leave out the condition in the on statement?
And what firmware do you use?
Rules are not easily tested indeed, you might change the loglevel to see if it shows more info.

riker1
Normal user
Posts: 344
Joined: 26 Dec 2017, 18:02

Re: rule not triggering for distance SR04

#6 Post by riker1 » 23 Apr 2018, 18:34

wim16 wrote: 23 Apr 2018, 18:16 What if you leave out the condition in the on statement?
And what firmware do you use?
Rules are not easily tested indeed, you might change the loglevel to see if it shows more info.

Hi

do you mean :

on Dist_139#Dist_V do
GPIO,16,0
endon




led 16 not triggered.
log does not say anything about GPIO command


did set loglevel to debug, but does not show me a hint.


using: mega-20180409

riker1
Normal user
Posts: 344
Joined: 26 Dec 2017, 18:02

Re: rule not triggering for distance SR04

#7 Post by riker1 » 23 Apr 2018, 18:44

did switch on debug serial and see more

but only

RuleDebug: 100: dist_139#dist_v<100.00 do
RuleDebug: 101: gpio,16,0

but does not show execution of gpio command.


EVENT: Dist_139#Dist_V=125.34 Processing time:47 milliSeconds
HTTP : connecting to 192.168.0.9:8383
HTTP : closing connection
SR04 : Distance: 13.12
EVENT: Dist_139#Dist_V=13.12
RuleDebug Processing:rules1.txt
flags CMI parse output:
RuleDebug: 100: dist_139#dist_v<100.00 do
RuleDebug: 101: gpio,16,0
RuleDebug Processing:rules2.txt
flags CMI parse output:
RuleDebug Processing:rules3.txt
flags CMI parse output:
RuleDebug Processing:rules4.txt
flags CMI parse output:
EVENT: Dist_139#Dist_V=13.12 Processing time:49 milliSeconds
HTTP : connecting to 192.168.0.9:8383
HTTP/1.1 200 OK

HTTP : Success
Content-Type: text/plain

Connection: close

Content-Length: 0



HTTP : closing connection
SR04 : Distance: 7.16
EVENT: Dist_139#Dist_V=7.16
RuleDebug Processing:rules1.txt
flags CMI parse output:
RuleDebug: 100: dist_139#dist_v<100.00 do
RuleDebug: 101: gpio,16,0
RuleDebug Processing:rules2.txt
flags CMI parse output:
RuleDebug Processing:rules3.txt
flags CMI parse output:
RuleDebug Processing:rules4.txt
flags CMI parse output:
EVENT: Dist_139#Dist_V=7.16 Processing time:47 milliSeconds
HTTP : connecting to 192.168.0.9:8383
HTTP/1.1 200 OK

HTTP : Success
Content-Type: text/plain

Connection: close

Content-Length: 0

riker1
Normal user
Posts: 344
Joined: 26 Dec 2017, 18:02

Re: rule not triggering for distance SR04

#8 Post by riker1 » 23 Apr 2018, 18:49

Hi

also tried now using state with threshold.
values are correct, but rule still not executed....

is it maybe a problem upper lower letters?



HTTP : closing connection
SR04 : State 1
EVENT: Dist_139#Dist_V=1.00
RuleDebug Processing:rules1.txt
flags CMI parse output:
RuleDebug: 100: dist_139#dist_v=1.00 do
RuleDebug: 101: gpio,16,0
RuleDebug Processing:rules2.txt
flags CMI parse output:
RuleDebug Processing:rules3.txt
flags CMI parse output:
RuleDebug Processing:rules4.txt
flags CMI parse output:
EVENT: Dist_139#Dist_V=1.00 Processing time:47 milliSeconds
HTTP : connecting to 192.168.0.9:8383
HTTP/1.1 200 OK

HTTP : Success
Content-Type: text/plain

Connection: close

Content-Length: 0



HTTP : closing connection
SR04 : State 0
EVENT: Dist_139#Dist_V=0.00
RuleDebug Processing:rules1.txt
flags CMI parse output:
RuleDebug: 100: dist_139#dist_v=1.00 do
RuleDebug: 101: gpio,16,0
RuleDebug Processing:rules2.txt
flags CMI parse output:
RuleDebug Processing:rules3.txt
flags CMI parse output:
RuleDebug Processing:rules4.txt
flags CMI parse output:
EVENT: Dist_139#Dist_V=0.00 Processing time:47 milliSeconds
HTTP : connecting to 192.168.0.9:8383
HTTP/1.1 200 OK

HTTP : Success
Content-Type: text/plain

Connection: close

Content-Length: 0



HTTP : closing connection
SR04 : State 1
EVENT: Dist_139#Dist_V=1.00
RuleDebug Processing:rules1.txt
flags CMI parse output:
RuleDebug: 100: dist_139#dist_v=1.00 do

riker1
Normal user
Posts: 344
Joined: 26 Dec 2017, 18:02

Re: rule not triggering for distance SR04

#9 Post by riker1 » 23 Apr 2018, 18:52

solved it.

looks like it was caused by some blanks in the ruleset.!!!!!

Thanks for helping

wim16
Normal user
Posts: 88
Joined: 01 May 2017, 20:35

Re: rule not triggering for distance SR04 (solved)

#10 Post by wim16 » 23 Apr 2018, 19:27

Good!

Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 51 guests