Solaranlage Komplettbeispiel Fronius BYD: Unterschied zwischen den Versionen
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
Zeile 237: | Zeile 237: | ||
Summe Entladung: Summe_Entladung kWh | Summe Ladung: Summe_Ladung kWh<br/> | Summe Entladung: Summe_Entladung kWh | Summe Ladung: Summe_Ladung kWh<br/> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==myBYDBox== | |||
das Modul BYDBox ermöglicht es direkt aus der Batterie einzelne Zelldaten auszulesen | |||
Achtung: IP der BYD-Box nehmen, nicht die vom Fronius ! | |||
<syntaxhighlight lang="perl">define myBYDBox BYDBox 192.168.xxx.xxx 60 | |||
attr myBYDBox DbLogExclude .* | |||
attr myBYDBox detail-level 1 | |||
attr myBYDBox disable 0 | |||
attr myBYDBox room Energie-Strom | |||
attr myBYDBox verbose 0</syntaxhighlight> | |||
== BYD.Box_view == | |||
darstellung der Batterie über ein DOIF aus myBYDBox die ui_Table dazu genutzt<syntaxhighlight lang="perl"> | |||
define BYD.Box_viev DOIF ## | |||
attr BYD.Box_viev alias BYD.Box_viev | |||
attr BYD.Box_viev room Energie-Strom | |||
attr BYD.Box_viev uiTable {package ui_Table;;}\ | |||
"BYDB-Box"| ring2([myBYDBox:BatteryPower],-6000,6000,120,0,"W",200,[(0,120,500,90,6000,60)],"1,font-weight:normal",[myBYDBox:Battery_1_SOC],0,100,0,120,"%",undef,"1,font-weight:normal",undef,undef,"0,,1,0,1") |\ | |||
ring2([myBYDBox:BatteryCurrent],-20,20,120,0,"A",200,undef,"1,font-weight:normal",[myBYDBox:BatteryOutVoltage],300,400,0,120,"V",undef,"1,font-weight:normal",undef,undef,"0,,,0,1") |\ | |||
ring2([myBYDBox:Battery_1_MaxmVolt],2800,3500,120,0,"mV",200,undef,"1,font-weight:normal",[myBYDBox:Battery_1_MinmVolt],2800,3500,0,120,"mV",undef,"1,font-weight:normal") |\ | |||
ring2([myBYDBox:BatteryMaxTemp],10,30,120,0,"°C",200,undef,"1,font-weight:normal",[myBYDBox:BatteryMinTemp],10,30,0,120,"°C",undef,"1,font-weight:normal") | |||
</syntaxhighlight> | |||
== BYD_Cells == | |||
Ladezustand der einzelnen Zellen einer BYD-Box über ein DOIF aus myBYDBox | |||
es sind 4 Zellengruppen definiert, ggf anpassen (10.2 kWh BYD)<syntaxhighlight lang="perl"> | |||
define BYD_Cells DOIF ## | |||
attr BYD_Cells alias BYD_Cells | |||
attr BYD_Cells room Energie-Strom | |||
attr BYD_Cells uiTable {package ui_Table;;\ | |||
\ | |||
sub floor_round {\ | |||
my ($zahl)=@_;;\ | |||
return(POSIX::floor($zahl / 10) * 10) - 10;;\ | |||
}\ | |||
\ | |||
sub ceil_round {\ | |||
my ($zahl)=@_;;\ | |||
return(POSIX::ceil($zahl / 10) * 10) + 10;;\ | |||
}\ | |||
\ | |||
sub colorBYD {\ | |||
my ($zahl)=@_;;\ | |||
my $min = 2800;;\ | |||
my $max = 3550;;\ | |||
my $mid = 3000;;\ | |||
my $mid2 = 3400;;\ | |||
my $color_green = 120;;\ | |||
\ | |||
my $num = 0;;\ | |||
\ | |||
if($zahl >= $mid2 && $zahl < $max)\ | |||
{\ | |||
$num = $color_green - (($zahl-$mid2)/($max-$mid2) * $color_green);;\ | |||
}\ | |||
elsif($zahl < $mid)\ | |||
{\ | |||
$num = (($zahl-$min)/($mid-$min) * $color_green);;\ | |||
}\ | |||
elsif($zahl >= $mid)\ | |||
{\ | |||
$num = $color_green;;\ | |||
}\ | |||
\ | |||
return(POSIX::ceil($num));;\ | |||
}\ | |||
}\ | |||
\ | |||
cylinder_bars("BYD Modul 1",floor_round([myBYDBox:Battery_1_MinmVolt]),ceil_round([myBYDBox:Battery_1_MaxmVolt]),"mV",250,undef,undef,0,\ | |||
[myBYDBox:Battery_1_VoltsperCell_000],colorBYD([myBYDBox:Battery_1_VoltsperCell_000]),"0",\ | |||
[myBYDBox:Battery_1_VoltsperCell_001],colorBYD([myBYDBox:Battery_1_VoltsperCell_001]),"1",\ | |||
[myBYDBox:Battery_1_VoltsperCell_002],colorBYD([myBYDBox:Battery_1_VoltsperCell_002]),"2",\ | |||
[myBYDBox:Battery_1_VoltsperCell_003],colorBYD([myBYDBox:Battery_1_VoltsperCell_003]),"3",\ | |||
[myBYDBox:Battery_1_VoltsperCell_004],colorBYD([myBYDBox:Battery_1_VoltsperCell_004]),"4",\ | |||
[myBYDBox:Battery_1_VoltsperCell_005],colorBYD([myBYDBox:Battery_1_VoltsperCell_005]),"5",\ | |||
[myBYDBox:Battery_1_VoltsperCell_006],colorBYD([myBYDBox:Battery_1_VoltsperCell_006]),"6",\ | |||
[myBYDBox:Battery_1_VoltsperCell_007],colorBYD([myBYDBox:Battery_1_VoltsperCell_007]),"7",\ | |||
[myBYDBox:Battery_1_VoltsperCell_008],colorBYD([myBYDBox:Battery_1_VoltsperCell_008]),"8",\ | |||
[myBYDBox:Battery_1_VoltsperCell_009],colorBYD([myBYDBox:Battery_1_VoltsperCell_009]),"9",\ | |||
[myBYDBox:Battery_1_VoltsperCell_010],colorBYD([myBYDBox:Battery_1_VoltsperCell_010]),"10",\ | |||
[myBYDBox:Battery_1_VoltsperCell_011],colorBYD([myBYDBox:Battery_1_VoltsperCell_011]),"11",\ | |||
[myBYDBox:Battery_1_VoltsperCell_012],colorBYD([myBYDBox:Battery_1_VoltsperCell_012]),"12",\ | |||
[myBYDBox:Battery_1_VoltsperCell_013],colorBYD([myBYDBox:Battery_1_VoltsperCell_013]),"13",\ | |||
[myBYDBox:Battery_1_VoltsperCell_014],colorBYD([myBYDBox:Battery_1_VoltsperCell_014]),"14",\ | |||
[myBYDBox:Battery_1_VoltsperCell_015],colorBYD([myBYDBox:Battery_1_VoltsperCell_015]),"15") |\ | |||
\ | |||
cylinder_bars("BYD Modul 2",floor_round([myBYDBox:Battery_1_MinmVolt]),ceil_round([myBYDBox:Battery_1_MaxmVolt]),"mV",250,undef,undef,0,\ | |||
[myBYDBox:Battery_1_VoltsperCell_016],colorBYD([myBYDBox:Battery_1_VoltsperCell_016]),"0",\ | |||
[myBYDBox:Battery_1_VoltsperCell_017],colorBYD([myBYDBox:Battery_1_VoltsperCell_017]),"1",\ | |||
[myBYDBox:Battery_1_VoltsperCell_018],colorBYD([myBYDBox:Battery_1_VoltsperCell_018]),"2",\ | |||
[myBYDBox:Battery_1_VoltsperCell_019],colorBYD([myBYDBox:Battery_1_VoltsperCell_019]),"3",\ | |||
[myBYDBox:Battery_1_VoltsperCell_020],colorBYD([myBYDBox:Battery_1_VoltsperCell_020]),"4",\ | |||
[myBYDBox:Battery_1_VoltsperCell_021],colorBYD([myBYDBox:Battery_1_VoltsperCell_021]),"5",\ | |||
[myBYDBox:Battery_1_VoltsperCell_022],colorBYD([myBYDBox:Battery_1_VoltsperCell_022]),"6",\ | |||
[myBYDBox:Battery_1_VoltsperCell_023],colorBYD([myBYDBox:Battery_1_VoltsperCell_023]),"7",\ | |||
[myBYDBox:Battery_1_VoltsperCell_024],colorBYD([myBYDBox:Battery_1_VoltsperCell_024]),"8",\ | |||
[myBYDBox:Battery_1_VoltsperCell_025],colorBYD([myBYDBox:Battery_1_VoltsperCell_025]),"9",\ | |||
[myBYDBox:Battery_1_VoltsperCell_026],colorBYD([myBYDBox:Battery_1_VoltsperCell_026]),"10",\ | |||
[myBYDBox:Battery_1_VoltsperCell_027],colorBYD([myBYDBox:Battery_1_VoltsperCell_027]),"11",\ | |||
[myBYDBox:Battery_1_VoltsperCell_028],colorBYD([myBYDBox:Battery_1_VoltsperCell_028]),"12",\ | |||
[myBYDBox:Battery_1_VoltsperCell_029],colorBYD([myBYDBox:Battery_1_VoltsperCell_029]),"13",\ | |||
[myBYDBox:Battery_1_VoltsperCell_030],colorBYD([myBYDBox:Battery_1_VoltsperCell_030]),"14",\ | |||
[myBYDBox:Battery_1_VoltsperCell_031],colorBYD([myBYDBox:Battery_1_VoltsperCell_031]),"15") |\ | |||
\ | |||
cylinder_bars("BYD Modul 3",floor_round([myBYDBox:Battery_1_MinmVolt]),ceil_round([myBYDBox:Battery_1_MaxmVolt]),"mV",250,undef,undef,0,\ | |||
[myBYDBox:Battery_1_VoltsperCell_032],colorBYD([myBYDBox:Battery_1_VoltsperCell_032]),"0",\ | |||
[myBYDBox:Battery_1_VoltsperCell_033],colorBYD([myBYDBox:Battery_1_VoltsperCell_033]),"1",\ | |||
[myBYDBox:Battery_1_VoltsperCell_034],colorBYD([myBYDBox:Battery_1_VoltsperCell_034]),"2",\ | |||
[myBYDBox:Battery_1_VoltsperCell_035],colorBYD([myBYDBox:Battery_1_VoltsperCell_035]),"3",\ | |||
[myBYDBox:Battery_1_VoltsperCell_036],colorBYD([myBYDBox:Battery_1_VoltsperCell_036]),"4",\ | |||
[myBYDBox:Battery_1_VoltsperCell_037],colorBYD([myBYDBox:Battery_1_VoltsperCell_037]),"5",\ | |||
[myBYDBox:Battery_1_VoltsperCell_038],colorBYD([myBYDBox:Battery_1_VoltsperCell_038]),"6",\ | |||
[myBYDBox:Battery_1_VoltsperCell_039],colorBYD([myBYDBox:Battery_1_VoltsperCell_039]),"7",\ | |||
[myBYDBox:Battery_1_VoltsperCell_040],colorBYD([myBYDBox:Battery_1_VoltsperCell_040]),"8",\ | |||
[myBYDBox:Battery_1_VoltsperCell_041],colorBYD([myBYDBox:Battery_1_VoltsperCell_041]),"9",\ | |||
[myBYDBox:Battery_1_VoltsperCell_042],colorBYD([myBYDBox:Battery_1_VoltsperCell_042]),"10",\ | |||
[myBYDBox:Battery_1_VoltsperCell_043],colorBYD([myBYDBox:Battery_1_VoltsperCell_043]),"11",\ | |||
[myBYDBox:Battery_1_VoltsperCell_044],colorBYD([myBYDBox:Battery_1_VoltsperCell_044]),"12",\ | |||
[myBYDBox:Battery_1_VoltsperCell_045],colorBYD([myBYDBox:Battery_1_VoltsperCell_045]),"13",\ | |||
[myBYDBox:Battery_1_VoltsperCell_046],colorBYD([myBYDBox:Battery_1_VoltsperCell_046]),"14",\ | |||
[myBYDBox:Battery_1_VoltsperCell_047],colorBYD([myBYDBox:Battery_1_VoltsperCell_047]),"15") |\ | |||
\ | |||
cylinder_bars("BYD Modul 4",floor_round([myBYDBox:Battery_1_MinmVolt]),ceil_round([myBYDBox:Battery_1_MaxmVolt]),"mV",250,undef,undef,0,\ | |||
[myBYDBox:Battery_1_VoltsperCell_048],colorBYD([myBYDBox:Battery_1_VoltsperCell_048]),"0",\ | |||
[myBYDBox:Battery_1_VoltsperCell_049],colorBYD([myBYDBox:Battery_1_VoltsperCell_049]),"1",\ | |||
[myBYDBox:Battery_1_VoltsperCell_050],colorBYD([myBYDBox:Battery_1_VoltsperCell_050]),"2",\ | |||
[myBYDBox:Battery_1_VoltsperCell_051],colorBYD([myBYDBox:Battery_1_VoltsperCell_051]),"3",\ | |||
[myBYDBox:Battery_1_VoltsperCell_052],colorBYD([myBYDBox:Battery_1_VoltsperCell_052]),"4",\ | |||
[myBYDBox:Battery_1_VoltsperCell_053],colorBYD([myBYDBox:Battery_1_VoltsperCell_053]),"5",\ | |||
[myBYDBox:Battery_1_VoltsperCell_054],colorBYD([myBYDBox:Battery_1_VoltsperCell_054]),"6",\ | |||
[myBYDBox:Battery_1_VoltsperCell_055],colorBYD([myBYDBox:Battery_1_VoltsperCell_055]),"7",\ | |||
[myBYDBox:Battery_1_VoltsperCell_056],colorBYD([myBYDBox:Battery_1_VoltsperCell_056]),"8",\ | |||
[myBYDBox:Battery_1_VoltsperCell_057],colorBYD([myBYDBox:Battery_1_VoltsperCell_057]),"9",\ | |||
[myBYDBox:Battery_1_VoltsperCell_058],colorBYD([myBYDBox:Battery_1_VoltsperCell_058]),"10",\ | |||
[myBYDBox:Battery_1_VoltsperCell_059],colorBYD([myBYDBox:Battery_1_VoltsperCell_059]),"11",\ | |||
[myBYDBox:Battery_1_VoltsperCell_060],colorBYD([myBYDBox:Battery_1_VoltsperCell_060]),"12",\ | |||
[myBYDBox:Battery_1_VoltsperCell_061],colorBYD([myBYDBox:Battery_1_VoltsperCell_061]),"13",\ | |||
[myBYDBox:Battery_1_VoltsperCell_062],colorBYD([myBYDBox:Battery_1_VoltsperCell_062]),"14",\ | |||
[myBYDBox:Battery_1_VoltsperCell_063],colorBYD([myBYDBox:Battery_1_VoltsperCell_063]),"15") |\ | |||
</syntaxhighlight> | |||
== Autarkie, Eigenverbrauch == | |||
zwei Dummys mit dazugehörigen Füllroutinen und 15 Minuten at`s zu deren Ausführung<syntaxhighlight lang="perl"> | |||
define AutarkieQuote dummy | |||
attr AutarkieQuote DbLogExclude .* | |||
attr AutarkieQuote alias Autarkie | |||
attr AutarkieQuote group Fronius | |||
attr AutarkieQuote room Energie-Strom | |||
attr AutarkieQuote stateFormat Heute | |||
attr AutarkieQuote userReadings Heute {get_autarkie ( ReadingsVal("Fronius_Erzeugung","Fronius_Symo_User_Produced_PV_EnergyDay",0) , ReadingsVal("Fronius_Einspeisung","Fronius_Symo_Meter_0_EnergyReal_WAC_Minus_Absolute_EnergyDay",0) , ReadingsVal("Fronius_Bezug","Fronius_Symo_Meter_0_EnergyReal_WAC_Plus_Absolute_EnergyDay",0) )},\ | |||
Gestern {get_autarkie ( ReadingsVal("Fronius_Erzeugung","Fronius_Symo_User_Produced_PV_EnergyDayLast",0) , ReadingsVal("Fronius_Einspeisung","Fronius_Symo_Meter_0_EnergyReal_WAC_Minus_Absolute_EnergyDayLast",0) , ReadingsVal("Fronius_Bezug","Fronius_Symo_Meter_0_EnergyReal_WAC_Plus_Absolute_EnergyDayLast",0) )},\ | |||
Monat {get_autarkie ( ReadingsVal("Fronius_Erzeugung","Fronius_Symo_User_Produced_PV_EnergyMonth",0) , ReadingsVal("Fronius_Einspeisung","Fronius_Symo_Meter_0_EnergyReal_WAC_Minus_Absolute_EnergyMonth",0) , ReadingsVal("Fronius_Bezug","Fronius_Symo_Meter_0_EnergyReal_WAC_Plus_Absolute_EnergyMonth",0) )},\ | |||
Vormonat {get_autarkie ( ReadingsVal("Fronius_Erzeugung","Fronius_Symo_User_Produced_PV_EnergyMonthLast",0) , ReadingsVal("Fronius_Einspeisung","Fronius_Symo_Meter_0_EnergyReal_WAC_Minus_Absolute_EnergyMonthLast",0) , ReadingsVal("Fronius_Bezug","Fronius_Symo_Meter_0_EnergyReal_WAC_Plus_Absolute_EnergyMonthLast",0) )},\ | |||
Jahr {get_autarkie ( ReadingsVal("Fronius_Erzeugung","Fronius_Symo_User_Produced_PV_EnergyYear",0) , ReadingsVal("Fronius_Einspeisung","Fronius_Symo_Meter_0_EnergyReal_WAC_Minus_Absolute_EnergyYear",0) , ReadingsVal("Fronius_Bezug","Fronius_Symo_Meter_0_EnergyReal_WAC_Plus_Absolute_EnergyYear",0) )} | |||
define EigenverbrQuote dummy | |||
attr EigenverbrQuote DbLogExclude .* | |||
attr EigenverbrQuote alias Eigenverbr. | |||
attr EigenverbrQuote group Fronius | |||
attr EigenverbrQuote room Energie-Strom | |||
attr EigenverbrQuote stateFormat Heute | |||
attr EigenverbrQuote userReadings Heute {get_eigenverbrauch ( ReadingsVal("Fronius_Erzeugung","Fronius_Symo_User_Produced_PV_EnergyDay",0) , ReadingsVal("Fronius_Einspeisung","Fronius_Symo_Meter_0_EnergyReal_WAC_Minus_Absolute_EnergyDay",0) )},\ | |||
Gestern {get_eigenverbrauch ( ReadingsVal("Fronius_Erzeugung","Fronius_Symo_User_Produced_PV_EnergyDayLast",0) , ReadingsVal("Fronius_Einspeisung","Fronius_Symo_Meter_0_EnergyReal_WAC_Minus_Absolute_EnergyDayLast",0) )},\ | |||
Monat {get_eigenverbrauch ( ReadingsVal("Fronius_Erzeugung","Fronius_Symo_User_Produced_PV_EnergyMonth",0) , ReadingsVal("Fronius_Einspeisung","Fronius_Symo_Meter_0_EnergyReal_WAC_Minus_Absolute_EnergyMonth",0) )},\ | |||
Vormonat {get_eigenverbrauch ( ReadingsVal("Fronius_Erzeugung","Fronius_Symo_User_Produced_PV_EnergyMonthLast",0) , ReadingsVal("Fronius_Einspeisung","Fronius_Symo_Meter_0_EnergyReal_WAC_Minus_Absolute_EnergyMonthLast",0) )},\ | |||
Jahr {get_eigenverbrauch ( ReadingsVal("Fronius_Erzeugung","Fronius_Symo_User_Produced_PV_EnergyYear",0) , ReadingsVal("Fronius_Einspeisung","Fronius_Symo_Meter_0_EnergyReal_WAC_Minus_Absolute_EnergyYear",0) )} | |||
</syntaxhighlight>In die Datei 99_myUtils.pm die Berechnungsroutinen eintragen:<syntaxhighlight lang="perl"> | |||
sub get_eigenverbrauch | |||
{ | |||
my($erzeugung,$einspeisung) = @_; | |||
return(100) if ($erzeugung)<=0; | |||
my($eigenverbrauch)=(($erzeugung)-($einspeisung))/($erzeugung)*100; | |||
return($eigenverbrauch); | |||
} | |||
sub get_autarkie | |||
{ | |||
my($erzeugung,$einspeisung,$bezug) = @_; | |||
my($autarkie)=(($erzeugung)-($einspeisung))/(($erzeugung)-($einspeisung)+($bezug))*100; | |||
return($autarkie); | |||
} | |||
</syntaxhighlight>Zusätzliche Routinen in 99_myUtils.pm um zu kleine oder auch zu große Werte auszusondern. Das "verschönert" die Graphen; kann auch weggelassen werden. Hintergrund: Integralberechnungen übersteuern beim Start.<syntaxhighlight lang="perl"> | |||
sub reduce_max_value | |||
{ | |||
my($device, $reading, $max_value)=@_; | |||
# Begrenzung der Ausgabewerte für Graphen | |||
my($Grenzwert) = ReadingsVal($device,$reading, 0); | |||
return($max_value) if (ReadingsVal($device, $reading,0) > $max_value ); | |||
return($Grenzwert); | |||
} | |||
sub reduce_min_value | |||
{ | |||
my($device, $reading, $min_value)=@_; | |||
# Begrenzung der Ausgabewerte für Graphen | |||
my($Grenzwert) = ReadingsVal($device,$reading, 0); | |||
return(0) if (ReadingsVal($device, $reading,0) <= $min_value ); | |||
return($Grenzwert); | |||
} | |||
</syntaxhighlight>Alle 15 Min erneute Berechnung der Werte (oder eine längere Zeit setzen...)<syntaxhighlight lang="perl"> | |||
define Autarkie_Timer at +*00:15:00 {fhem "setreading AutarkieQuote Heute 1"} | |||
attr Autarkie_Timer DbLogExclude .* | |||
attr Autarkie_Timer room Energie-Strom | |||
define Eigenverbr_Timer at +*00:15:00 {fhem "setreading EigenverbrQuote Heute 1"} | |||
attr Eigenverbr_Timer DbLogExclude .* | |||
attr Eigenverbr_Timer room Energie-Strom | |||
</syntaxhighlight> | |||
== mySolarStat == | |||
größere radingsGroup als Übersichtstabelle, passt auch gut in ftui2 auf`s Tablet |
Version vom 14. November 2024, 11:19 Uhr
An dieser Seite wird momentan noch gearbeitet. |
Einbindung eines Fronius-Wechselrichters, BYD-Speicher, SolarForecast, evcc-Autoladen und FTUI 2 Darstellung in FHEM
Dies Wiki beschreibt die beispielhafte Einbindung einer Solaranlage in FHEM.
Alle Module zur Steuerung der Komponenten sind bereits in fhem vorhanden bzw. werden gerade weiterentwickelt.
Ein Wechselrichter der Fa Fronius aus Österreich sowie der beliebte China-Speicher von BYD sind oft die Grundeinheiten einer Einfamilienhauslösung.
Alle notwendigen Readings werden über die vorhandenen Module speziell für dies Paket über Userreadings erzeugt,
so das auch andere Erzeuger oder Speicher in das Grundkonstrukt übernommen werden können.
Vorbedingungen
FHEM läuft und hat genügend Platz für Logdaten (>1GB/Jahr)
Der Wechselrichter sowie der Speicher sind über Lan oder eine sehr stabile(!) Wlan Verbindung erreichbar.
Von Wlan ist aber abzuraten, weil diese Verbindungen oftmals zu lange Zeitverzögerungen oder auch kurzzeitige Unterbrechungen haben.
Es läuft mit Wlan, aber oft nicht stabil genug. Der Aufbau eines Lan zu weiter entfernten Einheiten ist aufwändig, lohnt aber immer.
Alle Daten werden über DbLog gespeichert und die Graphen daraus gewonnen.
Für den Fronius Wechselrichter ist das Technician Passwort erforderlich, um die Kommunikation z.B. über Modbus zu ermöglichen.
Anleitungen dazu stehen in den Handbüchern der Firma Fronius.
Auf dem System läuft die Software EVCC, die das Laden eines Fahrzeugs komfortabel steuern kann. (aber leider auch etwas kostet :))
Grundstruktur
Der Wechselrichter wird über das Modul fronius ausgelesen und div. Userreadings erzeugt.
Zusätzlich werden über HTTPMOD weitere Daten ausgelesen.
Der Speicher ist über den Wechselrichter per ModbusAttr erreichbar sowie auch direkt über das Modul BYDBox.
Daraus ergeben sich zusätzlich gebrauchbare Darstellungen des Batteriezustands.
Bezug, Einspeisung, Erzeugung und Hausverbrauch werden über vier ElectricityCalculator Module erzeugt,
diese Module erzeugen auch die gesammten Statistikdaten. (Heute, Gestern, Monat, Vormonat, Jahr)
Zwei weitere Dummys plus Berechnungsroutinen erhalten die Daten Eigenverbrauchsquote und Autarkiegrad.
Das sehr umfangreiche Modul SolarForecast wird integriert und viele Graphen dargestellt.
Eine größere readingsGroup stellt die Gesamtstatistik der Anlage dar.
Das optinonale Programm EVCC wird integriert und kann auch gesteuert werden.
Einige FTUI2 Beispiele runden die Darstellung auf einem Tablet ab.
Fronius_Symo in FHEM
in FHEM wird das Modul fronius angelegt und darin diverse userRedings erzeugt
define Fronius_Symo fronius 192.168.xxx.xxx
attr Fronius_Symo DbLogExclude .*
attr Fronius_Symo DbLogInclude PowerFlow_Site_P_PV,PowerFlow_Site_P_Grid,PowerFlow_Site_P_Load,Akku_Laden,Akku_Entladen,User_Consumed_E
attr Fronius_Symo group Fronius
attr Fronius_Symo icon measure_photovoltaic_inst
attr Fronius_Symo room Energie-Strom
attr Fronius_Symo stateFormat {return "Status: ".ReadingsVal($name,"state","")."<br>\
PV-aktuell: ".sprintf("%.0f",ReadingsVal($name,"PowerFlow_Site_P_PV",0))." W<br>\
PV Einspeisung: ".sprintf("%.0f",ReadingsVal($name,"Einspeisung",0))." W<br>\
Netzbezug: ".sprintf("%.0f",ReadingsVal($name,"Bezug",0))." W<br>\
Akku Laden: ".sprintf("%.0f",ReadingsVal($name,"Akku_Laden",0))." W<br>\
Akku Entladen: ".sprintf("%.0f",ReadingsVal($name,"Akku_Entladen",0))." W<br>\
Ladestand Akku: ".sprintf("%.0f",ReadingsVal($name,"Storage_0_Controller_StateOfCharge_Relative",0))." %<br>\
Autarkiegrad: ".sprintf("%.1f",ReadingsVal($name,"PowerFlow_Site_rel_Autonomy",0))." %<br>\
PV gesamt: ".sprintf("%.2f",ReadingsVal($name,"PowerFlow_Site_E_Total",0)/1000)." kWh";;;;}
attr Fronius_Symo userReadings Einspeisung:PowerFlow_Site_P_Grid.* {ReadingsVal($name,"PowerFlow_Site_P_Grid","")<0?ReadingsVal($name,"PowerFlow_Site_P_Grid","")*-1:0},\
Neg_Einspeisung:PowerFlow_Site_P_Grid.* {ReadingsVal($name,"PowerFlow_Site_P_Grid","")<0?ReadingsVal($name,"PowerFlow_Site_P_Grid",""):0},\
Bezug:PowerFlow_Site_P_Grid.* {ReadingsVal($name,"PowerFlow_Site_P_Grid","")>0?ReadingsVal($name,"PowerFlow_Site_P_Grid",""):0},\
Akku_Laden:PowerFlow_Site_P_Akku.* {ReadingsVal($name,"PowerFlow_Site_P_Akku","")<0?ReadingsVal($name,"PowerFlow_Site_P_Akku","")*-1:0},\
Akku_Entladen:PowerFlow_Site_P_Akku.* {ReadingsVal($name,"PowerFlow_Site_P_Akku","")>0?ReadingsVal($name,"PowerFlow_Site_P_Akku",""):0},\
User_Produced_PV:PowerFlow_Site_P_PV.* integral {ReadingsVal("$name","PowerFlow_Site_P_PV","0")/3600000},\
User_Consumed_EN:PowerFlow_Site_P_PV.* {ReadingsVal($name,"PowerFlow_Site_P_PV","")+ReadingsVal($name,"PowerFlow_Site_P_Grid","")+ReadingsVal($name,"PowerFlow_Site_P_Akku","")},\
User_Consumed_E:PowerFlow_Site_P_PV.* {ReadingsVal($name,"User_Consumed_EN","")>0?ReadingsVal($name,"User_Consumed_EN",""):0},\
User_Consumed_Energie_C:User_Consumed_E.* integral {ReadingsVal("$name","User_Consumed_E","0")/3600000}
GEN24_MPPT
über HTTPMOD werden aus dem Fronius String Werte ausgelesen
define GEN24_MPPT HTTPMOD http://192.168.178.7/components/cache/readable 30
attr GEN24_MPPT alignTime 00:00
attr GEN24_MPPT event-on-update-reading .*
attr GEN24_MPPT group Fronius
attr GEN24_MPPT icon inverter
attr GEN24_MPPT reading1Name MPPT1_DC_W
attr GEN24_MPPT reading1OExpr {sprintf("%.0f", $val)}
attr GEN24_MPPT reading1OMap null:0
attr GEN24_MPPT reading1Regex "PV_POWERACTIVE_MEAN_01_F32"[ : \t]+([-+]?[a-z\d\.]+)
attr GEN24_MPPT reading2Name MPPT2_DC_W
attr GEN24_MPPT reading2OExpr {sprintf("%.0f", $val)}
attr GEN24_MPPT reading2OMap null:0
attr GEN24_MPPT reading2Regex "PV_POWERACTIVE_MEAN_02_F32"[ : \t]+([-+]?[a-z\d\.]+)
attr GEN24_MPPT reading3Name MPPT1_DC_A
attr GEN24_MPPT reading3OExpr {sprintf("%.3f", $val)}
attr GEN24_MPPT reading3OMap null:0
attr GEN24_MPPT reading3Regex "PV_CURRENT_MEAN_01_F32"[ : \t]+([-+]?[a-z\d\.]+)
attr GEN24_MPPT reading4Name MPPT1_DC_V
attr GEN24_MPPT reading4OExpr {sprintf("%.3f", $val)}
attr GEN24_MPPT reading4OMap null:0
attr GEN24_MPPT reading4Regex "PV_VOLTAGE_MEAN_01_F32"[ : \t]+([-+]?[a-z\d\.]+)
attr GEN24_MPPT reading5Name MPPT2_DC_A
attr GEN24_MPPT reading5OExpr {sprintf("%.3f", $val)}
attr GEN24_MPPT reading5OMap null:0
attr GEN24_MPPT reading5Regex "PV_CURRENT_MEAN_02_F32"[ : \t]+([-+]?[a-z\d\.]+)
attr GEN24_MPPT reading6Name MPPT2_DC_V
attr GEN24_MPPT reading6OExpr {sprintf("%.3f", $val)}
attr GEN24_MPPT reading6OMap null:0
attr GEN24_MPPT reading6Regex "PV_VOLTAGE_MEAN_02_F32"[ : \t]+([-+]?[a-z\d\.]+)
attr GEN24_MPPT room Energie-Strom
attr GEN24_MPPT showError 1
attr GEN24_MPPT stateFormat Süd: MPPT1_DC_W W, MPPT1_DC_V V, MPPT1_DC_A A West: MPPT2_DC_W W, MPPT2_DC_V V, MPPT2_DC_A A
PV_Batterie
per ModbusAttr werden Daten der Batterie aus dem Fronius gelesen und es können so auch Einstellungen daran vorgenommen werden
define PV_Batterie ModbusAttr 1 60 192.168.xxx.xxx:502 TCP
attr PV_Batterie DbLogExclude .*
attr PV_Batterie dev-h-combine 125
attr PV_Batterie dev-h-defFormat %.1f
attr PV_Batterie dev-h-defLen 2
attr PV_Batterie dev-h-defPoll 1
attr PV_Batterie dev-h-defUnpack f>
attr PV_Batterie devStateStyle style="text-align:right"
attr PV_Batterie disable 0
attr PV_Batterie event-min-interval ACActEnergy:7200,ACPower:7200,Battery.*:7200
attr PV_Batterie event-on-change-reading .*Energy:0.1,ACPower:1,DCPowerMPPT.*:1,status,Battery.*charge.*:1,BatteryState
attr PV_Batterie group Fronius
attr PV_Batterie icon measure_battery_100
attr PV_Batterie obj-h40073-reading ACCurrentPhaseA
attr PV_Batterie obj-h40075-reading ACCurrentPhaseB
attr PV_Batterie obj-h40077-reading ACCurrentPhaseC
attr PV_Batterie obj-h40085-reading ACVoltagePhaseA
attr PV_Batterie obj-h40087-reading ACVoltagePhaseB
attr PV_Batterie obj-h40089-reading ACVoltagePhaseC
attr PV_Batterie obj-h40091-format %.0f
attr PV_Batterie obj-h40091-reading ACPower
attr PV_Batterie obj-h40093-reading ACFrequency
attr PV_Batterie obj-h40109-reading CabinetTemperature
attr PV_Batterie obj-h40117-format %s
attr PV_Batterie obj-h40117-len 1
attr PV_Batterie obj-h40117-map 1:off,2:sleeping,3:starting,4:active,5:throttled,6:shutdown,7:fault,8:standby
attr PV_Batterie obj-h40117-reading status
attr PV_Batterie obj-h40117-unpack n
attr PV_Batterie obj-h40196-expr $val / 1000
attr PV_Batterie obj-h40196-format %.2f
attr PV_Batterie obj-h40196-len 4
attr PV_Batterie obj-h40196-reading ACActEnergy
attr PV_Batterie obj-h40196-unpack Q>
attr PV_Batterie obj-h40267-format %d
attr PV_Batterie obj-h40267-group 1-1
attr PV_Batterie obj-h40267-len 1
attr PV_Batterie obj-h40267-reading DCPowerScale
attr PV_Batterie obj-h40267-unpack s>
attr PV_Batterie obj-h40284-expr $val * 10 ** ReadingsVal($name, 'DCPowerScale', 1)
attr PV_Batterie obj-h40284-group 1-2
attr PV_Batterie obj-h40284-len 1
attr PV_Batterie obj-h40284-reading DCPowerMPPT1
attr PV_Batterie obj-h40284-unpack n
attr PV_Batterie obj-h40304-expr $val * 10 ** ReadingsVal($name, 'DCPowerScale', 1)
attr PV_Batterie obj-h40304-group 1-3
attr PV_Batterie obj-h40304-len 1
attr PV_Batterie obj-h40304-reading DCPowerMPPT2
attr PV_Batterie obj-h40304-unpack n
attr PV_Batterie obj-h40324-expr $val * 10 ** ReadingsVal($name, 'DCPowerScale', 1)
attr PV_Batterie obj-h40324-group 1-4
attr PV_Batterie obj-h40324-len 1
attr PV_Batterie obj-h40324-reading BatteryChargeWatt
attr PV_Batterie obj-h40324-unpack n
attr PV_Batterie obj-h40325-expr $val/1000000
attr PV_Batterie obj-h40325-ignoreExpr $val < 100
attr PV_Batterie obj-h40325-len 2
attr PV_Batterie obj-h40325-poll 300
attr PV_Batterie obj-h40325-reading Summe_Ladung
attr PV_Batterie obj-h40325-unpack N
attr PV_Batterie obj-h40344-expr $val * 10 ** ReadingsVal($name, 'DCPowerScale', 1)
attr PV_Batterie obj-h40344-group 1-5
attr PV_Batterie obj-h40344-len 1
attr PV_Batterie obj-h40344-reading BatteryDischargeWatt
attr PV_Batterie obj-h40344-unpack n
attr PV_Batterie obj-h40345-expr $val/1000000
attr PV_Batterie obj-h40345-ignoreExpr $val < 100
attr PV_Batterie obj-h40345-len 2
attr PV_Batterie obj-h40345-poll 300
attr PV_Batterie obj-h40345-reading Summe_Entladung
attr PV_Batterie obj-h40345-unpack N
attr PV_Batterie obj-h40355-len 1
attr PV_Batterie obj-h40355-reading BatConfigMaxReferenceWatt
attr PV_Batterie obj-h40355-unpack n
attr PV_Batterie obj-h40358-format %s
attr PV_Batterie obj-h40358-len 1
attr PV_Batterie obj-h40358-map 0:none,1:chargeMax,2:dischrMax,3:bothMax
attr PV_Batterie obj-h40358-reading BatConfigMaxEnabled
attr PV_Batterie obj-h40358-set 1
attr PV_Batterie obj-h40358-unpack n
attr PV_Batterie obj-h40360-expr $val / 100
attr PV_Batterie obj-h40360-format %.0f
attr PV_Batterie obj-h40360-len 1
attr PV_Batterie obj-h40360-poll 60
attr PV_Batterie obj-h40360-reading BatConfigReserve
attr PV_Batterie obj-h40360-set 1
attr PV_Batterie obj-h40360-setexpr $val * 100
attr PV_Batterie obj-h40360-unpack n
attr PV_Batterie obj-h40361-expr $val / 100
attr PV_Batterie obj-h40361-len 1
attr PV_Batterie obj-h40361-reading BatteryChargePercent
attr PV_Batterie obj-h40361-unpack n
attr PV_Batterie obj-h40364-format %s
attr PV_Batterie obj-h40364-len 1
attr PV_Batterie obj-h40364-map 1:off,2:empty,3:discharging,4:charging,5:full,6:holding,7:testing
attr PV_Batterie obj-h40364-reading BatteryState
attr PV_Batterie obj-h40364-unpack n
attr PV_Batterie obj-h40365-expr $val / 10000 * ReadingsVal($name, 'BatConfigMaxReferenceWatt', 1)
attr PV_Batterie obj-h40365-len 1
attr PV_Batterie obj-h40365-max ReadingsVal($name, 'BatConfigMaxReferenceWatt', 1)
attr PV_Batterie obj-h40365-min -ReadingsVal($name, 'BatConfigMaxReferenceWatt', 1)
attr PV_Batterie obj-h40365-reading BatConfigMaxDischargeWatt
attr PV_Batterie obj-h40365-set 1
attr PV_Batterie obj-h40365-setexpr $val / ReadingsVal($name, 'BatConfigMaxReferenceWatt', 1) * 10000
attr PV_Batterie obj-h40365-unpack s>
attr PV_Batterie obj-h40366-expr $val / 10000 * ReadingsVal($name, 'BatConfigMaxReferenceWatt', 1)
attr PV_Batterie obj-h40366-len 1
attr PV_Batterie obj-h40366-max ReadingsVal($name, 'BatConfigMaxReferenceWatt', 1)
attr PV_Batterie obj-h40366-min -ReadingsVal($name, 'BatConfigMaxReferenceWatt', 1)
attr PV_Batterie obj-h40366-reading BatConfigMaxChargeWatt
attr PV_Batterie obj-h40366-set 1
attr PV_Batterie obj-h40366-setexpr $val / ReadingsVal($name, 'BatConfigMaxReferenceWatt', 1) * 10000
attr PV_Batterie obj-h40366-unpack s>
attr PV_Batterie room Energie-Strom
attr PV_Batterie stateFormat Status: BatteryState <br/>\
Ladung: BatteryChargePercent % | Reserve: BatConfigReserve %<br/>\
Temp: CabinetTemperature °C<br/>\
Summe Entladung: Summe_Entladung kWh | Summe Ladung: Summe_Ladung kWh<br/>
myBYDBox
das Modul BYDBox ermöglicht es direkt aus der Batterie einzelne Zelldaten auszulesen
Achtung: IP der BYD-Box nehmen, nicht die vom Fronius !
define myBYDBox BYDBox 192.168.xxx.xxx 60
attr myBYDBox DbLogExclude .*
attr myBYDBox detail-level 1
attr myBYDBox disable 0
attr myBYDBox room Energie-Strom
attr myBYDBox verbose 0
BYD.Box_view
darstellung der Batterie über ein DOIF aus myBYDBox die ui_Table dazu genutzt
define BYD.Box_viev DOIF ##
attr BYD.Box_viev alias BYD.Box_viev
attr BYD.Box_viev room Energie-Strom
attr BYD.Box_viev uiTable {package ui_Table;;}\
"BYDB-Box"| ring2([myBYDBox:BatteryPower],-6000,6000,120,0,"W",200,[(0,120,500,90,6000,60)],"1,font-weight:normal",[myBYDBox:Battery_1_SOC],0,100,0,120,"%",undef,"1,font-weight:normal",undef,undef,"0,,1,0,1") |\
ring2([myBYDBox:BatteryCurrent],-20,20,120,0,"A",200,undef,"1,font-weight:normal",[myBYDBox:BatteryOutVoltage],300,400,0,120,"V",undef,"1,font-weight:normal",undef,undef,"0,,,0,1") |\
ring2([myBYDBox:Battery_1_MaxmVolt],2800,3500,120,0,"mV",200,undef,"1,font-weight:normal",[myBYDBox:Battery_1_MinmVolt],2800,3500,0,120,"mV",undef,"1,font-weight:normal") |\
ring2([myBYDBox:BatteryMaxTemp],10,30,120,0,"°C",200,undef,"1,font-weight:normal",[myBYDBox:BatteryMinTemp],10,30,0,120,"°C",undef,"1,font-weight:normal")
BYD_Cells
Ladezustand der einzelnen Zellen einer BYD-Box über ein DOIF aus myBYDBox
es sind 4 Zellengruppen definiert, ggf anpassen (10.2 kWh BYD)
define BYD_Cells DOIF ##
attr BYD_Cells alias BYD_Cells
attr BYD_Cells room Energie-Strom
attr BYD_Cells uiTable {package ui_Table;;\
\
sub floor_round {\
my ($zahl)=@_;;\
return(POSIX::floor($zahl / 10) * 10) - 10;;\
}\
\
sub ceil_round {\
my ($zahl)=@_;;\
return(POSIX::ceil($zahl / 10) * 10) + 10;;\
}\
\
sub colorBYD {\
my ($zahl)=@_;;\
my $min = 2800;;\
my $max = 3550;;\
my $mid = 3000;;\
my $mid2 = 3400;;\
my $color_green = 120;;\
\
my $num = 0;;\
\
if($zahl >= $mid2 && $zahl < $max)\
{\
$num = $color_green - (($zahl-$mid2)/($max-$mid2) * $color_green);;\
}\
elsif($zahl < $mid)\
{\
$num = (($zahl-$min)/($mid-$min) * $color_green);;\
}\
elsif($zahl >= $mid)\
{\
$num = $color_green;;\
}\
\
return(POSIX::ceil($num));;\
}\
}\
\
cylinder_bars("BYD Modul 1",floor_round([myBYDBox:Battery_1_MinmVolt]),ceil_round([myBYDBox:Battery_1_MaxmVolt]),"mV",250,undef,undef,0,\
[myBYDBox:Battery_1_VoltsperCell_000],colorBYD([myBYDBox:Battery_1_VoltsperCell_000]),"0",\
[myBYDBox:Battery_1_VoltsperCell_001],colorBYD([myBYDBox:Battery_1_VoltsperCell_001]),"1",\
[myBYDBox:Battery_1_VoltsperCell_002],colorBYD([myBYDBox:Battery_1_VoltsperCell_002]),"2",\
[myBYDBox:Battery_1_VoltsperCell_003],colorBYD([myBYDBox:Battery_1_VoltsperCell_003]),"3",\
[myBYDBox:Battery_1_VoltsperCell_004],colorBYD([myBYDBox:Battery_1_VoltsperCell_004]),"4",\
[myBYDBox:Battery_1_VoltsperCell_005],colorBYD([myBYDBox:Battery_1_VoltsperCell_005]),"5",\
[myBYDBox:Battery_1_VoltsperCell_006],colorBYD([myBYDBox:Battery_1_VoltsperCell_006]),"6",\
[myBYDBox:Battery_1_VoltsperCell_007],colorBYD([myBYDBox:Battery_1_VoltsperCell_007]),"7",\
[myBYDBox:Battery_1_VoltsperCell_008],colorBYD([myBYDBox:Battery_1_VoltsperCell_008]),"8",\
[myBYDBox:Battery_1_VoltsperCell_009],colorBYD([myBYDBox:Battery_1_VoltsperCell_009]),"9",\
[myBYDBox:Battery_1_VoltsperCell_010],colorBYD([myBYDBox:Battery_1_VoltsperCell_010]),"10",\
[myBYDBox:Battery_1_VoltsperCell_011],colorBYD([myBYDBox:Battery_1_VoltsperCell_011]),"11",\
[myBYDBox:Battery_1_VoltsperCell_012],colorBYD([myBYDBox:Battery_1_VoltsperCell_012]),"12",\
[myBYDBox:Battery_1_VoltsperCell_013],colorBYD([myBYDBox:Battery_1_VoltsperCell_013]),"13",\
[myBYDBox:Battery_1_VoltsperCell_014],colorBYD([myBYDBox:Battery_1_VoltsperCell_014]),"14",\
[myBYDBox:Battery_1_VoltsperCell_015],colorBYD([myBYDBox:Battery_1_VoltsperCell_015]),"15") |\
\
cylinder_bars("BYD Modul 2",floor_round([myBYDBox:Battery_1_MinmVolt]),ceil_round([myBYDBox:Battery_1_MaxmVolt]),"mV",250,undef,undef,0,\
[myBYDBox:Battery_1_VoltsperCell_016],colorBYD([myBYDBox:Battery_1_VoltsperCell_016]),"0",\
[myBYDBox:Battery_1_VoltsperCell_017],colorBYD([myBYDBox:Battery_1_VoltsperCell_017]),"1",\
[myBYDBox:Battery_1_VoltsperCell_018],colorBYD([myBYDBox:Battery_1_VoltsperCell_018]),"2",\
[myBYDBox:Battery_1_VoltsperCell_019],colorBYD([myBYDBox:Battery_1_VoltsperCell_019]),"3",\
[myBYDBox:Battery_1_VoltsperCell_020],colorBYD([myBYDBox:Battery_1_VoltsperCell_020]),"4",\
[myBYDBox:Battery_1_VoltsperCell_021],colorBYD([myBYDBox:Battery_1_VoltsperCell_021]),"5",\
[myBYDBox:Battery_1_VoltsperCell_022],colorBYD([myBYDBox:Battery_1_VoltsperCell_022]),"6",\
[myBYDBox:Battery_1_VoltsperCell_023],colorBYD([myBYDBox:Battery_1_VoltsperCell_023]),"7",\
[myBYDBox:Battery_1_VoltsperCell_024],colorBYD([myBYDBox:Battery_1_VoltsperCell_024]),"8",\
[myBYDBox:Battery_1_VoltsperCell_025],colorBYD([myBYDBox:Battery_1_VoltsperCell_025]),"9",\
[myBYDBox:Battery_1_VoltsperCell_026],colorBYD([myBYDBox:Battery_1_VoltsperCell_026]),"10",\
[myBYDBox:Battery_1_VoltsperCell_027],colorBYD([myBYDBox:Battery_1_VoltsperCell_027]),"11",\
[myBYDBox:Battery_1_VoltsperCell_028],colorBYD([myBYDBox:Battery_1_VoltsperCell_028]),"12",\
[myBYDBox:Battery_1_VoltsperCell_029],colorBYD([myBYDBox:Battery_1_VoltsperCell_029]),"13",\
[myBYDBox:Battery_1_VoltsperCell_030],colorBYD([myBYDBox:Battery_1_VoltsperCell_030]),"14",\
[myBYDBox:Battery_1_VoltsperCell_031],colorBYD([myBYDBox:Battery_1_VoltsperCell_031]),"15") |\
\
cylinder_bars("BYD Modul 3",floor_round([myBYDBox:Battery_1_MinmVolt]),ceil_round([myBYDBox:Battery_1_MaxmVolt]),"mV",250,undef,undef,0,\
[myBYDBox:Battery_1_VoltsperCell_032],colorBYD([myBYDBox:Battery_1_VoltsperCell_032]),"0",\
[myBYDBox:Battery_1_VoltsperCell_033],colorBYD([myBYDBox:Battery_1_VoltsperCell_033]),"1",\
[myBYDBox:Battery_1_VoltsperCell_034],colorBYD([myBYDBox:Battery_1_VoltsperCell_034]),"2",\
[myBYDBox:Battery_1_VoltsperCell_035],colorBYD([myBYDBox:Battery_1_VoltsperCell_035]),"3",\
[myBYDBox:Battery_1_VoltsperCell_036],colorBYD([myBYDBox:Battery_1_VoltsperCell_036]),"4",\
[myBYDBox:Battery_1_VoltsperCell_037],colorBYD([myBYDBox:Battery_1_VoltsperCell_037]),"5",\
[myBYDBox:Battery_1_VoltsperCell_038],colorBYD([myBYDBox:Battery_1_VoltsperCell_038]),"6",\
[myBYDBox:Battery_1_VoltsperCell_039],colorBYD([myBYDBox:Battery_1_VoltsperCell_039]),"7",\
[myBYDBox:Battery_1_VoltsperCell_040],colorBYD([myBYDBox:Battery_1_VoltsperCell_040]),"8",\
[myBYDBox:Battery_1_VoltsperCell_041],colorBYD([myBYDBox:Battery_1_VoltsperCell_041]),"9",\
[myBYDBox:Battery_1_VoltsperCell_042],colorBYD([myBYDBox:Battery_1_VoltsperCell_042]),"10",\
[myBYDBox:Battery_1_VoltsperCell_043],colorBYD([myBYDBox:Battery_1_VoltsperCell_043]),"11",\
[myBYDBox:Battery_1_VoltsperCell_044],colorBYD([myBYDBox:Battery_1_VoltsperCell_044]),"12",\
[myBYDBox:Battery_1_VoltsperCell_045],colorBYD([myBYDBox:Battery_1_VoltsperCell_045]),"13",\
[myBYDBox:Battery_1_VoltsperCell_046],colorBYD([myBYDBox:Battery_1_VoltsperCell_046]),"14",\
[myBYDBox:Battery_1_VoltsperCell_047],colorBYD([myBYDBox:Battery_1_VoltsperCell_047]),"15") |\
\
cylinder_bars("BYD Modul 4",floor_round([myBYDBox:Battery_1_MinmVolt]),ceil_round([myBYDBox:Battery_1_MaxmVolt]),"mV",250,undef,undef,0,\
[myBYDBox:Battery_1_VoltsperCell_048],colorBYD([myBYDBox:Battery_1_VoltsperCell_048]),"0",\
[myBYDBox:Battery_1_VoltsperCell_049],colorBYD([myBYDBox:Battery_1_VoltsperCell_049]),"1",\
[myBYDBox:Battery_1_VoltsperCell_050],colorBYD([myBYDBox:Battery_1_VoltsperCell_050]),"2",\
[myBYDBox:Battery_1_VoltsperCell_051],colorBYD([myBYDBox:Battery_1_VoltsperCell_051]),"3",\
[myBYDBox:Battery_1_VoltsperCell_052],colorBYD([myBYDBox:Battery_1_VoltsperCell_052]),"4",\
[myBYDBox:Battery_1_VoltsperCell_053],colorBYD([myBYDBox:Battery_1_VoltsperCell_053]),"5",\
[myBYDBox:Battery_1_VoltsperCell_054],colorBYD([myBYDBox:Battery_1_VoltsperCell_054]),"6",\
[myBYDBox:Battery_1_VoltsperCell_055],colorBYD([myBYDBox:Battery_1_VoltsperCell_055]),"7",\
[myBYDBox:Battery_1_VoltsperCell_056],colorBYD([myBYDBox:Battery_1_VoltsperCell_056]),"8",\
[myBYDBox:Battery_1_VoltsperCell_057],colorBYD([myBYDBox:Battery_1_VoltsperCell_057]),"9",\
[myBYDBox:Battery_1_VoltsperCell_058],colorBYD([myBYDBox:Battery_1_VoltsperCell_058]),"10",\
[myBYDBox:Battery_1_VoltsperCell_059],colorBYD([myBYDBox:Battery_1_VoltsperCell_059]),"11",\
[myBYDBox:Battery_1_VoltsperCell_060],colorBYD([myBYDBox:Battery_1_VoltsperCell_060]),"12",\
[myBYDBox:Battery_1_VoltsperCell_061],colorBYD([myBYDBox:Battery_1_VoltsperCell_061]),"13",\
[myBYDBox:Battery_1_VoltsperCell_062],colorBYD([myBYDBox:Battery_1_VoltsperCell_062]),"14",\
[myBYDBox:Battery_1_VoltsperCell_063],colorBYD([myBYDBox:Battery_1_VoltsperCell_063]),"15") |\
Autarkie, Eigenverbrauch
zwei Dummys mit dazugehörigen Füllroutinen und 15 Minuten at`s zu deren Ausführung
define AutarkieQuote dummy
attr AutarkieQuote DbLogExclude .*
attr AutarkieQuote alias Autarkie
attr AutarkieQuote group Fronius
attr AutarkieQuote room Energie-Strom
attr AutarkieQuote stateFormat Heute
attr AutarkieQuote userReadings Heute {get_autarkie ( ReadingsVal("Fronius_Erzeugung","Fronius_Symo_User_Produced_PV_EnergyDay",0) , ReadingsVal("Fronius_Einspeisung","Fronius_Symo_Meter_0_EnergyReal_WAC_Minus_Absolute_EnergyDay",0) , ReadingsVal("Fronius_Bezug","Fronius_Symo_Meter_0_EnergyReal_WAC_Plus_Absolute_EnergyDay",0) )},\
Gestern {get_autarkie ( ReadingsVal("Fronius_Erzeugung","Fronius_Symo_User_Produced_PV_EnergyDayLast",0) , ReadingsVal("Fronius_Einspeisung","Fronius_Symo_Meter_0_EnergyReal_WAC_Minus_Absolute_EnergyDayLast",0) , ReadingsVal("Fronius_Bezug","Fronius_Symo_Meter_0_EnergyReal_WAC_Plus_Absolute_EnergyDayLast",0) )},\
Monat {get_autarkie ( ReadingsVal("Fronius_Erzeugung","Fronius_Symo_User_Produced_PV_EnergyMonth",0) , ReadingsVal("Fronius_Einspeisung","Fronius_Symo_Meter_0_EnergyReal_WAC_Minus_Absolute_EnergyMonth",0) , ReadingsVal("Fronius_Bezug","Fronius_Symo_Meter_0_EnergyReal_WAC_Plus_Absolute_EnergyMonth",0) )},\
Vormonat {get_autarkie ( ReadingsVal("Fronius_Erzeugung","Fronius_Symo_User_Produced_PV_EnergyMonthLast",0) , ReadingsVal("Fronius_Einspeisung","Fronius_Symo_Meter_0_EnergyReal_WAC_Minus_Absolute_EnergyMonthLast",0) , ReadingsVal("Fronius_Bezug","Fronius_Symo_Meter_0_EnergyReal_WAC_Plus_Absolute_EnergyMonthLast",0) )},\
Jahr {get_autarkie ( ReadingsVal("Fronius_Erzeugung","Fronius_Symo_User_Produced_PV_EnergyYear",0) , ReadingsVal("Fronius_Einspeisung","Fronius_Symo_Meter_0_EnergyReal_WAC_Minus_Absolute_EnergyYear",0) , ReadingsVal("Fronius_Bezug","Fronius_Symo_Meter_0_EnergyReal_WAC_Plus_Absolute_EnergyYear",0) )}
define EigenverbrQuote dummy
attr EigenverbrQuote DbLogExclude .*
attr EigenverbrQuote alias Eigenverbr.
attr EigenverbrQuote group Fronius
attr EigenverbrQuote room Energie-Strom
attr EigenverbrQuote stateFormat Heute
attr EigenverbrQuote userReadings Heute {get_eigenverbrauch ( ReadingsVal("Fronius_Erzeugung","Fronius_Symo_User_Produced_PV_EnergyDay",0) , ReadingsVal("Fronius_Einspeisung","Fronius_Symo_Meter_0_EnergyReal_WAC_Minus_Absolute_EnergyDay",0) )},\
Gestern {get_eigenverbrauch ( ReadingsVal("Fronius_Erzeugung","Fronius_Symo_User_Produced_PV_EnergyDayLast",0) , ReadingsVal("Fronius_Einspeisung","Fronius_Symo_Meter_0_EnergyReal_WAC_Minus_Absolute_EnergyDayLast",0) )},\
Monat {get_eigenverbrauch ( ReadingsVal("Fronius_Erzeugung","Fronius_Symo_User_Produced_PV_EnergyMonth",0) , ReadingsVal("Fronius_Einspeisung","Fronius_Symo_Meter_0_EnergyReal_WAC_Minus_Absolute_EnergyMonth",0) )},\
Vormonat {get_eigenverbrauch ( ReadingsVal("Fronius_Erzeugung","Fronius_Symo_User_Produced_PV_EnergyMonthLast",0) , ReadingsVal("Fronius_Einspeisung","Fronius_Symo_Meter_0_EnergyReal_WAC_Minus_Absolute_EnergyMonthLast",0) )},\
Jahr {get_eigenverbrauch ( ReadingsVal("Fronius_Erzeugung","Fronius_Symo_User_Produced_PV_EnergyYear",0) , ReadingsVal("Fronius_Einspeisung","Fronius_Symo_Meter_0_EnergyReal_WAC_Minus_Absolute_EnergyYear",0) )}
In die Datei 99_myUtils.pm die Berechnungsroutinen eintragen:
sub get_eigenverbrauch
{
my($erzeugung,$einspeisung) = @_;
return(100) if ($erzeugung)<=0;
my($eigenverbrauch)=(($erzeugung)-($einspeisung))/($erzeugung)*100;
return($eigenverbrauch);
}
sub get_autarkie
{
my($erzeugung,$einspeisung,$bezug) = @_;
my($autarkie)=(($erzeugung)-($einspeisung))/(($erzeugung)-($einspeisung)+($bezug))*100;
return($autarkie);
}
Zusätzliche Routinen in 99_myUtils.pm um zu kleine oder auch zu große Werte auszusondern. Das "verschönert" die Graphen; kann auch weggelassen werden. Hintergrund: Integralberechnungen übersteuern beim Start.
sub reduce_max_value
{
my($device, $reading, $max_value)=@_;
# Begrenzung der Ausgabewerte für Graphen
my($Grenzwert) = ReadingsVal($device,$reading, 0);
return($max_value) if (ReadingsVal($device, $reading,0) > $max_value );
return($Grenzwert);
}
sub reduce_min_value
{
my($device, $reading, $min_value)=@_;
# Begrenzung der Ausgabewerte für Graphen
my($Grenzwert) = ReadingsVal($device,$reading, 0);
return(0) if (ReadingsVal($device, $reading,0) <= $min_value );
return($Grenzwert);
}
Alle 15 Min erneute Berechnung der Werte (oder eine längere Zeit setzen...)
define Autarkie_Timer at +*00:15:00 {fhem "setreading AutarkieQuote Heute 1"}
attr Autarkie_Timer DbLogExclude .*
attr Autarkie_Timer room Energie-Strom
define Eigenverbr_Timer at +*00:15:00 {fhem "setreading EigenverbrQuote Heute 1"}
attr Eigenverbr_Timer DbLogExclude .*
attr Eigenverbr_Timer room Energie-Strom
mySolarStat
größere radingsGroup als Übersichtstabelle, passt auch gut in ftui2 auf`s Tablet