[RELEASE] Averaging Plus - Average just about anything. Trigger on High/Low/Delta/Average/Percent

Same as you did before. If you select high/low setpoints, the app works exactly like it did before. These fields have always existed, if you don't want to trigger any actions, simply don't put anything in them.

Hope this helps

Ah, I see. It's me, not you. LOL

Digging back up in this thread I see a previous note, where I specifically reference some debug messages talking about setpoints. I have no idea how I had it set before, and I'm clearly having a senior moment with the logic of the Setpoint implementation -- no matter, when my brain cells start operating, perhaps I can puzzle it out. For now, using 0 and 9999999 seem to work fine, and all is well.

S.

1 Like

I just ran into a sporadic issue with averaging, and I'm hoping someone can shed some light on what's going on.

I recently noticed that my average humidity will be way off and then correct itself after a bit. I looked at the individual humidity values in Hubitat, but they always report correctly. After enabling logging for the averaging app, I saw that sometimes one of my sensors would register almost zero:

Log Example 1

app:8432022-04-24 07:50:38.057 am debug - - - - - End Averaging (S) - - - - -
app:8432022-04-24 07:50:38.054 am debugIn averageHandler (S) - The average (24) is ABOVE the high setpoint (null)
app:8432022-04-24 07:50:38.052 am debugIn averageHandler (S) - highSetpoint: null - lowSetpoint: null
app:8432022-04-24 07:50:38.043 am debugIn averageHandler (S) - Sending theData: humidity:24.0
app:8432022-04-24 07:50:38.041 am debug------------------------------------------------
app:8432022-04-24 07:50:38.039 am debugIn averageHandler (S) - totalNum: 48.00000000001 - numOfDev: 2 - theAverage: 24.0
app:8432022-04-24 07:50:38.037 am debugIn averageHandler - working on EcobeeTherm: ecobee Thermostat - num: 1.0E-11
app:8432022-04-24 07:50:38.035 am infoIn getTimeDiff - EcobeeTherm: ecobee Thermostat - dur: 8 minutes, 35.032 seconds - days: 0 - hours: 0 - totalHours: 0
app:8432022-04-24 07:50:38.031 am debugIn getTimeDiff (1.2.9) - working on EcobeeTherm: ecobee Thermostat
app:8432022-04-24 07:50:38.029 am debugIn averageHandler - working on Lower Bathroom Multisensor - num: 48.0
app:8432022-04-24 07:50:38.026 am infoIn getTimeDiff - Lower Bathroom Multisensor - dur: 16 minutes, 24.024 seconds - days: 0 - hours: 0 - totalHours: 0
app:8432022-04-24 07:50:38.022 am debugIn getTimeDiff (1.2.9) - working on Lower Bathroom Multisensor
app:8432022-04-24 07:50:38.021 am debugIn averageHandler - Attribute: humidity
app:8432022-04-24 07:50:38.020 am debug - - - - - Start Averaging (S) - - - - -
app:8432022-04-24 07:50:38.019 am debugIn averageHandler (1.2.9)

My first thought was there's something wrong with the individual device (ecobee thermostat), but then I noticed it's not always that specific device causing it:

Log Example 2

app:8432022-04-24 08:13:38.057 am debug - - - - - End Averaging (S) - - - - -
app:8432022-04-24 08:13:38.054 am debugIn averageHandler (S) - The average (19) is ABOVE the high setpoint (null)
app:8432022-04-24 08:13:38.052 am debugIn averageHandler (S) - highSetpoint: null - lowSetpoint: null
app:8432022-04-24 08:13:38.043 am debugIn averageHandler (S) - Sending theData: humidity:19.0
app:8432022-04-24 08:13:38.042 am debug------------------------------------------------
app:8432022-04-24 08:13:38.039 am debugIn averageHandler (S) - totalNum: 38.00000000001 - numOfDev: 2 - theAverage: 19.0
app:8432022-04-24 08:13:38.038 am debugIn averageHandler - working on EcobeeTherm: ecobee Thermostat - num: 38.0
app:8432022-04-24 08:13:38.035 am infoIn getTimeDiff - EcobeeTherm: ecobee Thermostat - dur: 35.033 seconds - days: 0 - hours: 0 - totalHours: 0
app:8432022-04-24 08:13:38.031 am debugIn getTimeDiff (1.2.9) - working on EcobeeTherm: ecobee Thermostat
app:8432022-04-24 08:13:38.030 am debugIn averageHandler - working on Lower Bathroom Multisensor - num: 1.0E-11
app:8432022-04-24 08:13:38.027 am infoIn getTimeDiff - Lower Bathroom Multisensor - dur: 1 minutes, 59.024 seconds - days: 0 - hours: 0 - totalHours: 0
app:8432022-04-24 08:13:38.022 am debugIn getTimeDiff (1.2.9) - working on Lower Bathroom Multisensor
app:8432022-04-24 08:13:38.021 am debugIn averageHandler - Attribute: humidity
app:8432022-04-24 08:13:38.020 am debug - - - - - Start Averaging (S) - - - - -
app:8432022-04-24 08:13:38.018 am debugIn averageHandler (1.2.9)

