Sol-Ark - Inverter Monitoring

poldim

New Member
I have a custom integration for HA on github now. It has good functionality at this point when using TCP/IP. Should not be too hard to make it work with RTU, which is what I could use some help with. If you are interested in working on it let me know and I will give you access. Just send me your github username.

View attachment 65412
View attachment 65411
Very nice!! The username is the same: https://github.com/poldim. It's the same on reddit, discord if you want to chat...

How are you converting from RTU to TCP? The little black MAX485 adapter on a Pi to just act as the TCP/IP gateway?
IIRC, your NR flows were pushing the data to MQTT?

BTW, I took some time and cleaned up the SunSynk register map file. Use as needed: https://docs.google.com/spreadsheets/d/1JKPSJ3RWAkGTsEz0LB08PZZ-XCBtGfTnJy5yqc7GmP4/edit?usp=sharing
 
Last edited:

solardad

Solar Addict
BTW, I took some time and cleaned up the SunSynk register map file. Use as needed: https://docs.google.com/spreadsheets/d/1JKPSJ3RWAkGTsEz0LB08PZZ-XCBtGfTnJy5yqc7GmP4/edit?usp=sharing

Looks good.

As a side note it looks like there are two address R/W registers, 43 and 58, that control inverter shut down / on and RSD (Rapid Shut Down (PV Only)) I find this very interesting since I have been contemplating how to deal with a battery bank/cell over or under voltage issue. Provides some additional options on how to tackle the issue.
 

Fahmula

Solar Enthusiast
Nice write up @solardad!
I've got influxdb and grafana working nicely thanks to all the effort from you and the guys over at powerforum. Only issue I'm having is setting up MQTT on Hass.io. I've got the mosquitto broker listing to the ip and port from node red but I'm not seeing any entities in home assistant.

Edit;
Got it working now buy adding a user name and password!
 

Attachments

  • Untitled.png
    Untitled.png
    61.3 KB · Views: 7
Last edited:

Fahmula

Solar Enthusiast
Nice write up @solardad!
I've got influxdb and grafana working nicely thanks to all the effort from you and the guys over at powerforum. Only issue I'm having is setting up MQTT on Hass.io. I've got the mosquitto broker listing to the ip and port from node red but I'm not seeing any entities in home assistant.

Edit;
Got it working now buy adding a user name and password!

Running into another issue with Home Assistant Energy. I can't seem to figure it out.
 

Attachments

  • Untitled.png
    Untitled.png
    29.6 KB · Views: 6

bixelps

New Member
Very nice!! The username is the same: https://github.com/poldim. It's the same on reddit, discord if you want to chat...

How are you converting from RTU to TCP? The little black MAX485 adapter on a Pi to just act as the TCP/IP gateway?
IIRC, your NR flows were pushing the data to MQTT?

BTW, I took some time and cleaned up the SunSynk register map file. Use as needed: https://docs.google.com/spreadsheets/d/1JKPSJ3RWAkGTsEz0LB08PZZ-XCBtGfTnJy5yqc7GmP4/edit?usp=sharing
I have invited you to collaborate on my custom integration. I wrote a little on the main page about how it work but in short I am using a USB<->RS485 converter and https://github.com/3cky/mbusd running on an old OpenWRT box. This is a direct Modbus interface to the inverter and does not require MQTT.

It will be trivial to add native RTU support I think.

If you will install it and make sure you do not have any issues I will feel more confident in making it public.
 

bixelps

New Member
I have made my SolArk custom integration for Home Assistant available here for anyone interested.
https://github.com/pbix/HA-solark-PV

This is a HACS compliant integration. There are instructions on the main page of how to install it directly in HA.

It uses Modbus directly. For now it support Modbus/TCP but with a simple hack you can use Modbus RTU.

I have tested it with Home Assistant Energy and it seems to be working good. Looking forward to the comments of others on it over on github.
 
Last edited:

Fahmula

Solar Enthusiast
I have made my SolArk custom integration for Home Assistant available here for anyone interested.
https://github.com/pbix/HA-solark-PV

This is a HACS compliant integration. There are instructions on the main page of how to install it directly in HA.

It uses Modbus directly. For now it support Modbus/TCP but with a simple hack you can use Modbus RTU.

I have tested it with Home Assistant Energy and it seems to be working good. Looking forward to the comments of others on it over on github.
I was using your integration and also MQTT on HA and it seems running both at the same time was causing my issue.
 

poldim

New Member
I have made my SolArk custom integration for Home Assistant available here for anyone interested.
https://github.com/pbix/HA-solark-PV

This is a HACS compliant integration. There are instructions on the main page of how to install it directly in HA.

It uses Modbus directly. For now it support Modbus/TCP but with a simple hack you can use Modbus RTU.

I have tested it with Home Assistant Energy and it seems to be working good. Looking forward to the comments of others on it over on github.


When I click to setup the integration, it comes up like this. I'm assuming this is just some more details that need to be built out in your config_flow. I tried to compare to the ESPHome one, but I'm no coder so I'm somewhat useless here.
I set it up with 20 second updates and it would pull the initial value and then go intermitent for a few pulls and then finally crash without getting the data. Log error below.

Thanks for making this and LMK if you want to move to GH or another place for the feedback.

1632378484736.png1632379000860.png



[CODE]2021-09-22 23:31:15 ERROR (MainThread) [custom_components.solark_modbus.hub] Unexpected error fetching SolArk data: unpack requires a buffer of 4 bytes Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh self.data = await self._async_update_data() File "/config/custom_components/solark_modbus/hub.py", line 87, in _async_update_data realtime_data = await self.hass.async_add_executor_job( File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/solark_modbus/hub.py", line 128, in read_modbus_realtime_data data["totalinv_e"] = decoder.decode_32bit_uint()/10.0 File "/usr/local/lib/python3.9/site-packages/pymodbus/payload.py", line 411, in decode_32bit_uint handle = self._unpack_words(fstring, handle) File "/usr/local/lib/python3.9/site-packages/pymodbus/payload.py", line 361, in _unpack_words handle = unpack(up, handle) struct.error: unpack requires a buffer of 4 bytes[/CODE]
 

bixelps

New Member
Thanks for making this and LMK if you want to move to GH or another place for the feedback.
Please make an issue on Github and describe your setup a little and include your error message.. I cannot do support here effectively.
 

dennisuello

Solar Enthusiast
I have mine hooked up
Can you still use the Sol-Ark Powerview app while using Solar Assistant and does it effect close looped battery communication on the Canbus line?

Thanks
I have mine hooked up with RS232 cable to where Sol-ark WiFi dongle goes, so not in my case.
 

mano

New Member
Solar Assistant monitoring my sol-ark.
View attachment 65827

I am interesting in doing this. My port in Sol-ark-12-P has battery communication cable already connected. In the settings of the inverter, the setting "Battery Lithium Mode" is set of "4". I was wondering if we can get data out of the inverter in this case. The Solar assistant website suggests using a RJ45 port splitter if the port is already taken (I think it simply parallel connections, which is ok for RS485), but at the same time the battery I think I the master already, and the inverter being the salve.
 

robby

Solar Addict
I am interesting in doing this. My port in Sol-ark-12-P has battery communication cable already connected. In the settings of the inverter, the setting "Battery Lithium Mode" is set of "4". I was wondering if we can get data out of the inverter in this case. The Solar assistant website suggests using a RJ45 port splitter if the port is already taken (I think it simply parallel connections, which is ok for RS485), but at the same time the battery I think I the master already, and the inverter being the salve.
I am in the same boat as you. I have fortress batteries closed loop on Mode 4 and I am using the Dongle and PV-Pro.
I want to use Solar-Assistant but I also want to be able to access PV-Pro and have the dongle for updates.
Two monitoring systems may seem like a lot but I do like the fact that Sol-Ark is monitoring my system and will supposedly call me if something happens. At the same time I need real time updates so we can shift loads to cut Grid usage to a minimum.
 

denarius

Solar Enthusiast
I am interesting in doing this. My port in Sol-ark-12-P has battery communication cable already connected. In the settings of the inverter, the setting "Battery Lithium Mode" is set of "4". I was wondering if we can get data out of the inverter in this case. The Solar assistant website suggests using a RJ45 port splitter if the port is already taken (I think it simply parallel connections, which is ok for RS485), but at the same time the battery I think I the master already, and the inverter being the salve.

If your inverter is reading your battery via the RS485 then yes a splitter won't work for you. Even if the inverter is just set to read from RS485 and you connect SolarAssistant to the port it can't read from it. That leaves you with only one monitoring port, the WiFi/RS232 port. Some of the other Sol-Ark models has multiple RS485 ports.
 

Sanwizard

Photon Sorcerer
If your inverter is reading your battery via the RS485 then yes a splitter won't work for you. Even if the inverter is just set to read from RS485 and you connect SolarAssistant to the port it can't read from it. That leaves you with only one monitoring port, the WiFi/RS232 port. Some of the other Sol-Ark models has multiple RS485 ports.
If you install a Victron shunt in front of your battery, solar-assistant can read that directly for instant battery SOC. You will need a VE to USB cable for the shunt to connext to the Pi.
 
Top