Disable power exporting when the price goes negative with an Enphase solar inverter

A few weeks ago we got a Tesla Powerwall installed, taking advantage of the price drop and the NSW government subsidy. I've signed up for Amber, who pass through the wholesale power price such that in the 19 days we've had it, we're $70 in credit having consumed nearly 400 kWh of power. Admittedly we've been using the air conditioners a lot to chew up free solar and keep the house pre-cooled during the hot days.

To get the most out of Amber, you need to be able to store power and predict when you will need it. Their SmartShift app does this for you, but you can control it crudely when you need to, for example tell it to not dump power to the grid on a night you know you'll need power, say to run the oven. Otherwise it automatically works it out, and it's been pretty good for that.

However, Amber can't currently control my Enphase inverter. You need to be able to stop your solar generating and exporting power to the grid when the power goes negative. Fortunately a guy in Melbourne has written a great little script that does just this. It monitors the Amber power price and when it goes negative tells the inverter to switch to an export profile that has "0 kW" set as the export limit.

The only problem, as reported here by another Enphase user, the Powerwall reacts so quickly to any loads in the house that the Enphase microinverters see essentially no load and don't produce any power. If your battery isn't already full, your house will drain from the battery and then once empty it'll use the grid. Using the grid when it's negative isn't a bad thing but draining the battery not so much.

So I worked with Brendan to work out where I could hook in a quick check to see if the battery is full, using Home Assistant. I don't know Ruby at all so Brendan was very helpful and patient.

Here's the diff you can run against the repository to make the required change. You'll need to create a long-lived API token in your Home Assistant instance and set that as ZEST_HOME_ASSISTANT_TOKEN, then find the URL for the battery charge level resource in the Tesla integration and set that in ZEST_HOME_ASSISTANT_URL. For mine that URL is http://<IP of HA>:8123/api/states/sensor.my_home_charge. That's it.

Thanks so much Brendan for helping me out!

With the instability in the grid these days pushing the spot prices up a lot I suspect I'll be able to pay off the battery much quicker than it'd be on a normal power plan, with the added bonus of us not having to worry about when we use power so much.

0 responses