Page 1 of 1

(Resolved) Rule not triggering - "on GPIO#04 do"

Posted: 14 Aug 2022, 14:15
by Zodiac69
Hi All
Have a strange one and i presume i am doing something wrong here.

Rule 1 - This is working as i can see the event in the log file - EVENT: GPIO#4=0, EVENT: GPIO#4=1
on System#Boot do
Monitor GPIO,04
endon

Rule 2 - This rule is not triggering even though i see the GPIO=0 event in the logs
on GPIO#04=0 do
Let,2,0 // Set Var 2 to zero
Let,2,([var#2]+1) // add 1 pulse to Var 2
Let,2,([Var#2]/1000) // Divide by 1000 - 1000 pulses per kWh
Let,1,([var#1]-[var#2]) // Subtract Var 2 from Var 1 - Var 1 is kWh from WEB interface
endon

Any idea what i am doing wrong?

Re: Rule not triggering - "on GPIO#04 do"

Posted: 14 Aug 2022, 15:36
by Ath
Zodiac69 wrote: 14 Aug 2022, 14:15 on System#Boot do
Monitor GPIO,04
endon
Here the numeric value 04 is parsed to 4, so the monitor is installed
Zodiac69 wrote: 14 Aug 2022, 14:15 Rule 2 - This rule is not triggering even though i see the GPIO=0 event in the logs
on GPIO#04=0 do
Here, the generated event (GPIO#4=0) and the rule (GPIO#04) don't match. (Anything from the = and further is left out of the rule-match process)

And then there is also this reported issue: #4198

Re: Rule not triggering - "on GPIO#04 do"

Posted: 14 Aug 2022, 15:57
by Zodiac69
Hi Ath

Thank you.
I presumed that "on GPIO#04=0 do" must be the same format as "Monitor GPIO,04" with leading zero.
Changed "on GPIO#04=0 do" to "on GPIO#4=0 do" and it is now working.

Re: (Resolved) Rule not triggering - "on GPIO#04 do"

Posted: 20 Aug 2022, 11:49
by Zodiac69
Hi Ath

Just a FYI

This was the 1st time i used a GPIO that is lower than GPIO10.

Re: (Resolved) Rule not triggering - "on GPIO#04 do"

Posted: 20 Aug 2022, 11:54
by Ath
Zodiac69 wrote: 20 Aug 2022, 11:49 This was the 1st time i used a GPIO that is lower than GPIO10.
:lol:

Then you haven't used an ESP01 unit, as that exposes only GPIO 0 to GPIO 3 ;)