Averaging

Ha!

What is the attribute you want to sum? And for how long? With some way to set to zero again?

Energy meter. I will be using it as an accumlation of all energy meters for a monthly total.

It doesn't necessarily have to zero itself, I already use RM to do this on the other energy meters on a specific day each month.

Please show me a screenshot of one such device, right side of the page where it shows state.

Here's one
energy
Here's another
ernergy1

Do you want 'energy' summed?

The app would start adding these up... But then what? I'm missing how you want this to work. Put that value in a virtual EnergyMeter device?

I have no experience with these devices to have a clue what you want. Does the device report an energy value from time to time, and just add those to a running sum?

Yes exactly the energy reading of multiple devices summed into a virtual device that shows the accumulation of all of them combined.

Yes depending on the driver you can select on how often it reports, some I have set for every two hours, Some every 6 hours. It shows my monthly Kilowatt usage of what is plugged into it.

I have one of them on every higher energy usage item, like televisions, refrigerators, freezers, furnace blowers, internet modems, POE cameras, etc.

1 Like

Perfect! Works like a charm. Thank you so much!

1 Like

I don't know if that's what you want or not. Whenever there is an energy report, it adds all of the selected energyMeter devices and stuff that value into the created 'omni sensor' device as its energy value.

If you want instead for it to just add the most recent report to the existing sum, then replace the third to last line with this:

def sum = energysum.currentEnergy + evt.value.toInteger()

In other words, do you want a current sum, or an accumulating sum?

1 Like

Will that sum change whenever a single device adds to it's total automatically, or will a new report need to be ran?

I don't know how these devices work. This app's handler() method will run on each energy report. Is that reported value itself an accumulated value, or is it a new value? If each device is doing its own accumulation then you want the original version. If each device is making a new report and you want to accumulate, then use the replacement line.

I have to run out.... Play with it. It's easy to change how it works -- hopefully obvious with the two examples above.

1 Like

Each device does their own accumulation, and when more power is added. Say for example my fridge has used 5.30 kwh so far, the next time it cycles the device will report 5.40 now.

Right on, thanks again

1 Like

Could we get one for min/max of a group of (temperature) sensors too please :smiley:?

You can't get both in one sensor, since each temperature sensor has only a single temperature attribute to set. So the app would have to create two devices, one for min and one for max.

1 Like

awesome - thanks!

Awesome, thank you!

Hi @bravenel, could it be possible to add a mechanism like a switch to pause/resume the averaging function on command. I have various iterations of temperature averaging for the purpose of swapping avg values to Thermostat Controller depending of time of day or desired rooms to be monitored. I have over 7 simultaneous iterations running at the same time and I have been noticing that since then, is taking a toll on the hub's response time. Thank you.