The Elusive 'Always On' Calculation

Many Sense users muse over what the Always On value really means and how it is calculated. I have seen suggestions on this forum that it is some kind of rolling average or rolling minimum over the past 48 hours. The near-exact definition can be found here:

Always On is a calculation of the lowest power of each of your mains, added together, where “lowest” refers to the 1% bin of the observed wattage histogram over the previous 24-48 hour period. It is updated every half second, though most users will not see significant real-time changes given the 48 hour lookback window.

But what does that really mean ? Thanks to Home Assistant, I have been able to pull 1 minute samples of Sense data, so I can try to duplicate the calculation. So I’m going to start with the results first, then show how the calculation was done and finally cover the caveats that make my calculation different.

Here’s a view of the one minute samples of Total Consumption for the past 4 days in red. Not quite the 1/2 second rolling usage visible in power meter, but close enough for now. The blue is my duplicated Always On calculation. You will note that the Always On is zero until 48 hours worth of data is “filled” -that’s because results of the calculation used (a statistical binning) is invalid until an entire 48 hours is available.

If I zoom in, I can get a better visual feel for the relationship between the Total Usage minimums and the Always On calculation. Definitely not an average or the absolute minimum. Also remember that the blue is based the samples for the 48 hours previous.

If I look at the Sense number for today, I can see that my April 1st number is in the same ballpark, around 400W.

Below are a couple of snapshots of the “calculation” for the 48 hours prior to 3/31 and 4/1. Each 48 hour window consists of 2880 one minute samples. The 1% bin is the 29th smallest sample of all those samples. The red line shows 1% bin line in the distribution. Techies out there will immediately recognize that we are NOT dealing with a simple Gaussian or normal distribution here, so the only way to compute a 1% bin is the discrete method that Sense uses.

So it seems I have a nearly working calculation. I say nearly, because the Sense number, at 410W right now, is a little lower than the 448W that my calculation is coming up with. Then again there are two big differences due to my limited data access:

  • Sense use 1/2 second samples, so they are using 172,800 samples over 48 hours vs. 2,880.
  • Sense also splits the 1% bin calculation across both legs (L1, L2) of the mains - they add the 1% bins for each leg.

Both of those differences are likely to lead to a lower result than mine, so I’m pretty confident I’m emulating the Sense calculation to the best of my ability.

ps: As I collect more data, I’ll update these graphs.

3 Likes

Here’s an update that gives a little more insight into Always On behavior. The top is
a weeks worth of Always On (blue) in the context of Total Usage (red). The bottom is a zoomed in view of the same.

Any time Total Usage drops below Always On, Always On gets dragged lower, while when the minimum Total Usage stays above Always On, Always On gradually increases, as some of the past minimums move out of the history window.

And here’s a more recent distribution in the 48 hour Always On window:

One more update, with a little more insight. In addition to the 1% bin function (in blue), I have added the similar 48 hour results for the the min function (in green) and the mean/average (in purple). As you can see in the full-sized plot below, the average for 24 hours is far larger than the Always On (1% bin) and the min.

If I zoom way in, you can see that the 1% bin and min results are similar, but the 1% smooths things out a bit more.

2 Likes

Kevin, your explanation of Always On is clear and the data you get from Home Assistant has confirmed your understanding. I hate to be contrarian, but applying this definition isn’t working for me. At least, not lately. About a month ago I started noticing that the Always On values no longer match the understanding you describe. Before that, they did match.

Since I don’t have Home Assistant (yet, although maybe someday!), the way that I check the calculation is to use the Power Monitor view and zoom out so 48 hours show. Here is a screen shot of how that looked at the start of this weekend.


I look across the bottom of the figure for minimum values. In this case, the red rectangle marks the spot that looks lowest at coarse resolution. Then I pinch to zoom into this area. The following shows the area in the red rectangle, but enlarged to fill the screen.

The vertical line on the right side is a “cursor” that shows the time which corresponds to the text value in the top corner. This minimum lasted more or less 15 minutes, so should have been enough to make the 1% bin end up being about 215 watts. That is not what displays on bubble view or in the Always On tile, both of which report closer to 100 watts. I forgot to screen capture that, so used hourly data export and Excel to create the following graph.

I placed a red line at 7AM on Saturday morning, which is the time that corresponds to the 48-hour lookback window shown above. Data export reports 0.117 kW at this time, which is equal to 117 watts. This is only 60% of what my visual estimate gives. Granted, my visual estimates are not as precise as Home Assistant, but I shouldn’t be off by that much!

