SolarEdge Wechselrichter: Unterschied zwischen den Versionen

Aus FHEMWiki
K (Neue Kategorie "Wechselrichter" eingetragen)
 
(10 dazwischenliegende Versionen von 4 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
{{Infobox Hardware
{{Infobox Hardware
|Bild=platzHalter.png
|Bild=SolarEdgeSE8K.jpg
|Bildbeschreibung=SolarEdge SE10k
|Bildbeschreibung=SolarEdge Wechselrichter
|HWProtocol=Modubus TCP  
|HWProtocol=Modubus TCP  
|HWType=Wechselrichter
|HWType=Wechselrichter
Zeile 15: Zeile 14:
|HWManufacturer=[https://www.solaredge.com/de Solaredge]
|HWManufacturer=[https://www.solaredge.com/de Solaredge]
}}
}}
== Wechselrichter von SolarEdge in FHEM einbinden==
Dieser Artikel beschreibt die Einbindung von SolarEdge Wechselrichtern der Serie SE(x)K in ein FHEM System über eine Ethernetverbindung mit Hilfe des Moduls '''[[ModbusAttr]]'''. Die Wechselrichter der SE(x)K Serie bis 10KWp (SE3K - SE10K) sind alle sehr ähnlich aufgebaut, so dass diese Anleitung für alle funktionieren sollte.


== SE10k von Solaredge in FHEM einbinden==
===Vorbedingungen===
FHEM läuft und hat genügend Platz für Modifikationen und Logfiles (ca. 100 MByte / Jahr).


Dieser Artikel beschreibt die Einbindung eines Solaredgewechselrichters SE10k in ein FHEM System über eine Ethernetverbindung mit Hilfe des Moduls ModbusAttr.
===Am Wechselrichter===
Im zugehörigen Menü ist bereits der Port 502 eingestellt. Trotzdem muss dieser noch einmal aktiviert werden, da sonst Modbus TCP nicht aktiv wird.
Hilfe da zu bietet die Installationsanleitung [1].  <br>
Es ist möglich, dass es auch nur 10 Minuten aktiv bleibt wenn er nicht angesprochen wird.


==ModbusAttr Device in FHEM ==
in FHEM wird ein ModbusAttr angelegt<pre>
define SolarEdge ModbusAttr 1 60 192.168.178.36 TCP
attr SolarEdge dev-h-defPoll 1
attr SolarEdge dev-h-defShowGet 1
attr SolarEdge enableControlSet 1
attr SolarEdge event-on-change-reading .*
attr SolarEdge event-on-update-reading I_AC_Energy_WH,I_AC_Power,Status
attr SolarEdge group Energie
attr SolarEdge maxTimeoutsToReconnect 3
attr SolarEdge silentReconnect 1
attr SolarEdge sortUpdate 1
attr SolarEdge stateFormat {sprintf("PV: %.2f KW, Eigenverbrauch: %.2f KW, Netz: %.2f KW, Batterie: %.2f KW, Ladestand: %.2f %%",ReadingsVal("SolarEdge","I_DC_Power",0),ReadingsVal("SolarEdge","Eigenverbrauch",0),ReadingsVal("SolarEdge","M_AC_POWER",0),ReadingsVal("SolarEdge","B_Instantaneous_Power",0),ReadingsVal("SolarEdge","B_State_of_Energy",0))}
attr SolarEdge userReadings Eigenverbrauch { sprintf("%.2f", ReadingsNum ('SolarEdge' ,'I_DC_Power',0) - ( ReadingsNum ('SolarEdge' ,'M_AC_POWER',0) + ReadingsNum ('SolarEdge' ,'B_Instantaneous_Power',0) ) )}
</pre>


=== Vorbedingungen ===
danach können die Modbus Datenpunkte (Register) der vorhandenen SolarEdge Komponenten wie Wechselrichter, Zwischenzähler und Batteriespeicher wie folgt definiert werden.


FHEM läuft und hat genügend Platz für Modifikationen und Logfiles (ca. 100 MByte / Jahr).
==SolarEdge Wechselrichter==
Die Namen der Attribut-Definition für ModbusAttr sind eng an die Sunspec-Implementierung aus der SolarEdge-Dokumentation angelehnt.


=== Am Wechselrichter ===
<pre>
attr SolarEdge obj-h40000-len 4
attr SolarEdge obj-h40000-reading I_SunSpec_ID
attr SolarEdge obj-h40000-unpack (a4)
attr SolarEdge obj-h40004-len 16
attr SolarEdge obj-h40004-reading I_Manufacturer
attr SolarEdge obj-h40004-unpack (a16)
attr SolarEdge obj-h40020-len 16
attr SolarEdge obj-h40020-reading I_Model
attr SolarEdge obj-h40020-unpack (a16)
attr SolarEdge obj-h40044-len 8
attr SolarEdge obj-h40044-reading I_Version
attr SolarEdge obj-h40044-unpack (a8)
attr SolarEdge obj-h40052-len 16
attr SolarEdge obj-h40052-reading I_SerialNumber
attr SolarEdge obj-h40052-unpack (a16)
attr SolarEdge obj-h40068-reading I_DeviceAddress
attr SolarEdge obj-h40069-map 101:SinglePhase, 102:SplitSinglePhase, 103:ThreePhase
attr SolarEdge obj-h40069-reading I_PhaseDesign
attr SolarEdge obj-h40070-reading I_SunSpec_Length
attr SolarEdge obj-h40071-expr $val * (10 ** ReadingsNum ('SolarEdge','I_AC_Current_SF',0))
attr SolarEdge obj-h40071-reading I_AC_Current
attr SolarEdge obj-h40072-expr $val * (10 ** ReadingsNum ('SolarEdge','I_AC_Current_SF',0))
attr SolarEdge obj-h40072-reading I_AC_Current_A
attr SolarEdge obj-h40073-expr $val * (10 ** ReadingsNum ('SolarEdge','I_AC_Current_SF',0))
attr SolarEdge obj-h40073-reading I_AC_Current_B
attr SolarEdge obj-h40074-expr $val * (10 ** ReadingsNum ('SolarEdge','I_AC_Current_SF',0))
attr SolarEdge obj-h40074-reading I_AC_Current_C
attr SolarEdge obj-h40075-reading I_AC_Current_SF
attr SolarEdge obj-h40075-unpack s>
attr SolarEdge obj-h40079-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'I_AC_Voltage_SF',0))
attr SolarEdge obj-h40079-reading I_AC_Voltage_AN
attr SolarEdge obj-h40080-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'I_AC_Voltage_SF',0))
attr SolarEdge obj-h40080-reading I_AC_Voltage_BN
attr SolarEdge obj-h40081-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'I_AC_Voltage_SF',0))
attr SolarEdge obj-h40081-reading I_AC_Voltage_CN
attr SolarEdge obj-h40082-reading I_AC_Voltage_SF
attr SolarEdge obj-h40082-unpack s>
attr SolarEdge obj-h40083-expr ($val * (10 ** $val[1]))/1000
attr SolarEdge obj-h40083-len 2
attr SolarEdge obj-h40083-reading I_AC_Power
attr SolarEdge obj-h40083-unpack s>s>
attr SolarEdge obj-h40085-expr $val * (10 ** $val[1])
attr SolarEdge obj-h40085-len 2
attr SolarEdge obj-h40085-reading I_AC_Frequency
attr SolarEdge obj-h40085-unpack s>s>
attr SolarEdge obj-h40087-expr $val * (10 ** $val[1])
attr SolarEdge obj-h40087-len 2
attr SolarEdge obj-h40087-reading I_AC_VA
attr SolarEdge obj-h40087-unpack s>s>
attr SolarEdge obj-h40089-expr $val * (10 ** $val[1])
attr SolarEdge obj-h40089-len 2
attr SolarEdge obj-h40089-reading I_AC_VAR
attr SolarEdge obj-h40089-unpack s>s>
attr SolarEdge obj-h40091-expr abs($val) * (10 ** $val[1])
attr SolarEdge obj-h40091-len 2
attr SolarEdge obj-h40091-reading I_AC_PF
attr SolarEdge obj-h40091-unpack s>s>
attr SolarEdge obj-h40093-expr $val * (10 ** $val[1])/1000
attr SolarEdge obj-h40093-len 3
attr SolarEdge obj-h40093-reading I_AC_Energy_WH
attr SolarEdge obj-h40093-unpack l>s>
attr SolarEdge obj-h40096-expr $val * (10 ** $val[1])
attr SolarEdge obj-h40096-len 2
attr SolarEdge obj-h40096-reading I_DC_Current
attr SolarEdge obj-h40096-unpack s>s>
attr SolarEdge obj-h40098-expr $val * (10 ** $val[1])
attr SolarEdge obj-h40098-len 2
attr SolarEdge obj-h40098-reading I_DC_Voltage
attr SolarEdge obj-h40098-unpack s>s>
attr SolarEdge obj-h40100-expr $val * (10 ** $val[1])/1000
attr SolarEdge obj-h40100-len 2
attr SolarEdge obj-h40100-reading I_DC_Power
attr SolarEdge obj-h40100-unpack s>s>
attr SolarEdge obj-h40103-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'I_Temp_SF',0))
attr SolarEdge obj-h40103-len 1
attr SolarEdge obj-h40103-reading I_Temp_Sink
attr SolarEdge obj-h40103-unpack s>
attr SolarEdge obj-h40106-reading I_Temp_SF
attr SolarEdge obj-h40106-unpack s>
attr SolarEdge obj-h40107-map 1:Off, 2:Sleeping, 3:Starting, 4:On, 5:Throttled, 6:ShuttingDown, 7:Fault, 8:Maintenance
attr SolarEdge obj-h40107-reading I_Status
attr SolarEdge obj-h40108-reading I_Status_Vendor
</pre>


