Multiple on/off statuses in one plot

Posted on
Wed Dec 14, 2016 12:05 pm
Tsjompie offline
Posts: 15
Joined: Nov 04, 2016

Multiple on/off statuses in one plot

LS,

I'd like to plot multiple motion detectors in one graph.
Reason for that is to allow me to image on the movement in the house, determining whether someone is there. Eventually a variable is set "HouseInUse", based on the different motion sensors.

Plotting those as 0 or 1 implies any of the detected motions is shown on the y-axis, though multiple variables are written on the 0 or 1 scale. X-axis in time.
When no motion is detected all variables are plotted on the 0 value of the scale.

I assume using the multiplier per variable allows me to plot (for example) a 2, 3 or 4 on the y axis.
However, using that setup, when no motion is detected all the variable are still plotted on 0, making the graph impossible to interpret. All *, ^, + are on the same line, making it impossible to distinct.

I thought about a solution to cover this is to add 1 per motion detector, so the first one +0, the second one +1, the third +3, etcetera.
This would allow me identify which variable (motion) is on or off during a specific time span.

As far as I understand there is only the option to multiple, which will be useful for the ON state, though Off is still plotted on the 0 line. All motion detector plotting on 0 again makes the interpretation of the graph impossible.

Is there another way covering this?

Thanks for the input,


Tsjompie

Posted on
Wed Dec 14, 2016 2:01 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Multiple on/off statuses in one plot

One way : Mult=-1 add 1


Sent from my iPhone using Tapatalk

Posted on
Wed Dec 14, 2016 2:02 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Multiple on/off statuses in one plot

Mult=-2. Add 2
Etc


Sent from my iPhone using Tapatalk

Posted on
Thu Dec 15, 2016 6:42 am
Tsjompie offline
Posts: 15
Joined: Nov 04, 2016

Re: Multiple on/off statuses in one plot

Thank you :lol:

Started the config

Posted on
Thu Dec 15, 2016 6:52 am
johnpolasek offline
Posts: 911
Joined: Aug 05, 2011
Location: Aggieland, Texas

Re: Multiple on/off statuses in one plot

I use event based plotting with a different multiplier for each device. Here is a plot of the last 24 hours showing when the driveway alert triggered (0.75), when my 3 motion sensors ((0.8, 0.85, 0.9) and when each of the 4 door open switches (1.0, 1.25, 1.5, and 1.75) occurred. The green line plotted against the right axis is the count of "family" Pi Beacons present listed as straight data. The only thing that I need to edit is to change the color of the Guest Motion to something a bit more distinctive from the Front Door...
Attachments
Occupation Plot.png
Occupation Plot.png (58.48 KiB) Viewed 3995 times

Posted on
Thu Dec 15, 2016 10:14 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Multiple on/off statuses in one plot

Plotting those as 0 or 1 implies any of the detected motions is shown on the y-axis, though multiple variables are written on the 0 or 1 scale. X-axis in time.
When no motion is detected all variables are plotted on the 0 value of the scale.

I assume using the multiplier per variable allows me to plot (for example) a 2, 3 or 4 on the y axis.
However, using that setup, when no motion is detected all the variable are still plotted on 0, making the graph impossible to interpret. All *, ^, + are on the same line, making it impossible to distinct.


Tsjompie sorry misread your equation. I though you like to show the OFF state.

John shows an example how to show on/off (really nice plot)..
(((BYTW John, you could suppress the left y axis numbers as they do not add value: set tick marks to >>" "0<< would show a space at 0 the x-axis -- syntax:
"stringToShow"at posY,"stringToShow"at posY,"stringToShow"at posY,"stringToShow"at posY,
"abc"1,"123"5,"xxx",7
would show abc at Y=1; 123 at Y=5 and xxx at Y=7)))



In general to show x on/off lines and to remove the dots at 0:
mult= 1,2,3,4,5,6,7,8,..
offset = -0.01
yrange= 0:10 ( will not show anything < 0)

would put the ON states on 1,2,3,4,5,6,7,8 and OFF at -0.0001 (< 0!!)
and should not show the of states on the x axis as they are outside the plot are.


if you want to plot ONLY the OFF states do:
mult = -1,-2,-3,-4...
offset 0.9999,1.999,2.9999,3.9999
that would multiply the values with -1 and add 0.999 results in values 0/1 => 0.9999/-0.00001 = OFF at 0.9999 ON at -0.0001 and similar for 2,3,4

Karl

Posted on
Fri Dec 23, 2016 5:49 am
Tsjompie offline
Posts: 15
Joined: Nov 04, 2016

Re: Multiple on/off statuses in one plot

Hi Guys,

Just ran into your replies, for which I'd like to thank you.
In particular as that shows me how to solve the histogram view at the bottom of the plot.

At the moment the plot I use now serves the insight I was looking for, though with your input I'll change the way those histograms look like now.

Thanks for your support, enjoy your x-mas days.


Tsjompie


PS:
- the multi motion sensor is close to the dog basket
- the histogram data is based on the SmartPhone radar plugin
Attachments
MotionOverview.png
MotionOverview.png (87.18 KiB) Viewed 3872 times

Posted on
Sat Dec 24, 2016 3:32 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Multiple on/off statuses in one plot

You could get rid of the line keys by putting their label on the y axis with the trick set tick marks.


Sent from my iPhone using Tapatalk

Posted on
Mon Dec 26, 2016 9:45 am
Tsjompie offline
Posts: 15
Joined: Nov 04, 2016

Re: Multiple on/off statuses in one plot

Merry X-mas Karl (and any other reading this :D ),

I tried to change those tickmarks (as that would show way better), though I seem to have a config set incorrect.
See the attached images for the string configuration and the graph.

Using quotes ("test","value","third,sensor","register","zes", "zeven", "acht", "negen", "ten", "eleven", "twelve") results in a error message in left corner of the plat stating: string incorrect.
Doing the same, ending with (e.g.) 10, 11 and 12 (integers) they show; the text ticks won't.

It would be great you help me out with this ;)


