Modul 93_DbRep - Reporting und Management von Datenbankinhalten (DbLog)

Begonnen von DS_Starter, 19 Mai 2016, 22:52:13

Vorheriges Thema - Nächstes Thema

Tomk

Zitat von: DS_Starter am 03 April 2023, 22:07:35Zunächst setzt du

event-on-update-reading state
Das reicht, die Readings von DbRep muss man üblicherweise nicht loggen oder daraus Events erzeugen, es sei denn man macht es bewusst für die weitere Verarbeitung.

Dann führst du diffValue mit der Option writeToDB aus.

Es entstehen neue Readings in der Datenbank des ausgewerteten Devices, wie in meinem Beispiel:

Device: SMA_Energymeter , neues Reading: diff_day_Einspeisung_Wirkleistung_Zaehler

Diese Readings holst du dir in dein SVG-Device und kannst sie anzeigen.



Ich hab's jetzt kapiert und hinbekommen... das ist ja noch genialer aus ich gedacht habe  :o

Vielen Dank, echt klasse das Modul!

Tomk

Eine Frage doch noch: wenn ich die diff Werte für den aktuellen Monat berechnen lasse wird für die Tage in der Zukunft der letzte wert von heute übernommen. Soll das so sein?

DS_Starter

Nein, das soll so nicht sein.
Danke für den Hinweis. Dann kann ich gleich morgen einen Fix erstellen.
Bei "nur Anzeige" funktioniert es wie beabsichtigt.

LG
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

ZitatDanke für den Hinweis. Dann kann ich gleich morgen einen Fix erstellen.
Bei "nur Anzeige" funktioniert es wie beabsichtigt.

Habe es gefixt und eingecheckt.
Dadurch endet jetzt die Anzeige von diffValue-Ergebnissen auch am Endetimestamp.

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

300P

Hallo Heiko,

nach dem letzten aktuellen Update bekomme ich nach Update/Restart leider folgende "neue" LOG-Einträge:

93_DbRep.pm:v8.52.3-s27393/2023-04-04


2023.04.05 14:25:23 1: Including ./log/fhem.save
2023.04.05 14:25:25 2: netatmo: missing app refresh token!
2023.04.05 14:25:25 0: Featurelevel: 6.2
2023.04.05 14:25:25 0: Server started with 259 defined entities (fhem.pl:27302/2023-03-05 perl:5.032001 os:linux user:fhem pid:1455389)
2023.04.05 14:26:02 2: DbLog myDbLog - WARNING - "countNbl" is outdated. Please consider use of DbRep "set <Name> countEntries" instead.
2023.04.05 14:26:18 2: AttrTemplates: got 259 entries
2023.04.05 14:26:18 1: PERL WARNING: Use of uninitialized value in subroutine entry at ./FHEM/99_Utils.pm line 21.
2023.04.05 14:27:19 1: DbRep Rep.SB25.Erzeugung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|10.4850000000006|2023-04-05_14:26:50';

2023.04.05 14:27:19 1: DbRep Rep.SMAEM.Einspeisung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|4.08279999999991|2023-04-05_14:26:49';

2023.04.05 14:27:20 1: DbRep Rep.SMAEM.Bezug.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|0.0515999999997803|2023-04-05_13:48:51';

2023.04.05 14:27:20 1: DbRep Rep.SBS25.Ladung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|1.73600000000005|2023-04-05_13:49:07';

2023.04.05 14:27:21 1: DbRep Rep.SBS25_2.Ladung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|4.27099999999973|2023-04-05_09:23:18';

2023.04.05 14:27:21 1: DbRep Rep.SBS25.Entladung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|8.54100000000017|2023-04-05_14:01:47';

2023.04.05 14:27:21 1: DbRep Rep.SBS25_2.Entladung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|5.36299999999983|2023-04-05_13:03:30';

2023.04.05 14:27:22 1: DbRep Rep.SB30.Erzeugung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|3.16100000000006|2023-04-05_14:26:50';

2023.04.05 14:27:22 1: DbRep Rep.SB40.Erzeugung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|6.98599999999999|2023-04-05_14:26:50';

