mkaiser / Sungrow-SHx-Inverter-Modbus-Home-Assistant

Sungrow SH Integration for Home Assistant for SH3K6, SH4K6, SH5K-20, SH5K-V13, SH3K6-30, SH4K6-30, SH5K-30, SH3.RS, SH3.6RS, SH4.0RS, SH5.0RS, SH6.0RS, SH5.0RT, SH6.0RT, SH8.0RT, SH10RT, SH5.0RT-20, SH6.0RT-20, SH8.0RT-20, SH10RT-20, SH5.0RT-V112, SH6.0RT-V112, SH8.0RT-V112, SH10RT-V112, SH5.0RT-V122, SH6.0RT-V122, SH8.0RT-V122, SH10RT-V122, SH4.6R
310 stars 80 forks source link

Switching grid off and running off battery when I want to? #85

Open elektrinis opened 1 year ago

elektrinis commented 1 year ago

I want to be able to control my grid connection, I mean, to disconnect from grid and operate in Backup mode only, when conditions are right. I'm aware I can simply add a contactor and control that as any device, but is this doable with inverter itself?

I want this because my energy company is charging me for phase imbalance - even when overall sum of phase power is zero, some phases are negative and some are positive. And they are making me "buy" the energy from myself. This is also a standard practice in many countries.

dylan09 commented 1 year ago

Probably depends on how often you want to switch! But as soon as the inverter is in off-grid mode, it no longer feeds energy into the house grid. All loads that are not connected to the inverter backup draw their energy from the public grid.

How much energy are we talking about? For us it's about 0.1-0.3 kWh a day. This is because the inverter cannot respond quickly enough to load changes. And because of regulating inaccuracies.

elektrinis commented 1 year ago

Well it not only does not respond quickly, but it will not balance the phases as well. Even though the hardware is probably separate for all three channels and is capable of it. For example, if everything is off and I only have my oven running at 2kW on one phase, inverter will feed 2kW back on all phases distributed equally. So my meter will see 1.33kW draw on one phase and 0.66kW feed-in on two other phases. Overall power will be zero. And then my electricity company takes the feedin from two phases, cuts some "tax" from it and sell it back on the remaining phase. This illustrates how they treat us: 338843830_772121484124876_1590063429638902323_n Here we can see almost perfectly symmetrical graphs of "taken from grid" vs. "feed in to grid". While actually overall power was kept at zero.

My inverter/house is already wired in a way that everything is connected to Backup port of the inverter, except for EV chargers. The beauty of this inverter, compared to others, is that I offers full 10kW Backup, which is plenty of power for basic home needs, even for heating. I would like to automate the switching to occur roughly 2-3 times per day (when EVs are charging, when I have too much surplus, etc). I understand mechanical contactors have limited life, especially when switching under high load. In this case however I can make sure the power is close to zero before switching.

The schematic of inverter's internals says there are relays, both on Backup and on Grid side. Screenshot 2023-03-31 113247 Grid relay is switched off by inverter when grid power is off to isolate Grid when running in Backup mode (for anti-islanding protection and soft frequency synchronization when grid comes back on), and then switched back on when grid is back up. I wonder if there are any configuration combos or modes to control this.

Like, what are VPP and "Micro Grid" modes? Screenshot 2023-03-31 114458

elektrinis commented 1 year ago

Based on information online:

Microgrids are self-contained systems (i.e. islanded from the main power grid) while VPPs are a combination of resources dependent on grid infrastructure. When the grid is down, VPPs can't deliver power to consumers. Microgrids functionally require some capacity for local storage such as battery systems.

I wonder what exactly MicroGrid mode does. While VPP sounds very similar to External EMS

Louisbertelsmann commented 1 year ago

I would say that MicroGrid does exactly what it says. It's a small grid. You're independent from the outside. The generation, storage, distribution and consumption all take place in that small grid. For example, if you have a house in a rural area with no electricity, you would use it.

elektrinis commented 1 year ago

I have switched it to MicroGrid mode to test. Can't see any difference. While I don't know if it has physically disconnected from grid, it is still reporting some power flowing. Screenshot_2023-04-02-08-03-55-480_io homeassistant companion android-edit

I was able to see much higher Grid power being reported when which on the microwave. So I don't see any difference from self-consumption mode.

Any other ideas?

mkaiser commented 1 year ago

I did not fully understand this, yet and have several general questions:

Will the relay between grid and inverter switch off, if you go to microgrid / some backup mode?

Lets assume it switches off (you could also simulate this by manually turn off the circuit breaker or RCD to the inverter):

After some time (>1 hour) your local micro grid and the "cities" power grid won't be phase-aligned any more due to minor timing issues.

How could you safely switch back to the city-power grid? Are there some synchronisation mechanisms? I have not found this in sungrows documentation

mkaiser commented 1 year ago

btw. how did you realise the surplus loading? So charging your cars, when with spare power from PV without draining the batteries?

I thought about going to EVCC, but I am not very convinced, that this is a good software for this, as you could also do it all manually in HA

elektrinis commented 1 year ago

To reconnect to grid, it should be the same process as after blackout. When blackout occurs, the inverter switches off the contactor on grid side instead of trying to reverse-power the whole town. And you are right, the voltage and frequency will drift off and this is why inverter is so slow to switch back on - before closing contactor, it synchronizes phase/voltage softly. I would expect the same behavior when switching off and on manually.

As for EV charging.... Currently I have an automation to put the inverter in to "forced stop" mode before EV charging starts, or else it will take the power from battery, and also I have noticed two systems hunting around for zero power on grid side if my EVSE is set to "solar" mode, which is unpredictable. In case of this "off grid mode", I would first connect to the grid and only then start charging the car(s).