Trying to record motion events over time on a fuel stream using a motion sensor. I imagine its only setup to handle an integer value instead of a true or false. Is this correct, or can this be done?
Motion Sensor Fuel Stream
You can set it up, but I donât know what the graph would look like. I just went in1to one of my stream pistons to see if the motion option existed.
Itâs not elegant but you can have the motion trigger write a stream from anything. I use mine to send the temp from that sensor to a stream. Just a thought.
You canât write a string (active or inactive) to a fuel stream so you need to convert it to an integer (1 or 0):
.
.
Nice solution. Would be nice to be able to turn off the connecting lines. Makes it look strange haha.
You could put it on a timer if you wanted a consistent x-axis, too.
I havenât used fuel streams yet (in part because I havenât thought of a use for them)⌠what is your end-goal for the data from this one? How much data can a fuel stream contain?
Thanks for posting this. Iâm hoping to use this solution to graph a few other thermostat values that are not integer-based.
Here is how I did it for graphing when a window is open, but I am sure you could modify it for a motion sensor. I wanted perpendicular lines so the results would look like âbarsâ. (The thicker the bars, the longer the duration) The trick was to put one extra data point at each trigger. (The Fuel graph also shows sunrise and sunset in action) Feel free to delete the âSet Piston Tileâ lines if you donât want a tile for this piston.
I used 50 to signify that the window is open, and 0 to signify that it is closed. For the sun, I choose 100 for daytime, and 0 for night⌠but feel free to change those to whatever suits you.
I also have one for outside conditions which I kind of like:
(contains(wuCurrent,âSnowâ) ? â90â :
(contains(wuCurrent,âHailâ) ? â80â :
(contains(wuCurrent,âThunderstormâ) ? â70â :
(contains(wuCurrent,âRainâ) ? â60â :
(contains(wuCurrent,âDrizzleâ) ? â50â :
(contains(wuCurrent,âFogâ) ? â35â :
(contains(wuCurrent,âOvercastâ) ? â15â :
(contains(wuCurrent,âMostly Cloudyâ) ? â10â :
(contains(wuCurrent,âCloudâ) ? â5â : â0â)))))))))
but this one I do NOT use the extra data point, so my lines are angled
I find it interesting that you looked for a general trigger on the window contact then just checked the state of the sensor for open. Any particular reason you didnât use an open trigger? Interested for the purpose of streamlining my pistons.
There may be a more streamlined method⌠(please share if you have an example)
My logic was: depending on the windows contact, and whether it was opening or closing, I wanted a different data point for my fuel stream, and a different Tile on my dashboard⌠I guess I could have made one piston for when the window opens, and another when it closes, but I am already up to 91 pistons, so to me, this method was streamlined, LOL
Hi WCmore, do you mind to share this fuel streams code ?
pretty cool fuel streams btw !
HI @WCmore,
Iâm trying to figure out fuel streams by reading up - but your code snippet confuses me - the fuel stream appears to map Temp2\Outdoors and \ window open and \ SunUp onto the same graph - but the code only references \ window open, is this an extract of a larger Piston or does the fuel stream map from a number of separate pistons?
Also, what does the syntax âzz \ {name of stream}â mean - is zz a container for a number of fuel streams?
I cannot share the import code because I have a whole lot of stuff happening at sunrise and sunset, but here is the code I use to draw that Fuel Stream:
My Sunrise Piston:
My Sunset Piston:
Basically, any piston can write to any fuel stream at any time. Once you visit the Fuel Stream page, you can decide which data points to display in the graph.
Yes, zz is my testing container. I do this until I am totally happy with it (at least two weeks), and then I move it to the ârealâ container. I do this because fuel streams cannot be renamed or deleted once they have been created, so this way, my only container that is âclutteredâ with old outdated data is the âzzâ found at the very bottom.
Great - thanks, as Iâve not published any pistons which use them, Iâve not seen the behaviour. Will the functionality be updated or is it static? There doesnât seem to be much on the forums about fuel streams.