2023.04.05 14:27:22 1: DbRep Rep.FCU.Erzeugung.heute - rh:
2023.04.05 14:29:19 1: DbRep Rep.SB25.Erzeugung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|10.5|2023-04-05_14:28:51';

2023.04.05 14:29:19 1: DbRep Rep.SMAEM.Einspeisung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|4.17529999999988|2023-04-05_14:28:51';

2023.04.05 14:29:19 1: DbRep Rep.SMAEM.Bezug.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|0.0515999999997803|2023-04-05_13:48:51';

2023.04.05 14:29:20 1: DbRep Rep.SBS25.Ladung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|1.73600000000005|2023-04-05_13:49:07';

2023.04.05 14:29:20 1: DbRep Rep.SBS25_2.Ladung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|4.27099999999973|2023-04-05_09:23:18';

2023.04.05 14:29:20 1: DbRep Rep.SBS25.Entladung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|8.54100000000017|2023-04-05_14:01:47';

2023.04.05 14:29:20 1: DbRep Rep.SBS25_2.Entladung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|5.36299999999983|2023-04-05_13:03:30';

2023.04.05 14:29:20 1: DbRep Rep.SB30.Erzeugung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|3.20500000000038|2023-04-05_14:28:52';

2023.04.05 14:29:21 1: DbRep Rep.SB40.Erzeugung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|7.04500000000007|2023-04-05_14:28:52';

2023.04.05 14:29:21 1: DbRep Rep.FCU.Erzeugung.heute - rh:
2023.04.05 14:29:42 1: DbRep Rep.SB25.Erzeugung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|10.5030000000006|2023-04-05_14:29:22';

2023.04.05 14:29:43 1: DbRep Rep.SMAEM.Einspeisung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|4.19859999999994|2023-04-05_14:29:21';

2023.04.05 14:29:43 1: DbRep Rep.SMAEM.Bezug.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|0.0515999999997803|2023-04-05_13:48:51';

2023.04.05 14:29:43 1: DbRep Rep.SBS25.Ladung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|1.73600000000005|2023-04-05_13:49:07';

2023.04.05 14:29:43 1: DbRep Rep.SBS25_2.Ladung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|4.27099999999973|2023-04-05_09:23:18';

2023.04.05 14:29:44 1: DbRep Rep.SBS25.Entladung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|8.54100000000017|2023-04-05_14:01:47';

2023.04.05 14:29:44 1: DbRep Rep.SBS25_2.Entladung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|5.36299999999983|2023-04-05_13:03:30';

2023.04.05 14:29:44 1: DbRep Rep.SB30.Erzeugung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|3.2170000000001|2023-04-05_14:29:22';

2023.04.05 14:29:44 1: DbRep Rep.SB40.Erzeugung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|7.06000000000006|2023-04-05_14:29:22';

2023.04.05 14:29:44 1: DbRep Rep.FCU.Erzeugung.heute - rh:
2023.04.05 14:30:26 1: DbRep Rep.SB25.Erzeugung.Jahr - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|318.116999999998|2023-04-05_14:29:52';

2023.04.05 14:30:27 1: DbRep Rep.SB25.Erzeugung.Gesamt - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|10470.471|2023-04-05_14:29:52';

2023.04.05 14:30:48 1: DbRep Rep.SMAEM.Einspeisung.Jahr - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|182.1125|2023-04-05_14:29:52';

2023.04.05 14:30:55 1: DbRep Rep.SMAEM.Einspeisung.Gesamt - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|6881.72790001501|2023-04-05_14:30:22';

2023.04.05 14:31:11 1: DbRep Rep.SMAEM.Bezug.Jahr - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|102.8576|2023-04-05_13:48:51';

2023.04.05 14:31:17 1: DbRep Rep.SBS25.Ladung.Jahr - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|306.058999999999|2023-04-05_13:49:07';

2023.04.05 14:31:18 1: DbRep Rep.SMAEM.Bezug.Gesamt - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|10568.2338999784|2023-04-05_13:48:51';

2023.04.05 14:31:19 1: DbRep Rep.SB25.Erzeugung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|10.5159999999996|2023-04-05_14:30:53';