Im zugehörigen Menu ist bereits der Port 503 eingestellt. Trotzdem muss dieser noch einmal aktiviert werden, da sonst Modbus TCP nicht aktiv wird.
==SolarEdge Zwischenzähler==
Hilfe da zu bietet die Installationsanleitung [1].  <br>
Die Namen der Attribut-Definition für ModbusAttr sind eng an die Sunspec-Implementierung aus der SolarEdge-Dokumentation angelehnt.
Es ist möglich, dass es auch nur 10 Minuten aktiv bleibt wenn er nicht angesprochen wird.


== ModbusAttr Device in FHEM ==
<pre>
attr SolarEdge obj-h40123-len 16
attr SolarEdge obj-h40123-reading M_Manufacturer
attr SolarEdge obj-h40123-unpack (a16)
attr SolarEdge obj-h40139-len 16
attr SolarEdge obj-h40139-reading M_Model
attr SolarEdge obj-h40139-unpack (a16)
attr SolarEdge obj-h40163-len 8
attr SolarEdge obj-h40163-reading M_Version
attr SolarEdge obj-h40163-unpack (a8)
attr SolarEdge obj-h40171-len 16
attr SolarEdge obj-h40171-reading M_SerialNumber
attr SolarEdge obj-h40171-unpack (a16)
attr SolarEdge obj-h40187-reading M_DeviceAddress
attr SolarEdge obj-h40188-map 201:SinglePhase, 202:SplitSinglePhase, 203:StarConnectThreePhase, 204:DeltaConnectThreePhase
attr SolarEdge obj-h40188-reading M_PhaseDesign
attr SolarEdge obj-h40189-reading M_SunSpec_Length
attr SolarEdge obj-h40190-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_Current_SF',0))
attr SolarEdge obj-h40190-reading M_AC_Current
attr SolarEdge obj-h40191-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_Current_SF',0))
attr SolarEdge obj-h40191-reading M_AC_Current_A
attr SolarEdge obj-h40192-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_Current_SF',0))
attr SolarEdge obj-h40192-reading M_AC_Current_B
attr SolarEdge obj-h40193-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_Current_SF',0))
attr SolarEdge obj-h40193-reading M_AC_Current_C
attr SolarEdge obj-h40193-unpack s>
attr SolarEdge obj-h40194-reading M_AC_Current_SF
attr SolarEdge obj-h40194-unpack s>
attr SolarEdge obj-h40195-expr $val/100
attr SolarEdge obj-h40195-reading M_AC_Voltage
attr SolarEdge obj-h40195-unpack s>
attr SolarEdge obj-h40196-expr $val/100
attr SolarEdge obj-h40196-reading M_AC_Voltage_A
attr SolarEdge obj-h40196-unpack s>
attr SolarEdge obj-h40197-expr $val/100
attr SolarEdge obj-h40197-reading M_AC_Voltage_B
attr SolarEdge obj-h40197-unpack s>
attr SolarEdge obj-h40198-expr $val/100
attr SolarEdge obj-h40198-reading M_AC_Voltage_C
attr SolarEdge obj-h40198-unpack s>
attr SolarEdge obj-h40206-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_Power_SF',0))/1000
attr SolarEdge obj-h40206-reading M_AC_POWER
attr SolarEdge obj-h40206-unpack s>
attr SolarEdge obj-h40207-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_Power_SF',0))/1000
attr SolarEdge obj-h40207-reading M_AC_POWER_A
attr SolarEdge obj-h40207-unpack s>
attr SolarEdge obj-h40208-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_Power_SF',0))/1000
attr SolarEdge obj-h40208-reading M_AC_POWER_B
attr SolarEdge obj-h40208-unpack s>
attr SolarEdge obj-h40209-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_Power_SF',0))/1000
attr SolarEdge obj-h40209-reading M_AC_POWER_C
attr SolarEdge obj-h40209-unpack s>
attr SolarEdge obj-h40210-reading M_AC_POWER_SF
attr SolarEdge obj-h40211-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_VA_SF',0))
attr SolarEdge obj-h40211-reading M_AC_VA
attr SolarEdge obj-h40211-unpack s>
attr SolarEdge obj-h40212-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_VA_SF',0))
attr SolarEdge obj-h40212-reading M_AC_VA_A
attr SolarEdge obj-h40212-unpack s>
attr SolarEdge obj-h40213-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_VA_SF',0))
attr SolarEdge obj-h40213-reading M_AC_VA_B
attr SolarEdge obj-h40213-unpack s>
attr SolarEdge obj-h40214-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_VA_SF',0))
attr SolarEdge obj-h40214-reading M_AC_VA_C
attr SolarEdge obj-h40214-unpack s>
attr SolarEdge obj-h40215-reading M_AC_VA_SF
attr SolarEdge obj-h40216-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_VAR_SF',0))
attr SolarEdge obj-h40216-reading M_AC_VAR
attr SolarEdge obj-h40216-unpack s>
attr SolarEdge obj-h40217-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_VAR_SF',0))
attr SolarEdge obj-h40217-reading M_AC_VAR_A
attr SolarEdge obj-h40217-unpack s>
attr SolarEdge obj-h40218-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_VAR_SF',0))
attr SolarEdge obj-h40218-reading M_AC_VAR_B
attr SolarEdge obj-h40218-unpack s>
attr SolarEdge obj-h40219-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_VAR_SF',0))
attr SolarEdge obj-h40219-reading M_AC_VAR_C
attr SolarEdge obj-h40219-unpack s>
attr SolarEdge obj-h40220-reading M_AC_VAR_SF
attr SolarEdge obj-h40221-expr abs($val) * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_PF_SF',0))
attr SolarEdge obj-h40221-reading M_AC_PF
attr SolarEdge obj-h40221-unpack s>
attr SolarEdge obj-h40222-expr abs($val) * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_PF_SF',0))
attr SolarEdge obj-h40222-reading M_AC_PF_A
attr SolarEdge obj-h40222-unpack s>
attr SolarEdge obj-h40223-expr abs($val) * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_PF_SF',0))
attr SolarEdge obj-h40223-reading M_AC_PF_B
attr SolarEdge obj-h40223-unpack s>
attr SolarEdge obj-h40224-expr abs($val) * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_PF_SF',0))
attr SolarEdge obj-h40224-reading M_AC_PF_C
attr SolarEdge obj-h40224-unpack s>
attr SolarEdge obj-h40225-reading M_AC_PF_SF
attr SolarEdge obj-h40225-unpack s>
attr SolarEdge obj-h40226-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_Energy_W_SF',0))
attr SolarEdge obj-h40226-format %.2f
attr SolarEdge obj-h40226-len 2
attr SolarEdge obj-h40226-reading M_Exported
attr SolarEdge obj-h40226-unpack s>
attr SolarEdge obj-h40234-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_Energy_W_SF',0))
attr SolarEdge obj-h40234-format %.2f
attr SolarEdge obj-h40234-len 2
attr SolarEdge obj-h40234-reading M_Imported
attr SolarEdge obj-h40234-unpack s>
attr SolarEdge obj-h40242-reading M_Energy_W_SF
attr SolarEdge obj-h40242-unpack s>
</pre>


