Solaranlage Komplettbeispiel Fronius BYD: Unterschied zwischen den Versionen

Aus FHEMWiki
KKeine Bearbeitungszusammenfassung
KKeine Bearbeitungszusammenfassung
Markierungen: Manuelle Zurücksetzung Visuelle Bearbeitung
Zeile 1: Zeile 1:
{{Baustelle}}
==Einbindung eines Fronius-Wechselrichters, BYD-Speicher, SolarForecast, evcc-Autoladen und FTUI 2 Darstellung in FHEM==
==Einbindung eines Fronius-Wechselrichters, BYD-Speicher, SolarForecast, evcc-Autoladen und FTUI 2 Darstellung in FHEM==
[[Datei:Screenshot 2024-11-14 164746.jpg|mini|Übersicht]]
[[Datei:Screenshot 2024-11-14 164746.jpg|mini|Übersicht]]
Zeile 849: Zeile 851:
</div>
</div>
</syntaxhighlight><!-- Fortsetzung folgt -->
</syntaxhighlight><!-- Fortsetzung folgt -->
[[Kategorie::Wechselrichter]]

Version vom 16. November 2024, 17:11 Uhr


Clock - Under Construction.svg An dieser Seite wird momentan noch gearbeitet.


Einbindung eines Fronius-Wechselrichters, BYD-Speicher, SolarForecast, evcc-Autoladen und FTUI 2 Darstellung in FHEM

Übersicht

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. Es gibt auch einen weiteren Grund für die Userreadings: Der Wechselrichter der Frima Fronius erzeugt einige Daten in relativ langen Zeitabständen (>10 Min) so dass diese z.B. nicht für aktuelle Intergrationen benutzt werden können.

ftui2 Übersicht

Vorbedingungen

FHEM läuft und hat genügend Platz für Logdaten (dBLog >1GB/Jahr wenn alles geloggt wird)

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.

Wenn Fahrzeugladen über eine Wallbox mit eingebunden werden soll muss die Software EVCC, die das Laden eines Fahrzeugs komfortabel steuern kann, installiert werden. (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ätzliche 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 es können viele Graphen dargestellt werden.

Eine größere readingsGroup stellt die Gesamtstatistik der Anlage dar.

Das optinonale Programm EVCC kann integriert und 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, das geht natürlich nur wenn der Speicher direkt über LAN am Netzwerk angebunden ist.

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

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

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

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: Diffential/Integralberechnungen unter/ü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

ReadingsGroup

größere radingsGroup als Übersichtstabelle, passt auch gut in ftui2 auf`s Tablet

define mySolarStat readingsGroup <  >,<Heute>,<Gestern>,<Monat>,<Vormonat>,<Jahr> \
Fronius_Erzeugung:Fronius_Symo_User_Produced_PV_EnergyDay,Fronius_Symo_User_Produced_PV_EnergyDayLast,Fronius_Symo_User_Produced_PV_EnergyMonth,Fronius_Symo_User_Produced_PV_EnergyMonthLast,Fronius_Symo_User_Produced_PV_EnergyYear \
Fronius_Einspeisung:Fronius_Symo_Meter_0_EnergyReal_WAC_Minus_Absolute_EnergyDay,Fronius_Symo_Meter_0_EnergyReal_WAC_Minus_Absolute_EnergyDayLast,Fronius_Symo_Meter_0_EnergyReal_WAC_Minus_Absolute_EnergyMonth,Fronius_Symo_Meter_0_EnergyReal_WAC_Minus_Absolute_EnergyMonthLast,Fronius_Symo_Meter_0_EnergyReal_WAC_Minus_Absolute_EnergyYear \
Fronius_Bezug:Fronius_Symo_Meter_0_EnergyReal_WAC_Plus_Absolute_EnergyDay,Fronius_Symo_Meter_0_EnergyReal_WAC_Plus_Absolute_EnergyDayLast,Fronius_Symo_Meter_0_EnergyReal_WAC_Plus_Absolute_EnergyMonth,Fronius_Symo_Meter_0_EnergyReal_WAC_Plus_Absolute_EnergyMonthLast,Fronius_Symo_Meter_0_EnergyReal_WAC_Plus_Absolute_EnergyYear \
Hausverbrauch:Fronius_Symo_User_Consumed_Energie_C_EnergyDay,Fronius_Symo_User_Consumed_Energie_C_EnergyDayLast,Fronius_Symo_User_Consumed_Energie_C_EnergyMonth,Fronius_Symo_User_Consumed_Energie_C_EnergyMonth,Fronius_Symo_User_Consumed_Energie_C_EnergyYear\
Autolade_Calculator:C_STROM_GAS_counters.A_EnergyDay,C_STROM_GAS_counters.A_EnergyDayLast,C_STROM_GAS_counters.A_EnergyMonth,C_STROM_GAS_counters.A_EnergyMonthLast,C_STROM_GAS_counters.A_EnergyYear \
AutarkieQuote:Heute,Gestern,Monat,Vormonat,Jahr \
EigenverbrQuote:Heute,Gestern,Monat,Vormonat,Jahr
attr mySolarStat alias Solarstromstatistik kWh / %
attr mySolarStat room Energie-Auto,Energie-Strom,Statistik
attr mySolarStat valueFormat %.1f

Grafiken

Erzeugung

Strombezug, Stromeinspeisung, Stromerzeugung, Stromverbrauch, Solare Vorhersage

hier "nur" ein Beispiel Stromerzeugung, die anderen Graphen dementsprechend anlegen

defmod SVG_myDbLog_1 SVG myDbLog:SVG_myDbLog_1:HISTORY
attr SVG_myDbLog_1 alias Stromerzeugung
attr SVG_myDbLog_1 fp_Energieerzeugung 415,204,1,SVG_myDbLog_1,
attr SVG_myDbLog_1 fp_Energieverbrauch 204,164,1,SVG_myDbLog_1,
attr SVG_myDbLog_1 label $data{currval1}::$data{currval2}::$data{currval3}::$data{currval4}::$data{currval5}::
attr SVG_myDbLog_1 plotReplace L1={sprintf("%.1f", $data{currval1})} L2={sprintf("%.1f", $data{currval2})}
attr SVG_myDbLog_1 room Energie-Strom
attr SVG_myDbLog_1 title "Stromerzeugung"

und dazu die .gplot Datei:

# Created by FHEM/98_SVG.pm, 2024-10-31 18:49:58
set terminal png transparent size <SIZE> crop
set output '<OUT>.png'
set xdata time
set timefmt "%Y-%m-%d_%H:%M:%S"
set xlabel " "
set title '<TL> <L1> W <L2>kWh'
set ytics 
set y2tics 
set grid y2tics
set ylabel "Momentanleistung [W]"
set y2label "Tageserzeugung [kWh]"

#myDbLog Fronius_Symo:PowerFlow_Site_P_PV:::
#myDbLog Fronius_Erzeugung:Fronius_Symo_User_Produced_PV_EnergyDay:::

plot "<IN>" using 1:2 axes x1y1 title 'Momentanleistung <L1> [W]' ls l3 lw 2 with lines,\
     "<IN>" using 1:2 axes x1y2 title 'Tageserzeugung <L2> [kWh]' ls l2fill lw 1 with lines

SolarForecast

SolarForecast Darstellung

es müssen vorher unter global die attr longitude und latitude für den Standort der Anlage eingebeben werden damit die einzelnen Wettermodelle funktionieren. Forecast hat ein prima selbsterklärendes Startmenü und man sieht auch gleich die evt. vorhandenen Einstellungsfehler.

Weiteres dazu im umfangreichen Wiki Solarforecast.

Die dort beschriebene Grafik Solare Vorhersage zeigt die Differenzen zwischen der berechneten Vorhersage und der tatsächlichen PV-Erzeugung eines Tages. Die Werte die in der Anlagenübersicht angezeigt werden. sollten identisch zu denen in dem u.A. ftui2 Widget sein. (Gegenkontrolle)

In diesem Beispiel ist ein Interner consumer01 (Autoladen) eingstellt, dessen Werte nicht mit in den Forecast einbezogen werden.

define Forecast SolarForecast
attr Forecast DbLogExclude .*
attr Forecast DbLogInclude LastHourPVforecast,LastHourPVreal,AllPVforecastsToEvent
attr Forecast affectConsForecastIdentWeekdays 0
attr Forecast consumer01 Autolade_Calculator type=charger power=2400 exconfc=1 icon=electric_car_icon pcurr=Auto_Ladung_av:kW etotal=C_STROM_GAS_counters.A_EnergyDay:kWh
attr Forecast ctrlLanguage DE
attr Forecast ctrlShowLink 1
attr Forecast ctrlStatisticReadings todayBatIn,todayBatOut,todayConsumptionForecast,todayGridConsumption,todayGridFeedIn
attr Forecast event-on-change-reading .*
attr Forecast graphicBeam3Content gridconsumption
attr Forecast graphicBeam4Content consumptionForecast
attr Forecast graphicEnergyUnit kWh
attr Forecast graphicHeaderDetail all
attr Forecast graphicHeaderShow 1
attr Forecast graphicHistoryHour 9
attr Forecast graphicLayoutType double
attr Forecast room Energie-Strom
attr Forecast setupBatteryDev PV_Batterie pin=BatteryChargeWatt:W pout=BatteryDischargeWatt:W intotal=Summe_Ladung:kWh outtotal=Summe_Entladung:kWh cap=10.26:kWh charge=BatteryChargePercent
attr Forecast setupInverterDev01 Fronius_Symo pv=PowerFlow_Site_P_PV:W etotal=User_Produced_PV:kWh capacity=10200
attr Forecast setupInverterStrings Suedseite,Westseite
attr Forecast setupMeterDev Fronius_Symo gcon=Bezug:W contotal=Meter_0_EnergyReal_WAC_Plus_Absolute:Wh gfeedin=Einspeisung feedtotal=Meter_0_EnergyReal_WAC_Plus_Absolute:Wh conprice=powerCost: feedprice=0.083:
attr Forecast setupRadiationAPI OpenMeteoDWDEnsemble-API
attr Forecast setupStringPeak Suedseite=7.66 Westseite=2.2
attr Forecast setupWeatherDev1 OpenMeteoDWDEnsemble-API
attr Forecast verbose 0
SolarForecast Diff. Grafik


Die Unterschiede vom Forecast zur reellen Erzeugung kann in einer Grafik dargestellt werden.

Autoladen über evcc

Integration und Steuerung der Wallbox, Wechselrichter, Batterie sowie zu ladendes Fahrzeug wird über das Programm evcc gemacht.

Die Software evcc läuft problemlos parallel auf dem fhem System und kann über MQTT2 eingebunden werden.

Weitere Infos dazu in https://evcc.io/

Der Nachteil dieser (externen) Software ist der Preis. Es wird mit Open-Source-Software geworben,

jedoch die meisten Module z.B. zum Steuern eines Fahrzeugs oder einer Wallbox gehen nur über einen sog. Sponsortoken,

den man für 1$ pro Monat erwerben kann. Aber solange ein solches Modul mit ähnlich umfangreichen Möglichkeiten bei

fhem nicht zur Verfügung steht, hier die Möglichkeit der Integration in fhem.

Der Clou ist hieri st die Hausbatterie entsprechend der evcc Möglichkeiten zu schalten und auch das Programm zu steuern

auf welche Art das Fz geladen werden soll: Sofort, nur PV Überschuss, Minimal + PV oder Aus

Zusätzlich ein weiterer ElectricityCalculator für die Autoladestatistik der Wallbox.

define MQTT2_evcc1 MQTT2_DEVICE evcc1
attr MQTT2_evcc1 DbLogExclude .*
attr MQTT2_evcc1 alias Wally
attr MQTT2_evcc1 autocreate 1
attr MQTT2_evcc1 event-on-change-reading .*
attr MQTT2_evcc1 icon wallbox
attr MQTT2_evcc1 readingList evcc1:evcc/updated:.* updated\
evcc1:evcc/loadpoints/1/chargePower:.* loadpoints_1_chargePower\
evcc1:evcc/site/pvPower:.* pvPower\
evcc1:evcc/site/pvEnergy:.* pvEnergy\
evcc1:evcc/site/pv:.* pv\
evcc1:evcc/site/pv/1/power:.* pv_1_power\
evcc1:evcc/site/pv/1/energy:.* pv_1_energy\
evcc1:evcc/site/batteryCapacity:.* batteryCapacity\
evcc1:evcc/site/batterySoc:.* batterySoc\
evcc1:evcc/site/batteryPower:.* batteryPower\
evcc1:evcc/site/batteryEnergy:.* batteryEnergy\
evcc1:evcc/site/battery:.* battery\
evcc1:evcc/site/battery/1/power:.* battery_1_power\
evcc1:evcc/site/battery/1/energy:.* battery_1_energy\
evcc1:evcc/site/battery/1/soc:.* battery_1_soc\
evcc1:evcc/site/battery/1/capacity:.* battery_1_capacity\
evcc1:evcc/site/battery/1/controllable:.* battery_1_controllable\
evcc1:evcc/site/gridPower:.* gridPower\
evcc1:evcc/site/gridCurrents/l1:.* l1\
evcc1:evcc/site/gridCurrents/l2:.* l2\
evcc1:evcc/site/gridCurrents/l3:.* l3\
evcc1:evcc/site/gridCurrents:.* gridCurrents\
evcc1:evcc/site/gridEnergy:.* gridEnergy\
evcc1:evcc/site/homePower:.* homePower\
evcc1:evcc/loadpoints/1/smartCostActive:.* loadpoints_1_smartCostActive\
evcc1:evcc/loadpoints/1/smartCostNextStart:.* loadpoints_1_smartCostNextStart\
evcc1:evcc/loadpoints/1/chargeCurrent:.* loadpoints_1_chargeCurrent\
evcc1:evcc/loadpoints/1/sessionEnergy:.* loadpoints_1_sessionEnergy\
evcc1:evcc/loadpoints/1/sessionSolarPercentage:.* loadpoints_1_sessionSolarPercentage\
evcc1:evcc/loadpoints/1/sessionPricePerKWh:.* loadpoints_1_sessionPricePerKWh\
evcc1:evcc/loadpoints/1/sessionPrice:.* loadpoints_1_sessionPrice\
evcc1:evcc/loadpoints/1/sessionCo2PerKWh:.* loadpoints_1_sessionCo2PerKWh\
evcc1:evcc/loadpoints/1/chargedEnergy:.* loadpoints_1_chargedEnergy\
evcc1:evcc/loadpoints/1/chargeDuration:.* loadpoints_1_chargeDuration\
evcc1:evcc/loadpoints/1/effectivePriority:.* loadpoints_1_effectivePriority\
evcc1:evcc/loadpoints/1/effectivePlanTime:.* loadpoints_1_effectivePlanTime\
evcc1:evcc/loadpoints/1/effectivePlanSoc:.* loadpoints_1_effectivePlanSoc\
evcc1:evcc/loadpoints/1/effectiveMinCurrent:.* loadpoints_1_effectiveMinCurrent\
evcc1:evcc/loadpoints/1/effectiveMaxCurrent:.* loadpoints_1_effectiveMaxCurrent\
evcc1:evcc/loadpoints/1/effectiveLimitSoc:.* loadpoints_1_effectiveLimitSoc\
evcc1:evcc/site/greenShareHome:.* greenShareHome\
evcc1:evcc/site/greenShareLoadpoints:.* greenShareLoadpoints\
evcc1:evcc/loadpoints/1/mode:.* loadpoints_1_mode\
evcc1:evcc/loadpoints/1/mode/set:.* set\
evcc1:evcc/site/statistics/30d/solarPercentage:.* solarPercentage\
evcc1:evcc/site/statistics/30d/chargedKWh:.* chargedKWh\
evcc1:evcc/site/statistics/30d/avgPrice:.* avgPrice\
evcc1:evcc/site/statistics/30d/avgCo2:.* avgCo2\
evcc1:evcc/site/statistics/365d/chargedKWh:.* chargedKWh\
evcc1:evcc/site/statistics/365d/avgPrice:.* avgPrice\
evcc1:evcc/site/statistics/365d/avgCo2:.* avgCo2\
evcc1:evcc/site/statistics/365d/solarPercentage:.* solarPercentage\
evcc1:evcc/site/statistics/total/chargedKWh:.* chargedKWh\
evcc1:evcc/site/statistics/total/avgPrice:.* avgPrice\
evcc1:evcc/site/statistics/total/avgCo2:.* avgCo2\
evcc1:evcc/site/statistics/total/solarPercentage:.* solarPercentage\
evcc1:evcc/loadpoints/1/connectedDuration:.* loadpoints_1_connectedDuration\
evcc1:evcc/loadpoints/1/pvAction:.* loadpoints_1_pvAction\
evcc1:evcc/loadpoints/1/pvRemaining:.* loadpoints_1_pvRemaining\
evcc1:evcc/loadpoints/1/vehicleWelcomeActive:.* loadpoints_1_vehicleWelcomeActive\
evcc1:evcc/loadpoints/1/connected:.* loadpoints_1_connected\
evcc1:evcc/loadpoints/1/charging:.* loadpoints_1_charging\
evcc1:evcc/loadpoints/1/vehicleSoc:.* loadpoints_1_vehicleSoc\
evcc1:evcc/loadpoints/1/chargeRemainingEnergy:.* loadpoints_1_chargeRemainingEnergy\
evcc1:evcc/loadpoints/1/vehicleRange:.* loadpoints_1_vehicleRange\
evcc1:evcc/loadpoints/1/enabled:.* loadpoints_1_enabled\
evcc1:evcc/loadpoints/1/planProjectedStart:.* loadpoints_1_planProjectedStart\
evcc1:evcc/loadpoints/1/planProjectedEnd:.* loadpoints_1_planProjectedEnd\
evcc1:evcc/loadpoints/1/planOverrun:.* loadpoints_1_planOverrun\
evcc1:evcc/loadpoints/1/vehicleOdometer:.* loadpoints_1_vehicleOdometer\
evcc1:evcc/loadpoints/1/phasesActive:.* loadpoints_1_phasesActive\
evcc1:evcc/loadpoints/1/vehicleDetectionActive:.* loadpoints_1_vehicleDetectionActive\
evcc1:evcc/loadpoints/1/vehicleName:.* loadpoints_1_vehicleName\
evcc1:evcc/loadpoints/1/vehicleClimaterActive:.* loadpoints_1_vehicleClimaterActive\
evcc1:evcc/loadpoints/1/vehicleLimitSoc:.* loadpoints_1_vehicleLimitSoc\
evcc1:evcc/site/availableVersion:.* availableVersion\
evcc1:evcc/loadpoints/1/vehicleIdentity:.* loadpoints_1_vehicleIdentity\
evcc1:evcc/loadpoints/1/chargeRemainingDuration:.* loadpoints_1_chargeRemainingDuration\
evcc1:evcc/status:.* status\
evcc1:evcc/loadpoints:.* loadpoints\
evcc1:evcc/vehicles:.* vehicles\
evcc1:evcc/site/pv/0:.* pv_0\
evcc1:evcc/site/battery/0:.* battery_0\
evcc1:evcc/site/vehicles/0:.* vehicles_0\
evcc1:evcc/site/pv/1:.* pv_1\
evcc1:evcc/site/battery/1:.* battery_1\
evcc1:evcc/site/vehicles/1:.* vehicles_1\
evcc1:evcc/site/pv/2:.* pv_2\
evcc1:evcc/site/battery/2:.* battery_2\
evcc1:evcc/site/vehicles/2:.* vehicles_2\
evcc1:evcc/site/pv/3:.* pv_3\
evcc1:evcc/site/battery/3:.* battery_3\
evcc1:evcc/site/vehicles/3:.* vehicles_3\
evcc1:evcc/site/pv/4:.* pv_4\
evcc1:evcc/site/battery/4:.* battery_4\
evcc1:evcc/site/vehicles/4:.* vehicles_4\
evcc1:evcc/site/pv/5:.* pv_5\
evcc1:evcc/site/battery/5:.* battery_5\
evcc1:evcc/site/vehicles/5:.* vehicles_5\
evcc1:evcc/site/pv/6:.* pv_6\
evcc1:evcc/site/battery/6:.* battery_6\
evcc1:evcc/site/vehicles/6:.* vehicles_6\
evcc1:evcc/site/pv/7:.* pv_7\
evcc1:evcc/site/battery/7:.* battery_7\
evcc1:evcc/site/vehicles/7:.* vehicles_7\
evcc1:evcc/site/pv/8:.* pv_8\
evcc1:evcc/site/battery/8:.* battery_8\
evcc1:evcc/site/vehicles/8:.* vehicles_8\
evcc1:evcc/site/pv/9:.* pv_9\
evcc1:evcc/site/battery/9:.* battery_9\
evcc1:evcc/site/vehicles/9:.* vehicles_9\
evcc1:evcc/site/version:.* version\
evcc1:evcc/site/bufferSoc:.* bufferSoc\
evcc1:evcc/site/bufferStartSoc:.* bufferStartSoc\
evcc1:evcc/site/prioritySoc:.* prioritySoc\
evcc1:evcc/site/siteTitle:.* siteTitle\
evcc1:evcc/site/gridConfigured:.* gridConfigured\
evcc1:evcc/site/maxGridSupplyWhileBatteryCharging:.* maxGridSupplyWhileBatteryCharging\
evcc1:evcc/site/batteryMode:.* batteryMode\
evcc1:evcc/site/batteryDischargeControl:.* batteryDischargeControl\
evcc1:evcc/site/residualPower:.* residualPower\
evcc1:evcc/site/currency:.* currency\
evcc1:evcc/site/smartCostType:.* smartCostType\
evcc1:evcc/vehicles/ev4/title:.* title\
evcc1:evcc/vehicles/ev4/icon:.* icon\
evcc1:evcc/vehicles/ev4/capacity:.* capacity\
evcc1:evcc/vehicles/ev4/minSoc:.* minSoc\
evcc1:evcc/vehicles/ev4/limitSoc:.* limitSoc\
evcc1:evcc/vehicles/ev4/features:.* features\
evcc1:evcc/vehicles/ev4/plans:.* plans\
evcc1:evcc/loadpoints/1/phasesConfigured:.* loadpoints_1_phasesConfigured\
evcc1:evcc/loadpoints/1/minCurrent:.* loadpoints_1_minCurrent\
evcc1:evcc/loadpoints/1/maxCurrent:.* loadpoints_1_maxCurrent\
evcc1:evcc/loadpoints/1/title:.* loadpoints_1_title\
evcc1:evcc/loadpoints/1/priority:.* loadpoints_1_priority\
evcc1:evcc/loadpoints/1/enableThreshold:.* loadpoints_1_enableThreshold\
evcc1:evcc/loadpoints/1/disableThreshold:.* loadpoints_1_disableThreshold\
evcc1:evcc/loadpoints/1/chargerPhases1p3p:.* loadpoints_1_chargerPhases1p3p\
evcc1:evcc/loadpoints/1/phasesEnabled:.* loadpoints_1_phasesEnabled\
evcc1:evcc/loadpoints/1/phaseAction:.* loadpoints_1_phaseAction\
evcc1:evcc/loadpoints/1/phaseRemaining:.* loadpoints_1_phaseRemaining\
evcc1:evcc/loadpoints/1/chargerPhysicalPhases:.* loadpoints_1_chargerPhysicalPhases\
evcc1:evcc/loadpoints/1/chargerFeatureIntegratedDevice:.* loadpoints_1_chargerFeatureIntegratedDevice\
evcc1:evcc/loadpoints/1/chargerFeatureHeating:.* loadpoints_1_chargerFeatureHeating\
evcc1:evcc/loadpoints/1/chargerIcon:.* loadpoints_1_chargerIcon\
evcc1:evcc/loadpoints/1/planTime:.* loadpoints_1_planTime\
evcc1:evcc/loadpoints/1/planEnergy:.* loadpoints_1_planEnergy\
evcc1:evcc/loadpoints/1/limitSoc:.* loadpoints_1_limitSoc\
evcc1:evcc/loadpoints/1/limitEnergy:.* loadpoints_1_limitEnergy\
evcc1:evcc/loadpoints/1/chargeCurrents/l1:.* l1\
evcc1:evcc/loadpoints/1/chargeCurrents/l2:.* l2\
evcc1:evcc/loadpoints/1/chargeCurrents/l3:.* l3\
evcc1:evcc/loadpoints/1/chargeCurrents:.* loadpoints_1_chargeCurrents\
evcc1:evcc/site/batteryGridChargeActive:.* batteryGridChargeActive\
evcc1:evcc/loadpoints/1/chargeTotalImport:.* loadpoints_1_chargeTotalImport\
evcc1:evcc/site/statistics/thisYear/avgCo2:.* avgCo2\
evcc1:evcc/site/statistics/thisYear/solarPercentage:.* solarPercentage\
evcc1:evcc/site/statistics/thisYear/chargedKWh:.* chargedKWh\
evcc1:evcc/site/statistics/thisYear/avgPrice:.* avgPrice\
evcc1:evcc/loadpoints/1/chargeVoltages/l1:.* l1\
evcc1:evcc/loadpoints/1/chargeVoltages/l2:.* l2\
evcc1:evcc/loadpoints/1/chargeVoltages/l3:.* l3\
evcc1:evcc/loadpoints/1/chargeVoltages:.* loadpoints_1_chargeVoltages\
evcc1:evcc/loadpoints/1/chargerStatusReason:.* loadpoints_1_chargerStatusReason\
evcc1:evcc/vehicles/ev4/features/1:.* features_1\
evcc1:evcc/vehicles/ev4/features/2:.* features_2\
evcc1:evcc/loadpoints/1/maxCurrent/set:.* set\
evcc1:evcc/loadpoints/1/enableDelay:.* loadpoints_1_enableDelay\
evcc1:evcc/loadpoints/1/disableDelay:.* loadpoints_1_disableDelay\
evcc1:evcc/loadpoints/1/batteryBoost:.* loadpoints_1_batteryBoost\
evcc1:evcc/site/pv/1/excessDCPower:.* pv_1_excessDCPower\
evcc1:evcc/vehicles/ev4/phases:.* phases\
evcc1:evcc/vehicles/ev4/minCurrent:.* minCurrent\
evcc1:evcc/vehicles/ev4/maxCurrent:.* maxCurrent\
evcc1:evcc/vehicles/ev4/priority:.* priority\
evcc1:evcc/site/gridPowers/l1:.* l1\
evcc1:evcc/site/gridPowers/l2:.* l2\
evcc1:evcc/site/gridPowers/l3:.* l3\
evcc1:evcc/site/gridPowers:.* gridPowers
attr MQTT2_evcc1 room Energie-Auto
attr MQTT2_evcc1 setList ChargeMode:Now,Min+PV,PV,Stop { my %h=(Now=>'now','Min+PV'=>'minpv',PV=>'pv',Stop=>'off');; qq(evcc/loadpoints/1/mode/set $h{$EVTPART1});; } \
PvPriority:Home,Car,FillCar { my %h=(Home=>'95','Car'=>'35','FillCar'=>'15');; qq(evcc/site/prioritySoc/set $h{$EVTPART1});; }\
MaxCurrent:11,14,16,20,24,32 { qq(evcc/loadpoints/1/maxCurrent/set $EVTPART1);; }
attr MQTT2_evcc1 stateFormat Auto_Status | loadpoints_1_mode
attr MQTT2_evcc1 userReadings Auto_Status { (ReadingsVal($name,'loadpoints_1_connected','') eq 'true' ? 2 : 0) },\
Reichweite { (ReadingsVal($name,'loadpoints_1_vehicleSoc','')*0.6) }

Und nun noch ein ElectricityCalculator, zur Berechnung der Strommenge:

Die Stromwerte kommen aus einem 1-Wire Counter der einen extra Zähler über den SO Port zählt.

Wenn die Wallbox einen Stromzähler hat, geht das natürlich einfacher; nur die Statistikwerte dieses Zählers werden benötigt.

define Autolade_Calculator ElectricityCalculator C_STROM_GAS:counters.A.*
attr Autolade_Calculator BasicPricePerAnnum 132,84
attr Autolade_Calculator Currency 
attr Autolade_Calculator DbLogExclude .*
attr Autolade_Calculator DbLogInclude C_STROM_GAS_counters.A_EnergyDay, Auto_Ladung_av
attr Autolade_Calculator DecimalPlace 3
attr Autolade_Calculator ElectricityCounterOffset 0
attr Autolade_Calculator ElectricityKwhPerCounts 0.001
attr Autolade_Calculator ElectricityPricePerKWh 0.3305
attr Autolade_Calculator MonthOfAnnualReading 9
attr Autolade_Calculator MonthlyPayment 121
attr Autolade_Calculator ReadingDestination CalculatorDevice
attr Autolade_Calculator SiPrefixPower kW
attr Autolade_Calculator alias Autoladen
attr Autolade_Calculator room Energie-Auto,Steuerung
attr Autolade_Calculator stateFormat Auto Aktuell: Auto_Ladung_av kW | Heute: C_STROM_GAS_counters.A_EnergyDay kWh<br/>
attr Autolade_Calculator userReadings Auto_reduce { reduce_min_value ('Autolade_Calculator', 'C_STROM_GAS_counters.A_PowerCurrent', 0.070);;},\
Auto_Ladung_av {movingAverage("Autolade_Calculator","Auto_reduce",60)}

ftui2 Widgets zur Darstellung auf einem Tablet

Widget pvvis und angepasste Daten zur Darstellung

Solaranlagenübersicht

Einige Werte werden intern berechnet, das Widget selbst kann im Forum geladen werden.

		<header>Solaranlage und Batterie</header>

					<div data-type="pvvis" data-device="Fronius_Symo"
						data-get="Fronius_Symo:Bezug"
						data-feed="Fronius_Symo:Neg_Einspeisung"
						data-lp1="MQTT2_evcc1:Auto_Status"
						data-lp1pow="Autolade_Calculator:Auto_reduce"
						data-carsoc="MQTT2_evcc1:loadpoints_1_vehicleSoc"
						data-carvol="Autolade_Calculator:C_STROM_GAS_counters.A_EnergyDay"
						data-carrange="MQTT2_evcc1:Reichweite"
						data-charge="Fronius_Symo:Akku_Laden"
						data-discharge="Fronius_Symo:Akku_Entladen"
						data-produce="Fronius_Symo:PowerFlow_Site_P_PV"
						data-sumproduceday="Fronius_Erzeugung:Fronius_Symo_User_Produced_PV_EnergyDay"
						data-sumgridday="Fronius_Bezug:Fronius_Symo_Meter_0_EnergyReal_WAC_Plus_Absolute_EnergyDay"
						data-sumfeedday="Fronius_Einspeisung:Fronius_Symo_Meter_0_EnergyReal_WAC_Minus_Absolute_EnergyDay"
						data-soc="Fronius_Symo:PowerFlow_Inverters_1_SOC"
						data-chargedischarge="Fronius_Symo:PowerFlow_Site_P_Akku"
						data-pv-max="10000"
						data-batt-max="10240"
						data-autarky="AutarkieQuote:Heute"
						data-pvhome="Fronius_Symo:PowerFlow_Site_P_Load"
						data-width="450" data-height="450" class="centered">
					</div>

Und Widget SolarForecast für die Vorschau auf ftui2, darunter die Differenz Vorhersage/reale Erzeugung:

<div class="page" id="content_forecast">
<div class="gridster">
<ul>

		 <li data-row="1" data-col="1" data-sizex="9" data-sizey="9">
				<header>Solar Vorhersage</header>
				<div class="cell">
					<div data-type="smaportalspg" data-device="Forecast" data-get="state"></div>  
				</div>
		</li> 
		<li data-row="9" data-col="1" data-sizex="9" data-sizey="4">
		<header>Vorhersage</header>
			<div data-type="chart"
			data-device="Hausverbrauch"
			data-logdevice='["myDbLog"]'
			data-logfile='["HISTORY"]'
			data-columnspec='["Forecast:LastHourPVreal","Forecast:LastHourPVforecast"]'
			data-style='["ftui l6fill","ftui l1fill"]'
			data-uaxis='["primary","secondary"]'
			data-legend='["Akt.Erzeugung","Akt.Vorhersage"]'
			data-yunit="°kWh"
			data-ytext="Menge"
				data-width="100%"
				data-height="100%"
				data-yticks="auto"
				data-minvalue="auto"
				data-maxvalue="auto"
				data-nofulldays="true"
				data-daysago_start="-6H"
				data-daysago_end="-22H"
				data-xticks="auto"
			</div>
		</li>

</ul>
</div>
</div>