2023.04.05 14:31:19 1: DbRep Rep.SMAEM.Einspeisung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|4.26829999999995|2023-04-05_14:30:52';

2023.04.05 14:31:20 1: DbRep Rep.SMAEM.Bezug.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|0.0515999999997803|2023-04-05_13:48:51';

2023.04.05 14:31:20 1: DbRep Rep.SBS25.Ladung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|1.73600000000005|2023-04-05_13:49:07';

2023.04.05 14:31:20 1: DbRep Rep.SBS25_2.Ladung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|4.27099999999973|2023-04-05_09:23:18';

2023.04.05 14:31:20 1: DbRep Rep.SBS25.Entladung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|8.54100000000017|2023-04-05_14:01:47';

2023.04.05 14:31:21 1: DbRep Rep.SBS25_2.Entladung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|5.36299999999983|2023-04-05_13:03:30';

2023.04.05 14:31:21 1: DbRep Rep.SB30.Erzeugung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|3.25|2023-04-05_14:30:53';

2023.04.05 14:31:21 1: DbRep Rep.SB40.Erzeugung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|7.10500000000002|2023-04-05_14:30:53';

2023.04.05 14:31:21 1: DbRep Rep.FCU.Erzeugung.heute - rh:
2023.04.05 14:31:24 1: DbRep Rep.SBS25_2.Ladung.Jahr - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|318.758|2023-04-05_09:23:18';

2023.04.05 14:31:26 1: DbRep Rep.SBS25.Ladung.Gesamt - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|4274.5320000085|2023-04-05_13:49:07';

2023.04.05 14:31:32 1: DbRep Rep.SBS25_2.Ladung.Gesamt - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|2222.594|2023-04-05_09:23:18';

2023.04.05 14:31:34 1: DbRep Rep.SBS25.Entladung.Jahr - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|443.462|2023-04-05_14:01:47';

2023.04.05 14:31:43 1: DbRep Rep.SBS25.Entladung.Gesamt - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|6017.462|2023-04-05_14:01:47';

2023.04.05 14:31:45 1: DbRep Rep.SBS25_2.Entladung.Jahr - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|467.712|2023-04-05_13:03:30';

2023.04.05 14:31:52 1: DbRep Rep.SB30.Erzeugung.Jahr - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|238.442|2023-04-05_14:31:24';

2023.04.05 14:31:55 1: DbRep Rep.SBS25_2.Entladung.Gesamt - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|3199.752|2023-04-05_13:03:30';

2023.04.05 14:31:59 1: DbRep Rep.SB40.Erzeugung.Jahr - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|450.263|2023-04-05_14:31:24';

2023.04.05 14:32:00 1: DbRep Rep.FCU.Erzeugung.Jahr - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|1090|2023-04-01_10:00:34';

2023.04.05 14:32:00 1: PERL WARNING: Use of uninitialized value in subroutine entry at ./FHEM/93_DbRep.pm line 4784.
2023.04.05 14:32:02 1: DbRep Rep.SB30.Erzeugung.Gesamt - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|2730.938|2023-04-05_14:31:24';

2023.04.05 14:32:09 1: DbRep Rep.SB40.Erzeugung.Gesamt - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|550.892|2023-04-05_14:31:54';

2023.04.05 14:32:10 1: DbRep Rep.FCU.Erzeugung.Gesamt - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|23663|2023-04-01_10:00:34';

2023.04.05 14:33:19 1: DbRep Rep.SB25.Erzeugung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|10.5320000000011|2023-04-05_14:32:54';

2023.04.05 14:33:19 1: DbRep Rep.SMAEM.Einspeisung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|4.36099999999988|2023-04-05_14:32:54';

2023.04.05 14:33:20 1: DbRep Rep.SMAEM.Bezug.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|0.0515999999997803|2023-04-05_13:48:51';

2023.04.05 14:33:20 1: DbRep Rep.SBS25.Ladung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|1.73600000000005|2023-04-05_13:49:07';

2023.04.05 14:33:20 1: DbRep Rep.SBS25_2.Ladung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|4.27099999999973|2023-04-05_09:23:18';

2023.04.05 14:33:20 1: DbRep Rep.SBS25.Entladung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|8.54100000000017|2023-04-05_14:01:47';