in FHEM wird ein ModbusAttr angelegt
==SolarEdge Batteriespeicher==
Die Namen der Attribut-Definition für ModbusAttr sind eng an die Sunspec-Implementierung aus der SolarEdge-Dokumentation angelehnt.


<code> define SolarEdge ModbusAttr 1 30 192.168.178.36 TCP </code>
<pre>
attr SolarEdge obj-h62720-len 16
attr SolarEdge obj-h62720-reading B_Manufacturer
attr SolarEdge obj-h62720-unpack (a16)
attr SolarEdge obj-h62736-len 16
attr SolarEdge obj-h62736-reading B_Model
attr SolarEdge obj-h62736-unpack (a16)
attr SolarEdge obj-h62752-len 8
attr SolarEdge obj-h62752-reading B_Version
attr SolarEdge obj-h62752-unpack (a8)
attr SolarEdge obj-h62768-len 16
attr SolarEdge obj-h62768-reading B_SerialNumber
attr SolarEdge obj-h62768-unpack (a16)
attr SolarEdge obj-h62784-reading B_DeviceAddress
attr SolarEdge obj-h62786-expr $val / 1000
attr SolarEdge obj-h62786-format %.2f
attr SolarEdge obj-h62786-len 2
attr SolarEdge obj-h62786-reading B_Rated_Energy
attr SolarEdge obj-h62786-revRegs 1
attr SolarEdge obj-h62786-unpack f>
attr SolarEdge obj-h62788-expr $val / 1000
attr SolarEdge obj-h62788-format %.2f
attr SolarEdge obj-h62788-len 2
attr SolarEdge obj-h62788-reading B_Max_Charge_Continues_Power
attr SolarEdge obj-h62788-revRegs 1
attr SolarEdge obj-h62788-unpack f>
attr SolarEdge obj-h62790-expr $val / 1000
attr SolarEdge obj-h62790-format %.2f
attr SolarEdge obj-h62790-len 2
attr SolarEdge obj-h62790-reading B_Max_Discharge_Continues_Power
attr SolarEdge obj-h62790-revRegs 1
attr SolarEdge obj-h62790-unpack f>
attr SolarEdge obj-h62792-expr $val / 1000
attr SolarEdge obj-h62792-format %.2f
attr SolarEdge obj-h62792-len 2
attr SolarEdge obj-h62792-reading B_Max_Charge_Peak_Power
attr SolarEdge obj-h62792-revRegs 1
attr SolarEdge obj-h62792-unpack f>
attr SolarEdge obj-h62794-expr $val / 1000
attr SolarEdge obj-h62794-format %.2f
attr SolarEdge obj-h62794-len 2
attr SolarEdge obj-h62794-reading B_Max_Discharge_Peak_Power
attr SolarEdge obj-h62794-revRegs 1
attr SolarEdge obj-h62794-unpack f>
attr SolarEdge obj-h62828-format %.1f
attr SolarEdge obj-h62828-len 2
attr SolarEdge obj-h62828-reading B_Average_Temperature
attr SolarEdge obj-h62828-revRegs 1
attr SolarEdge obj-h62828-unpack f>
attr SolarEdge obj-h62830-format %.1f
attr SolarEdge obj-h62830-len 2
attr SolarEdge obj-h62830-reading B_Max_Temperature
attr SolarEdge obj-h62830-revRegs 1
attr SolarEdge obj-h62830-unpack f>
attr SolarEdge obj-h62832-format %.1f
attr SolarEdge obj-h62832-len 2
attr SolarEdge obj-h62832-reading B_Instantaneous_Voltage
attr SolarEdge obj-h62832-revRegs 1
attr SolarEdge obj-h62832-unpack f>
attr SolarEdge obj-h62834-format %.1f
attr SolarEdge obj-h62834-len 2
attr SolarEdge obj-h62834-reading B_Instantaneous_Current
attr SolarEdge obj-h62834-revRegs 1
attr SolarEdge obj-h62834-unpack f>
attr SolarEdge obj-h62836-expr $val / 1000
attr SolarEdge obj-h62836-format %.2f
attr SolarEdge obj-h62836-len 2
attr SolarEdge obj-h62836-reading B_Instantaneous_Power
attr SolarEdge obj-h62836-revRegs 1
attr SolarEdge obj-h62836-unpack f>
attr SolarEdge obj-h62838-len 4
attr SolarEdge obj-h62838-reading B_Lifetime_Export_Energy_Counter
attr SolarEdge obj-h62838-revRegs 1
attr SolarEdge obj-h62838-unpack Q>
attr SolarEdge obj-h62842-expr $val / 1000
attr SolarEdge obj-h62842-format %s
attr SolarEdge obj-h62842-len 4
attr SolarEdge obj-h62842-reading B_Lifetime_Import_Energy_Counter
attr SolarEdge obj-h62842-revRegs 1
attr SolarEdge obj-h62842-unpack Q>
attr SolarEdge obj-h62846-expr $val / 1000
attr SolarEdge obj-h62846-format %.2f
attr SolarEdge obj-h62846-len 2
attr SolarEdge obj-h62846-reading B_Max_Energy
attr SolarEdge obj-h62846-revRegs 1
attr SolarEdge obj-h62846-unpack f>
attr SolarEdge obj-h62848-expr $val / 1000
attr SolarEdge obj-h62848-format %.2f
attr SolarEdge obj-h62848-len 2
attr SolarEdge obj-h62848-reading B_Available_Energy
attr SolarEdge obj-h62848-revRegs 1
attr SolarEdge obj-h62848-unpack f>
attr SolarEdge obj-h62850-format %.1f
attr SolarEdge obj-h62850-len 2
attr SolarEdge obj-h62850-reading B_State_of_Health
attr SolarEdge obj-h62850-revRegs 1
attr SolarEdge obj-h62850-unpack f>
attr SolarEdge obj-h62852-format %.1f
attr SolarEdge obj-h62852-len 2
attr SolarEdge obj-h62852-reading B_State_of_Energy
attr SolarEdge obj-h62852-revRegs 1
attr SolarEdge obj-h62852-unpack f>
attr SolarEdge obj-h62854-len 2
attr SolarEdge obj-h62854-map 0:Off, 1:Standby, 2:Init, 3:Charge, 4:Discharge, 5:Fault, 6:TrickleCharge, 7:Idle
attr SolarEdge obj-h62854-reading B_Status
attr SolarEdge obj-h62856-len 2
attr SolarEdge obj-h62856-reading B_Status_Internal
attr SolarEdge obj-h62856-unpack s>
</pre>


