I would like to share my experience of integration the information of the inverter SMA Tripower x (STP XX-50) in Home Assistant. The SMA Tripower x series was released in summer 2022.
Much of the information available at this point on the internet refers to the old Tripower series and is only partially correct for the new series.
I’ll try to show you in this text what worked. What did not work. And where I had to code something myself.
-
Since I also use the sunny home manger 2.0 in addition to the inverter, I started there. Access to the sunny home manager 2.0 was quite easily solvable with the SMA Energy Meter addon. GitHub - kellerza/hassio-sma-em: Home Assistant SMA Add-On
-
I had less luck with the existing SMA Solar integration (SMA Solar - Home Assistant) . After some testing, I decided to look at used library (pysma) directly. pysma doesn’t seem to work with the new Tripower series.
-
Tried ha-sunspec. No luck. Tripower X probably doesn’t support sunspec.
[Update Aug 2023] SunSpec is now supported. -
Next try mobus.
The modbus examples available on the net for access via Modbus did not work either, as they were for older/different devices.Based on the SMA information (Sunny Tripower X: Wechselrichter jetzt entdecken! | SMA Solar // Download / Modus), I created a new modbus configuration. I have focused on the fields that are most important to me. Unfortunately, I have not found any information on how to interpret the fields (e.g. sma status) marked TAGLIST. You can always find approaches on the internet, but no complete or official information.
modbus:
- name: SMA
type: tcp
host: 192.168.2.161
port: 502
sensors:
- name: sma_power_ac_raw
state_class: measurement
unit_of_measurement: W
slave: 3
address: 30775
count: 2
data_type: uint32
scan_interval: 60
- name: sma_power_ac_l1_raw
unit_of_measurement: W
state_class: measurement
slave: 3
address: 30777
count: 2
data_type: int32
scan_interval: 60
- name: sma_power_ac_l2_raw
unit_of_measurement: W
state_class: measurement
slave: 3
count: 2
address: 30779
data_type: int32
scan_interval: 60
- name: sma_power_ac_l3_raw
unit_of_measurement: W
state_class: measurement
slave: 3
count: 2
address: 30781
data_type: int32
scan_interval: 60
- name: sma_power_total_production
unit_of_measurement: Wh
state_class: total_increasing
device_class: energy
slave: 3
address: 30513
scan_interval: 60
data_type: int64
- name: sma_status
slave: 3
address: 30201
scan_interval: 60
count: 2
data_type: int32
[....]
template:
- sensor:
- name: "sma_power_ac"
state: >-
{% if states('sensor.sma_power_ac_raw')|float < 0 or states('sensor.sma_power_ac_raw')|float > 2000000000 %}
0
{% else %}
{{ states('sensor.sma_power_ac_raw') }}
{% endif %}
unit_of_measurement: "W"
state_class: measurement
-
I was still not really satisfied, because I could not get the information about the individual strings via modus. This information is available on the inverter’s local website.
So I wrote a small Python script that extracts the files from the website (via JSON) and makes them available im Home Assistant using MQTT-Discovery .
Please consider this script as a proof of concept, even if I use it successfully myself.
GitHub - littleyoda/Home-Assistant-Tripower-X-MQTT: Script which reads out the current measured values of an inverter of the SMA Tripower x (STP XX-50) series and makes them available via MQTT Home Assistant.
I hope that this will make life a little easier for other people.