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.
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
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.
Here’s the output from my iPad…
Playing with the hourly version of the stacked bar. But for hourly, an area chart seems to work better.
@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.
I really want this too. I would love to be able to use this to help identify some appliances, and to see what’s actually happening in the moment. On the web interface this is possible to do without too much effort and I use the web interface a lot more than the mobile interface.
Is anyone at Sense actually looking at this feature?
Any update on this possible feature?
I am also extremely interested in a feature such as this. It would be so much more useful than the single-color Power Meter chart with just labels for when devices turn on and off. Even if it didn’t replace the Power Meter chart itself, I am sure I would use it as often or more often.
If you want a substitute, at least to try, you can use this web app I cooked up. It takes either a monthly or yearly exported file from Sense, at “Day” resolution (not “Hour”) and converts it into these two graphs.
The link is here… Once in, just Browse to your exported / downloaded data file. LMK if you have any questions.
@cjdickey36, your idea for replacing the Power Meter chart with the colorful chart caught my imagination! I know that implementing everything @kevin1 has done with R, from scratch into the Sense app, is a programmer’s nightmare. That won’t get traction from Sense, but the idea is still awesome!
A scaled back version is possible. All of us have an Always On bubble, so adding a second color which would plot that item across the bottom of the power meter graph might be a small enough lift to actually happen. Everyone also has an Other bubble, so that could be a third color which Sense might actually go for.
If colors on the graph are popular with users, the feature could be expanded later. Rather than checking which are the top items as Kevin did so nicely (which would be very difficult to code outside of R), they could allow the user to assign any one device to each of a short list of colors.
And if that were popular, the next expansion could be allowing colors to represent a category to which the user would assign multiple devices. Behold, a road map towards implementation of your idea!
Thanks for sharing this again, @kevin1. I’ve started getting enough data that seeing this trend is pretty actionable. First step - actually turning the smart plug on my roommates PS4 off…