danach alle Attribute aus dem unten stehenden list nach dem Verfahren:
Die Folgende Datei enthält die entsprechenden Anpassungen an die SolarEdge-Dokumentation, die diesen Attribut-Definitionen zugrunde liegen.
<code> attr SolarEdge dev-h-defPoll 1 </code>


Mehr Daten sind im Sunspec Protokoll [2] zu finden
[[Datei:FHEM-Solaredge_SunSpec_ModbusAttr.pdf]]


=== List von Device Solaredge in FHEM ===
==Weiteres Beispiel einer etwas umfangreicheren Einbindung==
<pre>
<pre>
Internals:
Internals:
Zeile 178: Zeile 494:
</pre>
</pre>


=== Dummys anlegen ===
===[[Dummy]] Devices anlegen===
 
Zur Verwendung der "at"s werden Dummys benötigt
Zur Verwendung der "at"s werden Dummys benötigt
<pre>
<pre>
define dum_pv_energyday_log dummy  
define dum_pv_energyday_log dummy  
Zeile 203: Zeile 517:
</pre>
</pre>


=== notify device in FHEM ===
=== [[notify]] device in FHEM ===
 
Auslesen der Daten, getriggert vom ModbusAttr:
Auslesen der Daten, getriggert vom ModbusAttr:


prg_solaredge
prg_solaredge
 
<syntaxhighlight lang="Perl">
<pre>
KeSolarEdge:DC-Power:.* {
KeSolarEdge:DC-Power:.* {
   # 16.2.2018 Markus Loeben
   # 16.2.2018 Markus Loeben
Zeile 244: Zeile 556:
   }
   }
}
}
</pre>
</syntaxhighlight>
 
=== at device in FHEM ===


===[[at]] device in FHEM===
Tägliches Auswerten für spätere SVGs:
Tägliches Auswerten für spätere SVGs:


at_midnight
at_midnight
<pre>
<syntaxhighlight lang="Perl">
*23:59 {
*23:59 {
   # Abspeichern der täglichen, wöchentlichen und monatlichen Werte 16.3.18 Loeben;
   # Abspeichern der täglichen, wöchentlichen und monatlichen Werte 16.3.18 Loeben;
Zeile 293: Zeile 604:
   }
   }
}
}
</pre>
</syntaxhighlight>
 
== Log ==


==Log==
Das ModbusDevice legt sich ein eigenes Log an. Um aber übersichtliche Grafiken zu bekommen werden die Daten des Dummy benötigt. Hier hilft ein Logfile
Das ModbusDevice legt sich ein eigenes Log an. Um aber übersichtliche Grafiken zu bekommen werden die Daten des Dummy benötigt. Hier hilft ein Logfile


<code> define FileLog_KePv Filelog %L/pv-%Y.log dum_pv*.* </code>
<code> define FileLog_KePv Filelog %L/pv-%Y.log dum_pv*.* </code>


== Grafiken ==
==Grafiken==
{{Todo | Beschreibungen zu SVG hinterlegen }}


{{Todo | Beschreibungen zu SVG hinterlegen }}
==Links==
#Solaredge: [https://www.solaredge.com/sites/default/files/se-inverter-installation-guide-de.pdf Installationsanleitung]
#Solaredge: [https://www.solaredge.com/sites/default/files/sunspec-implementation-technical-note-de.pdf Sunspec Protokoll]


[[Kategorie:Other Components]]
[[Kategorie:Wechselrichter]]
[[Kategorie:Energieerzeugungsmessung]]
[[Kategorie:Energieerzeugungsmessung]]
== Links ==
# Solaredge: [https://www.solaredge.com/sites/default/files/se-inverter-installation-guide-de.pdf Installationsanleitung]
# Solaredge: [https://www.solaredge.com/sites/default/files/sunspec-implementation-technical-note-de.pdf Sunspec Protokoll]

Aktuelle Version vom 19. Januar 2024, 19:44 Uhr

SolarEdge Wechselrichter
SolarEdge Wechselrichter
Allgemein
Protokoll Modubus TCP
Typ Wechselrichter
Kategorie Energieverbrauchsmessung
Technische Details
Kommunikation Ethernet TCP
Kanäle 1 (bidiektional)
Betriebsspannung 750V DC; 230V 3xAC
Leistungsaufnahme Eigenverbrauch 2% (geschätzt)
Versorgung 230V~ 3xAC
Abmessungen 317x512x214 (mm)
Sonstiges
Modulname ModbusAttr
Hersteller Solaredge

Wechselrichter von SolarEdge in FHEM einbinden

Dieser Artikel beschreibt die Einbindung von SolarEdge Wechselrichtern der Serie SE(x)K in ein FHEM System über eine Ethernetverbindung mit Hilfe des Moduls ModbusAttr. Die Wechselrichter der SE(x)K Serie bis 10KWp (SE3K - SE10K) sind alle sehr ähnlich aufgebaut, so dass diese Anleitung für alle funktionieren sollte.

Vorbedingungen

FHEM läuft und hat genügend Platz für Modifikationen und Logfiles (ca. 100 MByte / Jahr).

Am Wechselrichter

Im zugehörigen Menü ist bereits der Port 502 eingestellt. Trotzdem muss dieser noch einmal aktiviert werden, da sonst Modbus TCP nicht aktiv wird. Hilfe da zu bietet die Installationsanleitung [1].
Es ist möglich, dass es auch nur 10 Minuten aktiv bleibt wenn er nicht angesprochen wird.

ModbusAttr Device in FHEM

in FHEM wird ein ModbusAttr angelegt

define SolarEdge ModbusAttr 1 60 192.168.178.36 TCP
attr SolarEdge dev-h-defPoll 1
attr SolarEdge dev-h-defShowGet 1
attr SolarEdge enableControlSet 1
attr SolarEdge event-on-change-reading .*
attr SolarEdge event-on-update-reading I_AC_Energy_WH,I_AC_Power,Status
attr SolarEdge group Energie
attr SolarEdge maxTimeoutsToReconnect 3
attr SolarEdge silentReconnect 1
attr SolarEdge sortUpdate 1
attr SolarEdge stateFormat {sprintf("PV: %.2f KW, Eigenverbrauch: %.2f KW, Netz: %.2f KW, Batterie: %.2f KW, Ladestand: %.2f %%",ReadingsVal("SolarEdge","I_DC_Power",0),ReadingsVal("SolarEdge","Eigenverbrauch",0),ReadingsVal("SolarEdge","M_AC_POWER",0),ReadingsVal("SolarEdge","B_Instantaneous_Power",0),ReadingsVal("SolarEdge","B_State_of_Energy",0))}
attr SolarEdge userReadings Eigenverbrauch { sprintf("%.2f", ReadingsNum ('SolarEdge' ,'I_DC_Power',0) - ( ReadingsNum ('SolarEdge' ,'M_AC_POWER',0) + ReadingsNum ('SolarEdge' ,'B_Instantaneous_Power',0) ) )}

danach können die Modbus Datenpunkte (Register) der vorhandenen SolarEdge Komponenten wie Wechselrichter, Zwischenzähler und Batteriespeicher wie folgt definiert werden.

SolarEdge Wechselrichter

Die Namen der Attribut-Definition für ModbusAttr sind eng an die Sunspec-Implementierung aus der SolarEdge-Dokumentation angelehnt.

