• Have you tried out dark mode?! Scroll to the bottom of any page to find a sun or moon icon to turn dark mode on or off!

diy solar

diy solar

isolation of battery to inverter comms

OK, I wrote it this morning, it seems to work fine on 1 inverter, sending half the allowed current. I will let it run for a while and then connect the second one and link the batteries.

Have you encounteres other message id's not mentioned in the Pylontech CAN document?
 
Below are the messages I use from DIY battery to Solis. I set my Solis inverters to "user defined" battery not pylontech:-

Message ID and contents..
0x351: Charge and Discharge parameters
= (max charge voltage, charge current, discharge current, discharge voltage (the latter is not used by Solis))
0x355: SOC & SOH
0x356: Current measurement of Battery Voltage, Current & Temp
0x359: Protection & Alarm flags

There are also...
0x35C: Battery charge request flags (which I heard are ignored by Solis; I don't use them)
and, if you do want to set Solis to pylontech battery you need to set:-
0x35E: Manufacturer name ("PYLON ") = ASCII "PYLON" followed by 3 spaces.
 
OK, no undocumented ones then!

It's done! I wired both inverters to the same battery stack, with the CAN hack in the middle. It works fine.

Each inverter respects the max battery current sent by BMS over CAN, so I'm just sending half the value reported by the battery. I tested on discharge: it works. Not tested on charge yet.

Some issues:

- Battery power reported on the display is in fact what the BMS reports! So both inverters report total battery power, not their own battery power. Same for battery modbus registers, which become a bit useless. I wonder if that would change with a "user defined" battery?

- Then, since both inverters can use the full battery, I set it to turn the second inverter off at night, which saves its idle power. Ironically, even when off, it keeps responding to modbus and CAN, which means... it still reports total battery power even when off!
 
Excellent work, well done :)

What is the max power that your batteries can now discharge across the two inverters?

What happens if one inverter is charging battery and the other pulling from battery? (which I guess could happen if one has much more PV input than the other due to string positioning)?

- Battery power reported on the display is in fact what the BMS reports! So both inverters report total battery power, not their own battery power. Same for battery modbus registers, which become a bit useless. I wonder if that would change with a "user defined" battery?
Gut feel is that I doubt that behaviour would vary just on protocol, but interesting to see.

- Then, since both inverters can use the full battery, I set it to turn the second inverter off at night, which saves its idle power. Ironically, even when off, it keeps responding to modbus and CAN, which means... it still reports total battery power even when off!
There are definitely some inconsistencies when you have two Solis "working" together. The other day, I turned off the AC Grid to one of mine (so it was just powering backup circuit from battery). But with the other inverter still producing, the one with the AC grid turned off triggered its internal relays every minute or so - but with the other inverter off all was fine. All I can think is that it was reacting to having a signal from the Acrel meter making it think there was some AC connection and tried to reconnect - weird.
 
What is the max power that your batteries can now discharge across the two inverters?
I have 4 US50000 so the BMS says 320A! The limit is set by the inverter's max battery current (100A each). So 10kW total. I'll never use that much, but when there's a lot of sun, it's going to charge pretty fast...

What happens if one inverter is charging battery and the other pulling from battery? (which I guess could happen if one has much more PV input than the other due to string positioning)?
Well... it just happens, nothing special, except higher losses from double conversion. At the moment I've tweaked the fake meter readings to balance them so they both charge or discharge at the same rate. The idea is RI² losses are minimized if both inverter battery currents are equal.

Right now I take the smartmeter reading, divide by 2, and feed that to the inverters. To balance them, when needed, I just add a bit of offset to one fake meter so its inverter outputs more, and substract from the other so it outputs less.

That works fine, but I have to polish it a bit. I have 3 identical PV strings, and another with a different orientation, so when PV production is very different between the two inverters, since they both charge at the same rate and send remaining power on the AC output, then... if I make battery power equal, then the issue is swept under the rug and comes out the other end on the grid port: it can happen that one inverter is exporting when the other importing. That's the same as one charging the battery while the other is discharging it, but with the grid instead of the battery.

Shouldn't be too complicated to fix....


Gut feel is that I doubt that behaviour would vary just on protocol, but interesting to see.
Well, it's cosmetic, so... meh

Funny thing is, the arrow showing the direction of power to/from the battery on the display is from the inverter's internals, so each inverter gets its own arrow... but the watts displayed on top are from the BMS, so they both display the same!

"Battery current" in the information display (deep in the menus) gives the correct info, but I don't know where it is in the modbus map...

There are definitely some inconsistencies when you have two Solis "working" together. The other day, I turned off the AC Grid to one of mine (so it was just powering backup circuit from battery). But with the other inverter still producing, the one with the AC grid turned off triggered its internal relays every minute or so - but with the other inverter off all was fine. All I can think is that it was reacting to having a signal from the Acrel meter making it think there was some AC connection and tried to reconnect - weird.

