diff --git a/fhem/contrib/DS_Starter/76_SolarForecast.pm b/fhem/contrib/DS_Starter/76_SolarForecast.pm index 03d891978..424b02903 100644 --- a/fhem/contrib/DS_Starter/76_SolarForecast.pm +++ b/fhem/contrib/DS_Starter/76_SolarForecast.pm @@ -116,7 +116,8 @@ BEGIN { # Versions History intern my %vNotesIntern = ( - "0.47.0" => "26.05.2021 add flowGraphic, attr flowGraphicSize, graphicSelect, flowGraphicAnimate ", + "0.48.0" => "28.05.2021 new optional key ready in consumer attribute ", + "0.47.0" => "28.05.2021 add flowGraphic, attr flowGraphicSize, graphicSelect, flowGraphicAnimate ", "0.46.1" => "21.05.2021 set <> reset pvHistory ", "0.46.0" => "16.05.2021 integrate intotal, outtotal to currentBatteryDev, set maxconsumer to 9 ", "0.45.1" => "13.05.2021 change the calc of etotal at the beginning of every hour in _transferInverterValues ". @@ -2560,13 +2561,15 @@ sub __switchConsumer { ## Verbraucher einschalten ############################ - my $oncom = ConsumerVal ($hash, $c, "oncom", ""); # Set Command für "on" - if($oncom && $pstate =~ /planned/xs && $startts && $t >= $startts) { # Verbraucher Start ist geplant && Startzeit überschritten - my $surplus = CurrentVal ($hash, "surplus", 0); # aktueller Überschuß - my $mode = ConsumerVal ($hash, $c, "mode", $defcmode); # Consumer Planungsmode - my $power = ConsumerVal ($hash, $c, "power", 0); # Consumer nominale Leistungsaufnahme (W) + my $oncom = ConsumerVal ($hash, $c, "oncom", ""); # Set Command für "on" + my $ready = ConsumerVal ($hash, $c, "ready", 1); + + if($ready && $oncom && $pstate =~ /planned/xs && $startts && $t >= $startts) { # Verbraucher Start ist geplant && Startzeit überschritten + my $surplus = CurrentVal ($hash, "surplus", 0); # aktueller Überschuß + my $mode = ConsumerVal ($hash, $c, "mode", $defcmode); # Consumer Planungsmode + my $power = ConsumerVal ($hash, $c, "power", 0); # Consumer nominale Leistungsaufnahme (W) - if($mode eq "must" || $surplus >= $power) { # "Muss"-Planung oder Überschuß > Leistungsaufnahme + if($mode eq "must" || $surplus >= $power) { # "Muss"-Planung oder Überschuß > Leistungsaufnahme CommandSet(undef,"$cname $oncom"); my (undef,undef,undef,$starttime) = timestampToTimestring ($t); my $stopdiff = ceil(ConsumerVal ($hash, $c, "mintime", $defmintime) / 60) * 3600; @@ -2626,7 +2629,7 @@ sub _transferBatteryValues { $boutunit //= $binunit; $binunit //= $boutunit; - Log3 ($name, 5, "$name - collect Battery data: device=$badev, pin=$pin ($piunit), pout=$pou ($pounit), totalin: $bin ($binunit), totalout: $bout ($boutunit)"); + Log3 ($name, 5, "$name - collect Battery data: device=$badev, pin=$pin ($piunit), pout=$pou ($pounit), totalin: $bin ($binunit), totalout: $bout ($boutunit), charge: $batchr"); my $piuf = $piunit =~ /^kW$/xi ? 1000 : 1; my $pouf = $pounit =~ /^kW$/xi ? 1000 : 1; @@ -3155,8 +3158,6 @@ return; ################################################################ # Grunddaten aller registrierten Consumer speichern -# $acref - übergebene Referenz Hash zum Füllen -# mit Consumer Infos ################################################################ sub collectAllRegConsumers { my $paref = shift; @@ -3190,6 +3191,7 @@ sub collectAllRegConsumers { my $ctype = $hc->{type} // $defctype; my $hours = ($hc->{mintime} // $hef{$ctype}{mt}) / 60; my $avgenergy = $hc->{power} * $hours * $hef{$ctype}{tot}; # Wh + my $ready = ReadingsVal ($consumer, $hc->{ready}, 1); # Reading für Ready-Bit -> Einschalten möglich ? $data{$type}{$name}{consumers}{$c}{name} = $consumer; # Name des Verbrauchers (Device) $data{$type}{$name}{consumers}{$c}{alias} = $alias; # Alias des Verbrauchers (Device) @@ -3201,6 +3203,7 @@ sub collectAllRegConsumers { $data{$type}{$name}{consumers}{$c}{icon} = $hc->{icon} // q{}; # Icon für den Verbraucher $data{$type}{$name}{consumers}{$c}{oncom} = $hc->{on} // q{}; # Setter Einschaltkommando $data{$type}{$name}{consumers}{$c}{offcom} = $hc->{off} // q{}; # Setter Ausschaltkommando + $data{$type}{$name}{consumers}{$c}{ready} = $ready; # 1 - Einschalten soll möglich sein, 0 - nicht $data{$type}{$name}{consumers}{$c}{retotal} = $rtot // q{}; # Reading der Leistungsmessung $data{$type}{$name}{consumers}{$c}{uetotal} = $utot // q{}; # Unit der Leistungsmessung } @@ -4305,7 +4308,6 @@ sub flowGraphic { -
  • consumerXX <Device Name> type=<type> power=<power> [mode=<mode>] [icon=<Icon>] [mintime=<minutes>] [on=<Kommando>] [off=<Kommando>] [etotal=<Readingname>:<Einheit>]
    +
  • consumerXX <Device Name> type=<type> power=<power> [mode=<mode>] [icon=<Icon>] [mintime=<minutes>] [on=<Kommando>] [off=<Kommando>] [ready=<Readingname>] [etotal=<Readingname>:<Einheit>]
    Registriert einen Verbraucher <Device Name> beim SolarForecast Device. Dabei ist <Device Name> ein in FHEM bereits angelegtes Verbraucher Device, z.B. eine Schaltsteckdose. Die meisten Schlüssel sind optional, sind aber für bestimmte Funktionalitäten Voraussetzung und werden mit default-Werten besetzt.

    @@ -6410,6 +6412,8 @@ Ein/Ausschaltzeiten sowie deren Ausführung vom SolarForecast Modul übernehmen mintimeMindestlaufzeit bzw. typische Laufzeit für einen Zyklus des Verbrauchers nach dem Einschalten in Minuten (default: Typ bezogen) on Set-Kommando zum Einschalten des Verbrauchers (optional) off Set-Kommando zum Ausschalten des Verbrauchers (optional) + ready Reading im Verbraucherdevice welches das Einschalten des Verbrauchers freigibt bzw. blockiert (optional) + Readingwert = 1: Einshalten freigegeben, Readingwert = 0: Einshalten blockiert etotal Reading welches die Summe der verbrauchten Energie liefert und der Einheit (Wh/kWh) (optional)