Inverter: SMA - dalathegreat/Battery-Emulator GitHub Wiki
Caution
Working with high voltage is dangerous. Always follow local laws and regulations regarding high voltage work. If you are unsure about the rules in your country, consult a licensed electrician for more information.
Sunny Boy Storage
- Sunny Boy Storage 2.5 (SBS2.5-1VL-10) ✔️
- Sunny Boy Storage 3.7 (SBS3.7-10) ✔️
- Sunny Boy Storage 5.0 (SBS5.0-10) ✔️
- Sunny Boy Storage 6.0 (SBS6.0-10) ✔️
[!NOTE] The inverter contains a 120 Ohm terminating resistor on CAN-L/H pins
Sunny Boy Smart Energy
- Sunny Boy Smart Energy 3.6 (SBSE3.6-50) ✔️
- Sunny Boy Smart Energy 4.0 (SBSE4.0-50) ✔️
- Sunny Boy Smart Energy 5.0 (SBSE5.0-50) ✔️
- Sunny Boy Smart Energy 6.0 (SBSE6.0-50) ✔️
Sunny Tripower Smart Energy
- Sunny Tripower Smart Energy 5.0 (STP5.0-3SE-40) ✔️
- Sunny Tripower Smart Energy 6.0 (STP6.0-3SE-40) ✔️
- Sunny Tripower Smart Energy 8.0 (STP8.0-3SE-40) ✔️
- Sunny Tripower Smart Energy 10.0 (STP10.0-3SE-40) ✔️
Sunny Island
- Sunny Island 4.4M (SI4.4M-13) (Testers wanted!)
- Sunny Island 6.0H (SI6.0H-13) (Testers wanted!)
- Sunny Island 8.0H (SI8.0H-13) (Testers wanted!)
[!IMPORTANT] The Sunny Island inverters are rated for 48V. Make sure the battery you intend to use matches the voltage requirement!
This inverter does not handle a CAN connected EV battery on the same channel. If the inverter, which likes to see only BYD CAN frames, sees standard automotive CAN frames, the inverter will enter a fault state.
This can be solved in several ways:
- You can use the Stark CMR hardware which has more CAN channels (Recommended option)
- You can add an isolated MCP2515 CAN channel
- You can add an isolated MCP2518 CANFD channel, and run it in classic CAN mode
- You can use a CAN filter between inverter and the rest of the system
Keep in mind that you will also need automated contactor control via GPIO, or a battery that has CAN controllable on/off contactors. This is due to a complicated pairing process when taking the battery in to use, when the inverter will command on/off the battery in order to succeed with pairing. Due to this, the Stark CMR is highly recommended for first timers!
Important
Grounding is extremely important for all inverters. Make sure the battery case is connected to protective earth, and the shield part of the twisted pair CAN is connected to PE also! Failing to do this may result in CAN errors.
The inverter needs to be able to control the closing of the contactors. This is done via a signal, called the enable line. It controls the "Inverter allows contactor closing" in the Battery Emulator web interface.
Stark hardware
If you have the Stark CMR, you can wire the 12V enable line directly to SIGNAL IN (GPIO 2) and SMA GND directly to SIGNAL GND. The Stark CMR hardware does not require any resistors, it can take the full input voltage of the enable line.
Other hardware
The Enable line is connected to GPIO 5 on the LilyGo board. Due to the signal being 12V, we need to step it down to 3.3V that the Battery-Emulator uses on its GPIO pins.
[!NOTE] In some cases GPIO5 is already occupied by the battery (for example with a BMW i3 battery or using an MCP2515 CAN addon board). An error will be thrown while compiling the battery emulator. SMA enable pin has to be re-assigned in the Battery Emulator code from GPIO5 to e.g. GPIO33
A small PCB with resistors and JST Connectors is a great way to stop down from 12v to ~3.3V. Parts list:
- 2x 2.2K Ω resistor
- 1x 1K Ω resistor
- 1x 3K Ω resistor
- 2x JST Connector 2 pins (1 for SMA Inverter enable line cables, 1 for Battery emulator cables)
This stepdown can be achieved with a resistor divider

The 1k resistor isn't technically needed but just in case there's a short it would limit the current into the LilyGo pin.
Details for Sunny Boy Smart Energy & Sunny Tripower Smart Energy
Pin layout Custom PCB in the example below:
1. 12V Enable line SMA Tripower
2. Ground SMA Tripower
3. Ground Lilygo
4. GPIO 05 or 33 (or a different pin that you configure) (Default is GPIO 05)
This is how the connection for the SMA Tripower would look like.

SMA Hybrid Communication pin layout
1. CAN-H
2. 12V enable line
3. CAN-L
4. Ground
13. Fast-Stop
14. Fast-Stop
Details for Sunny Boy Smart Energy & Sunny Tripower Smart Energy
Fast-Stop is not required, but optional. This should turn off the inverter (and open battery contacts?) in a safe way.Fast-Stop or emergency stop is a normally open connection. Closing the circuit (pin 13 to pin 14) will disable the inverter completely. PV input, battery and battery backup.
You can enable Fast-Stop in the settings of the inverter (Device parameters -> Device -> Inputs/outputs -> Digital input -> Fast shutdown via the digital input)
When activated the following event will be triggered
10513 -NSS quick stop: Stop through Digital inputs is executed
When deactivated the following event will be triggered
10513 - NSS quick stop: Start through Digital inputs is executed (maybe it will start-up from itself... )
I was too impatient to wait for the inverter to startup (after 2 minutes I disconnected the inverter completely) I'm not sure if the inverter will start up to 'normal' if you wait longer (feel free to edit the wiki)
A known working solution to restart the inverter is:
- Black switch on the side of the SMA Hybrid turned off
- Turn off 230v SMA hybrid
- Wait until all LEDS are off
- Enable your emergency stop to be open again
- Turn on 230v
- Turn on black switch
- Wait for SMA Hybrid
- It should start within 5 minutes.
Details for Sunny Boy Storage
For this inverter type, use the option called BYD Battery-Box HVS over SMA CAN or alternatively the BYD Battery-Box H over SMA CAN as "Inverter Protocol" setting
Details for Sunny Boy Smart Energy
For this inverter type, use the option called BYD Battery-Box HVS over SMA CAN as "Inverter Protocol"
Details for Sunny Tripower Smart Energy
For this inverter type, use the option called BYD Battery-Box HVS over SMA CAN as "Inverter Protocol"
Details for Sunny Island
For this inverter type, use the option called aSMA Low Voltage (48V) protocol via CAN as "Inverter Protocol"
The SMA inverter is sensitive when you try to install the battery to the inverter. Pairing the battery in the installation assistant is sometimes tricky.
Details for Sunny Boy Storage
For the SMA battery configuration process (pairing) to succeed, the following conditions must be fulfilled:
- The battery emulator state (as seen on the webserver) is OK. This means that the battery must be sending CAN messages.
- The enable line is connected, and able to close the contactors.
- The HV DC lines of the battery are connected to the SMA, such that the SMA measures voltage when the enable line goes high.
- The SMA is connected via CAN to the battery emulator, such that the SMA can send a pairing request, and the battery emulator can respond to this.
Steps:
- Power on the SMA, and wait for the blue light to stay on continuously.
- Connect to the SMA web interface. The IP address of webserver is
192.168.12.3when connecting directly to the SMA WiFi network (access point). This web interface will list the IP address of the SMA on your local network on the bottom of the page. Some inverters were delivered without onboard WIFI/WLAN so you can only access these via your LAN network address. On your local network, you can also reach the webpage via its hostnamesmaxxxxxxxxxx.home(wherexxxxxxxxxxshall be replaced with the serial number of your device) or look up the IP address with an app like 'Net Analyzer'. - Log in to the SMA web interface as installer. To perform the battery configuration process you'll need the installer password (or generate PUK from SMA website).
- Start the installation assistant (https://smaxxxxxxxxxx.home/#/formwizard) or via top-right dropdown menu.
- Proceed with the SMA installation assistant till the 'battery configuration' step, but do not complete the battery config yet.
- Go to the battery config step in the installation assistant. Wait for the pairing to start. During pairing, make sure the
Inverter allows contactor closingcheckbox on the battery emulator webserver goes ✔️
- Let the pairing run until it completes. The assistant showing 100% may not mean that the pairing is completed. The battery should be recognised by the SMA. It can take up to 30 minutes for the pairing to complete.
- Once done,
BYD Battery-Box (4-8)or 'Battery-Box Premium HVS' and a serial number are seen in the configuration assistant, like in the image below. The capacity is always 10200 Wh, as that is the capacity of the battery type being emulated.
- Sometimes the battery is recognized as
Other. If the pairing fails, and the red light of the inverter turns on, it may be necessary to power down the SMA, and power it back on again, to complete the pairing. - Once
BYD Battery-Box (4-8)is seen, complete the battery functional test: charge/discharge the battery using the buttons in the installation assistant. - Proceed with the next pages of the installation assistant to finalize the SMA configuration process.
Details for Sunny Boy Smart Energy & Sunny Tripower Smart Energy
- Power off the battery emulator.
- Power off the SMA.
- Disconnect SMA CAN-bus connection on the battery emulator side.
- Power on the SMA, and wait for the blue light to stay on continuously.
- Connect to the SMA web interface. The IP address of webserver is
192.168.12.3when connecting directly to the SMA WiFi network (access point). This web interface will list the IP address of the SMA on your local network on the bottom of the page. On your local network, you can also reach the webpage via its hostnamesmaxxxxxxxxxx.home(wherexxxxxxxxxxshall be replaced with the serial number of your device). - Log in to the SMA web interface as installer. To perform the battery configuration process you'll need the installer password (or buy PUK from SMA).
- Start the installation assistant (https://smaxxxxxxxxxx.home/#/formwizard).
- Proceed with the SMA instalation assistant till step 6 (do not go to battery config yet).
- Power on the battery emulator. Wait for the battery emulator to be fully booted. For pairing to succeed, the following conditions must be fulfilled: - The battery emulator state (as seen on the webserver) is OK. This means that the battery must be sending CAN messages. - The enable line is connected, and able to close the contactors. - The HV DC lines of the battery are connected to the SMA, such that the SMA measures voltage when the enable line goes high. - The SMA is connected via CAN to the battery emulator, such that the SMA can send a pairing request, and the battery emulator can respond to this.
- Reconnect the SMA CAN-bus connection on the battery emulator side.
- Go to step 7 in the installation assistant. Wait for the pairing to start. During pairing, make sure the
Inverter allows contactor closingcheckbox on the battery emulator webserver goes ✔️
- Let the pairing run until it completes. The battery should be recognised by the SMA. It can take up to 30 minutes for the pairing to complete.
- The battery should be recognised as a
BYD Battery-Box Premium HVS battery. - Battery functional test: charge/discharge the battery using the buttons in the installation assistant.
- Proceed with the next pages of the installation assistant to finalize the SMA configuration process.
Updating the battery emulator software requires (at least in 1 case) to disconnect the SMA CAN-bus to reboot.
- Disconnect SMA CAN-bus
- Update battery emulator
- Wait for reboot
- Connect SMA CAN-bus
- Enjoy
To charge/discharge the battery you need a type of energy meter. This can be the SMA Energy meter (expensive) or a simulated SMA energy meter.
To simulate the SMA energy meter you can use Home Assistant and an energy meter (like HomeWizard): SMA-Energy-Meter-emulator
Please feel free to add!
This is how the SBS should be connected to the lily/stark hardware

