diff --git a/fhem/contrib/DS_Starter/76_SMAPortal.pm b/fhem/contrib/DS_Starter/76_SMAPortal.pm
index 359d2bb29..f55195655 100644
--- a/fhem/contrib/DS_Starter/76_SMAPortal.pm
+++ b/fhem/contrib/DS_Starter/76_SMAPortal.pm
@@ -161,6 +161,7 @@ use vars qw($FW_ME); # webname (default is fh
# Versions History intern
our %vNotesIntern = (
+ "2.3.1" => "13.06.2019 switch Credentials read from RAM to verbose 4, changed W/h->Wh and kW/h->kWh in PortalAsHtml ",
"2.3.0" => "12.06.2019 add set on,off,automatic cmd for controlled devices ",
"2.2.0" => "10.06.2019 relocate RestOfDay and Tomorrow data from level 3 to level 2, change readings to start all with uppercase, ".
"add consumer energy data of current day/month/year, new attribute \"verbose5Data\" ",
@@ -526,7 +527,7 @@ sub getcredentials ($$) {
my $logpw = AttrVal($name, "showPassInLog", "0") == 1 ? $passwd : "********";
- Log3($name, 3, "$name - Credentials read from RAM: $username $logpw");
+ Log3($name, 4, "$name - Credentials read from RAM: $username $logpw");
} else {
Log3($name, 1, "$name - Credentials not set in RAM !");
@@ -1875,7 +1876,7 @@ sub PortalAsHtml ($$) {
$html_end = AttrVal($wlname, 'htmlEnd', undef); # beliebige HTML Strings die nach der Grafik ausgegeben werden
$type = AttrVal($wlname, 'layoutType', 'pv');
- $kw = AttrVal($wlname, 'W/kW', 'W');
+ $kw = AttrVal($wlname, 'Wh/kWh', 'Wh');
$height = AttrNum($wlname, 'beamHeight', 200);
$width = AttrNum($wlname, 'beamWidth', 6); # zu klein ist nicht problematisch
@@ -1904,20 +1905,20 @@ sub PortalAsHtml ($$) {
my $pvRe = ReadingsNum($name,"L2_RestOfDay-PV", 0);
my $pvTo = ReadingsNum($name,"L2_Tomorrow-PV", 0);
- if ($kw eq 'kW') {
- $co4h = sprintf("%.1f" , $co4h/1000)." kW";
- $coRe = sprintf("%.1f" , $coRe/1000)." kW";
- $coTo = sprintf("%.1f" , $coTo/1000)." kW";
- $pv4h = sprintf("%.1f" , $pv4h/1000)." kW";
- $pvRe = sprintf("%.1f" , $pvRe/1000)." kW";
- $pvTo = sprintf("%.1f" , $pvTo/1000)." kW";
+ if ($kw eq 'kWh') {
+ $co4h = sprintf("%.1f" , $co4h/1000)." kWh";
+ $coRe = sprintf("%.1f" , $coRe/1000)." kWh";
+ $coTo = sprintf("%.1f" , $coTo/1000)." kWh";
+ $pv4h = sprintf("%.1f" , $pv4h/1000)." kWh";
+ $pvRe = sprintf("%.1f" , $pvRe/1000)." kWh";
+ $pvTo = sprintf("%.1f" , $pvTo/1000)." kWh";
} else {
- $co4h .= " W";
- $coRe .= " W";
- $coTo .= " W";
- $pv4h .= " W";
- $pvRe .= " W";
- $pvTo .= " W";
+ $co4h .= " Wh";
+ $coRe .= " Wh";
+ $coTo .= " Wh";
+ $pv4h .= " Wh";
+ $pvRe .= " Wh";
+ $pvTo .= " Wh";
}
# Headerzeile generieren
@@ -1932,8 +1933,8 @@ sub PortalAsHtml ($$) {
if ($header) {
my ($h1,$h2);
if(AttrVal("global","language","EN") eq "DE") {
- $h1 = "Prognose [pv] - nächste 4 Stunden: $pv4h/h / Rest des Tages: $pvRe/h / Morgen: $pvTo/h";
- $h2 = "Prognose [co] - nächste 4 Stunden: $co4h/h / Rest des Tages: $coRe/h / Morgen: $coTo/h";
+ $h1 = "Prognose [pv] - nächste 4 Stunden: $pv4h / Rest des Tages: $pvRe / Morgen: $pvTo";
+ $h2 = "Prognose [co] - nächste 4 Stunden: $co4h / Rest des Tages: $coRe / Morgen: $coTo";
my ($year, $month, $day, $hour, $min, $sec) = $lup =~ /(\d+)-(\d\d)-(\d\d)\s+(.*)/;
$lup = "$3.$2.$1 $4";
$lupt = "letzte Aktualisierung:";
@@ -2378,7 +2379,7 @@ sub formatVal6($$;$) {
$v = abs($v);
}
- if ($kw eq 'kW') { # bei Anzeige in kW muss weniger aufgefüllt werden
+ if ($kw eq 'kWh') { # bei Anzeige in kWh muss weniger aufgefüllt werden
$v = sprintf('%.1f',($v/1000));
$v += 0; # keine 0.0 oder 6.0 etc
diff --git a/fhem/contrib/DS_Starter/76_SMAPortalSPG.pm b/fhem/contrib/DS_Starter/76_SMAPortalSPG.pm
index 2ae2965f4..c91f1e7f6 100644
--- a/fhem/contrib/DS_Starter/76_SMAPortalSPG.pm
+++ b/fhem/contrib/DS_Starter/76_SMAPortalSPG.pm
@@ -4,7 +4,6 @@
# 76_SMAPortalSPG.pm
#
# (c) 2019 by Heiko Maaz e-mail: Heiko dot Maaz at t-online dot de
-# forked from 98_weblink.pm by Rudolf König
#
# This Module is used by module 76_SMAPortal to create graphic devices.
# It can't be used standalone without any SMAPortal-Device.
@@ -35,6 +34,7 @@ eval "use FHEM::Meta;1" or my $modMetaAbsent = 1;
# Versions History intern
our %SMAPortalSPG_vNotesIntern = (
+ "1.1.0" => "13.06.2019 commandRef revised, changed attribute W/kW to Wh/kWh ",
"1.0.0" => "03.06.2019 initial Version "
);
@@ -68,7 +68,7 @@ sub SMAPortalSPG_Initialize($) {
"spaceSize ".
"suggestIcon ".
"layoutType:pv,co,pvco,diff ".
- "W/kW:W,kW ".
+ "Wh/kWh:Wh,kWh ".
"weatherColor:colorpicker,RGB ".
$readingFnAttributes;
$hash->{RenameFn} = "SMAPortalSPG_Rename";
@@ -262,14 +262,244 @@ return;
1;
=pod
-=item summary Definition of grapic devices by the SMAPortal module
+=item summary Definition of graphic devices by the SMAPortal module
=item summary_DE Erstellung von Grafik-Devices durch das SMAPortal-Modul
=begin html
SMAPortalSPG
- Is coming soon.
+
+The module SMAPortalSPG is a device module attuned to the module SMAPortal for definition of graphic devices.
+
+
+
+ Define
+
+
+
+ A SMAPortal graphic device is defined by the command "set <name> createPortalGraphic <type>" in an SMAPortal device.
+ Please see the description of SMAPortal "createPortalGraphic" command.
+
+
+
+
+ Set
+
+
+
+
+ Get
+
+
+
+
+
+ Attribute
+
+
+
+
+ - alias
+ In conjunction with "showLink" a user-defined label for the device.
+
+
+
+
+ - autoRefresh
+ If set, active browser pages of the FHEMWEB device which has called the SMAPortalSPG device, are new reloaded after
+ the specified time (seconds). Browser pages of a particular FHEMWEB device to be refreshed can be specified by
+ attribute "autoRefreshFW" instead.
+
+
+
+
+ - autoRefreshFW
+ If "autoRefresh" is activated, you can specify a particular FHEMWEB device whose active browser pages are refreshed
+ periodically.
+
+
+
+
+ - beamColor
+ Color selection for the primary beams.
+
+
+
+
+ - beamColor2
+ Color selection for the secondary beams. The second color only make sense for devices of type "Generation_Consumption"
+ (Type pvco) and "Differential" (Type diff).
+
+
+
+
+ - beamHeight <value>
+ Height of beams in px and therefore the determination of the whole graphic Height.
+ In conjunction with "hourCount" it is possible to create quite tiny graphics. (default: 200)
+
+
+
+
+ - beamWidth <value>
+ Width of the beams in px. (default: 6 (auto))
+
+
+
+
+ - consumerList <Verbraucher1>:<Icon>@<Farbe>,<Verbraucher2>:<Icon>@<Farbe>,...
+ Comma separated list of consumers which are connected to the Sunny Home Manager.
+ Once the activation of a listed consumer is planned, the consumer icon will be shown in the beams of the planned period.
+ The name of a consumer must be identical to its name in Reading "L3_<consumer>_Planned".
+
+ Example:
+ attr <name> consumerList Trockner:scene_clothes_dryer@yellow,Waschmaschine:scene_washing_machine@lightgreen,Geschirrspueler:scene_dishwasher@orange
+
+
+
+
+
+ - consumerLegend <none | icon_top | icon_bottom | text_top | text_bottom>
+ Location respectively the method of the shown consumer legend.
+
+
+
+
+ - disable
+ Activate/deactivate the device.
+
+
+
+
+ - forcePageRefresh
+ The attribute is evaluated by the SMAPortal module.
+ If set, a reload of all browser pages with active FHEMWEB connections will be enforced when the parent SMAPortal device
+ was updated.
+
+
+
+
+ - hourCount <4...24>
+ Amount of beams/hours to show. (default: 24)
+
+
+
+
+ - hourStyle
+ Format of time specification.
+
+
+
+
+ | not set | - only hours without minutes (default) |
+ | :00 | - hours and minutes two-digit, e.g. 10:00 |
+ | :0 | - hours and minutes one-digit, e.g. 8:0 |
+
+
+
+
+
+
+ - maxPV <0...val>
+ Maximum yield per hour to calculate the beam height. (default: 0 -> dynamical)
+
+
+
+
+ - htmlStart <HTML-String>
+ A user-defined HTML-String issued before the graphic code.
+
+
+
+
+ - htmlEnd <HTML-String>
+ A user-defined HTML-String issued after the graphic code.
+
+
+
+
+ - showDiff <no | top | bottom>
+ Additional note of the difference "Generation - Consumption" as well as the device type Differential (diff) does.
+ (default: no)
+
+
+
+
+ - showHeader
+ Shows the header line with forecast data, Rest of the current day generation and the forecast of the next day
+ (default: 1)
+
+
+
+
+ - showLink
+ Show the detail link above the graphic device. (default: 1)
+
+
+
+
+ - showNight
+ Show the night hours (without forecast values) additionally. (default: 0)
+
+
+
+
+ - showWeather
+ Show weather icons. (default: 1)
+
+
+
+
+ - spaceSize <value>
+ Determines the space (px) above or below the beams (only when using the type "Differential" (diff)) to the shown values.
+ If styles are using large fonts the default value may be too less.
+ In that cases please increase the value. (default: 24)
+
+
+
+
+ - suggestIcon
+ Set the icon used in periods with suggestion to switch consumers on.
+ You can use the standard "Select Icon" function (down left in FHEMWEB) to select the wanted icon.
+
+
+
+
+ - layoutType <pv | co | pvco | diff>
+ Layout type of Portal graphic. (default: pv)
+
+
+
+
+ | pv | - Generation |
+ | co | - Consumption |
+ | pvco | - Generation and Consumption |
+ | diff | - Differenz between Generation and Consumption |
+
+
+
+
+
+
+ - Wh/kWh <Wh | kWh>
+ Switch the unit to W or to kW rounded to one position after decimal point. (default: W)
+
+
+
+
+ - weatherColor
+ Color of weather icons.
+
+
+
+
+
+
+
=end html
=begin html_DE
@@ -286,7 +516,7 @@ Das Modul SMAPortalSPG ist ein mit SMAPortal abgestimmtes Gerätemodul zur Defin
- Ein SMAPortal Grafik Device wird durch den SMAPortal Befehl "set <name> createPortalGraphic <Typ>" erstellt.
+ Ein SMAPortal Grafik-Device wird durch den SMAPortal Befehl "set <name> createPortalGraphic <Typ>" erstellt.
Siehe auch die Beschreibung zum SMAPortal "createPortalGraphic" Befehl.
@@ -313,7 +543,7 @@ Das Modul SMAPortalSPG ist ein mit SMAPortal abgestimmtes Gerätemodul zur Defin
- alias
- In Verbindung mit "showLink" beliebiger Abzeigename.
+ In Verbindung mit "showLink" ein beliebiger Abzeigename.
@@ -340,40 +570,40 @@ Das Modul SMAPortalSPG ist ein mit SMAPortal abgestimmtes Gerätemodul zur Defin
- beamColor2
- Farbauswahl der sekundären Balken. Die zweite Farbe ist nur sinnvoll für Anzeigedevice "Generation_Consumption"
- (Type pvco) und "Differential" (Type diff).
+ Farbauswahl der sekundären Balken. Die zweite Farbe ist nur sinnvoll für den Anzeigedevice-Typ "Generation_Consumption"
+ (pvco) und "Differential" (diff).
- beamHeight <value>
Höhe der Balken in px und damit Bestimmung der gesammten Höhe.
- In Verbindung mit hourCount lassen sich damit auch recht kleine Grafikausgaben erzeugen. (default: 200)
+ In Verbindung mit "hourCount" lassen sich damit auch recht kleine Grafikausgaben erzeugen. (default: 200)
- beamWidth <value>
- Breite der Balken in px. ( default: 6 (auto) )
+ Breite der Balken in px. (default: 6 (auto))
- - consumerList
- Komma getrennte Liste der am Sunny Home Manager angeschlossenen Geräte in der Form <Verbrauchername>:<Icon>@<Farbe>.
- Sobald die Einschaltung einer der angegebenen Verbraucher geplant ist, wird der geplante Zeitraum in der Grafik
+ - consumerList <Verbraucher1>:<Icon>@<Farbe>,<Verbraucher2>:<Icon>@<Farbe>,...
+ Komma getrennte Liste der am SMA Sunny Home Manager angeschlossenen Geräte.
+ Sobald die Aktivierung einer der angegebenen Verbraucher geplant ist, wird der geplante Zeitraum in der Grafik
angezeigt.
Der Name des Verbrauchers muss dabei dem Namen im Reading "L3_<Verbrauchername>_Planned" entsprechen.
Beispiel:
- Trockner:scene_clothes_dryer@yellow,Waschmaschine:scene_washing_machine@lightgreen,Geschirrspueler:scene_dishwasher@orange
+ attr <name> consumerList Trockner:scene_clothes_dryer@yellow,Waschmaschine:scene_washing_machine@lightgreen,Geschirrspueler:scene_dishwasher@orange
- consumerLegend <none | icon_top | icon_bottom | text_top | text_bottom>
- Lage bzw. Art und Weise der angezeigten Consumers Legende.
+ Lage bzw. Art und Weise der angezeigten Verbraucherlegende.
@@ -385,9 +615,9 @@ Das Modul SMAPortalSPG ist ein mit SMAPortal abgestimmtes Gerätemodul zur Defin
- forcePageRefresh
- Das Attribut wird durch SMAPortal ausgewertet.
- Wenn gesetzt, wird ein Reload aller Browserseiten mit aktiven FHEMWEB-Verbindungen nach dem Abschluß bestimmter
- SMAPortal-Befehle erzwungen.
+ Das Attribut wird durch das SMAPortal-Device ausgewertet.
+ Wenn gesetzt, wird ein Reload aller Browserseiten mit aktiven FHEMWEB-Verbindungen nach dem Update des
+ Eltern-SMAPortal-Devices erzwungen.
@@ -414,19 +644,19 @@ Das Modul SMAPortalSPG ist ein mit SMAPortal abgestimmtes Gerätemodul zur Defin
- maxPV <0...val>
- Maximaler Ertrag in einer Stunde zur Berechnung der Balkenhöhe, 0 = dynamisch. (default: 0)
+ Maximaler Ertrag in einer Stunde zur Berechnung der Balkenhöhe. (default: 0 -> dynamisch)
- htmlStart <HTML-String>
- Angabe eines beliebigen HTML-Strings der vor der generierten Portalgrafik ausgegeben wird.
+ Angabe eines beliebigen HTML-Strings der vor dem Grafik-Code ausgeführt wird.
- htmlEnd <HTML-String>
- Angabe eines beliebigen HTML-Strings der nach der generierten Portalgrafik ausgegeben wird.
+ Angabe eines beliebigen HTML-Strings der nach dem Grafik-Code ausgeführt wird.
@@ -437,34 +667,34 @@ Das Modul SMAPortalSPG ist ein mit SMAPortal abgestimmtes Gerätemodul zur Defin
- - showHeader <1|0>
+ - showHeader
Anzeige der Kopfzeile mit Prognosedaten, Rest des aktuellen Tages und des nächsten Tages (default: 1)
- - showLink <1|0>
- Anzeige des Device-Detaillinks über der grafischen Ausgabe (default: 1)
+ - showLink
+ Anzeige des Detail-Links über dem Grafik-Device (default: 1)
- - showNight <1|0>
- Ebenfalls die Nachtstunden ohne Ertragsprognose anzeigen (default: 0)
+ - showNight
+ Die Nachtstunden (ohne Ertragsprognose) werden mit angezeigt. (default: 0)
- - showWeather <1|0>
+ - showWeather
Wettericons anzeigen. (default: 1)
- spaceSize <value>
- Legt fest wieviel Platz in px über den Balken (bei Anzeigetyp Differential (diff) auch unter diesen) zur Anzeige der
- Werte freigehalten wird. Bei Styles die große Fonts benutzen, kann der default-Wert zu klein sein, bzw. u.U. rutscht ein
- Balken über die Grundlinie. In diesen Fällen bitte den Wert erhöhen. (default: 24)
+ Legt fest wieviel Platz in px über oder unter den Balken (bei Anzeigetyp Differential (diff)) zur Anzeige der
+ Werte freigehalten wird. Bei Styles mit große Fonts kann der default-Wert zu klein sein bzw. rutscht ein
+ Balken u.U. über die Grundlinie. In diesen Fällen bitte den Wert erhöhen. (default: 24)
@@ -492,9 +722,9 @@ Das Modul SMAPortalSPG ist ein mit SMAPortal abgestimmtes Gerätemodul zur Defin
-
- - W/kW <W | kW>
- Wertanzeige in W oder in kW auf eine Nachkommastelle gerundet. (default: W)
+
+ - Wh/kWh <Wh | kWh>
+ Definiert die Anzeigeeinheit in Wh oder in kWh auf eine Nachkommastelle gerundet. (default: W)
@@ -530,7 +760,7 @@ Das Modul SMAPortalSPG ist ein mit SMAPortal abgestimmtes Gerätemodul zur Defin
"refresh"
],
"version": "v1.1.1",
- "release_status": "testing",
+ "release_status": "stable",
"author": [
"Heiko Maaz "
],