Custom Component: SolarEdge Modbus TCP

Hey,

i’m using this integration and loving it. I now have 22 entities, but the one i really like to see is the grid power but i can’t seem to get it working. Is there any way i can see what my current power is that i’m exporting or importing? I have a solaredge meter so i can see i my solaredge app what i am currently exporting or importing and love to implement this in HA so i can control my electric heating depending on my grid power.

many thanks.

Hi, that is correct. Only One client at a time is allowed. However there are solutions for creating a proxy allowing multiple clients. I know there exist python projects for it but have not seen it implemented for any HA addons

To calculate daily/monthly energy you can use the integral function in grafana if you are using influxdb.

To see export have a look at the meter1 option to read the second meter as well.

In the config
read_meter1: true

This also slightly depend how your inverter is configured

I have enabled meter1 and the sensor meter1 is availble but it says 0
Is there something i’m missing out?
Love to have sensors that monitor the grid power cause the gouvernement has announced new rules regarding consumption vs solar ans want to cut off some appliances when grid power is to high

Finaly got it working with the workaround awulf suggested :grinning: Now the entity modbus_meter1 is my grid power. Is there a way to have all the other data to be a sensor? SolarEdge Modbus Meter #1 now has 1 value but when i click it i have a bunch of other values.

It seems i underestimated myself and was a little bit to soon :smile:
I’ve added this to configuration.yaml:

    solaredge_exported:
        friendly_name: "geexporteerd"
        value_template: "{{ state_attr('sensor.solaredge_modbus_meter_1', 'exported') }}"
        unit_of_measurement: 'Kwh'

And a sensor from modbus_meter_1 was availble.

thanks for this , really loving it!!!

I faced the same issues as you did, tried all the different solutions and was nearly giving up. However, as a final try, I grabbed a old powerline adapter lying around and decided to hook my inverter to ethernet instead of WiFi. Rebooted the whole bunch and to my amazement the modbus data was pouring into HA.

Seems like the TCP ports are blocked when the inverter is not connected through ethernet. Could be worth a final try if your inverter is on wifi as well.

@erikarenhill thanks for your work on this component! Much appreciated!

Glad you got it working. Mine is running through Ethernet and has been since the initial install. Not sure what’s going on here. Thanks for the update.

It is in the documentation of SolarEdge, modus won’t work over wifi. I put a ethernet cable in the SolarEdge and because I have no switch there, and ethernet to wifi adapter.

1 Like

Does this code support a storedge battary added to the solaredge and modbusmeter system?

In a couple off months a battery will be added to my system and I like to implement the realtime battery charge/discharge instead of the Official integration with 15 minute refresh intervals.

I did all the things in the istructions but I get no value or unknow.
I tried both 1502 and 502, Firewall disabled, Modbus TCP seems to be enabled but from the SolarEdgeApp I can not set anything.
I don’t know what else to try. Any help appreciated.

I’m getting a similar error as you @wallipolli.

Invalid config for [solaredge_modbus]: expected a dictionary for dictionary value @ data[‘solaredge_modbus’][‘host’]. Got ‘192.168.100.146’ expected a dictionary for dictionary value @ data[‘solaredge_modbus’][‘name’]. Got ‘SolarEdge Modbus’ expected a dictionary for dictionary value @ data[‘solaredge_modbus’][‘port’]. Got 1502 expected a dictionary for dictionary value @ data[‘solaredge_modbus’][‘read_meter1’]. Got True expected a dictionary for dictionary value @ data[‘solaredge_modbus’][‘scan_interval’]. Got 5. (See /config/configuration.yaml, line 68).

I’m using the sample-configuration.yaml content with the correct IP address for my system. Visual Studio Code in Hass.io is not complaining about my configuration.yaml.

I have removed the OOTB SolarEdge integration. Still no joy. Anyone any ideas…

Thanks in Advance,

Awulf’s steps worked! - SE5000H latest firmware as of Jan 2021.

" awulf

Finally Modbus TCP working! :smiley:
Not entirely sure if its a bug or what happened, but these are the steps I took, just in case someone else is having these problems. (For the screen less model)

  1. Flick the switch on SolarEdge to P and connect your mobile device to the WiFi hotspot (password on the side of the inverter, or use the QR code + mySolarEdge app)
  2. Open the browser and visit http://172.16.0.1 and click on the “Communication” menu item
  3. Select “RS485-2”
  4. Choose Protocol “SunSpec (Non-SE Logger)”, also under that set Device ID to 1 (mine was set to 5). Now some Modbus TCP requests were responding.
  5. Change the Protocol over to “SolarEdge Master” (now a SolarEdge logger script was getting data too)
  6. Change back protocol to “None”
  7. Power cycle the inverter for good measure, and it was all still working
    ."

I’ve setup this custom component and it’s working fine, but I’m missing a crucial data which is the power from the solar panels to the home :frowning:
My current setup is:
Solaredge inverter 1
Server: LAN
Lan: Modbus: TCP 502
RS 485-1_ MLT mutidevice
Meter1 ( device MTR, Protocol WN, ID 2)
Battery LG ( Device Bat , LG, ID 15)
RS 485 E ( Device SE, Protocol M, ID 1)
IP: 192.168.1.8

Inverter 3 (Triphase): SE3500
Server RS485-1
Lan: Modbus: TCP: 502
Device Se protocol S, ID 3
IP: 192.168.1.6


The component is working when connecting to 192.168.1.6.
The sensor.solaredge_modbus ac_power_output should be power from the panels.
The sensor.solaredge_modbus_meter_1 ac_power_output should be power consumption from the grid.
How can I get the power from the panels to the house?

I have the exact the same error:

Invalid config for [solaredge_modbus]: expected a dictionary for dictionary value @ data[‘solaredge_modbus’][‘host’]

etc, etc.

Any1 has any idea?

Thanks and regards

I couldn’t get anywhere with it so I moved over to this solution which I managed to get working. https://github.com/binsentsu/home-assistant-solaredge-modbus :+1:

That said I’d still like to know how to get this solution working for the future!

1 Like

Thanks for the link. Got it work with that solution as well.

1 Like

Hi.
does anyone know the solarEdge Modbus registers for the current charging / discharging power
of the battery ?

Somehow the monitoring app and the setapp can split the current production into household consumption and battery charge.
But this information is not availalbe via the REST api nor the documented Modbus registers.

Maybe you can catch it with a sniffer when you login to the webinterface of solaredge. i capture at that way the data of the production of each panel.