trigger on GPIO or task, does it matter

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
GravityRZ
Normal user
Posts: 206
Joined: 23 Dec 2019, 21:24

trigger on GPIO or task, does it matter

#1 Post by GravityRZ » 14 Mar 2020, 14:18

in my current rules i trigger a task by monitoring a change of that task value.

does it make a difference to monitor a gpio pin instead and run a task, based on that change.

eg, is there a difference in responsetime, cpu overhead

i know when i want to monitor a gpio pin i need to add a monitor command at startup and i can imagine this takes extra cpu cycles
Also i can imagine that the GPIO status is totally unfiltered so jitter can occur were as using the plugin might avoid things
thanks

so in my case

Code: Select all

On Watermeter#Count do	
	if [Watermeter#Count] > 0 and [Watermeter#Time] > 2500
or

Code: Select all

On  GPIO#14=0 do					
	if [Watermeter#Time] > 2500

GravityRZ
Normal user
Posts: 206
Joined: 23 Dec 2019, 21:24

Re: trigger on GPIO or task, does it matter

#2 Post by GravityRZ » 17 Mar 2020, 19:56

i am testing this at the moment to see if it is more accurate when used with the generic pulsecounter.

The pulsecounter only triggers on an interval base.
When you set the interval to 1 second it is workable but then you can get to a situation that when the counter is triggered and the 1 second timer resets(because the timer does not start when triggered but has it's own schedule) the counter is triggered again thus causing an extra count

i currently have the rules triggered by GPIO.
this way it is instantly

downside might be that in case of jitter on the GPIO pin (proximity sensor is stuck in trigger mode) i might get multiple readings

so far so good

GravityRZ
Normal user
Posts: 206
Joined: 23 Dec 2019, 21:24

Re: trigger on GPIO or task, does it matter

#3 Post by GravityRZ » 19 Mar 2020, 18:18

tested it and it makes no difference. changd things back to use only the variables from the plugin to get a more consistent flow value

mr.gosh
New user
Posts: 1
Joined: 01 May 2021, 19:42

Re: trigger on GPIO or task, does it matter

#4 Post by mr.gosh » 01 May 2021, 19:54

Hi - I want exactly what you discribe.
My Reed-Contact is counting impulsed on the gas-meter.
But the impulse counter is pinned to fixed intervals:
pulse-counter.png
pulse-counter.png (113.52 KiB) Viewed 4579 times
But to have a better logging in my "volkszaehler" installation it would be better if the event would not be younted but directly transmitted to the database.

Could you explain how you submit the event directly to a generic http target? Or how I could deactivate the interval?

GravityRZ
Normal user
Posts: 206
Joined: 23 Dec 2019, 21:24

Re: trigger on GPIO or task, does it matter

#5 Post by GravityRZ » 05 May 2021, 20:23

just noticed this.

you can not disable the interval but i did set it to 1 second.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 33 guests