How to reliably detect a grid power outage from inverter Modbus data

I am using the Modbus Data thing to successfully read all of the inverter data available through Modbus based on this SolarEdge application note.. Unfortunately something as simple as grid status isn’t available, but I need to determine immediately when the grid power is out (and my batteries and SolarEdge home backup unit are powering the house through the inverter) to perform load shedding via software (like turning off heat pumps).

Can anyone think of a reliable way to do this using Modbus inverter data alone? I can’t use the SolarEdge cloud API - it can’t be polled rapidly and continuously.

Can you pull voltage value from the inverter ? If yes then with a simple rule you can update an item to on or off if your voltage goes below or above a certain value

You can pull the AC output voltage of the inverter, but I think that will stay steady as long as the inverter is producing, either from the battery or the solar panels. I don’t see a separate “line voltage” or “grid voltage” output, but maybe I’m missing something.

Thanks for the response in any case

Just had a quick look at sunspec can you pull ac-frequency label as Actual grid frequency? If yes voilà that is your indication the grid is out. Read here

Thanks so much - I didn’t see that document or “actual grid frequency” as the description of that value - that might work, I’ll try it, many thanks.

Don’t know about your Country, but here in Portugal it is mandatory to cut production from the inverter when grid goes down, unless you have a separate system to disconnect your house from grid. Is this your case ? If yes that system should provide some info.

Power cuts can exist due to occasional maintenance by the power supplier, and to grant that field personnel is not electrocuted we have to cut off inverters (or disconnect house from grid) when grid goes down.

Hi Hugo - we happened to be in Portugal last week and had a wonderful visit to Lisbon and Porto :slight_smile:

Yes, I have the SolarEdge whole home backup unit that cuts off the grid - but it has no monitoring facility of any kind! It is connected to the inverter via RS485 and reported up through the inverter. So unfortunately I don’t think there is a way to detect it that way.

1 Like

Glad you loved Portugal, I’m in Aveiro (60Km south Porto).

Back to your case, I have a Huawei 2000 inverter with modbus/tcp and a power management unit connected via RS485. I don’t know SolarEdge, but the Huawei modbus interface manual indicates the registers used by the various devices connected to the inverter, so probably SolarEdge has the same.

OH modbus binding allows you to specify different search rates for different register ranges, so maybe your problem to detect a power failure in time can be handled this way. But probably SunSpec binding is preferred in your case.

Actually I’m using Modbus TCP to connect to the inverter. I had previously connected a Raspberry Pi with and RS485 module to connect in via a Modbus serial connection, and if I had kept that perhaps I could have listened to the inverter’s conversation with the home-backup-device as you suggest. But the Modbus TCP interface is more limited and seems to allow only reading of registers from the inverter itself.

Are you following this document ? seems to indicate that there are registers for connected equipment.

Hugo, thanks, when I can get a moment I guess I need to digest the common models document here to see if I can figure out what is available through those extended registers.

Meanwhile, the idea of using “actual grid frequency” didn’t work out. I pulled the main breaker to the house and that register happily kept showing 60 cycles for actual grid frequency even when there was no actual grid :frowning:

I don’t have a battery so don’t know the exact setup of such a system.
From my (battery-less but with PV) system I would guess the electricity meter could give you a hint: In case it shows exactly ±0 the grid has gone… Maybe you have a chance to get this information off the meter?

kind regards

In many cases, electricity meter takes some small amount energy to power itself. So when grid is gone, very likely communication to it is gone too. Inverter might still have internal battery to answer openhab call over rs485 interface or ethernet (if its supplied with UPS). However this is my pure speculation.

Anyhow - how do you power your home, if you have no grid power and lack backup battery?