My first assistant discovery was Solar Assistant. It solved two problems:
-
It let me disconnect my inverter from the internet so that the manufacturer (or possibly their evil new equity fund owners, or hackers who invaded them) couldn’t remotely disable my inverter or turn my battery stack into a massive pyrotechnic device.
-
It gave me much finer-grained information than the almost worthless once-every-five-minutes readings that the stock system provided. Plus (three!)…
-
It gave me programmatic access to the state of the inverter though the MQTT protocol (no need to follow the link unless you’re a home automation nerd). I didn’t realize how important that would be.
Then I settled into a habit of obsessively checking the status of the system so I could adjust the charging parameters. I realized that it’s a fairly complex problem if you want optimum charge on the EV while still making sure the house gets enough to get us through to the next day.
Today was kind of extreme but otherwise typical situation: the day dawned bright and sunny with a cloudless sky.
I set the car up to charge at its maximum rate (about 8kw). The sun was so bright and the day so clear that soon the array of solar panels was pumping out 11kw — 110% of its rated 10kw capacity.
Within two hours, however, the mist forest was earning its nickname. Clouds rolled in through the trees and blotted out the sun over the panels.
The solar output dropped rapidly from 11kw to a mere 350 watts. Later in the day it started to rain. The solar output never went anywhere.
Had I been asleep (not unusual since my thyroid surgery), or had I strolled out of WiFi range or driven to one of the many areas on the island where there is no cellular service or if I’d just gotten distracted with other things, I would have been draining our solar plant batteries just to charge the car. The car is not (yet) equipped with vehicle-to-home capability, so we would have been stuck in the dark.
Clearly, this charge and load management stuff needs to be automated.
At the same time, as the solar equipment is somewhat remote from the house, I was looking into IP cameras. I’ve long used, and been overall pretty happy with, Wyze internet-of-things (IoT) cameras (and locks and smart plugs and thermostats). Their products all depend on an internet connection and access to their central servers, though, meaning that they can cut you off or change your products’ feature set or start requiring subscriptions at any time. Not to mention spying on your cameras, or the fact that if your internet goes down (not so unusual here) everything stops working. So I started looking into Home Assistant, a decentralized, free and open-source home automation suite. It runs fine on a Raspberry Pi, which I had in hand, so I installed it and started poking around.
It is much more challenging to get started with Home Assistant than with a proprietary IoT system. The initial home screen, for me, was mostly just blank. I read several tutorials, but they were mostly big vocabulary lessons: devices, entitites, automations, Green, Yellow, ODROID, integrations, areas, floors, cards, triggers, conditions, actions, dashboards, states, sensors, services, scripts, scenes, add-ons… whew! But there was very little information on how to actually do anything. It’s a lot to take on, but as I dug around I discovered two crucial things:
An “integration” exists for Tesla automobiles. In the past, I’ve written code that uses the Tesla APIs, and it can get a bit… involved. Once I added the Tesla integration and activated it with my car’s credentials, I immediately had access to dozens of parameters for my car (each one an “entity”). Of immediate interest, I could see the car’s location, state of charge, and whether it’s plugged in. Other entities let me turn charging on or off, and set the rate and limit for charging.
The other exciting discovery was an integration for the MQTT protocol, an industrial equipment control protocol that has been embraced by the home automation community. Since Solar Assistant allows access to entities that reveal my solar plant’s state-of-charge, power being generated, overall load, and battery charging rate (and many, many more parameters) I should be able to write an automation in Home Assistant that gets triggered every few minutes that will then run a script that will query the inverter device via the MQTT integration, then make a decision about whether some excess energy should be diverted to charging another device (Joulee the Free Salvage Tesla) and using the Tesla integration to request that the charging status, charge rate, and charge limit entities start the charging process.
It sounds involved, but will likely be much simpler than writing and debugging scripts in something like bash or perl or python to do the job. In addition, I can then add smart plugs down the road to manage loads like turning off the hot tub heater, dehumidifiers, and water heaters (we’ll have several) for a few minutes when we need an urgent charge for the house or car (or just don’t want to overload the system when, say, we’re using the clothes dryer).
And I’ll still need Home Assistant to help manage my cameras.
So I have a lot of work ahead of me, but I think it will be fun and fruitful.
—2p