Six Colors
Six Colors

Apple, technology, and other stuff

This Week's Sponsor

Magic Lasso AdblockBlock ads in iPhone, iPad and Mac apps

By Jason Snell

Putting my solar (power) system in my menu bar

It was a busy summer at the Snell house. Our roof predated our purchase of our house, and we’ve been in this house 25 years, so… yeah. We needed a new roof. Getting a new roof was an opportunity to add a rooftop solar power system and update our HVAC system, so we went all in, and all summer I coordinated with three different companies, all of whom wanted to spend time on my roof, or attaching things to the side of my house, or rewiring things on the inside.

Anyway, it’s all done now. We survived, and our house got a big upgrade! But I’d be lying if I didn’t say that I wasn’t also excited to figure out how to integrate my new home tech into my life in a custom way.

The new HVAC system was easy—there’s a Homebridge plug-in, and boom, it’s now integrated with HomeKit. On the solar side, things were trickier. I found a few Homebridge plug-ins, but looking in the Home app to see my solar status didn’t really make sense? I wanted it in my Mac’s menu bar. Just because. Why did we pay for three big solar batteries on the side of our house if I can’t see a battery icon that represents my house? C’mon.

Anyway, what I ended up doing was digging through loads of documentation—most of which involved querying the solar system manufacturer’s API, which is delayed and limited to about one query per hour unless you pay a subscription fee. But I did finally discover, by looking at the code for one of those Homebridge plug-ins, that there’s a local API for my solar system. Yep, it’s true—my solar system, the one inside my house, has its own web server and will respond to properly formatted queries with blobs of JSON.

After a lot of wrangling, I got it to work. So if you’ve got an Enphase Energy solar system of recent vintage (hello, Google searchers!), feel free to check out my Python SwiftBar script, which shows me how much power my house is using, the status of the battery, how much power the solar panels are generating, and what (if ever) we’re taking from or sending to the grid.

And so there it is. My house has a battery, and that battery icon is in my Mac menu bar. It feels… right? Yes, that’s it. It feels right.

If you appreciate articles like this one, support us by becoming a Six Colors subscriber. Subscribers get access to an exclusive podcast, members-only stories, and a special community.


Search Six Colors