Speedwire Integration wie und wo in OpenEMS?

Hallo!

Ich habe die erste Steuerung meiner Anlage SMA - SHM Anlage und Kunbus RevPi Connect 4 mit einem Python Programm gelöst und lese dabei auch den SHM über Speedwire. Der SHM schickt alle Sekunden einen Multicast mit seinen Messwerten. Das schaut dann dekodiert ungefähr so aus:

SMA: b’SMA’ sysUid: 372 Serial: 3014004160
Length: 604 Time: 3770443696
----Summe----
P: Bezug: 0.0000 kW 2220.5875 kWh Lieferung: 2.0164 kW 18958.1733 kWh
Q: Bezug: 0.0000 kvar 93.6703 kvarh Lieferung: 0.3411 kvar 1217.9781 kvarh
S: Bezug: 0.0000 kVA 2695.3457 kVAh Lieferung: 2.0451 kVA 19253.8821 kVAh
cos phi: 0.9860 Frequenz: 50.003 Hz
----Phase L1----
P: Bezug: 0.0000 kW 1780.1330 kWh Lieferung: 0.6916 kW 6431.5898 kWh
Q: Bezug: 0.0000 kvar 128.4456 kvarh Lieferung: 0.1606 kvar 455.8916 kvarh
S: Bezug: 0.0000 kVA 1884.4963 kVAh Lieferung: 0.7100 kVA 6455.5077 kVAh
Strom: 3.3470 A Spannung: 230.173 V cos phi: 0.9740
----Phase L2----
P: Bezug: 0.0000 kW 733.9668 kWh Lieferung: 0.8691 kW 7766.5868 kWh
Q: Bezug: 0.0000 kvar 6.5083 kvarh Lieferung: 0.0347 kvar 575.9355 kvarh
S: Bezug: 0.0000 kVA 755.6951 kVAh Lieferung: 0.8698 kVA 7867.8175 kVAh
Strom: 3.9340 A Spannung: 231.052 V cos phi: 0.9990
----Phase L3----
P: Bezug: 0.0000 kW 1531.5718 kWh Lieferung: 0.4558 kW 6585.0813 kWh
Q: Bezug: 0.0000 kvar 122.8712 kvarh Lieferung: 0.1459 kvar 350.3054 kvarh
S: Bezug: 0.0000 kVA 1598.6233 kVAh Lieferung: 0.4785 kVA 6661.1056 kVAh
Strom: 2.6140 A Spannung: 229.505 V cos phi: 0.9520
Softwareversion Sunny Home Manager: 2.13.6.R|020d06

Ich würde diesen Speedwire Decoder gerne auch in OpenEMS einbauen.
Leider bin ich auf OpenEMS und der verwendeten Entwicklungsumgebung noch nicht fit.
Wo müsste man das einbauen? Wie passt das in das Message Model von OpenEMS?
In einer Config müsste man die Seriennummer des SHM eingeben, damit man die richtigen Messwerte bekommt.

Danke.

Mit besten Grüßen,
Peter

Hallo Peter !

Der SunnyHomeManager 2.0 ist bereits im openEMS integriert :slight_smile:

Allerdings eben nicht nativ, sondern über einen bereits bestehenden Inverter (was meistens ja der Fall ist, wenn man einen SHM2.0 nutzt.

Grüße !

Sorry for injecting English, but SMA meters have UDP protocol which broadcasts data and can be consumed by listeners. This is (as far I understand) called speedwire udp. There are few flavors of protocol, for various revisions of SMA hardware.
UDP protocol itself received small update several years ago which caused openHAB integration to break.

I need to still mention that we still (and effectively are using UDP in some Implementations)

Glad we do not use openHAB in openEMS :slight_smile:

Thanks Sn0w3y,

I had a short look into the implementation. I did not understand how it passes the values to OpenEMS. I saw some values are not read at all like cosphi, meters of the single phases, etc.
SHM is sending out the values via a udp multicast in binary coding. Something like 604 bytes, so it would be a matter of receiving and decoding it.

BR
Peter

I did the phyton implementation for the current version 2.13.6.R of the Sunny Home Manager. It would have been impossible without having a SMA SHM to test. It looks like with version 2.3.4.R SMA added the frequency and maybe changed the length of bytes block sent. I think with version 2.8.5.R cosphi of single phases where added without changing the length. I went thru SMA documentation and again found several issues. For example the EMETER-Protokoll-TI-en-10.pdf documentation does not say anything about frequency or cosphi of single phases.

BR
Peter

Indeed, changes in protocol sometimes come completely unexpected. Issue which affected openHAB, started from firmware upgrade, which SMA began to roll in October 2021. Obviously, there was a bug in OH implementation, which assumed that all frames broadcasted by meter are reading. That’s not a case, frame header specifies message type. I think most complete implementation of protocol for Java is here: GitHub - J0B10/SMA-Speedwire: SMA-Speedwire is an api for communicating with SMA products over Ethernet using the speedwire interface. (other author even brought a meter simulator).