2023.04.05 14:33:20 1: DbRep Rep.SBS25_2.Entladung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|5.36299999999983|2023-04-05_13:03:30';

2023.04.05 14:33:21 1: DbRep Rep.SB30.Erzeugung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|3.29200000000037|2023-04-05_14:32:55';

2023.04.05 14:33:21 1: DbRep Rep.SB40.Erzeugung.heute - rh: $VAR1 = 'no_aggregation';
$VAR2 = 'no_aggregation|7.16800000000001|2023-04-05_14:32:55';

2023.04.05 14:33:21 1: DbRep Rep.FCU.Erzeugung.heute - rh:




etc. usw



Gruß
300P
FHEM 6.3 - Raspberry Pi 3 / Pi 4 - VControl300 mit VITOVALOR 300P - SMAEM - SMAInverter - DbLog/DbRep - MariaDB/QNAP - div. HTTPMOD - div. Modbus ser+TCP - SolarForecast - Tibber + Ladung mit SMA-SBS25

DS_Starter

Hi,

ja, sorry.
Da habe ich gestern eine "Entwicklungsversion" eingecheckt. (Man, man ...  :o )
DbRep habe ich schon geradegezogen und eingecheckt. Du kannst aber vorab diese V aus meinem contrib ziehen damit der Log-Terror aufhört.

LG
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

300P

FHEM 6.3 - Raspberry Pi 3 / Pi 4 - VControl300 mit VITOVALOR 300P - SMAEM - SMAInverter - DbLog/DbRep - MariaDB/QNAP - div. HTTPMOD - div. Modbus ser+TCP - SolarForecast - Tibber + Ladung mit SMA-SBS25

Tomk

Moin und frohe Ostern zusammen.

Ich versuche die Funktion diffValue täglich mittels "at" in die db schrieben zu lassen.

Der befehl wird ausgeführt aber nur das Reading aktualisiert, nicht der db Eintrag. Das "writeToDB" funktioniert so scheinbar nicht. Was mache ich falsch?

defmod CalcDailyPvProd at *04:00:00 set Rep.Pv.lm.daily diffValue wirteToDB

HeikoGr

defmod CalcDailyPvProd at *04:00:00 set Rep.Pv.lm.daily diffValue wirteToDB

Du hast einen Buchstabendreher

Tomk


300P

#1975
Hallo Heiko,

irgendwie hab ich seit dem letzten Update einen Wurm in meinen diversen REP.<gerät>.<art>.<zeitraum> -Abfragen, die schon mehrere Jahre anstandslos funktionierten.
(Betrifft hier die diffValue Funktion - egal ob mit oder ohne Nutzung <writeToDB>)

Mein Problem:
Wenn es keinen Anfangs- und keinen Endwert gibt, bekam ich bislang "0" als Ergebnis statt einer x-beliebigen Zahl und alles war okay..... :)

Kein Werte kann aber leider schon vorkommen, da manche Daten zu dem Zeitpunkt gar nicht da sein können oder evtl. keine Wertveränderung in dem Zeitraum anfiel....oder ...weil neues Gerät oder Gerät nicht mehr vorhanden (weitere PV-Anlage erst ab ab oder nur bis JJJJ/MM/TT)  o. ä.  :o

Nun bekommen ich "" (wahrscheinlich leer / garnix) neuerdings als Antwort und das weitere Reporting der Statistiken wird in Folge daher irgendwie ab diesem Punkt abgebrochen weil kein Wert geschrieben wird.

Ich hab aber noch nicht gefunden warum und wieso das seit dem Update  so ist. :o
Die alten vorhergehenden Werte in meinen Statistiken bleiben einfach weiter bestehen.
Könnte es evtl. jetzt eine "andere" Reaktion beim UserExit hervorrufen oder was damit zu tuen haben ??