Regardless, going into the individual devices never show anything out of the ordinary; always in the 35-50 range, never '1.0E-11'. Any thoughts on what's causing this? It happens randomly, but seems like it has started happening more often over the last week or so.

-Also-

Is there any chance that averages can be updated when the individual devices update the field in real-time, instead of every x minutes? For example, I have an automation for our bathroom fans based on humidity...I have set the update interval to 1 minute (needs to be very responsive), but it seems wasteful to run the averaging app every single minute all day long when the humidity doesn't change for 90% of the day.

Thanks!

How do I use output of the virtual device in the condition?
Here is virtual device that was created:


it has bunch of variables like todayHigh etc.
But when I use this virtual device in the condition, it always shows null?
image
Can someone clarify how to use output of virtual averaging device as a condition (for example average temperature)?

I assume you're trying to use this in Rule Machine?? I don't use RM so it would probably be best to start a new thread in the RM category.

Ask how to use an attribute of a virtual device as a condition or something like that. :man_shrugging:

Thanks

yes, that's right, I need to use output of virtual device in the Rule Machine... quick search shows what you suggesting is not possible in RM Hub/device variables in rule machine?

What's the point of this app if I can't use it in RM, generally what I want is to calculate average temp and then if this is above threshold, set Hub variable to true so I drive bunch of logic in many RM rules, so may be approach is differently, how to set Hub Variable from Averaging Plus app?

It is possible; I use the data from the virtual devices in a number of Rule Machine rules (your link is referencing variables of the hub itself, not of devices controlled by the hub).

First off, are you trying to average multiple real sensors to average them out, or are you trying to take a "running average" of one sensor over a period of time?

If it's the former, that virtual sensor created in the Averaging Plus app should have a populated 'temperature' value, and it should be available in RM.

If it's the latter, that might be why it's coming back as null. In this case, instead of using a capability of 'temperature' in RM, you'd want to use a capability of 'custom attribute' and select the specific attribute in the virtual sensor to use/compare against.

Hopefully that all makes sense; feel free to reach out if you have more questions on how I use it!

1 Like

Thanks @quinnjudge "Custom Variable" worked perfectly

1 Like

Noticing something weird going on averaging humidity for the house. Right now it's averaging these 4 devices. All 4 are Zooz 4-in-1 motion sensors. The two on the C5 are the older 500 series and the other two are the newer 700 series.

image

Here are the current values for each device

image
image
image
image

Without doing the math and just eyeballing the numbers, you can see the average should be about 52%ish. But the virtual device is reporting 64.5 which is higher than any single reading.

image

Looks like its dividing by 3 something instead of 4.

Please post a screenshot of the debug log.

Well, I see the problem. It's not actually giving me a new average.

New version...

1.3.1 - 05/29/22 - Fixed timeBetween

Hi @bptworld
First of all thanks for all the apps you release. Do you ever sleep? :wink:

Just a quick question. I've noticed that if I try to use the HE settings -> Swap Apps Device, the Average Device does not actually show up in the list.
It's really no big deal but I would have thought it should appear there.
Just wondering really. :man_shrugging:
Thanks again.

1 Like

Child devices aren’t eligible to be used with the Swap Devices app - too many possible issues.

2 Likes

Ah-ha....... that explains it then. Thanks again. :+1:

Downloaded the update.

It does seem to calculate the average correctly, but then I guess has an issue setting it or something. Still shows 64.5 on the dashboard.

New version...

1.3.2 - 05/31/22 - Fixed issue with state.lastValue

When I check in HPM I don't see a new version.

Nope, as stated in the first post...