Calculate average to make Scene Decision


My question is; how could I calculate the average Lux (from a Multisensor6) over a period of time?

My goal is to turn on a set of accent lights early on a cloudy day, and conversely later on a bright sunny day.

I have datamine2 up and running but don’t have a method of performing calculations on the collected data. Perhaps it it beyond the capabilities of my VeraPlus but I would like to try before looking into another route.

Any suggestions would be appreciated.


If you don’t want the hassle of storing a history of previous data in order to calculate a running average, then a simple recursive filter (exponential average) is trivial to implement… even on Vera!

average = average + (new - average) * alpha

Alpha is a constant less than 1. The smaller it is, the more smoothing.

Would be easy to put into a scheduled scene, read the current value, and write an updated average.

Thanks for the direction! I was somehow stuck on using datamine, but of course it is not needed for this.