attr SolarEdge obj-h40000-len 4
attr SolarEdge obj-h40000-reading I_SunSpec_ID
attr SolarEdge obj-h40000-unpack (a4)
attr SolarEdge obj-h40004-len 16
attr SolarEdge obj-h40004-reading I_Manufacturer
attr SolarEdge obj-h40004-unpack (a16)
attr SolarEdge obj-h40020-len 16
attr SolarEdge obj-h40020-reading I_Model
attr SolarEdge obj-h40020-unpack (a16)
attr SolarEdge obj-h40044-len 8
attr SolarEdge obj-h40044-reading I_Version
attr SolarEdge obj-h40044-unpack (a8)
attr SolarEdge obj-h40052-len 16
attr SolarEdge obj-h40052-reading I_SerialNumber
attr SolarEdge obj-h40052-unpack (a16)
attr SolarEdge obj-h40068-reading I_DeviceAddress
attr SolarEdge obj-h40069-map 101:SinglePhase, 102:SplitSinglePhase, 103:ThreePhase
attr SolarEdge obj-h40069-reading I_PhaseDesign
attr SolarEdge obj-h40070-reading I_SunSpec_Length
attr SolarEdge obj-h40071-expr $val * (10 ** ReadingsNum ('SolarEdge','I_AC_Current_SF',0))
attr SolarEdge obj-h40071-reading I_AC_Current
attr SolarEdge obj-h40072-expr $val * (10 ** ReadingsNum ('SolarEdge','I_AC_Current_SF',0))
attr SolarEdge obj-h40072-reading I_AC_Current_A
attr SolarEdge obj-h40073-expr $val * (10 ** ReadingsNum ('SolarEdge','I_AC_Current_SF',0))
attr SolarEdge obj-h40073-reading I_AC_Current_B
attr SolarEdge obj-h40074-expr $val * (10 ** ReadingsNum ('SolarEdge','I_AC_Current_SF',0))
attr SolarEdge obj-h40074-reading I_AC_Current_C
attr SolarEdge obj-h40075-reading I_AC_Current_SF
attr SolarEdge obj-h40075-unpack s>
attr SolarEdge obj-h40079-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'I_AC_Voltage_SF',0))
attr SolarEdge obj-h40079-reading I_AC_Voltage_AN
attr SolarEdge obj-h40080-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'I_AC_Voltage_SF',0))
attr SolarEdge obj-h40080-reading I_AC_Voltage_BN
attr SolarEdge obj-h40081-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'I_AC_Voltage_SF',0))
attr SolarEdge obj-h40081-reading I_AC_Voltage_CN
attr SolarEdge obj-h40082-reading I_AC_Voltage_SF
attr SolarEdge obj-h40082-unpack s>
attr SolarEdge obj-h40083-expr ($val * (10 ** $val[1]))/1000
attr SolarEdge obj-h40083-len 2
attr SolarEdge obj-h40083-reading I_AC_Power
attr SolarEdge obj-h40083-unpack s>s>
attr SolarEdge obj-h40085-expr $val * (10 ** $val[1])
attr SolarEdge obj-h40085-len 2
attr SolarEdge obj-h40085-reading I_AC_Frequency
attr SolarEdge obj-h40085-unpack s>s>
attr SolarEdge obj-h40087-expr $val * (10 ** $val[1])
attr SolarEdge obj-h40087-len 2
attr SolarEdge obj-h40087-reading I_AC_VA
attr SolarEdge obj-h40087-unpack s>s>
attr SolarEdge obj-h40089-expr $val * (10 ** $val[1])
attr SolarEdge obj-h40089-len 2
attr SolarEdge obj-h40089-reading I_AC_VAR
attr SolarEdge obj-h40089-unpack s>s>
attr SolarEdge obj-h40091-expr abs($val) * (10 ** $val[1])
attr SolarEdge obj-h40091-len 2
attr SolarEdge obj-h40091-reading I_AC_PF
attr SolarEdge obj-h40091-unpack s>s>
attr SolarEdge obj-h40093-expr $val * (10 ** $val[1])/1000
attr SolarEdge obj-h40093-len 3
attr SolarEdge obj-h40093-reading I_AC_Energy_WH
attr SolarEdge obj-h40093-unpack l>s>
attr SolarEdge obj-h40096-expr $val * (10 ** $val[1])
attr SolarEdge obj-h40096-len 2
attr SolarEdge obj-h40096-reading I_DC_Current
attr SolarEdge obj-h40096-unpack s>s>
attr SolarEdge obj-h40098-expr $val * (10 ** $val[1])
attr SolarEdge obj-h40098-len 2
attr SolarEdge obj-h40098-reading I_DC_Voltage
attr SolarEdge obj-h40098-unpack s>s>
attr SolarEdge obj-h40100-expr $val * (10 ** $val[1])/1000
attr SolarEdge obj-h40100-len 2
attr SolarEdge obj-h40100-reading I_DC_Power
attr SolarEdge obj-h40100-unpack s>s>
attr SolarEdge obj-h40103-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'I_Temp_SF',0))
attr SolarEdge obj-h40103-len 1
attr SolarEdge obj-h40103-reading I_Temp_Sink
attr SolarEdge obj-h40103-unpack s>
attr SolarEdge obj-h40106-reading I_Temp_SF
attr SolarEdge obj-h40106-unpack s>
attr SolarEdge obj-h40107-map 1:Off, 2:Sleeping, 3:Starting, 4:On, 5:Throttled, 6:ShuttingDown, 7:Fault, 8:Maintenance
attr SolarEdge obj-h40107-reading I_Status
attr SolarEdge obj-h40108-reading I_Status_Vendor

SolarEdge Zwischenzähler

Die Namen der Attribut-Definition für ModbusAttr sind eng an die Sunspec-Implementierung aus der SolarEdge-Dokumentation angelehnt.