Thanks (again),


Tsjompie
Attachments
ScaleView.png
ScaleView.png (147.43 KiB) Viewed 3788 times
ScaleTickMarks.png
ScaleTickMarks.png (60.38 KiB) Viewed 3788 times

Posted on
Mon Dec 26, 2016 10:50 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Multiple on/off statuses in one plot

It is "label"position,"label"position ...
And position is a number.
So for your example something like:
"Test"1,"sensor"2,"register"3 .....

That would put Test on y=1 ; sensor on y=2 ....




Sent from my iPhone using Tapatalk

Posted on
Tue Dec 27, 2016 7:13 am
johnpolasek offline
Posts: 911
Joined: Aug 05, 2011
Location: Aggieland, Texas

Re: Multiple on/off statuses in one plot

And I can verify that it does work; my latest incarnation of the daily presence plot, which makes a lot more sense than the 0.5, 0.6, 0.7... etc that I had.
Attachments
PresencePlot.png
PresencePlot.png (62.74 KiB) Viewed 3737 times

Posted on
Tue Dec 27, 2016 8:50 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Multiple on/off statuses in one plot

And you can switch off the line keys :
Delete the text of the line key field for each line.


Sent from my iPhone using Tapatalk

Posted on
Wed Dec 28, 2016 4:32 am
Tsjompie offline
Posts: 15
Joined: Nov 04, 2016

Re: Multiple on/off statuses in one plot

Thanks guys, for sharing this :)

Attached the plots I created, covering my needs.
E.g. setting the HouseInUse variable using triggers on the motion sensors.
(see plotmotion-minute-s1)

Other good example is:
I use (besides the default "isdaylight") also an "IsDark" variable. Very cloudy, not sunny, weather impacts the wish to enable lights. The graph showing that behavior is embedded as Luminance-minute-S2

Finally, the last plot shows the temperatures, combined with the setting (setpoints) of the Nest thermostats. This one still to be combined with the presence variable, for now only plotted in the motionplot. Once sure that behaves correctly I'll set the heating based on whether people are at home or not.

Again,
I'm very happy with this functionality as it doesn't only allow me to look at the behavior, but also to debug any incorrect set trigger to change variables.
Hoping you enjoy the configurations as much as i do.


Tsjompie
Attachments
Temps-minute-S1.png
Temperatures and SetPoints of Nest
Temps-minute-S1.png (49.69 KiB) Viewed 3666 times
Luminance-minute-S2.png
Luminance and Dark/Daylight
Luminance-minute-S2.png (92.71 KiB) Viewed 3666 times
PlotMotion-minute-S1.png
Motion plot including presence variable
PlotMotion-minute-S1.png (38.94 KiB) Viewed 3666 times

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests