Custom Component: SolarEdge Modbus TCP

My modbus intergration stopped working… It worked fine for over a year… Perhaps een upgrade from solaredge? Could they messed something up with an upgrade of the firmware?

Latest firmware stops it working over wifi. I had to run a cable to get it working.

Thanks! I connected a Cable and set the inverter to use ethernet and now it’s working again!

Dear @erikarenhill , I’m using happily your custome component since a year, and it’s great.

I just upgraded my HA instance, and I noticed the following error message in the log, wonder if it is a problem or not:

Detected blocking call to sleep inside the event loop. This is causing stability issues. Please report issue to the custom component author for solaredge_modbus doing blocking calls at custom_components/solaredge_modbus/sensor.py, line 75: sleep(0.005)
1 Like

thanks for notifying me on this @Guesswho620 , I’ll have a look how I could fix this

I just updated to 2022.4, but suddenly all attributes are gone? Anyone else have this issue?

@dutchguy I have a fix for this, I will get it pushed into github in a moment so you should be able to update soon

@dutchguy please try the new version now and see if it works better for you.

That was a quick fix! Updating now…

Thanks for the update, it is working fine again. The only thing left is a warning:

Detected blocking call to sleep inside the event loop. This is causing stability issues. Please report issue to the custom component author for solaredge_modbus doing blocking calls at custom_components/solaredge_modbus/sensor.py, line 75: sleep(0.005)

Is this something you can fix too? Maybe you can replace it by await asyncio.sleep(delay)?

I just manually replaced the sleep(0.005) by await asyncio.sleep(0.005) and now all the warnings are gone. Maybe you can fix this for a next release?

1 Like

Thanks for the suggestion, will do that

Hello Erik,

thank you very much for your project and efforts. I’ve tried your solution to bind a solaredge SE7K (with display) to HA, but without sucess. The modbus over TCP has been activated by the solaredge support and a portscan shows the open 502 port at the Inverter-IP. I also have a three phase energy (revenue) meter (from solaredge) at ID=2 installed (like the official description of installation) and no batteries.

RS485-1:
Protocol Modbus (Multi-device)
Meter Export+Import
Meter Protocol SolarEdge
Device ID 2
CT Rating 50
Topology WYE

I did everything as it is discribed, but HA shows “unknown” at every sensor and works very slow. I’m a absolute beginner at HA so I don’t know what can I do to make this integration work. Maybe someone can help me in any way. Thanks a lot.

Hi, what does the config look like, anything in the HA logs? Do you use wifi or Ethernet?

Please tell me, where can I find this code-section? In the configuration.yaml?

Thank’s very much for your fast answering. :smile: I use Ethernet. I will post the log or error code as soon as I’m at home. Thank’s for the moment.

Hi, so now I’m at home and this ist the log of HA with the error code:`

creating modbus sensor
creating modbus meter#1 sensor
2022-04-20 14:02:42 ERROR (MainThread) [custom_components.solaredge_modbus.sensor] error 4
2022-04-20 14:03:12 ERROR (MainThread) [custom_components.solaredge_modbus.sensor] error 4
2022-04-20 14:03:13 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform template is taking over 10 seconds.
2022-04-20 14:03:13 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform utility_meter is taking over 10 seconds.
2022-04-20 14:03:13 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform solaredge_modbus is taking over 10 seconds.
2022-04-20 14:03:13 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform energy is taking over 10 seconds.
2022-04-20 14:03:13 WARNING (MainThread) [homeassistant.setup] Setup of mobile_app is taking over 10 seconds.
2022-04-20 14:03:13 ERROR (MainThread) [homeassistant.components.utility_meter.sensor] Could not restore state <unknown>. Resetting utility_meter.solar_production_daily
2022-04-20 14:03:13 ERROR (MainThread) [homeassistant.components.utility_meter.sensor] Could not restore state <unknown>. Resetting utility_meter.solar_production_hourly
2022-04-20 14:03:13 ERROR (MainThread) [homeassistant.components.utility_meter.sensor] Could not restore state <unknown>. Resetting utility_meter.solar_production_weekly
2022-04-20 14:03:13 ERROR (MainThread) [homeassistant.components.utility_meter.sensor] Could not restore state <unknown>. Resetting utility_meter.solar_production_monthly
2022-04-20 14:03:43 ERROR (MainThread) [custom_components.solaredge_modbus.sensor] error 4
2022-04-20 14:03:43 ERROR (MainThread) [homeassistant.components.sensor] Setup of platform energy is taking longer than 60 seconds. Startup will proceed without waiting any longer.
2022-04-20 14:04:13 ERROR (MainThread) [custom_components.solaredge_modbus.sensor] error 4
2022-04-20 14:04:43 ERROR (MainThread) [custom_components.solaredge_modbus.sensor] error 4
2022-04-20 14:05:13 ERROR (MainThread) [custom_components.solaredge_modbus.sensor] error 4
2022-04-20 14:05:13 WARNING (MainThread) [homeassistant.setup] Setup of default_config is taking over 10 seconds.
2022-04-20 14:05:44 ERROR (MainThread) [custom_components.solaredge_modbus.sensor] error 4
2022-04-20 14:06:14 ERROR (MainThread) [custom_components.solaredge_modbus.sensor] error 4
2022-04-20 14:06:44 ERROR (MainThread) [custom_components.solaredge_modbus.sensor] error 4
2022-04-20 14:07:14 ERROR (MainThread) [custom_components.solaredge_modbus.sensor] error 4
2022-04-20 14:07:44 ERROR (MainThread) [custom_components.solaredge_modbus.sensor] error 4'

Thanks for helping me.

Error 4 is typically that it cant communicate with the inverter. Did you specify correct ip address and port in configuration.xml?

Yes, IP and Port ist correct. The Display Front my Inverter also shows that Modbus TCP ist connected.

I have also tried to restart the Inverter.

Maybe I Had to change something about the rs485-2 settings?

I don’t have a smart meter myself, but see if this is of any help: Custom Component: SolarEdge Modbus TCP - #29 by awulf