I have a Xiaomi light sensor in my den. I’d like to calculate recent 30 minutes sensor data to tell my window shades if they should lower. The history graph shows a nice display. Node Red has a “statistics” node, which I can’t find any examples of how to use. Is there a simple way to retrieve sensor data and give me a msg.payload result?
I’ll answer my own question. The answer is the “smooth” node function. It will take a specified series of data and average it. You don’t need the “statistics” node which is impossible for me to figure out with unclear documentation.
Hello @starmanj , read your quite old topic and your answer. This makes sense to me. I currently search a way to check the average light level in the garage to see if I have forgotten to switch off the light.
I use a trigger to call a GET HISTORY node with the data for 30 minutes. I let it output as Split. But with the smooth-node I do not get an average result. Can you please let me know how you did that?
The debug node only lists all history states.
The Get History Node:
The Smooth-Node:
Would be good to know what I am doing wrong.
regards
TurboKanne
Looks okay to me. Mine is setup the same way. Are you sure you are feeding it data? I have my smoothed data feed a web graph to monitor trend. See below:
Smoothed data graph looks like this:
Took me a LONG time to figure all this out!
BTW there is a brand new built-in card called “Statistics Graph Card” which looks like it will calculate mean. But it’s not node-red.