attr SolarEdge obj-h40123-len 16
attr SolarEdge obj-h40123-reading M_Manufacturer
attr SolarEdge obj-h40123-unpack (a16)
attr SolarEdge obj-h40139-len 16
attr SolarEdge obj-h40139-reading M_Model
attr SolarEdge obj-h40139-unpack (a16)
attr SolarEdge obj-h40163-len 8
attr SolarEdge obj-h40163-reading M_Version
attr SolarEdge obj-h40163-unpack (a8)
attr SolarEdge obj-h40171-len 16
attr SolarEdge obj-h40171-reading M_SerialNumber
attr SolarEdge obj-h40171-unpack (a16)
attr SolarEdge obj-h40187-reading M_DeviceAddress
attr SolarEdge obj-h40188-map 201:SinglePhase, 202:SplitSinglePhase, 203:StarConnectThreePhase, 204:DeltaConnectThreePhase
attr SolarEdge obj-h40188-reading M_PhaseDesign
attr SolarEdge obj-h40189-reading M_SunSpec_Length
attr SolarEdge obj-h40190-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_Current_SF',0))
attr SolarEdge obj-h40190-reading M_AC_Current
attr SolarEdge obj-h40191-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_Current_SF',0))
attr SolarEdge obj-h40191-reading M_AC_Current_A
attr SolarEdge obj-h40192-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_Current_SF',0))
attr SolarEdge obj-h40192-reading M_AC_Current_B
attr SolarEdge obj-h40193-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_Current_SF',0))
attr SolarEdge obj-h40193-reading M_AC_Current_C
attr SolarEdge obj-h40193-unpack s>
attr SolarEdge obj-h40194-reading M_AC_Current_SF
attr SolarEdge obj-h40194-unpack s>
attr SolarEdge obj-h40195-expr $val/100
attr SolarEdge obj-h40195-reading M_AC_Voltage
attr SolarEdge obj-h40195-unpack s>
attr SolarEdge obj-h40196-expr $val/100
attr SolarEdge obj-h40196-reading M_AC_Voltage_A
attr SolarEdge obj-h40196-unpack s>
attr SolarEdge obj-h40197-expr $val/100
attr SolarEdge obj-h40197-reading M_AC_Voltage_B
attr SolarEdge obj-h40197-unpack s>
attr SolarEdge obj-h40198-expr $val/100
attr SolarEdge obj-h40198-reading M_AC_Voltage_C
attr SolarEdge obj-h40198-unpack s>
attr SolarEdge obj-h40206-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_Power_SF',0))/1000
attr SolarEdge obj-h40206-reading M_AC_POWER
attr SolarEdge obj-h40206-unpack s>
attr SolarEdge obj-h40207-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_Power_SF',0))/1000
attr SolarEdge obj-h40207-reading M_AC_POWER_A
attr SolarEdge obj-h40207-unpack s>
attr SolarEdge obj-h40208-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_Power_SF',0))/1000
attr SolarEdge obj-h40208-reading M_AC_POWER_B
attr SolarEdge obj-h40208-unpack s>
attr SolarEdge obj-h40209-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_Power_SF',0))/1000
attr SolarEdge obj-h40209-reading M_AC_POWER_C
attr SolarEdge obj-h40209-unpack s>
attr SolarEdge obj-h40210-reading M_AC_POWER_SF
attr SolarEdge obj-h40211-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_VA_SF',0))
attr SolarEdge obj-h40211-reading M_AC_VA
attr SolarEdge obj-h40211-unpack s>
attr SolarEdge obj-h40212-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_VA_SF',0))
attr SolarEdge obj-h40212-reading M_AC_VA_A
attr SolarEdge obj-h40212-unpack s>
attr SolarEdge obj-h40213-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_VA_SF',0))
attr SolarEdge obj-h40213-reading M_AC_VA_B
attr SolarEdge obj-h40213-unpack s>
attr SolarEdge obj-h40214-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_VA_SF',0))
attr SolarEdge obj-h40214-reading M_AC_VA_C
attr SolarEdge obj-h40214-unpack s>
attr SolarEdge obj-h40215-reading M_AC_VA_SF
attr SolarEdge obj-h40216-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_VAR_SF',0))
attr SolarEdge obj-h40216-reading M_AC_VAR
attr SolarEdge obj-h40216-unpack s>
attr SolarEdge obj-h40217-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_VAR_SF',0))
attr SolarEdge obj-h40217-reading M_AC_VAR_A
attr SolarEdge obj-h40217-unpack s>
attr SolarEdge obj-h40218-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_VAR_SF',0))
attr SolarEdge obj-h40218-reading M_AC_VAR_B
attr SolarEdge obj-h40218-unpack s>
attr SolarEdge obj-h40219-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_VAR_SF',0))
attr SolarEdge obj-h40219-reading M_AC_VAR_C
attr SolarEdge obj-h40219-unpack s>
attr SolarEdge obj-h40220-reading M_AC_VAR_SF
attr SolarEdge obj-h40221-expr abs($val) * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_PF_SF',0))
attr SolarEdge obj-h40221-reading M_AC_PF
attr SolarEdge obj-h40221-unpack s>
attr SolarEdge obj-h40222-expr abs($val) * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_PF_SF',0))
attr SolarEdge obj-h40222-reading M_AC_PF_A
attr SolarEdge obj-h40222-unpack s>
attr SolarEdge obj-h40223-expr abs($val) * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_PF_SF',0))
attr SolarEdge obj-h40223-reading M_AC_PF_B
attr SolarEdge obj-h40223-unpack s>
attr SolarEdge obj-h40224-expr abs($val) * (10 ** ReadingsNum ('SolarEdge' ,'M_AC_PF_SF',0))
attr SolarEdge obj-h40224-reading M_AC_PF_C
attr SolarEdge obj-h40224-unpack s>
attr SolarEdge obj-h40225-reading M_AC_PF_SF
attr SolarEdge obj-h40225-unpack s>
attr SolarEdge obj-h40226-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_Energy_W_SF',0))
attr SolarEdge obj-h40226-format %.2f
attr SolarEdge obj-h40226-len 2
attr SolarEdge obj-h40226-reading M_Exported
attr SolarEdge obj-h40226-unpack s>
attr SolarEdge obj-h40234-expr $val * (10 ** ReadingsNum ('SolarEdge' ,'M_Energy_W_SF',0))
attr SolarEdge obj-h40234-format %.2f
attr SolarEdge obj-h40234-len 2
attr SolarEdge obj-h40234-reading M_Imported
attr SolarEdge obj-h40234-unpack s>
attr SolarEdge obj-h40242-reading M_Energy_W_SF
attr SolarEdge obj-h40242-unpack s>

SolarEdge Batteriespeicher

Die Namen der Attribut-Definition für ModbusAttr sind eng an die Sunspec-Implementierung aus der SolarEdge-Dokumentation angelehnt.

