Averaging

toDouble is a conversion to a double precision floating point number...

"floats are rounded (to nearest) to 24 significant bits; doubles are rounded to 53"

just a more accurate representation of a number that can't be represented. :smiley:

You're telling the hub to do the division, with a maximum accuracy, THEN blow off the accuracy by rounding down to one decimal place. :slight_smile: Works perfectly and sacrificing all of those bits to the bit bucket is not going to harm your Karma at all. :smiley:

1 Like

Haha, in my defence, I initially tried to do it without the toDouble, but got errors. Thanks for the lesson.

Now.. if you make the final bit ... (1) into a variable and add an additional input.. you can select how many digits to display... :slight_smile:

4 Likes

A bit like in an app that used to exist called AverageEverything or something similar.

Can't remember who wrote it but I take all the credit :wink::grinning::grinning:

1 Like

Any chance if someone gets bored :wink: That one of these apps could be created for averaging Humidity?

Here you go:

2 Likes

Thanks Bruce, that was fast!

Do you have to assign a rule for it to keep updating, or is it dynamic on it's own? Meaning, as the temps change it automatically changes the device?

The temp changes every time one of the sensors in your list of sensors updates it temp reading.

2 Likes

There is now an Illuminance average app in our public repo:

5 Likes

Silly question.

Do you think it’s possible any of these apps could slow down the hub motion sensors lights?

Haven't noticed any slow downs, and I've been using these apps since the day they were created.

No, these would not slow anything down.

Mine sped up.

1 Like

Any chance we could get a version for "Relative Humidity" too?

It's up already up in the above post. Averaging

Oops, thanks!

Question... why would you prefer this method versus just having the average calculated immediately any time any sensor’s value changes? :thinking:

Most sensors send a report on an interval already. Everytime a report comes in from a selected sensor, it updates the average. Thus the options on the sensor device set the interval. Typically settings for rapid change reports and interval reports are offered. Send a report every 5 mins OR If the LUX changes by 20%... that kinda thing. :slight_smile:

They say that full bright sun is >10,000 lux. My Aeon Multisensor6 that is outside facing my front door/walkway is currently "looking" at shade and is reporting 1065 LUX. Luxurant is calculating 8455 LUX due to virtually no cloud cover on a 15 min interval.

In other words shifts of 3 & 10 might just be noise.