Strange. Did you do it during the day or night? Was the backup output enabled?
 
I have 4 US50000 so the BMS says 320A! The limit is set by the inverter's max battery current (100A each). So 10kW total. I'll never use that much, but when there's a lot of sun, it's going to charge pretty fast...
(y) yes, it's frustrating when I see my battery charging at 5kW and the inverters exporting at 5kW at the same time :(

Funny thing is, the arrow showing the direction of power to/from the battery on the display is from the inverter's internals, so each inverter gets its own arrow... but the watts displayed on top are from the BMS, so they both display the same!

"Battery current" in the information display (deep in the menus) gives the correct info, but I don't know where it is in the modbus map...
The battery current in the info display (page 3 IIRC) just comes from the BMS value - I know that because I got a negative bit wrong when converting from a 16 to 32 bit integer and ended up with the Solis telling me it was charging at something like 980A, rather than discharging at 20A.

So, if you need the true battery current can you not log that from your BMS/CANBus code?

Strange. Did you do it during the day or night? Was the backup output enabled?
In day time. I shut off AC Grid to my EH1P to stop PV flow to work on the PV input, backup was enabled (and working). The RHI was on and exporting. As soon as the RHI was turned off, the EH1P stopped its strange behaviour - will investigate more next time we're working on the system.
 
(y) yes, it's frustrating when I see my battery charging at 5kW and the inverters exporting at 5kW at the same time :(
Indeed! Well today the weather is absolutely terrible, so I couldn't test that, we'll have to wait...

The battery current in the info display (page 3 IIRC) just comes from the BMS value
Oh yes, but I'm talking about the other battery current! Advanced information -> running message -> top right of screen. This one must be measured by the inverter, because it is the correct value per inverter and still updates with the BMS current packet removed.
So, if you need the true battery current can you not log that from your BMS/CANBus code?
Sure! But it's not per inverter... So for balancing them I use (PV power - Grid port power - Backup port power) which is an approximation of battery power...

In day time. I shut off AC Grid to my EH1P to stop PV flow to work on the PV input, backup was enabled (and working). The RHI was on and exporting. As soon as the RHI was turned off, the EH1P stopped its strange behaviour - will investigate more next time we're working on the system.
That's weird... anyway if you disconnect it from the grid it'll still use PV to power the backup output, so that wouldn't make it safe to disconnect PV since it's still under load...
 
anyway if you disconnect it from the grid it'll still use PV to power the backup output, so that wouldn't make it safe to disconnect PV since it's still under load
my backup "load" is a single STC-1000 :);)
 
Alright, the sun showed up. It is charging at 100A per inverter, 10kW total, maxed out :ROFLMAO:
 
Oh yes, but I'm talking about the other battery current! Advanced information -> running message -> top right of screen. This one must be measured by the inverter, because it is the correct value per inverter and still updates with the BMS current packet removed.
Presumably you've scanned all the Modbus registers to find this value?

If so, and it's not there, presumably the only option would be to add a couple of smart shunts or hall-effect DC current clamps to the battery wires to each Solis?
 
Yes, I found it, it's 33217. I had a hunch it would be around other registers related to battery, so set it to log them, and found it. So I updated the register definitions in github, now "battery_current" is 33217, and the previous "battery_current" is renamed to "battery_current_bms".

It is in absolute value, and the sign is in the same register as the others, battery_current_direction. This new register reacts much faster, it is real time, which is more convenient for diverting power.

There's a bit of an offset like 1A, which seems to depend on the sign, I'm not sure, will investigate.

...and now the second inverter is limiting due to temperature because I haven't wired the external fans yet! lol
 
Yes, I found it, it's 33217. I had a hunch it would be around other registers related to battery, so set it to log them, and found it. So I updated the register definitions in github, now "battery_current" is 33217, and the previous "battery_current" is renamed to "battery_current_bms".

It is in absolute value, and the sign is in the same register as the others, battery_current_direction. This new register reacts much faster, it is real time, which is more convenient for diverting power.
Great - I'm going to try reading that register over the weekend and see how it compares to my BMS readings.

Thinking of your github registers... 2 questions/observations:-

a) a minor one, but just for clarity, where you wrote...

S32-1WGrid Port Powerfloat+ to grid, - From grid

I read that as "+ to grid" as in the the grid supply to the house, but I found it's actually "+ to grid port" i.e. I got a +ve value when the Solis is charging and -ve when it's exporting.

b) Where is Appendix 2? I'm sure I've seen the status bitfields described somewhere, but I can't remember where that was.

U16Inverter statusbitfieldSee Appendix 2