attr SolarEdge obj-h62720-len 16
attr SolarEdge obj-h62720-reading B_Manufacturer
attr SolarEdge obj-h62720-unpack (a16)
attr SolarEdge obj-h62736-len 16
attr SolarEdge obj-h62736-reading B_Model
attr SolarEdge obj-h62736-unpack (a16)
attr SolarEdge obj-h62752-len 8
attr SolarEdge obj-h62752-reading B_Version
attr SolarEdge obj-h62752-unpack (a8)
attr SolarEdge obj-h62768-len 16
attr SolarEdge obj-h62768-reading B_SerialNumber
attr SolarEdge obj-h62768-unpack (a16)
attr SolarEdge obj-h62784-reading B_DeviceAddress
attr SolarEdge obj-h62786-expr $val / 1000
attr SolarEdge obj-h62786-format %.2f
attr SolarEdge obj-h62786-len 2
attr SolarEdge obj-h62786-reading B_Rated_Energy
attr SolarEdge obj-h62786-revRegs 1
attr SolarEdge obj-h62786-unpack f>
attr SolarEdge obj-h62788-expr $val / 1000
attr SolarEdge obj-h62788-format %.2f
attr SolarEdge obj-h62788-len 2
attr SolarEdge obj-h62788-reading B_Max_Charge_Continues_Power
attr SolarEdge obj-h62788-revRegs 1
attr SolarEdge obj-h62788-unpack f>
attr SolarEdge obj-h62790-expr $val / 1000
attr SolarEdge obj-h62790-format %.2f
attr SolarEdge obj-h62790-len 2
attr SolarEdge obj-h62790-reading B_Max_Discharge_Continues_Power
attr SolarEdge obj-h62790-revRegs 1
attr SolarEdge obj-h62790-unpack f>
attr SolarEdge obj-h62792-expr $val / 1000
attr SolarEdge obj-h62792-format %.2f
attr SolarEdge obj-h62792-len 2
attr SolarEdge obj-h62792-reading B_Max_Charge_Peak_Power
attr SolarEdge obj-h62792-revRegs 1
attr SolarEdge obj-h62792-unpack f>
attr SolarEdge obj-h62794-expr $val / 1000
attr SolarEdge obj-h62794-format %.2f
attr SolarEdge obj-h62794-len 2
attr SolarEdge obj-h62794-reading B_Max_Discharge_Peak_Power
attr SolarEdge obj-h62794-revRegs 1
attr SolarEdge obj-h62794-unpack f>
attr SolarEdge obj-h62828-format %.1f
attr SolarEdge obj-h62828-len 2
attr SolarEdge obj-h62828-reading B_Average_Temperature
attr SolarEdge obj-h62828-revRegs 1
attr SolarEdge obj-h62828-unpack f>
attr SolarEdge obj-h62830-format %.1f
attr SolarEdge obj-h62830-len 2
attr SolarEdge obj-h62830-reading B_Max_Temperature
attr SolarEdge obj-h62830-revRegs 1
attr SolarEdge obj-h62830-unpack f>
attr SolarEdge obj-h62832-format %.1f
attr SolarEdge obj-h62832-len 2
attr SolarEdge obj-h62832-reading B_Instantaneous_Voltage
attr SolarEdge obj-h62832-revRegs 1
attr SolarEdge obj-h62832-unpack f>
attr SolarEdge obj-h62834-format %.1f
attr SolarEdge obj-h62834-len 2
attr SolarEdge obj-h62834-reading B_Instantaneous_Current
attr SolarEdge obj-h62834-revRegs 1
attr SolarEdge obj-h62834-unpack f>
attr SolarEdge obj-h62836-expr $val / 1000
attr SolarEdge obj-h62836-format %.2f
attr SolarEdge obj-h62836-len 2
attr SolarEdge obj-h62836-reading B_Instantaneous_Power
attr SolarEdge obj-h62836-revRegs 1
attr SolarEdge obj-h62836-unpack f>
attr SolarEdge obj-h62838-len 4
attr SolarEdge obj-h62838-reading B_Lifetime_Export_Energy_Counter
attr SolarEdge obj-h62838-revRegs 1
attr SolarEdge obj-h62838-unpack Q>
attr SolarEdge obj-h62842-expr $val / 1000
attr SolarEdge obj-h62842-format %s
attr SolarEdge obj-h62842-len 4
attr SolarEdge obj-h62842-reading B_Lifetime_Import_Energy_Counter
attr SolarEdge obj-h62842-revRegs 1
attr SolarEdge obj-h62842-unpack Q>
attr SolarEdge obj-h62846-expr $val / 1000
attr SolarEdge obj-h62846-format %.2f
attr SolarEdge obj-h62846-len 2
attr SolarEdge obj-h62846-reading B_Max_Energy
attr SolarEdge obj-h62846-revRegs 1
attr SolarEdge obj-h62846-unpack f>
attr SolarEdge obj-h62848-expr $val / 1000
attr SolarEdge obj-h62848-format %.2f
attr SolarEdge obj-h62848-len 2
attr SolarEdge obj-h62848-reading B_Available_Energy
attr SolarEdge obj-h62848-revRegs 1
attr SolarEdge obj-h62848-unpack f>
attr SolarEdge obj-h62850-format %.1f
attr SolarEdge obj-h62850-len 2
attr SolarEdge obj-h62850-reading B_State_of_Health
attr SolarEdge obj-h62850-revRegs 1
attr SolarEdge obj-h62850-unpack f>
attr SolarEdge obj-h62852-format %.1f
attr SolarEdge obj-h62852-len 2
attr SolarEdge obj-h62852-reading B_State_of_Energy
attr SolarEdge obj-h62852-revRegs 1
attr SolarEdge obj-h62852-unpack f>
attr SolarEdge obj-h62854-len 2
attr SolarEdge obj-h62854-map 0:Off, 1:Standby, 2:Init, 3:Charge, 4:Discharge, 5:Fault, 6:TrickleCharge, 7:Idle
attr SolarEdge obj-h62854-reading B_Status
attr SolarEdge obj-h62856-len 2
attr SolarEdge obj-h62856-reading B_Status_Internal
attr SolarEdge obj-h62856-unpack s>

Die Folgende Datei enthält die entsprechenden Anpassungen an die SolarEdge-Dokumentation, die diesen Attribut-Definitionen zugrunde liegen.

Datei:FHEM-Solaredge SunSpec ModbusAttr.pdf

Weiteres Beispiel einer etwas umfangreicheren Einbindung

Internals:
   BUSY       0
   DEF        1 30 192.168.178.36 TCP
   DEST       192.168.178.36:502
   DeviceName 192.168.178.36:502
   FD         91
   INTERVAL   600
   IODev      KeSolarEdge
   LASTOPEN   1523044866.65275
   MODBUSID   1
   ModuleVersion 3.7.3 - 22.12.2017
   NAME       KeSolarEdge
   NOTIFYDEV  global
   NR         354
   NTFY_ORDER 50-KeSolarEdge
   PARTIAL    
   PROTOCOL   TCP
   REQUESTHEX 00270000000601039c940001
   STATE      0 W; 1718 kWh
   TRIGGERTIME 1523048587.13296
   TRIGGERTIME_FMT 2018-04-06 23:03:07
   TYPE       ModbusAttr
   devioLoglevel 4
   nextOpenDelay 60
   QUEUE:
   READINGS:
     2018-04-06 22:53:07   AC-Energy       1717.665
     2018-04-06 22:53:07   AC-Energy-Scale 0
     2018-04-06 22:53:07   AC-Energy-Val   1717665
     2018-04-06 22:58:10   AC-Power        0
     2018-04-06 22:58:10   AC-Power-Scale  0
     2018-04-06 22:58:10   AC-Power-Val    0
     2018-04-06 22:53:07   DC-Current      0
     2018-04-06 22:53:07   DC-Current-Scale -32768
     2018-04-06 22:53:07   DC-Current-Val  65535
     2018-04-06 22:53:07   DC-Power        0
     2018-04-06 22:53:07   DC-Power-Scale  0
     2018-04-06 22:53:07   DC-Power-Val    0
     2018-04-06 22:53:07   DC-Voltage      0
     2018-04-06 22:53:07   DC-Voltage-Scale -1
     2018-04-06 22:53:07   DC-Voltage-Val  0
     2018-04-06 22:53:07   HeatSinkTemp    0
     2018-04-06 22:53:07   Status          2
     2018-04-06 22:53:07   Zustand         Nachtmodus
     2018-04-06 22:01:06   state           opened
   defptr:
     1:
   gotReadings:
     AC-Power-Scale 0
   helper:
     buffer     
     lid        1
     lrecv      1523048290.49688
     lsend      1523048290.48976
   lastRead:
     h40083     1523048290.48193
     h40084     1523048290.50143
     h40093     1523047987.08669
     h40095     1523047987.09043
     h40096     1523047987.09428
     h40097     1523047987.09784
     h40098     1523047987.10153
     h40099     1523047987.10505
     h40100     1523047987.10867
     h40101     1523047987.11226
     h40103     1523047987.1158
     h40107     1523047987.11994
Attributes:
   dev-h-combine 200
   dev-h-defPoll 1
   dev-h-defShowGet 1
   enableControlSet 1
   event-on-change-reading .*
   event-on-update-reading AC-Energy,AC-Energy-Scale,AC-Power-Scale,DC-Voltage-Scale,DC-Current-Scale,DC-Power-Scale,Status
   maxTimeoutsToReconnect 3
   obj-h40083-reading AC-Power-Val
   obj-h40084-reading AC-Power-Scale
   obj-h40084-unpack s>
   obj-h40093-len 2
   obj-h40093-reading AC-Energy-Val
   obj-h40093-unpack l>
   obj-h40095-reading AC-Energy-Scale
   obj-h40096-reading DC-Current-Val
   obj-h40097-reading DC-Current-Scale
   obj-h40097-unpack s>
   obj-h40098-reading DC-Voltage-Val
   obj-h40099-reading DC-Voltage-Scale
   obj-h40099-unpack s>
   obj-h40100-reading DC-Power-Val
   obj-h40101-reading DC-Power-Scale
   obj-h40101-unpack s>
   obj-h40103-reading HeatSinkTemp
   obj-h40103-unpack s>
   obj-h40107-reading Status
   room       Solar,SolarPV,SolarReport
   silentReconnect 1
   sortUpdate 1
   stateFormat {sprintf("%.0f W; %.0f kWh",ReadingsVal("KeSolarEdge","AC-Power",0),ReadingsVal("KeSolarEdge","AC-Energy",0))}
   userReadings AC-Energy:(AC-Energy-Scale.*) { 
  my $scale = ReadingsVal ("KeSolarEdge","AC-Energy-Scale",0);
  return (ReadingsVal ("KeSolarEdge","AC-Energy-Val",0) * ( 10 ** $scale) / 1000);;},
  