Internals:
   DATABASE   fhem
   DEF        myDbLog
   FUUID      621a8eb7-f33f-1da7-ce39-7d94f330866ad63d
   FVERSION   93_DbRep.pm:v8.52.3-s27396/2023-04-05
   LASTCMD    diffValue writeToDB
   MODEL      Client
   NAME       Rep.FCU.Erzeugung.heute
   NOTIFYDEV  global,Rep.FCU.Erzeugung.heute
   NR         316
   NTFY_ORDER 50-Rep.FCU.Erzeugung.heute
   ROLE       Client
   STATE      done
   TYPE       DbRep
   UTF8       1
   eventCount 358
   HELPER:
     DBLOGDEVICE myDbLog
     GRANTS     ALL PRIVILEGES
     IDRETRIES  2
     MINTS      1996-03-08 17:23:29
     PACKAGE    main
     VERSION    8.52.3
     CV:
       aggregation no
       aggsec     1
       destr      2023-04-10
       dsstr      2023-04-10
       epoch_seconds_end 1681163999
       mestr      04
       msstr      04
       testr      23:59:59
       tsstr      00:00:00
       wdadd      604800
       yestr      2023
       ysstr      2023
     DBREPCOL:
       COLSET     1
       DEVICE     64
       EVENT      512
       READING    64
       TYPE       64
       UNIT       32
       VALUE      128
   Helper:
     DBLOG:
       state:
         myDbLog:
           TIME       1681137712.95432
           VALUE      done
   OLDREADINGS:
   READINGS:
     2023-04-10 16:41:52   background_processing_time 0.0150
     2023-04-10 16:41:52   db_lines_processed 0
     2023-04-10 16:41:52   sql_processing_time 0.0025
     2023-04-10 16:41:52   state           done
Attributes:
   aggregation no
   devStateIcon connected:10px-kreis-gelb .*disconnect:10px-kreis-rot .*done:10px-kreis-gruen
   device     FCU
   diffAccept 20
   disable    0
   event-on-update-reading state
   group      Energy Meter Auswertung
   reading    FCU_Erzeugung_akt_Zaehlerstand
   room       Energie
   showproctime 1
   timeout    180
   timestamp_begin current_day_begin
   timestamp_end current_day_end
   userExitFn setDumEnergy .*:.*
   verbose    2


Hier die letzten Einträge des Gerätes in der Datenbank
(DB-Einträge erfolgen nur wenn eine Veränderung des Wertes erfolgt)


2023-04-07 19:42:17    FCU    VCONTROL300    FCU_Erzeugung_akt_Zaehlerstand: 23679    FCU_Erzeugung_akt_Zaehlerstand    23679    NULL
2023-04-07 18:22:12    FCU    VCONTROL300    FCU_Erzeugung_akt_Zaehlerstand: 23678    FCU_Erzeugung_akt_Zaehlerstand    23678    NULL
2023-04-07 17:02:14    FCU    VCONTROL300    FCU_Erzeugung_akt_Zaehlerstand: 23677    FCU_Erzeugung_akt_Zaehlerstand    23677    NULL
2023-04-07 15:47:13    FCU    VCONTROL300    FCU_Erzeugung_akt_Zaehlerstand: 23676    FCU_Erzeugung_akt_Zaehlerstand    23676    NULL
2023-04-07 14:27:15    FCU    VCONTROL300    FCU_Erzeugung_akt_Zaehlerstand: 23675    FCU_Erzeugung_akt_Zaehlerstand    23675    NULL
2023-04-07 13:12:13    FCU    VCONTROL300    FCU_Erzeugung_akt_Zaehlerstand: 23674    FCU_Erzeugung_akt_Zaehlerstand    23674    NULL
2023-04-07 11:52:14    FCU    VCONTROL300    FCU_Erzeugung_akt_Zaehlerstand: 23673    FCU_Erzeugung_akt_Zaehlerstand    23673    NULL
2023-04-07 10:37:10    FCU    VCONTROL300    FCU_Erzeugung_akt_Zaehlerstand: 23672    FCU_Erzeugung_akt_Zaehlerstand    23672    NULL
2023-04-07 07:14:41    FCU    VCONTROL300    FCU_Erzeugung_akt_Zaehlerstand: 23671    FCU_Erzeugung_akt_Zaehlerstand    23671    NULL
2023-04-07 05:54:38    FCU    VCONTROL300    FCU_Erzeugung_akt_Zaehlerstand: 23670    FCU_Erzeugung_akt_Zaehlerstand    23670    NULL
2023-04-07 04:34:39    FCU    VCONTROL300    FCU_Erzeugung_akt_Zaehlerstand: 23669    FCU_Erzeugung_akt_Zaehlerstand    23669    NULL
2023-04-07 03:19:38    FCU    VCONTROL300    FCU_Erzeugung_akt_Zaehlerstand: 23668    FCU_Erzeugung_akt_Zaehlerstand    23668    NULL
2023-04-07 01:59:41    FCU    VCONTROL300    FCU_Erzeugung_akt_Zaehlerstand: 23667    FCU_Erzeugung_akt_Zaehlerstand    23667    NULL
2023-04-07 00:44:40    FCU    VCONTROL300    FCU_Erzeugung_akt_Zaehlerstand: 23666    FCU_Erzeugung_akt_Zaehlerstand    23666    NULL
2023-04-06 23:24:39    FCU    VCONTROL300    FCU_Erzeugung_akt_Zaehlerstand: 23665    FCU_Erzeugung_akt_Zaehlerstand    23665    NULL
2023-04-01 10:00:34    FCU    VCONTROL300    FCU_Erzeugung_akt_Zaehlerstand: 23664    FCU_Erzeugung_akt_Zaehlerstand    23664    NULL
2023-04-01 08:44:44    FCU    VCONTROL300    FCU_Erzeugung_akt_Zaehlerstand: 23663    FCU_Erzeugung_akt_Zaehlerstand    23663    NULL
2023-04-01 07:24:44    FCU    VCONTROL300    FCU_Erzeugung_akt_Zaehlerstand: 23662    FCU_Erzeugung_akt_Zaehlerstand    23662    NULL
2023-04-01 06:09:43    FCU    VCONTROL300    FCU_Erzeugung_akt_Zaehlerstand: 23661    FCU_Erzeugung_akt_Zaehlerstand    23661    NULL
2023-04-01 04:54:46    FCU    VCONTROL300    FCU_Erzeugung_akt_Zaehlerstand: 23660    FCU_Erzeugung_akt_Zaehlerstand    23660    NULL
2023-04-01 03:34:43    FCU    VCONTROL300    FCU_Erzeugung_akt_Zaehlerstand: 23659    FCU_Erzeugung_akt_Zaehlerstand    23659    NULL
2023-04-01 02:14:46    FCU    VCONTROL300    FCU_Erzeugung_akt_Zaehlerstand: 23658    FCU_Erzeugung_akt_Zaehlerstand    23658    NULL
2023-04-01 00:59:42    FCU    VCONTROL300    FCU_Erzeugung_akt_Zaehlerstand: 23657    FCU_Erzeugung_akt_Zaehlerstand    23657    NULL



Gruß
300P


EDIT: DB-Einträge und Text ergänzt
FHEM 6.3 - Raspberry Pi 3 / Pi 4 - VControl300 mit VITOVALOR 300P - SMAEM - SMAInverter - DbLog/DbRep - MariaDB/QNAP - div. HTTPMOD - div. Modbus ser+TCP - SolarForecast - Tibber + Ladung mit SMA-SBS25

DS_Starter

Ja das stimmt. Man bekommt nichts zurück wenn in dem betreffenden Auswertungszeitraum keine (auswertbaren) Werte vorhanden sind.
Darauf kann man wahrscheinlich in der Funktion setDumEnergy reagieren.
Wie sieht die bei dir aus ?
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

300P

A:

Hab nochmals eine alte Version aus Februar installiert.
Dann ist alles i.o. bei gleichen REP.xxxxx - Aufrufen.
Als zusätzliches Reading gibt es da das alte bekannte:


2023-04-10__FCU__FCU_Erzeugung_akt_Zaehlerstand__DIFF__no_aggregation     -     2023-04-10 18:45:30



B:
Zitat von: DS_Starter am 10 April 2023, 18:16:08Ja das stimmt. Man bekommt nichts zurück wenn in dem betreffenden Auswertungszeitraum keine (auswertbaren) Werte vorhanden sind.
Darauf kann man wahrscheinlich in der Funktion setDumEnergy reagieren.
Wie sieht die bei dir aus ?