...and now the second inverter is limiting due to temperature because I haven't wired the external fans yet! lol
"Tant pis" :ROFLMAO::ROFLMAO: [ I hope that's the right expression ]
 
Last edited:
hmmm... I tried it, but getting 0 value :(

Solis EH1P: 4 33035 energy_generated_today 10.0 kWh
Solis EH1P: 4 33036 energy_generated_yesterday 16.5 kWh
Solis EH1P: 4 33049 mppt1_voltage 402.4 V
Solis EH1P: 4 33050 mppt1_current 2.6 A
Solis EH1P: 4 33051 mppt2_voltage 274.4 V
Solis EH1P: 4 33052 mppt2_current 4.0 A
Solis EH1P: 4 33057 pv_power 2143.0 W
Solis EH1P: 4 33073 phase_a_voltage 241.7 V
Solis EH1P: 4 33093 temperature 41.4 °C
Solis EH1P: 4 33133 battery_voltage 54.6 V
Solis EH1P: 4 33134 battery_current 27.7 A
Solis EH1P: 4 33135 battery_current_direction 0
Solis EH1P: 4 33151 grid_port_power -565.0 W
Solis EH1P: 4 33217 reserved_33217 0

and your prev comment says "always zero" :unsure:

33217U16Reservedintalways zero
 
Yes, thanks - guess my firmware doesn't support that register. No big deal though, I was only experimenting with it out of interest after peufeu's find.
 
OK that explains it!

When I wrote "Always zero", I had the previous firmware (3D0037). Now both inverters have the latest version installed (4A004C) so this register must have been added in the new firmware.

Besides the bug fixes, I also noticed other stuff like a new G100 menu, a "Passive mode" option that enables remote control (partially) but I no longer need it since the meter hack allows full control anyway, many bugs are fixed like the oscillation after switching a load, all choices of meters behave the same (no more 2 seconds lag), it polls the meter much more ofteh, it responds with proper modbus exceptions instead of rebooting when reading some forbidden registers...

The update is definitely good but what pisses me off is the complete absence of release notes!

I read that as "+ to grid" as in the the grid supply to the house, but I found it's actually "+ to grid port" i.e. I got a +ve value when the Solis is charging and -ve when it's exporting.

My bad, I added a note:

"Notice ‘-1W’ in unit column which inverts the sign on the GrugBus side"

After getting a headache I decided all the power measurements for everything should be negative=exporting, positive=consuming, so I don't need to remember the sign for each... if thing_power>0 it means power is going into the thing...

b) Where is Appendix 2? I'm sure I've seen the status bitfields described somewhere, but I can't remember where that was.

U16Inverter statusbitfieldSee Appendix 2

Appendix 2 is in the PDF "Without Control Hybrid EN 2020.9.15_RS485_MODBUS(ESINV-33000ID) Hybrid Inverter" which I'm sure you already have, otherwise I'll send it.

It's not a bitfield, it is a cornucopia of codes of cryptic signification, so I did not copy it. Besides, the register is useless, as it reports only one thing: if there's an error, it reports the error, and that takes priority over reporting whether the inverter is operating or not. So there is no way to know if it's working or not. It's much simpler to read the other status and bitfields registers: if there are several errors, you get all of them.

Obviously, sometimes when "operating status" says "Fault leads to turning OFF", it is still on and operating, even if "Normal Operation" is not set. hmm... oh well.

It's important to know if one or both inverters are operating, because if there are two, they must receive main meter power divided by 2, otherwise they will both do their job and respond with the full requested power, and oscillate (due to too open much loop gain). Sending power divided by 2 all the time is safe, it just makes response a bit slower (not enough open loop gain). So right now, if an inverter is on and not offgrid, the code assumes it is participating and tweaks the meter reading to half.

As a side note, I tried putting one inverter offgrid (aka flipping the breaker): it works fine, it just behaves as a battery charger. That's not very useful. I mean the only case where it could be useful would be if one inverter exports enough to power the house, putting the other offgrid saves 60W idle losses. But if the house needs more power, then the inverter that's still ongrid will provide it from the battery... which means it will do a roundtrip to 48V between the inverters, which has higher losses. I'm not gonna bother with that.

What I'm doing is: turn off the 6kW inverter at night and let the 5kW one run the house, which saves the idle power of one inverter. During the day they're both turned on. That's simple and effective.

Lastest modbus doc shows, keep in mind older units may or may not implement all registers

View attachment 246656

When I asked for the modbus register list, they sent me the 2020 version, I guess you have a more recent one with the updates. I think only the writable/control registers are under NDA, the 3xxxx registers are read only so should not be under NDA... perhaps you can actually share it, which would be awesome!...

The reason I needed this battery current register is to balance charge between inverters, and especially to know if one inverter is charging while the other is discharging, which I want to avoid. I can't use BMS values as they're sharing the same battery now.

The other reason is to control the car's charger: I set a target battery charging power according to SOC, and everything above that goes to controllable loads like the car (and soon the water heater). So the export power I'm using is: actual meter export + battery charging above target. This allows starting the car's charge before the inverters finish charging their battery, which is nice, because the car has a minimum power of 1500W below which it won't charge, and it is controlled in 1A steps so 240W. So it is best to not start it late in the day when production declines. The inverter's battery charger has no minimum power, so it can finish charging at the end of the day when production is lower, and it can absorb the car's leftover between 1A steps.

Here as the battery reaches 85% it sets a target of 2kW for the inverter's battery and the car takes the rest.

1727454343494.png
 
Last edited:
When I wrote "Always zero", I had the previous firmware (3D0037). Now both inverters have the latest version installed (4A004C) so this register must have been added in the new firmware.
Did you say the new firmware queries the Acrel meter 10x per second? Not sure I want to update to that as my meter data is sent over ethernet via a couple of Waveshare RS485 to Ethernet converters. Though oscillation fixes sounds worthwhile.

After getting a headache I decided all the power measurements for everything should be negative=exporting, positive=consuming, so I don't need to remember the sign for each... if thing_power>0 it means power is going into the thing...
Good idea.

Appendix 2 is in the PDF "Without Control Hybrid EN 2020.9.15_RS485_MODBUS(ESINV-33000ID) Hybrid Inverter" which I'm sure you already have, otherwise I'll send it.
I don't have it, so yes please.

It's not a bitfield, it is a cornucopia of codes of cryptic signification, so I did not copy it. Besides, the register is useless, as it reports only one thing: if there's an error, it reports the error, and that takes priority over reporting whether the inverter is operating or not. So there is no way to know if it's working or not. It's much simpler to read the other status and bitfields registers: if there are several errors, you get all of them.

Obviously, sometimes when "operating status" says "Fault leads to turning OFF", it is still on and operating, even if "Normal Operation" is not set. hmm... oh well.
LOL.

It's important to know if one or both inverters are operating, because if there are two, they must receive main meter power divided by 2, otherwise they will both do their job and respond with the full requested power, and oscillate (due to too open much loop gain). Sending power divided by 2 all the time is safe, it just makes response a bit slower (not enough open loop gain). So right now, if an inverter is on and not offgrid, the code assumes it is participating and tweaks the meter reading to half.

As a side note, I tried putting one inverter offgrid (aka flipping the breaker): it works fine, it just behaves as a battery charger. That's not very useful. I mean the only case where it could be useful would be if one inverter exports enough to power the house, putting the other offgrid saves 60W idle losses. But if the house needs more power, then the inverter that's still ongrid will provide it from the battery... which means it will do a roundtrip to 48V between the inverters, which has higher losses. I'm not gonna bother with that.

What I'm doing is: turn off the 6kW inverter at night and let the 5kW one run the house, which saves the idle power of one inverter. During the day they're both turned on. That's simple and effective.
How quickly will they switch on? Having one off overnight would be good to save the idle losses, but you'd need both inverters on if you need more than 5kW of power.

When I asked for the modbus register list, they sent me the 2020 version, I guess you have a more recent one with the updates.
I don't have any, sorry - I just used your csv list!
 
Did you say the new firmware queries the Acrel meter 10x per second? Not sure I want to update to that as my meter data is sent over ethernet via a couple of Waveshare RS485 to Ethernet converters. Though oscillation fixes sounds worthwhile.
I just checked: 14.3 times/s or every 70ms.

In fact my python code queries the meter 5 times/s and tweaks the values it'll feed to both inverters, and each inverter queries the python fake meters 14 times/s. The fake meters just report the same value between real meter updates. So if you're doing MITM too, the link between inverter and fake meter has to be fast, but the link between the MITM box and the real meter can be slow as you set the poll frequency to whatever you want...

How quickly will they switch on? Having one off overnight would be good to save the idle losses, but you'd need both inverters on if you need more than 5kW of power.
It takes about a minute, so not super reactive.
The only large load I have at night is the heat pump, and it runs for long cycles, so the startup time will not be an issue.

I don't have any, sorry - I just used your csv list!
I was asking Solar Guppy ;)
 
I was asking Solar Guppy ;)
LOL.. I might be old, but not yet dementing 👵 I swear to god that your last 3 paragraphs, the graph and the quote from SG was not there when I replied ! And I hadn't started on the Friday night gin either :ROFLMAO::ROFLMAO: 🍸
 
Oh yes, but I'm talking about the other battery current! Advanced information -> running message -> top right of screen. This one must be measured by the inverter, because it is the correct value per inverter and still updates with the BMS current packet removed.
FYI... I checked today and my EH1P doesn't show any battery current under "running message" screen.

So must be firmware related!
 

diy solar

diy solar
Back
Top