AC-Power:(AC-Power-Scale.*) { 
 my $scale = ReadingsVal ("KeSolarEdge","AC-Power-Scale",0);
 return (ReadingsVal ("KeSolarEdge","AC-Power-Val",0) * ( 10 ** $scale));;},

DC-Power:(DC-Power-Scale.*) { 
 my $scale = ReadingsVal ("KeSolarEdge","DC-Power-Scale",0);
 return (ReadingsVal ("KeSolarEdge","DC-Power-Val",0) * ( 10 ** $scale));;},
  
DC-Current:(DC-Current-Scale.*) {
 my $scale = ReadingsVal ("KeSolarEdge","DC-Current-Scale",0);
 return (ReadingsVal ("KeSolarEdge","DC-Current-Val",0) * ( 10 ** $scale));;},
  
DC-Voltage:(DC-Voltage-Scale.*) { 
 my $scale = ReadingsVal ("KeSolarEdge","DC-Voltage-Scale",0);
 return (ReadingsVal ("KeSolarEdge","DC-Voltage-Val",0) * ( 10 ** $scale));;},
 
Zustand:(Status.*) {
   my $Zus = ReadingsVal("KeSolarEdge","Status",0);
   my $rueck = ReadingsVal("KeSolarEdge","Zustand",0);
   if (($Zus == 2) and (InternalVal("KeSolarEdge","INTERVAL","") != 600)) {
     fhem("set KeSolarEdge interval 600");
	 $rueck = "Nachtmodus";
   }
   elsif  (InternalVal("KeSolarEdge","INTERVAL","") != 60) {
     fhem("set KeSolarEdge interval 60");
	 $rueck = "Tagmodus";
   }
   return ($rueck);;
 }
   webCmdLabel {sprintf("AC-Energy %.3f",ReadingsVal("Solaredge","AC-Energy",0));;}

Dummy Devices anlegen

Zur Verwendung der "at"s werden Dummys benötigt

define dum_pv_energyday_log dummy 
define dum_pv_energyday_read dummy 
define dum_pv_energymonth_log dummy 
define dum_pv_energymonth_read dummy
define dum_pv_energytoday dummy
define dum_pv_energytomonth dummy
define dum_pv_energytoweek dummy
define dum_pv_energytoyear dummy
define dum_pv_energyweek_log dummy
define dum_pv_energyweek_read dummy
define dum_pv_energyyear_log dummy
define dum_pv_energyyear_read dummy
define dum_pvdcpower dummy
define dum_pvdcvolt dummy
define dum_pvenergy dummy
define dum_pvloss dummy
define dum_pvpower_log dummy 
define dum_pvpower_read dummy 

notify device in FHEM

Auslesen der Daten, getriggert vom ModbusAttr:

prg_solaredge

KeSolarEdge:DC-Power:.* {
  # 16.2.2018 Markus Loeben
  # liest Solaredge aus und füllt die Werte in dummys, damit sie weiter verwertet werden können
  my $ACE = ReadingsVal("KeSolarEdge","AC-Energy",0);
  Log 5, "at_solaredge: ACE " . $ACE;
  my $day = Value("dum_pv_energyday_read");
  Log 5, "at_solaredge: day " . $day;
  my $week = Value("dum_pv_energyweek_read");
  Log 5, "at_solaredge: day " . $day;
  my $month = Value("dum_pv_energymonth_read");
  Log 5, "at_solaredge: month " . $month;
  my $year = Value("dum_pv_energyyear_read");
  Log 5, "at_solaredge: year " . $year;
  #.. die geleistete Energie größer 0 ist (was immer sein sollte, aber leider nicht immer ist) -> laufende Werte berechnen
  if ($ACE > 0) {
    fhem ("set dum_pv_energytoday " . sprintf ("%.2f",($ACE - $day)));
    fhem ("set dum_pv_energytoweek " . sprintf ("%.2f",($ACE - $week)));
    fhem ("set dum_pv_energytomonth " . sprintf ("%.2f",($ACE - $month)));
    fhem ("set dum_pv_energytoyear " . sprintf ("%.2f",($ACE - $year)));
  }
  #Log 1, "at_Solaredge: PV-Energy " . $ACE . "\n";
  #Leistung auslesen
  my $ACP = ReadingsVal("KeSolarEdge","AC-Power",0);
  my $DCP = ReadingsVal("KeSolarEdge","DC-Power",0);
  if ($DCP > 0) {
  # Verlustleistung berechnen
    fhem ("set dum_pvloss " . sprintf("%.1f", ($DCP - $ACP)));
    my $MP = Value("dum_pv_power_read");
    #Falls die größer ist als alles bis: ablegen
    if ($DCP > $MP) {
      fhem ("set dum_pv_power_read " . $DCP);
    }
  }
}

at device in FHEM

Tägliches Auswerten für spätere SVGs:

at_midnight

*23:59 {
  # Abspeichern der täglichen, wöchentlichen und monatlichen Werte 16.3.18 Loeben;
  use Time::Local;
  my ($Psec,$Pmin,$Phour,$Pmday,$Pmonth,$Pyear,$Pwday,$Pyday,$Pisdst) = localtime(time()+61);
  #Werte einlesen
  my $ace = ReadingsVal("KeSolarEdge","AC-Energy",-1);
  Log 5, "at_midnight AC-Energy" . " " . $ace;
  #Tag updaten
  # PV
  my $aceread = Value("dum_pv_energyday_read");
  Log 5, "at_midnight dum_pv_energyday_read " . $aceread;
  my $aceday = ($ace - $aceread);
  fhem ("set dum_pv_energyday_log " . sprintf("%.1f",($aceday)));
  fhem ("set dum_pv_energyday_read " . $ace);
  Log 5, "at_midnight dum_pv_energyday_read" . " " . $ace;
  my $MP = Value("dum_pv_power_read");
  fhem("set dum_pv_power_log " . $MP);
  fhem("set dum_pv_power_read 0");
  
  #Wochenwerte speichern;
  if ($Pwday == 1) {
    $aceread = Value("dum_pv_energyweek_read");
    $aceday = ($ace - $aceread);
    fhem ("set dum_pv_energyweek_log " . sprintf("%.1f",($ace - $aceread)));
    fhem ("set dum_pv_energyweek_read " . $ace);
  }  
  #Monatswerte speichern;
  if ($Pmday == 1) {
    $aceread = Value("dum_pv_energymonth_read");
    $aceday = ($ace - $aceread);
    fhem ("set dum_pv_energymonth_log " . sprintf("%.1f",($aceday)));
    fhem ("set dum_pv_energymonth_read " . $ace);
  }
  #Jahreswerte speichern;
  if ($Pyday == 1) {
    $aceread = Value("dum_pv_energyyear_read");
    $aceday = ($ace - $aceread);
    fhem ("set dum_pv_energyyear_log " . sprintf("%.1f",($aceday)));
    fhem ("set dum_pv_energyyear_read " . $ace);
  }
}

Log

Das ModbusDevice legt sich ein eigenes Log an. Um aber übersichtliche Grafiken zu bekommen werden die Daten des Dummy benötigt. Hier hilft ein Logfile

define FileLog_KePv Filelog %L/pv-%Y.log dum_pv*.*

Grafiken

Todo: Beschreibungen zu SVG hinterlegen


Links

  1. Solaredge: Installationsanleitung
  2. Solaredge: Sunspec Protokoll