Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple inverters #12

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

julezman
Copy link

@julezman julezman commented Oct 8, 2020

The main purpose of this is to address point 1 of the feature request I put in #5 for multiple inverters. However, it may also help with the recent request in #8.

Firstly, I must apologise for not getting back to your reply to my #5 feature request. It's great that you and @miguelrjim have added the meter functionality. However, the feature for multiple inverters is still required for me. You suggested that I could add another integration pointing at the second inverter. However, in my case I have two inverters that are physically connected in a master\slave combination on the RS485 bus (I think!). Only one of the inverters has an IP address. The second inverter is read using the unit number set to 2 (as per #8 request). The code still works without issue for the more standard single inverter install too (albeit with a prefix for the inverter for each sensor in the same way as the meters)

There are some questions I had about sections of the code and happy to discuss with you. Also, it may be better to separate the second inverter out to a second device but I followed the existing meter implementation. Again happy to discuss. Also, happy to adapt to cover #8 fully if that helps.

Thanks again for this great solaredge_modbus integration for HA. Hope this helps.

@binsentsu
Copy link
Owner

Hi. Thx for the effort. Will have a look at it. As for the devices, my goal was to have one read cycle per ip address in order to prevent possible multiple connections at the same time and have coherent data per time cycle. That's the reason for the hub part. But it's true this solution outgrew a bit by meter 1-3 addition. As for the stub method it's just dummy data I use while developing and not being actually connected to the inverter.

@WillCodeForCats
Copy link

I just set this up on my multiple inverter system and at first glance it appears to work as expected. I've got a two inverter system with one import/export meter.

@WillCodeForCats
Copy link

FYI on possible multiple connections thing: the Solaredge inverter will only allow one modbus/TCP connection at a time. Any additional connection attempts will be refused by the inverter, so it's not possible to accidentally establish multiple connections (unless Solaredge changes this behavior). It'll show up in the HA logs if this happens.

@koenigsdorfer
Copy link

Gday all, is there now a way to setup multiple inverters or just via the manual edit of the config file?

@WillCodeForCats
Copy link

I've started maintaining a fork with multiple inverter support that I use with my system (2 inverters with E+I meter on unit 1): https://github.com/WillCodeForCats/home-assistant-solaredge-modbus

@koenigsdorfer
Copy link

koenigsdorfer commented Sep 13, 2021

I have the same setup but once I try to add integration via the configuration it get the following error "Config flow could not be loaded"

Initially it didn't like (init.py) -- Line 76 and after that 526

@WillCodeForCats
Copy link

Somehow I did something wrong with the release. Anyway, I checked all the files against what's in my home HA install and re-released it, or just download that one file from the repo.

@koenigsdorfer
Copy link

koenigsdorfer commented Sep 16, 2021

So I have integrated V1.3.1-pr12-2 this time around, once in the configuration, selecting 1 inverter and Smart meter works, but when I go for 2 inverters and smart meter, no values will be displayed

@WillCodeForCats
Copy link

We're getting into "it works for me" territory. Example:
Screen Shot 2021-09-15 at 10 51 58 AM

Make sure your modbus connection between inverters is set up correctly and that all inverters on the bus are configured for the solaredge protocol (master/slave in older firmware, leader/follower in newer firmware) configured with different unit ID numbers: the first inverter with the Modbus/TCP connection should be unit 1 (master/leader), and all other units should be connected by modbus only and have incrementing unit id numbers (2, 3, 4, ...) as slave/follower.

@koenigsdorfer
Copy link

so i just had a look and setup is as per the following

RS485-1 has the smart meter with ID set to 2
RS458-2 with Inverter 1 ID set to 1 (Master) and Inverter 2 ID set to 3

I cant remember why that is, but I guess that causes the problem? Can I manually change the IDs somewhere?

@WillCodeForCats
Copy link

Yes, that won't work with the current code. I think many installers set it up that way because the meter default is ID 2, so they think they can't use that ID anymore so they use 3 for the next ID, but they are actually on different RS485 bus.

Because I think this might be a common problem I will think of a way to make it work in code.

@koenigsdorfer
Copy link

koenigsdorfer commented Sep 17, 2021

comment updated
you beauty, its working! when i changed the modbus meter ID it wouldn't work anymore and I thought its due to the "Same ID as the second inverter, but what I didn't realise was that the RS485 connection had a snapped wire. I happened before that I lost coms with the meter, but when I went out to check and put my hand on the meter to cover from sunshine so I could see the LEDs, must have been enough to establish the bus connection again.

so long story short, its working!!! thanks heaps mate!

This is probably a long shot, but I do have a smart relay as well. Is it possible to get consumption from the smart relay as well or is this not covered within the modbus protocol.?

orriginal post
yea the installer was part-me ;) . I do remember that I "had" to do it for some reason as I had problems discovering all devices when we set it up. IN saying that I do have an HD Wave and a Storedge inverter.

you are right, I just set the second inverter to 2 as well, which kicked the smart meter for some reason even though its on a different bus

@WillCodeForCats
Copy link

Good to hear it's working.

The smart relay isn't in the modbus protocol (or at least not documented). From what I read it doesn't seem like it has separate metering, just load control based on other data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants