This is a write up of how I managed to read SI 6048US values via a raspberry pi and send the values via MQTT to Home Assistant. Of coure you can use something else than Home Assistant.
I have 4 Sunny Islands in a 2Phase4 Setup with an external BMS (JK-BMS).
Part list:
- SI RS485 communication board
- Raspberry PI (I use the 3b+)
- USB-to-RS485 converter (be sure that the converter has a GND pin for a more reliable communication)
- I use this one: https://www.amazon.com/dp/B081NBCJRS
- MQTT Server (I use Mosquitto)
- RJ45 Communication cable
Mine came with the Sunny island. Its an RJ45-adapter to GND, DATA+ and DATA- Cable
You can also DIY it.
1. Connect the RJ45 Communication cable to the USB adapter.
GND <==> GND
DATA+ <==> A+
DATA- <==> A-
2. Plug in the RJ45 cable into the ComSMAOut RJ45-Port on the Master SI and the USB Connector to the raspberry pi.
Make sure you have terminating resistor on the ComSMAIn Port and the SI RS485 Communication board installed.
The Library I'm using uses the YASDI (Yet Another SMA Data Interface) protocol via RS485.
Make sure to set the correct Baud rate at the Sunny Island. Currently, I use 19200 to make 5 sec polling of the values possible.
I use the version 1.2 and not the latest (1.3). The latest doesnt work for me.
the mqtt topic consists of the prefix and the serialnumber of the SI. => "sunnyisland/<serialnumber>"
docker-compose.yml:
yasdi.ini:
When you run docker compose from the terminal you can see the image is connecting to the SI and sending the data to the MQTT server.
This is the data that gets sent from the pi to the MQTT Server:
Now you can use any application you want to read the values from the given MQTT topic.
I use this sensor config to import the values that i need into from the MQTT tpoic into Home Assisant
Enjoy your timely archived SI data!
This helped me a lot to diagnose a SI to JK-BMS CAN communication Error, which im doing a write up about soon.
Thanks to Kommando for helping me out with this one!
I have 4 Sunny Islands in a 2Phase4 Setup with an external BMS (JK-BMS).
Part list:
- SI RS485 communication board
- Raspberry PI (I use the 3b+)
- USB-to-RS485 converter (be sure that the converter has a GND pin for a more reliable communication)
- I use this one: https://www.amazon.com/dp/B081NBCJRS
- MQTT Server (I use Mosquitto)
- RJ45 Communication cable
Mine came with the Sunny island. Its an RJ45-adapter to GND, DATA+ and DATA- Cable
You can also DIY it.
1. Connect the RJ45 Communication cable to the USB adapter.
GND <==> GND
DATA+ <==> A+
DATA- <==> A-
2. Plug in the RJ45 cable into the ComSMAOut RJ45-Port on the Master SI and the USB Connector to the raspberry pi.
Make sure you have terminating resistor on the ComSMAIn Port and the SI RS485 Communication board installed.
The Library I'm using uses the YASDI (Yet Another SMA Data Interface) protocol via RS485.
GitHub - pkwagner/yasdi2mqtt: MQTT adapter for SMA YASDI inverters
MQTT adapter for SMA YASDI inverters. Contribute to pkwagner/yasdi2mqtt development by creating an account on GitHub.
github.com
Make sure to set the correct Baud rate at the Sunny Island. Currently, I use 19200 to make 5 sec polling of the values possible.
I use the version 1.2 and not the latest (1.3). The latest doesnt work for me.
the mqtt topic consists of the prefix and the serialnumber of the SI. => "sunnyisland/<serialnumber>"
docker-compose.yml:
services:
yasdi2mqtt:
image: "pkwagner/yasdi2mqtt:1.2"
restart: always
volumes:
- "./devices:/home/pi/yasdi2mqtt-1.2/devices"
- "./yasdi.ini:/home/pi/yasdi2mqtt-1.2/yasdi.ini:ro"
devices:
- "/dev/ttyUSB0:/dev/ttyUSB0"
environment:
YASDI_CONFIG: "/home/pi/yasdi2mqtt-1.2/yasdi.ini"
YASDI_DRIVER_ID: 0
YASDI_MAX_DEVICE_COUNT: 1
YASDI_UPDATE_INTERVAL: 5
MQTT_TOPIC_PREFIX: "sunnyisland"
MQTT_SERVER: "<IP>"
MQTT_PORT: 1883
MQTT_QOS_LEVEL: 0
MQTT_USER: "<user>"
MQTT_PASSWORD: "<pwd>"
LOG_LEVEL: 0
yasdi.ini:
[DriverModules]
Driver0=yasdi_drv_serial
[COM1]
Device=/dev/ttyUSB0
Media=RS485
Baudrate=19200
Protocol=SMANet
[Misc]
DebugOutput=/dev/stdout
When you run docker compose from the terminal you can see the image is connecting to the SI and sending the data to the MQTT server.
This is the data that gets sent from the pi to the MQTT Server:
{
"sn": <serialnumber>,
"time": 1726852630,
"values": {
"Msg": 0,
"Soh": 100,
"TotInvPwrAt": -0.9999023601412773,
"TotInvCur": 19.20009794086218,
"TotInvPwrRt": 1.9000976830720901,
"BatSoc": 82.0000988766551,
"BatVtg": 53.60000079870224,
"BatChrgVtg": 55.10000082105398,
"AptTmRmg": 0,
"TotBatCur": -17.69990260899067,
"BatTmp": 20.20009795576334,
"RmgTmFul": 13,
"RmgTmEqu": 179,
"BatSocErr": 0,
"GnRmgTm": 0,
"InvPwrAt": -0.2999023497104645,
"InvPwrAtSlv1": -0.19990234822034836,
"InvPwrAtSlv2": -0.19990234822034836,
"InvPwrAtSlv3": -0.19990234822034836,
"InvVtg": 120.00300569983665,
"InvVtgSlv1": 119.90000178664923,
"InvVtgSlv2": 119.90000178664923,
"InvVtgSlv3": 120.00000178813934,
"InvCur": 4.300097718834877,
"InvCurSlv1": 5.800097741186619,
"InvCurSlv2": 4.400097720324993,
"InvCurSlv3": 4.500097721815109,
"InvFrq": 60.00300284998957,
"InvPwrRt": 0.40009766072034836,
"InvPwrRtSlv1": 0.6000976637005806,
"InvPwrRtSlv2": 0.40009766072034836,
"InvPwrRtSlv3": 0.40009766072034836,
"ExtPwrAt": 0.00009765475988388062,
"ExtPwrAtSlv1": 0.00009765475988388062,
"ExtPwrAtSlv2": 0.00009765475988388062,
"ExtPwrAtSlv3": 0.00009765475988388062,
"ExtVtg": 3.1990001519443467,
"ExtVtgSlv1": 3.1000000461935997,
"ExtVtgSlv2": 0.7000000104308128,
"ExtVtgSlv3": 1.3000000193715096,
"ExtCur": 0.20009765774011612,
"ExtCurSlv1": 0.5000976622104645,
"ExtCurSlv2": 0.20009765774011612,
"ExtCurSlv3": 0.10009765625,
"ExtFrq": 0,
"ExtPwrRt": 0.00009765475988388062,
"ExtPwrRtSlv1": 0.00009765475988388062,
"ExtPwrRtSlv2": 0.00009765475988388062,
"ExtPwrRtSlv3": 0.00009765475988388062,
"TotExtPwrAt": 0.00009765475988388062,
"TotExtCur": 1.1000976711511612,
"TotExtPwrRt": 0.00009765475988388062,
"TotLodPwr": -0.9999023601412773,
"GdRmgTm": 0,
"Pac": -0.9999023601412773,
"Firmware": 7.304000346921384,
"Iac": 4.300097718834877,
"Vac": 120.00000178813934,
"Fac": 60.00000089406967,
"ChpPwrAt": 0.00009765475988388062,
"ChpRmgTm": 0,
"ChpStrRmgTm": 0,
"Sic1PvPwr": 0,
"Sic2PvPwr": 0,
"Sic3PvPwr": 0,
"Sic4PvPwr": 0,
"TotSicPvPwr": 0,
"TotSicBatCur": 0.00009765475988388062,
"TotMccLodPwr": 0.00009765475988388062,
"TotPvPwrAt": 0,
"TotLodPwrAt": 0,
"SlfCsmpPwrAt": 0,
"SlfCsmpIncPwr": 0,
"BatCpyThrpCnt": 0,
"GdCsmpPwrAt": 0,
"GdFeedPwrAt": 0,
"PacPV": 0.00009765475988388062,
"PacFeed-In": 0.00009765475988388062,
"PacConsumption": 0.00009765475988388062,
"kWhPV": 0,
"FwVer": 7.304000346921384,
"OnTmh": 16333.100243382156,
"FwVer2": 7.3000003467313945,
"EgyCntIn": 2998.3000446781516,
"EgyCntOut": 1022.3000152334571,
"EgyCntTm": 8534.60012717545,
"GnEgyCnt": 119.50000178068876,
"GnEgyTm": 196.30000292509794,
"GnOpTmh": 199.50000297278166,
"GnStrCnt": 212,
"GdEgyCntIn": 1.4000000208616257,
"GdEgyCntOut": 1521.1000226661563,
"GdEgyTmh": 7017.800104573369,
"GdOpTmh": 12671.000188812613,
"GdCtcCnt": 0,
"TotTmh": 5.700000084936619,
"Sic1EgyCntIn": 0,
"Sic2EgyCntIn": 0,
"Sic3EgyCntIn": 0,
"Sic4EgyCntIn": 0,
"TotSicEgyCntIn": 0,
"Sic1TdyEgyCntIn": 0,
"Sic2TdyEgyCntIn": 0,
"Sic3TdyEgyCntIn": 0,
"Sic4TdyEgyCntIn": 0,
"TotSicDyEgyCntI": 0,
"Serial Number": 1260043278,
"E-Total-In": 2998.3000446781516,
"E-Total": 1022.3000152334571,
"h-On": 16333.100243382156,
"TotLodEgyCnt": 0,
"SlfCsmpIncEgy": 0,
"SlfCsmpEgy": 0,
"SlfCsmpIncTdy": 0,
"GdCsmpEgyTdy": 0,
"kWhFeed-In": 0,
"kWhConsumption": 0,
"GdFeedEgyTdy": 0,
"Adr": "Master",
"OpStt": "Operating",
"OpSttSlv1": "Operating",
"OpSttSlv2": "Operating",
"OpSttSlv3": "Operating",
"CardStt": 2,
"Prio": "Ina",
"BatChrgOp": 10,
"AptPhs": "---",
"GnDmdSrc": "None",
"GnStt": "Off",
"InvOpStt": "Run",
"InvOpSttSlv1": "Run",
"InvOpSttSlv2": "Run",
"InvOpSttSlv3": "Run",
"Rly1Stt": "Off",
"Rly2Stt": "Off",
"GnRnStt": "On",
"Mode": "Operation",
"Error": "-----",
"ChpStt": "Idle",
"PvGdConStt": "---",
"LodGdConStt": "---",
"BatMntStt": "Off"
}
}
Now you can use any application you want to read the values from the given MQTT topic.
I use this sensor config to import the values that i need into from the MQTT tpoic into Home Assisant
mqtt:
sensor:
- name: "si-mqtt-BatVtg"
unique_id: "si-mqtt-BatVtg-0001"
state_topic : "sunnyisland/<serialnumber>"
value_template: '{{ (value_json["values"].BatVtg | float) | round(2, default=0) | float }}'
unit_of_measurement: "V"
entity_category: "diagnostic"
state_class: "measurement"
Enjoy your timely archived SI data!
This helped me a lot to diagnose a SI to JK-BMS CAN communication Error, which im doing a write up about soon.
Thanks to Kommando for helping me out with this one!