und so in der 99_myUtils.pm:



 if ($name =~ m/Rep.*heute/) {
    # Werte aktueller Tag
    if ($reading =~ m/SB25__etotal__DIFF/) {
      # Erzeugung aktueller Tag
      CommandSetReading(undef, "Dum.Energy PVDay ".(looks_like_number($value)?sprintf('%.1f',$value):0.0));
      # starten Report Einspeisung aktueller Tag
      CommandSet(undef,"Rep.SMAEM.Einspeisung.heute diffValue writeToDB");
      Log3 $name, 1, "$name - 1 Dum.Energy heute = $value";
   }
   if ($reading =~ m/SMA_Energymeter__Einspeisung_Wirkleistung_Zaehler__DIFF/) {
      # Einspeisung aktueller Tag
      CommandSetReading(undef, "Dum.Energy GridFeedInDay ".(looks_like_number($value)?sprintf('%.1f',$value):0.0));
      # starten Report Bezug aktueller Tag
      CommandSet(undef,"Rep.SMAEM.Bezug.heute diffValue writeToDB");
      Log3 $name, 1, "$name - 2 Dum.Energy heute = $value";
   }
   if ($reading =~ m/SMA_Energymeter__Bezug_Wirkleistung_Zaehler__DIFF/) {
      # Bezug aktueller Tag
      CommandSetReading(undef, "Dum.Energy GridConsumptionDay ".(looks_like_number($value)?sprintf('%.1f',$value):0.0));
      # starten Report Ladung aktueller Tag
      CommandSet(undef,"Rep.SBS25.Ladung.heute diffValue writeToDB");
      Log3 $name, 1, "$name - 3 Dum.Energy heute = $value";
   }
   if ($reading =~ m/SBS25__etotal__DIFF/) {
      # Ladung aktueller Tag
      CommandSetReading(undef, "Dum.Energy BattLoadInDay ".(looks_like_number($value)?sprintf('%.1f',$value):0.0));
      # starten Report SBS25_2Entladung aus Batterie Tag
      CommandSet(undef,"Rep.SBS25_2.Ladung.heute diffValue writeToDB");
      Log3 $name, 1, "$name - 4 Dum.Energy heute = $value";
   }
   if ($reading =~ m/SBS25_2__etotal__DIFF/) {
      # Ladung aktueller Tag
      CommandSetReading(undef, "Dum.Energy BattLoadInDay_2 ".(looks_like_number($value)?sprintf('%.1f',$value):0.0));
      # starten Report SBS25Entladung aus Batterie Tag
      CommandSet(undef,"Rep.SBS25.Entladung.heute diffValue writeToDB");
      Log3 $name, 1, "$name - 5 Dum.Energy heute = $value";
   }
   if ($reading =~ m/SBS25__bat_loadtotal__DIFF/) {
      # Entladung aktuelles Tag
      CommandSetReading(undef, "Dum.Energy BattLoadOutDay ".(looks_like_number($value)?sprintf('%.1f',$value):0.0));
      # starten Report SBS25_2Entladung aus Batterie Tag
      CommandSet(undef,"Rep.SBS25_2.Entladung.heute diffValue writeToDB");
      Log3 $name, 1, "$name - 6 Dum.Energy heute = $value";
   }
   if ($reading =~ m/SBS25_2__bat_loadtotal__DIFF/) {
      # Entladung aktuelles Tag
      CommandSetReading(undef, "Dum.Energy BattLoadOutDay_2 ".(looks_like_number($value)?sprintf('%.1f',$value):0.0));
      # starten Report FCUErzeugung heute
      CommandSet(undef,"Rep.SB30.Erzeugung.heute diffValue writeToDB");
      Log3 $name, 1, "$name - 7 Dum.Energy heute = $value";
   }
   if ($reading =~ m/SB30__etotal__DIFF/) {
      # Erzeugung aktueller Tag
      CommandSetReading(undef, "Dum.Energy PVDay_2 ".(looks_like_number($value)?sprintf('%.1f',$value):0.0));
      # starten Report Einspeisung aktueller Tag
      CommandSet(undef,"Rep.SB40.Erzeugung.heute diffValue writeToDB");
      Log3 $name, 1, "$name - 8 Dum.Energy heute = $value";
   }
   if ($reading =~ m/SB40__etotal__DIFF/) {
      # Erzeugung aktueller Tag
      CommandSetReading(undef, "Dum.Energy PVDay_40 ".(looks_like_number($value)?sprintf('%.1f',$value):0.0));
      # starten Report Einspeisung aktueller Tag
      CommandSet(undef,"Rep.FCU.Erzeugung.heute diffValue writeToDB");
      Log3 $name, 1, "$name - 9 Dum.Energy heute = $value";

   }

   if ($reading =~ m/FCU_Erzeugung_akt_Zaehlerstand__DIFF/) {
     # Erzeugung FCU aktueller Tag
      Log3 $name, 1, "$name - 10 Dum.Energy FCUDay = $value";
      CommandSetReading(undef, "Dum.Energy FCUDay ".(looks_like_number($value)?sprintf('%.1f',$value):0.0));

# Eigenverbrauchsquote aktueller Tag / Vortag
     my $pvday     = ReadingsVal("Dum.Energy", "PVDay", 0);
     my $pvday_2   = ReadingsVal("Dum.Energy", "PVDay_2", 0);
     my $pvday_40  = ReadingsVal("Dum.Energy", "PVDay_40", 0);
     my $fcuday    = ReadingsVal("Dum.Energy", "FCUDay", 0);
     my $feedinday = ReadingsVal("Dum.Energy", "GridFeedInDay", 0);
     my $sqday     = ($fcuday + $pvday + $pvday_2 + $pvday_40 - $feedinday) / ($fcuday + $pvday + $pvday_2 + $pvday_40) * 100 if(($fcuday + $pvday + $pvday_2 + $pvday_40) > 0);
     CommandSetReading(undef, "Dum.Energy SelfConsumptionQuoteDay ".sprintf('%.0f',$sqday)) if($sqday);

     # Autarkiequote aktueller Tag / Vortag
     my $consumday = ReadingsVal("Dum.Energy", "GridConsumptionDay", 0);
     my $aqday     = ($fcuday + $pvday + $pvday_2 + $pvday_40 - $feedinday) / ($fcuday + $pvday + $pvday_2 + $pvday_40 - $feedinday + $consumday) * 100 if(($fcuday + $pvday + $pvday_2 + $pvday_40 ) > 0);
     CommandSetReading(undef, "Dum.Energy AutarkyQuoteDay ".sprintf('%.0f',$aqday)) if ($aqday);

# Verbrauch aktueller Tag / Vortag
my $tcday = $fcuday + $pvday + $pvday_2 + $pvday_40 - $feedinday + $consumday;
CommandSetReading(undef, "Dum.Energy TotalConsumptionDay ".sprintf('%.1f',$tcday)) if ($tcday);
     
   }
 }

