Custom Component solaredge-modbus-multi

I know there are already several other SolarEdge modbus related integrations, but for various reasons none of them met all of my needs or what I was looking for, so I created solaredge-modbus-multi instead.

It’s available on GitHub at: GitHub - WillCodeForCats/solaredge-modbus-multi: Integrates SolarEdge inverters with Modbus/TCP local polling. Single inverters, multiple inverters, meters, and batteries are supported.

You can find it in HACS by searching for “SolarEdge Modbus Multi”.

Major Features

  • Inverter support for 1 to 32 SolarEdge inverters.
  • Meter support for 1 to 3 meters per inverter.
  • Battery support for 1 or 2 batteries per inverter.
  • Supports site limit and storage controls.
  • Automatically detects meters and batteries.
  • Supports Three Phase Inverters with Synergy Technology.
  • Polling frequency configuration option (1 to 86400 seconds).
  • Configurable starting inverter device ID.
  • Connects locally using Modbus/TCP - no cloud dependencies.
  • Informational sensor for device and its attributes
  • Supports status and error reporting sensors.
  • User friendly configuration through Config Flow.

Read about more it on the wiki: WillCodeForCats/solaredge-modbus-multi/wiki

2 Likes

Thanks for all the work, it’s a really great component and works mostly as expected. The 2.2 beta actually fixed an earlier breaking problem I had which was wonderful. I did have one question in regards to the SolarEdge Modbus setup though.

I have 2 SE 10000H inverters and set up both units as described (leader, follower; 1, 2, etc). The only change I made that wasn’t suggested was to only move the networked inverter to Import/export reading mode but I don’t think that really makes any difference.

My Modbus import and export readings are reported identical on each unit, so it looks like I am self-consuming 100% of my solar generation. The official Solaredge app also changed and now reports this, which is a little confusing to read on that graph. Is this expected behavior or is something set up wrong and I am missing some data somewhere?

I’m not sure what “import/export reading mode” is.

Well, without knowing what or why you’d would randomly change settings, I would suggest changing it back the way it was before and not doing that.

If you’re randomly changing meter settings you really can’t do that: meter settings must match how they’re physically installed. If your settings don’t match how the CTs are installed you’ll just create bad data.

I installed the latest beta version, but is it correct that only the toggles for power control are available and not yet the controls itself?

Correct only the options UI is there, they don’t do actually anything yet.

Once I have a final 2.2.6 release then I will release 2.2.7-pre.1 which will have control functions covered under the storedge control option. There was a reported issue with pre.3 that required a pre.4 before final release.

You can set the options now and the related function will appear in a future release, but they will not enable any new functionality in 2.2.6.

Release v2.2.7-pre.3 is now available.

This is an awesome integration, thanks for taking it a step further.
I’ve just lit up a 7 inverter setup and have 203 new sensors. Great!

I’ve been attempting to work with adaptations of some of the other non-multi energy.yaml files floating around on the forum. Quickly I’ve come to realize it’s a daunting task to first combine all the inverter’s data and adapt the templates (live solar readings from 7 inverters) to existing yaml configs. Could you share how you’re working with multiple inverters and presenting the data?

For aggregate data I just have a few template sensors adding up all the values, so in my case for total ac power I have a template sensor that adds each sensor.solaredge_i*_ac_power together. Obviously this is a lot of manual work making template sensors if you want lots of summary data or just have a lot of inverters.

What I could consider looking into is creating some kind of virtual inverter device within the integration that would total up some common things like AC/DC power, AC/DC current, total energy, maybe average voltages and frequency.

Yeah, basically what I’m left with doing, as you mention with template sensors.

This is what i’m working with so far:

template:
  - sensor:
      - name: "Site Solar AC Power"
        unique_id: site_solaredge_ac_power
        unit_of_measurement: "W"
        icon: mdi:solar-power
        state: >    
          {{ [ states('sensor.solaredge_i1_ac_power'), 
               states('sensor.solaredge_i2_ac_power'),
               states('sensor.solaredge_i3_ac_power'), 
               states('sensor.solaredge_i4_ac_power'),
               states('sensor.solaredge_i5_ac_power'),
               states('sensor.solaredge_i6_ac_power'), 
               states('sensor.solaredge_i7_ac_power') ]
               | map('float') | sum | round(0) }}
        availability: >
          {{ not 'unavailable' in
             [ states('sensor.solaredge_i1_ac_power'), 
               states('sensor.solaredge_i2_ac_power'),
               states('sensor.solaredge_i3_ac_power'), 
               states('sensor.solaredge_i4_ac_power'),
               states('sensor.solaredge_i5_ac_power'),
               states('sensor.solaredge_i6_ac_power'), 
               states('sensor.solaredge_i7_ac_power') ] }} 

I think your idea about adding all the _i* data together is a good one - maybe prefix those with sensor.site_solaredge_XXXXX. That would be a really useful feature, while still having individual i* data too.

Looks like Home Assistant 2022.12 new feature Summing entities without templates would do basically the same thing. I haven’t tried it yet, I usually wait until a .1 or .2 release.

heh funny - As long as it has the ability to add the necessary state and device classes. I’ll install it on my demo install and report back.

It doesn’t - I suppose one could edit the core.entity.registry but that’s more cumbersome than .yaml

Hi. I have inverter and counter meter. I use this integration and i have a question. IS any chance to read at the moment how many energy i use to my home and how many export to my energy distibution ? The same data whis is show in app android SolarEdge.

Yes, you can use it with the Home Assistant Energy dashboard.

Hi there,

just stumbled upon this cool addon, which seems to be a good alternative as the polling interval can be super short, compared to the “official” solaredge binding.

Question:
Is there any risk you see to utilize a polling interval as little as 1 second (keeping the ModBus connection open)? Or will this create a huge amount of logfile-entries and (over time) destroy the SD card of my raspberry?

Any hints appreciated :slight_smile:

I wouldn’t recommend doing 1 second polling with the database on an SD card, there will be writes every time the state updates. If you want to do 1 second interval move the database to an SSD or regular hard drive.

2 Likes

Thanks again for the good hints. I now moved to an 16GB SSD (instead of a SD Card) and I am now running on a 1 second MODBUS query interval (keeping the connection open). The whole responsiveness of my automations have increased massively. :+1:

The only negative side effect I can observe to far is that the size if the database has increased quite a bit (to no surprise), so I had to set some exclusions in the “recorder” … hope that this will bring the DB size under control again. Let’s see how this will work out in the near future. Thanks for the good hints, again. :slight_smile:

1 Like

Thanks for the posting this integration @WillCodeForCats. I’ve been using this for the last 3 weeks without any issues.

I’m now at the stage of reading through the Technical and Application Notes and have a few questions to do with the what the controls do.

Where do you recommend I go to ask questions about controlling the Inverter and Battery?

Thanks.

There is some discussion about controls here:

2 Likes