So the questions for the community are:

  1. Do you see anything wrong with my rudimentary technique for estimating Always On, which might explain the discrepancy?
  2. If not, what else might explain it?

I will share my theory for the second question, as a way to get discussion started. Feel free to tweak my theory, or to suggest something else entirely. Based on what I know about my house, I believe that Sense must be subtracting known device(s) that were on at the period when Always On should have reset. For example, say it knew that my Fridge was using about 100 W at the time (KP115 told it so), so it took the “raw” Always On as Kevin describes above, and reduced it to 117 watts to represent stuff that actually never cycles off. It knows that my Fridge does cycle off, even though it happened to be on when the 1% bin calculation was lowest.

I am aware that my theory described above does not match what Sense claims to do. I am actually happy that the value they report discounts my Fridge (in this example) and reports only the devices that really are Always On. I just wonder if other people experience this.

In my mind, you are thinking about this the right way, but there is probably more beneath the surface of that Sense Power Meter that might be affecting Always On.

You convinced me to plot my Home Assistant-based calculation (HA_AO) side-by-side with the actual exported Sense Always On. I had been hesitant to do that because each have such different origins. HA_AO is based on a rolling calculation of 2 minute samples of power from Sense. I believe the Sense exported hourly data represents energy usage aggregated over an hour, so it comes out looking like an average of 1/2 second Always On energy over that hour. But here’s an overview of those two compared and a more detailed view, with the Total Usage (from HA) removed.

My HA_AO calculation tracks the hourly Always On reasonably well, though it stays above the Sense hourly number by 20-60W. Hmmm. Not as big as your divergence @jefflayman, but certainly raises the question of what I’m missing.

There’s also the matter of the sporadic downward spikes in Sense hourly data. Those are a really strange phenomenon, since the 1 hour dips imply that some new low Sense Total Usage readings enter the calculation during the hour, then some past low readings fall out of the 48 hour window an hour later, in just the right numbers and magnitudes to restore the exact same 1% bin - highly unlikely.

If I look into some of the biggest dips, I see that a relatively large % occur during the midnight hour PST (3AM eastern), when Sense typically does firmware upgrades. Here’s one of those hours in both the web app and the iOS app. The web app make a short dropout in Sense service around 12:15AM more visible. I suspect that the May14th Always On dip was caused by that brief interruption in Sense monitor operation.

If I compare against the large one-sided drop (not a dip and resume) on May 6th at 3AM, that one looks perfectly normal.

I’m going to need to look more closely at all of the dips to see what’s going on with them, since there is more there than meets the eye. It looks like you might have one, @jefflayman, at 4AM just prior to your red line.

Here’s a view of the true dips (orange) vs the one-sided drop example (blue). Delta and Delta2 are the deltas between the current hour and the next hour, and between the next hour and the hour after that. So a negative value at 23:00:00 means that the dip happened during the midnight hour.

1 Like

@jefflayman, one more factor in the Sense definition could also make a big downside difference in the Sense Always On calculation - “ Always On is a calculation of the lowest power of each of your mains,…” So Sense looks at the 1% bin of each of your mains separately, something we can’t really see today. If your lowest usage on each main happens at different time, then you could easily see the difference you are seeing.

1 Like

Kevin, I think you have the explanation with that concept, especially if the 1% bin need not happen in each leg at the same time. Thank you for your input!

This tempts me to post a feature request. I wonder if the Always On tile could be updated to display the separate components in each leg. That might help people isolate the source of vampire energy usage. It would also have given me a clue to the results I posted above. However, I think there is already a feature request for labeling the leg of each device on its respective tile. Since AO is on both legs, then this idea may actually fall under that feature request. Now I just have to dig through all the feature requests so I can add a :heart: to the right one.

1 Like

Here’s the main Wishlist item for tracking power usage by leg / phase:

Thank you, Kevin! I hadn’t found that one, so this really helps. You know all the answers!

@jefflayman For the SENSE team to see your vote, go to the original (first) post in the ‘Product Wish List’ thread -

and click “like” (heart) on the initial posting. That adds your vote to a request.

You can sort ‘threads’ by latest, likes, number of views, etc. Using the sort procedure allows you to see what most people are commenting on and what they prefer to have changed or modified.

2 Likes