FHEM 6.3 - Raspberry Pi 3 / Pi 4 - VControl300 mit VITOVALOR 300P - SMAEM - SMAInverter - DbLog/DbRep - MariaDB/QNAP - div. HTTPMOD - div. Modbus ser+TCP - SolarForecast - Tibber + Ladung mit SMA-SBS25

DS_Starter

@300P,

ich habe dir eine Version zum Test in mein contrib geladen.
Die V sollte sowohl die Vorteile des letzten Change von diffValue bewahren als auch dein Problem beheben.
Teste sie mal bitte. Auch mit writeToDB.

LG
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

300P

Habs "mal eben eingespielt" und getestet......

DANKE! 8)

Das Reading mit dem "-" wird wieder wie vorher bei den Aufrufen zurückgegeben bzw. erzeugt.

2023-04-10__FCU__FCU_Erzeugung_akt_Zaehlerstand__DIFF__2023-04-10             -  2023-04-10 21:22:38
FHEM 6.3 - Raspberry Pi 3 / Pi 4 - VControl300 mit VITOVALOR 300P - SMAEM - SMAInverter - DbLog/DbRep - MariaDB/QNAP - div. HTTPMOD - div. Modbus ser+TCP - SolarForecast - Tibber + Ladung mit SMA-SBS25