Stacked power plot for Always-on, ID's appliances, and other?

Wow, I didn’t realize that some folks were getting so many plugs. Point taken. I just got my first HS110 yesterday, so maybe I’ll get in your league in a few months.

But yes, showing the top 10 or something like that (top 7? Depends how crowded the graphs get) would be extremely useful. So show 10 individual devices, other-identified, other-unidentified, and always-on, all stacked.

2 Likes

I like your designations… I’ll try to prototype using exported data, either today or tomorrow.

ps: I had a half dozen HS110s prior to the integration. Throw in a couple of HS300s at 6 devices per pop and a few more HS110s and you are at 25 pretty quickly.

4 Likes

Do the HS300s monitor the devices in each outlet separately? Or only the total power from all devices on the strip?

1 Like

Each outlet is a separate device in both Kasa and Sense-land. My only advice is that there isn’t that great an ROI to to replace an outlet strip connected to an HS110 with an HS300 if you have mostly networking stuff on the strip. All the networking equipment (router/switch/access point/base station/bridges) have very flat power utilization. Better to treat them all as one “virtual device”.

4 Likes

Here’s what a top 10 for daily usage on a per day basis over a 4 month window would look like:

4 Likes

Thanks, very useful!

My only comment is that I would put the less variable ones on the bottom, e.g. always on. And then the most variable ones on top. That way the plot would be easier to read, now it seems that the red is very variable, but it is pretty constant really.

So you (or Sense) could compute the Std Dev of all the points in time for each of them, and calculate the relative std dev (Std Dev / Mean) and stack them with the lowest RSD at the bottom and then by increasing RSD. Except always on probably should always be at the very bottom.

(Not asking what you do this with your plot, though I’d surely be curious to see it if you did … :wink:

3 Likes

Reasonable suggestion… R and ggplot are built to do this stuff kind of easily. The trickiest part is blending the special cases (Always On) into the mix.

Sure enough… Looks better:

And here’s the R code

SimplePlot2.R (4.0 KB)

14 Likes

I love this! It really cleared it up putting the low variability on bottom!

1 Like

@kevin1, This is great stuff. What all does one need to run your plots? Is there a post somewhere that has this?

Thanks!

The script I posted, runs in the R language and environment, all free and downloadable. It takes in one or more Sense yearly downloads with 1 hour resolution. R is an open-source statistical language that is taught in virtually all non-comp-sci focused data science courses today.

You can find the base R language here
https://www.r-project.org

A great IDE environment for R is R-Studio. The company that developed R-Studio offers a free version that is more than enough for most users.
https://www.rstudio.com

My script will require a little customization for your specifics, plus will require downloading some additional packages (reader, ggplot2), but R-Studio will help you with that.

If you have done some coding before, give it a try. There are plenty of videos and tutorials on how to use R.

5 Likes

R is something new to me and I’m just getting started trying to learn a little. Where I have my phone all the time and not a computer, I got the app from the Apple store.
Not sure exactly what I’ll be able to do from the phone just yet but the highlight of the description was the ability to learn from the app.

1 Like

Thanks Kevin, I’ll give this a try.

Looks like the App is a fairly full-featured version of R with all the requisite packages. But man, trying to code via a tiny touch screen or view graphical output is going to be challenging. Still useful for learning.

Python (another scripting language) has a similar iPhone app. @kevin1 is correct that programming on a touch screen is difficult/tedious, but if I had a script already made, running it in the app was pretty straight forward. @samwooly1 keep us updated if you get it set up and working in this app… I may try it out if you have some success.

1 Like

Quickly tried to port my script to iPhone/iPad R Compiler app. The first issue that I bumped up against is that file IO is very different in iOS-land (suspect the same for Android). That means that some of the nice R packages that make it much easier to parse and input .CSV files don’t really work. There also seem to be a capacity limitation of 128kB when I try to bring files in via other routes. Will invest a little more time playing around.

2 Likes

I don’t use R but I have used similar programs (Igor in particular) extensively, and I teach an introductory class about programming every year to our graduate students (who mostly have never programmed). In my experience trying to learn such a system on a phone is not a viable option. I think those phone apps are for experts that already know R very well and want to be able to process some data while away from their computers. But for learning from scratch, I VERY strongly encourage you to try to learn in a computer. It is hard enough already

2 Likes

Thanks for checking it out and the heads up. I think your right about using the computer. I’ll probably try both just so I make sure I mess something up somewhere.

Finally got the code to run on my iPad with the R Compiler App. But it took a lot of changes.

  • Due to the 128K input file limit, I had to move to a daily rather than hourly download from Sense, plus I had to seriously reduce the file size even for Jan-April by removing 70% of my devices (only kept the top 12 or so)
  • Had to give up on reading the data file in directly and do as the coder of this app recommends - read the data file into the In (stdin), then read.csv (in the code) from “stdin”. Typical R offers much more graceful access to data.
  • And forget about debugging on the iPhone/iPad - one error and the compiler craps out giving a cryptic message, with no indication of which line of code caused it.

The combination of code and datafile below should work on iPad/iPhone if you can get everything into the right place on your device.

SimplePlot2.R (2.2 KB)
Test2.csv (111.2 KB)

Here’s the output from my iPad…

2 Likes

Playing with the hourly version of the stacked bar. But for hourly, an area chart seems to work better.

HourlyArea

3 Likes

@RyanAtSense I’ve seen requests for this feature in a number of posts, but, it most clearly described here. This is an incredibly valuable visualization for tracking down energy use. I am a green building consultant, and, versions of this graph are the baseline tools we use to explain loads to clients and target energy conservation measures. It is especially useful for behavioral ECMs. The bubbles are cute, though, I’m afraid, not actually all that useful. It seems to me this is a tiny bit of coding that would have a large impact on the user experience.

3 Likes