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

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Zodiac69
Normal user
Posts: 85
Joined: 13 Jun 2016, 17:20

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

#1 Post by Zodiac69 » 14 Aug 2022, 14:15

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?
Last edited by Zodiac69 on 14 Aug 2022, 15:58, edited 1 time in total.

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

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

#2 Post by Ath » 14 Aug 2022, 15:36

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
/Ton (PayPal.me)

Zodiac69
Normal user
Posts: 85
Joined: 13 Jun 2016, 17:20

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

#3 Post by Zodiac69 » 14 Aug 2022, 15:57

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.

Zodiac69
Normal user
Posts: 85
Joined: 13 Jun 2016, 17:20

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

#4 Post by Zodiac69 » 20 Aug 2022, 11:49

Hi Ath

Just a FYI

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

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

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

#5 Post by Ath » 20 Aug 2022, 11:54

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 ;)
/Ton (PayPal.me)

Post Reply

Who is online

Users browsing this forum: No registered users and 27 guests