Based on some recent discussions, I decided to try my hand at forecasting energy usage based on the output of my Sense. Time series forecasting is hot topic in the machine learning world, where past behavior is analyzed to predict future behavior. There are many different techniques that can be applied, but the real trick is matching the technique or model, to the actual behaviors(s) to get a prediction or forecast that is reasonably accurate and doesn’t get out of control (divergence). I’ll talk in technical terms in a later post, but first wanted to share some results to build familiarity to what a forecast looks like.

The way it works is that you capture some data with in a datestamp (ds) / value (y) format for a number of periods that give a good lookback on your usage. The good news is that you can get this directly out of Sense export. With a little filtering, one can pull just the hourly export for “Total Usage” and the timestamp. After that, one can create a model of the existing data. There are many different mathematical techniques for creating a model, but the one I’m going to use first is Prophet, which comes from Facebook via open source. Prophet an additive component model, which means it breaks the historic data down into cyclic components (days, weekdays, months, years) and attempts to size the components to fit the incoming data. Finally one can feed the historic data into the model, then forecast out some period of time using the model.

Here’s the results of using my hourly Sense data with Prophet, looking back to the stat of 2021 and forecasting my Total Usage 300 hours (12.5 days) ahead. The black dots represent my actual hourly usage, the blue line is the forecast/fit line and the light blue shaded area represents the confidence band (80% is the default) for the forecast. You’ll also notice that a large number of 10kWh and above data points don’t live within in the confidence. Those are mostly car charging events that don’t occur on a fully cyclical basis (usually the same period in time of day, but randomly). That’s a downside of an approach that relies too much on cyclicality, but Prophet has ways of dealing with event, like these, but I haven’t tried that yet.

Here’s a view inside the components of model. The forecasted value for each hour is the hourly component, plus day of week component, plus the trend component for that point in time. To some degree, car charging dominates the cyclical components even though there isn’t complete cyclicality. You can see the 1AM bump and the Wed/Sat bump from EV charging.