Average and count

Posted on
Fri Feb 16, 2018 12:52 pm
DomoPat offline
User avatar
Posts: 180
Joined: Jul 17, 2010
Location: Toulouse, France

Average and count

I am trying to have a graph with a count of the times a door or the gate gets opened. Both variables are using "Yes" and "No" as values. But it does not seem to work, so help me understand, when I add a variable and select:
- average will calculate the average values of the variable on the sample period of one minute for the minute graph or one hour for the hour graph if I am correct. In my case it would count the "Yes" states as 1 and the "No" sates as 0, so if the door opens and closes in a one minute period the average would be 0.5 ? not what I would use in my case but I trying to make sure I understand correctly.
- count: does it count each change or only the "Yes" ? is it a count per period of one minute for the minute graph and one hour for the hour graph ?
- what about Max and Min: in my case, it would always be 1 for Max and 0 for Min ? it would be a good choice to show if a door has been opened during the minute or hour ?
- I don't understand the "Events UP", "Events Down" and "Events Change" choice, as I don't see the effects on the graphs. What is a typical use for these ?

And thank you for the great plugin, seeing the data in a graphical way is really useful !

Posted on
Fri Feb 16, 2018 4:50 pm
kw123 offline
User avatar
Posts: 5726
Joined: May 12, 2013
Location: Dallas, TX

Re: Average and count

The normal average/ count .. is 5 tests per 5 minute interval (1 every minute at ~ 58 secs)
ie:
for average: add to average whatever the value is at x minutes and 58 secs 5 times in a row (0:58;1:58;2:58;3:58;4:58) then divide by 5
for count: if >0 add 1
for min / max if value > < take that value
sum: add values
etc

You would need to use events which only looks at changes or single entries

So 10 "yes" in 5 minutes would create 10 events but they do not add up. Just single events value = 1. Have to think about how to add this. Should be doable.
Events are for rare events like door was opened .. mail was delivered. With these you can show at exactly at which second the door was the opened. Or was closed or both (dow --> up; up--> down or both = changed
Karl


Sent from my iPhone using Tapatalk

Posted on
Fri Feb 16, 2018 5:23 pm
kw123 offline
User avatar
Posts: 5726
Joined: May 12, 2013
Location: Dallas, TX

Re: Average and count

looking at the code.. adding for matplot would take about 3 hours.. I am out until feb 26 .. will look at it them.

for gnu plot I have to check a bit more

Karl

Posted on
Fri Feb 16, 2018 11:09 pm
kw123 offline
User avatar
Posts: 5726
Joined: May 12, 2013
Location: Dallas, TX

Re: Average and count

Actually was not that difficult. Tying to do this remotely. But it looks good

Should be able to post something tomorrow.


Sent from my iPhone using Tapatalk

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest