76_SMAPortal - Integration SMA Sunny Portal - Ideen & Modulweiterentwicklung

Begonnen von DS_Starter, 08 Juli 2019, 18:45:46

Vorheriges Thema - Nächstes Thema

Xguide

:-)

Jo, beim Start sieht es jetzt besser aus.
replaceJunkSigns bleibt abzuwarten, ist jetzt erstmal nicht reproduzierbar wann der Fehler aufgetreten ist...Habe gesehen, dass du beim Aufruf was verändert hast.

Danke und viele Grüße,

Marcel
FHEM 5.9 - Intel NUC i3 mit Proxmox im Stretch Container
HomeMatic - VCCU mit 2 x HM-LAN-CFG
Module: SMA Peripheries - Sonos - IPCam(s) - Philips Hue - Sprinkler - TabletUI - DBlog -

Xguide

Bad news, der replaceJunkSigns Bug ist noch nicht gefixt.
Du hast ihn m.E. auch nur an einer Stelle abgefangen. Ich habe nun mal logging eingebaut um zu verstehen wann der überhaupt kommt.
Mal sehen ob das was bringt. Ferner habe ich ein


  if (!$rn)
  {
    Log3 "76_SMAPortal", 1, "76_SMAPortal replaceJunkSigns - Debug replaceJunkSigns - return empty string.";
    return("");
  }


direkt in replaceJunkSigns eigebaut....

FHEM 5.9 - Intel NUC i3 mit Proxmox im Stretch Container
HomeMatic - VCCU mit 2 x HM-LAN-CFG
Module: SMA Peripheries - Sonos - IPCam(s) - Philips Hue - Sprinkler - TabletUI - DBlog -

DS_Starter

So, wieder da.
Ach ich habe es nur an einer Aufrufstelle gefixt, da gibts doch noch mehr.  ???
Kommt gleich ...
ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

DS_Starter

ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

Xguide

Moin Heiko,

leider ist über Nacht der Fehler mit meinem erweiteren Logging nicht wieder aufgetreten. Ich werfe jetzt mal deine Version rein und lass das mal über das Wochenende laufen.

Was jetzt allerdings neu ist, allerdings hier OT, aber vielleicht hast du ja einen Tipp für mich. Zwischen 22:00 und 24:00 Uhr hatte ich ziemlich heufig solche Blöcke im Log.
Wobei ich das auf dem RaPi und auf dem NUC hatte. Der größte gemeinsame Nenner sind die SMA Devices....

2019.08.22 21:17:52 1: PERL WARNING: Use of uninitialized value $_ in substitution (s///) at /opt/fhem//FHEM/Blocking.pm line 238.
2019.08.22 21:17:52 1: PERL WARNING: Use of uninitialized value $_ in concatenation (.) or string at /opt/fhem//FHEM/Blocking.pm line 238.
2019.08.22 21:18:38 1: PERL WARNING: Use of uninitialized value $_ in substitution (s///) at /opt/fhem//FHEM/Blocking.pm line 238.
2019.08.22 21:18:38 1: PERL WARNING: Use of uninitialized value $_ in concatenation (.) or string at /opt/fhem//FHEM/Blocking.pm line 238.
2019.08.22 21:19:24 1: PERL WARNING: Use of uninitialized value $_ in substitution (s///) at /opt/fhem//FHEM/Blocking.pm line 238.
2019.08.22 21:19:24 1: PERL WARNING: Use of uninitialized value $_ in concatenation (.) or string at /opt/fhem//FHEM/Blocking.pm line 238.
2019.08.22 21:20:10 1: PERL WARNING: Use of uninitialized value $_ in substitution (s///) at /opt/fhem//FHEM/Blocking.pm line 238.
2019.08.22 21:20:10 1: PERL WARNING: Use of uninitialized value $_ in concatenation (.) or string at /opt/fhem//FHEM/Blocking.pm line 238.
2019.08.22 21:20:56 1: PERL WARNING: Use of uninitialized value $_ in substitution (s///) at /opt/fhem//FHEM/Blocking.pm line 238.
2019.08.22 21:20:56 1: PERL WARNING: Use of uninitialized value $_ in concatenation (.) or string at /opt/fhem//FHEM/Blocking.pm line 238.
2019.08.22 21:21:42 1: PERL WARNING: Use of uninitialized value $_ in substitution (s///) at /opt/fhem//FHEM/Blocking.pm line 238.
2019.08.22 21:21:42 1: PERL WARNING: Use of uninitialized value $_ in concatenation (.) or string at /opt/fhem//FHEM/Blocking.pm line 238.
2019.08.22 21:22:28 1: PERL WARNING: Use of uninitialized value $_ in substitution (s///) at /opt/fhem//FHEM/Blocking.pm line 238.
2019.08.22 21:22:28 1: PERL WARNING: Use of uninitialized value $_ in concatenation (.) or string at /opt/fhem//FHEM/Blocking.pm line 238.
FHEM 5.9 - Intel NUC i3 mit Proxmox im Stretch Container
HomeMatic - VCCU mit 2 x HM-LAN-CFG
Module: SMA Peripheries - Sonos - IPCam(s) - Philips Hue - Sprinkler - TabletUI - DBlog -

Xguide

Changerequest?

Hallo Heiko,

die Consumer-Implementierung funktioniert wirklich prima, bezüglich der usablility wäre es jedoch wünschwert, wenn der Klick in der Portalgrafik von einem geplanten Verbraucher (icon gelb) direkt zu ON (icon grün) springen würde und man nicht erst noch über STOP (icon rot) gehen müsste. Der Response ist manchmal etwas langsam (FTUI/fhemWEB), so dass man bei mehrfachem drücken irgendeinen Zustand herstellt.

Das ist bei uns eigentlich auch die Standardanforderung. Die BT-Steckdosen der Endgeräte sind so konfiguriert, dass sie im AN-Zustand eine Last erkennen und dann automatisch in den STANDBY-Zustand wechseln. Aus diesem werden sie dann vom SHM geholt oder eben manuell, wenn es mal schnell gehen muss. Nach getaner Arbeit verbleibt die Steckdose im AN-Zustand. AUS-Zustand kommt bei uns eigentlich nie vor.

Vielleicht lässt sich das ja machen.

Beste Grüße

Marcel
FHEM 5.9 - Intel NUC i3 mit Proxmox im Stretch Container
HomeMatic - VCCU mit 2 x HM-LAN-CFG
Module: SMA Peripheries - Sonos - IPCam(s) - Philips Hue - Sprinkler - TabletUI - DBlog -

DS_Starter

Hallo Marcel,

machen lässt sich das auf jeden Fall. Frage ist ob man das Schaltverhalten hart verdrahtet oder per Attribut anpassbar macht. Mir persönlich ist es egal ob ich noch über "rot" gehen muss oder nicht.
Vllt. gibt es noch ein paar Meinungen dazu. Wenn nicht, kann ich das rot mal entfernen. Ein Attribut wäre ja jederzeit einbaubar.

Grüße,
Heiko
ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

DS_Starter

@Marcel, diese Blocking Warnungen gibt es bei mir nicht. Ich schau mal ob ich was finde.
ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

DS_Starter

Hallo Marcel,

kann mir schlecht vorstellen, dass die Blocking-Warnungen aus diesem Modul kommen.
Aber um sicher zu sein schalte doch mal bitte stacktrace an. DAnn wird es sich sicherlich zeigen woher es kommt.
Dann schauen wir weiter.

Grüße,
Heiko
ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

DS_Starter

Hi Marcel,

habe die V 2.5.0 in mein contrib geladen. Mit der Version wird in der Portalgrafik der Wechsel der Verbraucher nur noch zwischen on und automatic realisiert.

Grüße,
Heiko
ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

Xguide

Hallo Heiko,

vielen Dank dafür. Irgendwie funktionieren die Buttons bei mir gerade total unzuverlässig, wohingegend der Set-Befehl sofort funktioniert. Ich glaube ich werde einfach ein paar Softbuttons auf das Tab-Ui setzen und gut ist. Die kleinen Punkte sind eh sehr schwer zu treffen....

Ich werde es mir aber morgen noch einmal ansehen, bin leider gerade sehr zu :-(

Update: Kaum habe ich es geschrieben und noch einmal im Anschluss probiert, geht es deutlich besser. Danke, so ist es nun gut implementiert, für das Tablet werden aber noch Buttons Einzug erhalten.

Danke und beste Grüße,

Marcel
FHEM 5.9 - Intel NUC i3 mit Proxmox im Stretch Container
HomeMatic - VCCU mit 2 x HM-LAN-CFG
Module: SMA Peripheries - Sonos - IPCam(s) - Philips Hue - Sprinkler - TabletUI - DBlog -

DS_Starter

 :) ... ich checke die Version ein und ist morgen im Update.

Grüße,
Heiko
ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

Xguide

Zitat von: DS_Starter am 23 August 2019, 18:05:52
Hallo Marcel,

kann mir schlecht vorstellen, dass die Blocking-Warnungen aus diesem Modul kommen.
Aber um sicher zu sein schalte doch mal bitte stacktrace an. DAnn wird es sich sicherlich zeigen woher es kommt.
Dann schauen wir weiter.

Hallo Heiko,

das Ganze wird von meiner SMA Infrastruktur hervorgerufen, kommt aber nicht vom Portal. OT, aber vielleicht kann ich es ja dennoch mit deinem Tipp sofort abstellen.
Es beginnt im Log mit dem Erreichen der opertime_stop und endet um 23:59:59. Deute ich den stacktrace nun richtig, das es am notify liegt?


2019.08.26 21:08:34 1: PERL WARNING: Use of uninitialized value $_ in substitution (s///) at /opt/fhem//FHEM/Blocking.pm line 238.
2019.08.26 21:08:34 1: eval: my $EVTPART0='Einspeisung_Wirkleistung:';my $SELF='Notify_SMA_EnergyMeter';my $EVTPART1='2.1';my $EVENT='Einspeisung_Wirkleistung: 2.1';my $NAME='SMA_EnergyMeter';my $TYPE='SMAEM';{ 
  Log 5, "Notify_SMA_EnergyMeter: Notify triggert with event: ".$EVENT;
  my $tsNow = sprintf("%02d:%02d:%02d",$hour, $min, $sec);
  my $tsInvDayStart = substr(ReadingsVal("SMA_TriPower10","opertime_start","06:00:00"),11,8);
  my $tsInvDayEnd = substr(ReadingsVal("SMA_TriPower10","opertime_stop","23:00:00"),11,8);
  Log 5, "Notify_SMA_EnergyMeter: timestamp now: ".$tsNow;
  Log 5, "Notify_SMA_EnergyMeter: opertime_start: ".$tsInvDayStart;
  Log 5, "Notify_SMA_EnergyMeter: opertime_stop: ".$tsInvDayEnd; 
  if (($tsNow gt $tsInvDayStart) &&  ($tsNow lt $tsInvDayEnd))
  {
    if (ReadingsVal("Dummy_PVprocessing","state", 0) eq "1")
    {
      Log 3, "Notify_SMA_EnergyMeter: Processing PV & Battery Inverter data!"; 
      fhem "set Dummy_PVprocessing 2";
    }
    fhem "get SMA_TriPower10 data;sleep 1.0;get SMA_SunnyIsland data";
  }
  else
  {
    if (ReadingsVal("Dummy_PVprocessing","state", 0) eq "2")
    {
      Log 3, "Notify_SMA_EnergyMeter: Processing Battery Inverter data only!";
      fhem "set Dummy_PVprocessing 1";
    } 
    fhem "get SMA_SunnyIsland data";
  }
}
2019.08.26 21:08:34 1: stacktrace:
2019.08.26 21:08:34 1:     main::__ANON__                      called by /opt/fhem//FHEM/Blocking.pm (238)
2019.08.26 21:08:34 1:     main::BlockingInformParent          called by /opt/fhem//FHEM/76_SMAInverter.pm (578)
2019.08.26 21:08:34 1:     main::SMAInverter_getstatusDoParse  called by /opt/fhem//FHEM/Blocking.pm (194)
2019.08.26 21:08:34 1:     main::BlockingStart                 called by /opt/fhem//FHEM/Blocking.pm (107)
2019.08.26 21:08:34 1:     main::BlockingCall                  called by /opt/fhem//FHEM/76_SMAInverter.pm (499)
2019.08.26 21:08:34 1:     main::SMAInverter_GetData           called by /opt/fhem//FHEM/76_SMAInverter.pm (391)
2019.08.26 21:08:34 1:     main::SMAInverter_Get               called by fhem.pl (3753)
2019.08.26 21:08:34 1:     main::CallFn                        called by fhem.pl (1958)
2019.08.26 21:08:34 1:     main::CommandGet                    called by fhem.pl (1236)
2019.08.26 21:08:34 1:     main::AnalyzeCommand                called by fhem.pl (1089)
2019.08.26 21:08:34 1:     main::AnalyzeCommandChain           called by fhem.pl (3793)
2019.08.26 21:08:34 1:     main::fhem                          called by (eval 30026) (25)
2019.08.26 21:08:34 1:     (eval)                              called by fhem.pl (1135)
2019.08.26 21:08:34 1:     main::AnalyzePerlCommand            called by fhem.pl (1160)
2019.08.26 21:08:34 1:     main::AnalyzeCommand                called by fhem.pl (1089)
2019.08.26 21:08:34 1:     main::AnalyzeCommandChain           called by /opt/fhem//FHEM/91_notify.pm (121)
2019.08.26 21:08:34 1:     main::notify_Exec                   called by fhem.pl (3753)
2019.08.26 21:08:34 1:     main::CallFn                        called by fhem.pl (3673)
2019.08.26 21:08:34 1:     main::DoTrigger                     called by fhem.pl (4736)
2019.08.26 21:08:34 1:     main::readingsEndUpdate             called by /opt/fhem//FHEM/77_SMAEM.pm (673)
2019.08.26 21:08:34 1:     main::SMAEM_ParseDone               called by (eval 30014) (1)
2019.08.26 21:08:34 1:     (eval)                              called by fhem.pl (1135)
2019.08.26 21:08:34 1:     main::AnalyzePerlCommand            called by fhem.pl (1160)
2019.08.26 21:08:34 1:     main::AnalyzeCommand                called by fhem.pl (1089)
2019.08.26 21:08:34 1:     main::AnalyzeCommandChain           called by /opt/fhem//FHEM/98_telnet.pm (255)
2019.08.26 21:08:34 1:     main::telnet_Read                   called by fhem.pl (3753)
2019.08.26 21:08:34 1:     main::CallFn                        called by fhem.pl (748)
2019.08.26 21:08:34 1: PERL WARNING: Use of uninitialized value $_ in concatenation (.) or string at /opt/fhem//FHEM/Blocking.pm line 238.
2019.08.26 21:08:34 1: eval: my $EVTPART0='Einspeisung_Wirkleistung:';my $SELF='Notify_SMA_EnergyMeter';my $EVTPART1='2.1';my $EVENT='Einspeisung_Wirkleistung: 2.1';my $NAME='SMA_EnergyMeter';my $TYPE='SMAEM';{ 
  Log 5, "Notify_SMA_EnergyMeter: Notify triggert with event: ".$EVENT;
  my $tsNow = sprintf("%02d:%02d:%02d",$hour, $min, $sec);
  my $tsInvDayStart = substr(ReadingsVal("SMA_TriPower10","opertime_start","06:00:00"),11,8);
  my $tsInvDayEnd = substr(ReadingsVal("SMA_TriPower10","opertime_stop","23:00:00"),11,8);
  Log 5, "Notify_SMA_EnergyMeter: timestamp now: ".$tsNow;
  Log 5, "Notify_SMA_EnergyMeter: opertime_start: ".$tsInvDayStart;
  Log 5, "Notify_SMA_EnergyMeter: opertime_stop: ".$tsInvDayEnd; 
  if (($tsNow gt $tsInvDayStart) && ($tsNow lt $tsInvDayEnd))
  {
    if (ReadingsVal("Dummy_PVprocessing","state", 0) eq "1")
    {
      Log 3, "Notify_SMA_EnergyMeter: Processing PV & Battery Inverter data!"; 
      fhem "set Dummy_PVprocessing 2";
    }
    fhem "get SMA_TriPower10 data;sleep 1.0;get SMA_SunnyIsland data";
  }
  else
  {
    if (ReadingsVal("Dummy_PVprocessing","state", 0) eq "2")
    {
      Log 3, "Notify_SMA_EnergyMeter: Processing Battery Inverter data only!";
      fhem "set Dummy_PVprocessing 1";
    } 
    fhem "get SMA_SunnyIsland data";
  }
}
2019.08.26 21:08:34 1: stacktrace:
2019.08.26 21:08:34 1:     main::__ANON__                      called by /opt/fhem//FHEM/Blocking.pm (238)
2019.08.26 21:08:34 1:     main::BlockingInformParent          called by /opt/fhem//FHEM/76_SMAInverter.pm (578)
2019.08.26 21:08:34 1:     main::SMAInverter_getstatusDoParse  called by /opt/fhem//FHEM/Blocking.pm (194)
2019.08.26 21:08:34 1:     main::BlockingStart                 called by /opt/fhem//FHEM/Blocking.pm (107)
2019.08.26 21:08:34 1:     main::BlockingCall                  called by /opt/fhem//FHEM/76_SMAInverter.pm (499)
2019.08.26 21:08:34 1:     main::SMAInverter_GetData           called by /opt/fhem//FHEM/76_SMAInverter.pm (391)
2019.08.26 21:08:34 1:     main::SMAInverter_Get               called by fhem.pl (3753)
2019.08.26 21:08:34 1:     main::CallFn                        called by fhem.pl (1958)
2019.08.26 21:08:34 1:     main::CommandGet                    called by fhem.pl (1236)
2019.08.26 21:08:34 1:     main::AnalyzeCommand                called by fhem.pl (1089)
2019.08.26 21:08:34 1:     main::AnalyzeCommandChain           called by fhem.pl (3793)
2019.08.26 21:08:34 1:     main::fhem                          called by (eval 30026) (25)
2019.08.26 21:08:34 1:     (eval)                              called by fhem.pl (1135)
2019.08.26 21:08:34 1:     main::AnalyzePerlCommand            called by fhem.pl (1160)
2019.08.26 21:08:34 1:     main::AnalyzeCommand                called by fhem.pl (1089)
2019.08.26 21:08:34 1:     main::AnalyzeCommandChain           called by /opt/fhem//FHEM/91_notify.pm (121)
2019.08.26 21:08:34 1:     main::notify_Exec                   called by fhem.pl (3753)
2019.08.26 21:08:34 1:     main::CallFn                        called by fhem.pl (3673)
2019.08.26 21:08:34 1:     main::DoTrigger                     called by fhem.pl (4736)
2019.08.26 21:08:34 1:     main::readingsEndUpdate             called by /opt/fhem//FHEM/77_SMAEM.pm (673)
2019.08.26 21:08:34 1:     main::SMAEM_ParseDone               called by (eval 30014) (1)
2019.08.26 21:08:34 1:     (eval)                              called by fhem.pl (1135)
2019.08.26 21:08:34 1:     main::AnalyzePerlCommand            called by fhem.pl (1160)
2019.08.26 21:08:34 1:     main::AnalyzeCommand                called by fhem.pl (1089)
2019.08.26 21:08:34 1:     main::AnalyzeCommandChain           called by /opt/fhem//FHEM/98_telnet.pm (255)
2019.08.26 21:08:34 1:     main::telnet_Read                   called by fhem.pl (3753)
2019.08.26 21:08:34 1:     main::CallFn                        called by fhem.pl (748)


Danke für die Unterstützung,

Marcel

UPDATE:

Habe das Notify schon mal angepasst, denke aber nicht das es den Fehler verursacht....


SMA_EnergyMeter:Einspeisung_Wirkleistung:.* { 
  Log 5, "Notify_SMA_EnergyMeter: Notify triggert with event: ".$EVENT;
  my $modulstate = ReadingsVal("SMA_TriPower10","modulstate","undef");
  if ($modulstate eq "normal")
  {
    fhem "get SMA_TriPower10 data;sleep 1.0;get SMA_SunnyIsland data";
  }
  elsif ($modulstate eq "sleep")
  {
    fhem "get SMA_SunnyIsland data";
  }
  else
  {
    Log 1, "Notify_SMA_EnergyMeter: Unexpected modulstate: ".$modulstate; 
  }
}
FHEM 5.9 - Intel NUC i3 mit Proxmox im Stretch Container
HomeMatic - VCCU mit 2 x HM-LAN-CFG
Module: SMA Peripheries - Sonos - IPCam(s) - Philips Hue - Sprinkler - TabletUI - DBlog -

DS_Starter

Hallo Marcel,

es hat mit ziemlicher Sicherheit etwas mit meiner kürzlichen Implementierung der ETODAY Berechnung im Invertermodul zu tun.
Allerdings kommt das Prob wohl erst durch dein Konstrukt zum Vorschein denn bei mir gibt es keine Fehler im Log.
Schaue ich mir heute Abend an.

Grüße,
Heiko
ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

Xguide

FHEM 5.9 - Intel NUC i3 mit Proxmox im Stretch Container
HomeMatic - VCCU mit 2 x HM-LAN-CFG
Module: SMA Peripheries - Sonos - IPCam(s) - Philips Hue - Sprinkler - TabletUI - DBlog -