Adventures in home solar hacking!
I was on craigslist the other day, and found a real great deal on these solar microinverters. $50 a pop for a 250 watt capacity device is a great deal in most cases.
In case you’re wondering, a micro-inverter is a little box that attaches to the back of a solar panel and boosts the voltage and matches the frequency and phase of it’s output to match your home’s power, and pushes power back in to the grid, literally spinning your electrical meter backwards. You basically just plug them in and it goes. These things can go $200 a pop, and to find them for $50 is magical. This is the basics of a grid tie solar inverter. It first offsets whatever load you have in your house, literally stopping your electrical meter in it’s tracks and whatever is left over will spin the meter backwards and then gets exported out to your immediate neighbors, and if they can’t soak up the extra power, out to the greater grid it goes. So I hopped in to the car and met a dude at a storage unit and bought a pair of these microinverters from some no-name Chinese company called Renesola, hooked them to a couple of $100 panels the dude also had for sale (230 watts each!) plus another $20 in extra chingaderas to connect everything to the house, and I was off and running.
Hookup: The diagrams were shit, like most crappy Chinese no-name products, pixelated and printed too small, but they were sort of legible and the pictures made sense. L and N go to each hot leg of the 220, which should give anybody with half a brain some serious pause without a picture. N is basically ground in US electrical systems, though not technically, But the picture called for hooking it to a hot 220 leg, so fuck it. There were fuses and breakers and they were only $50. Then there was the PE wire. I had to look that up. PROTECTIVE EARTH. That’s what PE stands for. We call that one GROUND.
Now, let me be really frank here - The first setup was a little bootleg, coming in through the air conditioner power box. There were wire nuts involved. The inverters hook to 220, and the A/C is handy. Things like disconnects and maybe even fuses have since been added, so don’t do anything stupid at home (for very long or unattended)
Sure enough, the mechanical meter spun backwards. I don’t know what will happen with a digital meter - Maybe they’ll immediately call the fun police on you, who knows, but my meter is ancient and just fine.
So here comes the fun part. I wanted better performance monitoring, and some liquidator across town had a bundle of these monitoring boxes called the “ReneSola MRG Micro Replus Gateway ” that would talk to each inverter with “Power Line Communication” like the old X-10 devices, it basically superimposes data during the zero crossing (when the sine wave of your AC power is zero volts) and anything plugged in can talk during those very brief times. There are lots of different protocols for this, and Renesola does NOT use any of them. They use some rando chip called the Miartech MI200E, which appears to only be available on alibaba. Datasheets (in Chinese) can be found with a fair degree of hunting, but they’re probably of little use.
So I got this stupid box, which is a Linux box with a touch screen, 220V power input, USB and ethernet ports, that tries to connect to “The Cloud” which is some server in China that’s only referred to by it’s IP address, and it’s long gone. You can’t change it, and it’s pretty well locked down, despite the USB port and old versions of lightHTTPd running on it. I’ll post the results from a nmap session at some point. BUT, I don’t feel entirely comfortable with it on my network, but it’s not doing anything weird, plus I gave it a bad gateway address, so it’s probably going to have to work pretty hard to get on the internet.
You’d figure that with an Ethernet port, you could log in to it and get some web page for looking at statistics, but no. You get 404 errors. It’s got an SSH port open, but I wasn’t able to figure out the credentials. So, useless, but after some digging, and then backing up the device to a thumb drive, I discovered that it made a big old tarball with a directoy structure that started with root. So there was that. It started with root>Gateway>data>0>day.dat and a bunch of other files. And it just so happened to perfectly mirror the structure of the onboard web server. So putting in http://10.41.61.21/data/0/min.dat would download a file (on your own LAN of course) of minute-by-minute data that was literally every minute since midnight of that day. It looked like this, human readable and space delimited. And all day, it just appends more data to the end of the file, and overwrites every day at midnight.
So there’s Date,Time, kW, MPPT/DC voltage, AC voltage, AC amps, AC frequency, temperature, total kWh, RSSI maybe, mystery and mystery.
The graphs look great in Google Sheets when you import this data, so it’s working.
So my plan is to put this data in to an open source system called Homeassistant - which is a Raspberry Pi (usually) powered home automation hub, which as far as I can tell, is superior in every way to anything else out there. You can connect ANYTHING to it. Cameras, cars, every kind of smart device, thermostat, lock, TV, projector, server, web service, sensor, smart speaker, alarm system, zigbee, z-wave, you name it and you can voice control it. I run Homeassistant at my house and it’s fantastic. BUT IT NEEDS MORE DATA!
So now I need to learn python, and write my own integration and parse these files.
Now here’s the thing about Renesola. They’re GONE. That 20 year warranty? Gone with them. Check out their listing on the NYSE. So long.
And what I’m writing here is literally the only data out there that you’ll ever see on these devices unless some brave ex-Renesola IT soul should come forward with better information and keep these things useful for a few more years.
SO on to this HTTP directory structure. As follows:
.
├── data
│ ├── 0
│ ├── 1
│ ├── 2
│ and so on and so on
│ ├── 254
│ └── 255
├── ddata
├── mdata
├── total
└── ydata
In the numeric folders in “data”, you have files called day_base.dat day.dat hour_base.dat hour.dat min.dat min_tx.dat (with min.dat and min_tx appearing literally identical) Maybe other files are redundant too...
ddata, mdata and ydata have files called module0.dat thru module255.dat
and then in the total folder there’s two plain, extensionless files called
dayEnergy and energy
which is linux time, first line is the system total, followed by each panel on each line. Energy is the same data, but without timestamps.
As for these moduleX.dat files, I can’t really say. It’s linux time, followed by zeros, and terminating with some unprintable characters that I haven’t figured out. The backup I took was from the first day of operation, so maybe this isn’t fleshed out yet, and will probably look a lot different a few days in. Oddly, I can’t seem to make another backup, so I’m lucky to have picked this one up. More to follow I guess, as I perhaps write a Homeassistant integration.
I’m putting my Renesola solar hacking project on Github for all to criticize.
https://github.com/DrFrankReade/ReneSola_MRG
Hopefully all those poor saps that got burned when the company vanished can now once again start talking to their hardware and getting stats and troubleshooting. And one day maybe I’ll python-ize it.