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

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

Vorheriges Thema - Nächstes Thema

uwirt

Ich habe das wohl mit dem regelmässigen löschen der Tabelle offenbar nicht richtig verstanden. Ich habe mir jetzt ein "Lösch-DbRep" gemacht dass ich dann per "at" regelmässig auslösen möchte.

Nur leider wen ich das per "set" Befehl händisch auslösen möchte z.B. mit:


set Libelium_Db.Del delEntries 1:2


kriege ich einen Fehler:


Error - Wrong time limits. The <nn> (days newer than) option must be greater than the <no> (older than) one !



defmod Libelium_Db.Del DbRep Libelium_DbLog
attr Libelium_Db.Del allowDeletion 1
attr Libelium_Db.Del comment löschen aller Einträge in Libelium_Db älter als 30 Minuten
attr Libelium_Db.Del devStateIcon connected:10px-kreis-gelb .*disconnect:10px-kreis-rot .*done:10px-kreis-gruen
attr Libelium_Db.Del event-on-update-reading state
attr Libelium_Db.Del room Datenbank->Produktiv
attr Libelium_Db.Del timeOlderThan 1800

setstate Libelium_Db.Del Error - Wrong time limits. The <nn> (days newer than) option must be greater than the <no> (older than) one !
setstate Libelium_Db.Del 2020-05-07 11:36:32 state Error - Wrong time limits. The <nn> (days newer than) option must be greater than the <no> (older than) one !


Weiss da jemand weiter?
FHEM / Ubuntu / fitlet2
HomeMatic: CCU3|HmIP-STHD|HmIP-PCBS|HmIP-PCBS2|HmIP-PCBS-BAT|HM-WDC7000|HM-WDS100-C6-O|HM-WDS40|HM-LC-Sw1-FM|HM-LC-RGBW-WM|HM-ES-PMSw1-Pl|HM-ES-TX-WM
NAS: DS218+|DS209j|DS216+II|DS412+
Devices: Panasonic Webcams|Withings|Gardena Smart|Tuya

flummy1978

Habs grad fix bei mir getestet, weil ich hier auch grad rumspiele:

Zitat von: uwirt am 07 Mai 2020, 11:47:40

set Libelium_Db.Del delEntries 1:2


Wenn Du das exakt so eingibst, wäre wohl die Log Ausgabe interessant (verbose 4).

Wenn ich set DbRep_syncStandby_LiveDB 250:251 eingebe, versucht er auch laut log, zu löschen wo nichts zu löschen ist... funktioniert also wie gewollt ;)

Grüße
Andreas

uwirt

Das LogFile mit verbose 4 sieht folgendermassen aus:


2020.05.07 11:59:43 4: DbRep Libelium_Db.Del - -------- New selection ---------
2020.05.07 11:59:43 4: DbRep Libelium_Db.Del - Command: delEntries
2020.05.07 11:59:43 4: DbRep Libelium_Db.Del - timeDiffToNow - year: , day: 2, hour: , min: , sec:
2020.05.07 11:59:43 4: DbRep Libelium_Db.Del - Year 2020 is leap year
2020.05.07 11:59:43 4: DbRep Libelium_Db.Del - startMonth: 4 endMonth: 4 lastleapyear:  baseYear: 2020 diffdaylight:1 isdaylight:1
2020.05.07 11:59:43 4: DbRep Libelium_Db.Del - timeOlderThan - year: 0, day: 1, hour: 0, min: 0, sec: 0
2020.05.07 11:59:43 4: DbRep Libelium_Db.Del - Year 2020 is leap year
2020.05.07 11:59:43 4: DbRep Libelium_Db.Del - startMonth: 0 endMonth: 4 lastleapyear: 1 baseYear: 2020 diffdaylight:1 isdaylight:1
2020.05.07 11:59:43 4: DbRep Libelium_Db.Del - FullDay option: 0
2020.05.07 11:59:43 4: DbRep Libelium_Db.Del - Time difference to current time for calculating Timestamp begin: 172801 sec
2020.05.07 11:59:43 4: DbRep Libelium_Db.Del - Timestamp begin human readable: 2020-05-05 11:59:42
2020.05.07 11:59:43 4: DbRep Libelium_Db.Del - Time difference to current time for calculating Timestamp end: 172801 sec
2020.05.07 11:59:43 4: DbRep Libelium_Db.Del - Timestamp end human readable: 2020-05-05 11:59:42
FHEM / Ubuntu / fitlet2
HomeMatic: CCU3|HmIP-STHD|HmIP-PCBS|HmIP-PCBS2|HmIP-PCBS-BAT|HM-WDC7000|HM-WDS100-C6-O|HM-WDS40|HM-LC-Sw1-FM|HM-LC-RGBW-WM|HM-ES-PMSw1-Pl|HM-ES-TX-WM
NAS: DS218+|DS209j|DS216+II|DS412+
Devices: Panasonic Webcams|Withings|Gardena Smart|Tuya

flummy1978

Aber hier musst Du dann wohl auf Heiko(DS_Starter) warten  ::)
Entweder hast Du nen Bug gefunden oder ......
Zitat
2020.05.07 11:52:41.182 4 : DbRep DbRep_syncStandby_LiveDB - -------- New selection ---------
2020.05.07 11:52:41.182 4 : DbRep DbRep_syncStandby_LiveDB - Command: delEntries
2020.05.07 11:52:41.184 4 : DbRep DbRep_syncStandby_LiveDB - timeDiffToNow - year: , day: 251, hour: , min: , sec:
2020.05.07 11:52:41.185 4 : DbRep DbRep_syncStandby_LiveDB - Year 2020 is leap year
2020.05.07 11:52:41.185 4 : DbRep DbRep_syncStandby_LiveDB - startMonth: 7 endMonth: 4 lastleapyear: 2020 baseYear: 2019 diffdaylight:1 isdaylight:1
2020.05.07 11:52:41.186 4 : DbRep DbRep_syncStandby_LiveDB - timeOlderThan - year: 0, day: 250, hour: 0, min: 0, sec: 0
2020.05.07 11:52:41.187 4 : DbRep DbRep_syncStandby_LiveDB - Year 2020 is leap year
2020.05.07 11:52:41.187 4 : DbRep DbRep_syncStandby_LiveDB - startMonth: 8 endMonth: 7 lastleapyear: 2020 baseYear: 2019 diffdaylight:1 isdaylight:1
2020.05.07 11:52:41.188 4 : DbRep DbRep_syncStandby_LiveDB - FullDay option: 0
2020.05.07 11:52:41.188 4 : DbRep DbRep_syncStandby_LiveDB - Time difference to current time for calculating Timestamp begin: 21772801 sec
2020.05.07 11:52:41.189 4 : DbRep DbRep_syncStandby_LiveDB - Timestamp begin human readable: 2019-08-29 11:52:40
2020.05.07 11:52:41.189 4 : DbRep DbRep_syncStandby_LiveDB - Time difference to current time for calculating Timestamp end: 21686401 sec
2020.05.07 11:52:41.190 4 : DbRep DbRep_syncStandby_LiveDB - Timestamp end human readable: 2019-08-30 11:52:40
2020.05.07 11:52:41.422 3 : DbRep DbRep_syncStandby_LiveDB - Entries of user_fhem.history deleted: /--/--0

So sieht die Ausgabe bei mir mit 250:251 aus ... also exakt richtig und mit Deiner gleich, bis hin zu  2020.05.07 11:59:43 4: DbRep Libelium_Db.Del - Timestamp begin human readable: 2020-05-05 11:59:42 hier müsste 2020-05-04 11:59:42 stehen ...

Kannst Du es ggf. mit anderen zahlen testen ? 2:3[22:23] (dabei reading so wirr schreiben, dass er Dir nix löscht - wenn es eine live DB ist)

Wie gesagt, ich versuche nur zu helfen, auswendig kenne ich das Modul sicher nicht, kann also vollkommener Blödsinn sein, den ich schreibe ;)

DS_Starter

Moin,

@Andreas ...

ZitatIch denke mal Du hast das schon korrekt und nicht als irgendwie Kritik verstanden ;)
Wie kommst du denn darauf, wieso sollte ich ?

Konstruktive Hinweise/Kritik ist doch immer willkommen weil

a) ich / das Modul dadurch immer besser werden
b) die User sehr oft geniale Ideen haben, die man selbst wegen der oft eingefahrenen/einseitigen Sichtweise garnicht bekommt
c) ich machmal auch richtig Schrott produziere  :o  ;)

Ich hätte soviel an den ganzen Modulen zu tun und zu überarbeiten (auch manch dusslige Stelle) dass der Tag mehr als 24 Stunden haben könnte. Aber das geht nicht und ich muß mich auch mal selbst maßregeln, dass das andere Leben nicht zu kurz kommt, gerade jetzt im nahen Sommer -> Natur.  :D
Deswegen kommt so manches auf die ToDo ... wird aber meist nicht vergessen und kommt irgendwann.

@uwirt ...

ich vermute du hast nicht die aktuelle DbRep Version  93_DbRep.pm:v8.40.0-s21546/2020-03-30.
Das war mal ein Bug der schon gefixt ist und jetzt nicht mehr auftritt (gerade probiert).

Aber unabhängig davon wird dir das nichts nützen. Du verwendest keine history/current Tabellen. Deswegen werden bis auf Ausnahmen (z.B. sqlCmd) die Standardbefehle bei dir nicht funktionieren.
Du müsstest dir alles über eigene Statements zusammenbauen die du über sqlCmd dann ausführst.
Das wäre zumindest solange der Weg bis ich dem User die Möglichkeit gegebenen habe history/current durch Äquivalente ersetzen zu können.

LG,
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

uwirt

Danke für deine rasche Antwort Heiko - ich glaube jetzt habe ich es kapiert!

Kann ich dann das entsprechende sqlCmd von einem anderen "at" aus auf dieselbe DbRep loslassen oder muss ich pro "at" ein eigenes DbRep erstellen?
FHEM / Ubuntu / fitlet2
HomeMatic: CCU3|HmIP-STHD|HmIP-PCBS|HmIP-PCBS2|HmIP-PCBS-BAT|HM-WDC7000|HM-WDS100-C6-O|HM-WDS40|HM-LC-Sw1-FM|HM-LC-RGBW-WM|HM-ES-PMSw1-Pl|HM-ES-TX-WM
NAS: DS218+|DS209j|DS216+II|DS412+
Devices: Panasonic Webcams|Withings|Gardena Smart|Tuya

DS_Starter

ZitatKann ich dann das entsprechende sqlCmd von einem anderen "at" aus auf dieselbe DbRep loslassen oder muss ich pro "at" ein eigenes DbRep erstellen?
Technisch geht sowohl als auch. Ich empfehle für jede Aufgabe ein separates Device. Vor allem wenn man diverse Attribute gesetzt hat um zum Beispiel in deinem Fall die Ausgabe von sqlCmd zu formatieren.
Ist ein bisschen Geschmackssache.

BTW: wenn du es dir zutraust, könntest du im gesamten Modul "history" gegen <deine Tabelle> tauschen, bzw. current ebenfalls. Geht mit einem Editor ganz schnell. Dann solltest du alle Fnktionen nutzen können. Musst das Modul dann natürlich vom Update ausnehmen bis ich so eine Äquivalenzmöglichkeit eingebaut habe.
Sollte aber gehen ...

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

dk3572

ZitatDas geht alles in einem DbRep Device.
Es wird allerdings hier OT. Deswegen kopiere dir mal bitte das Rep.STP5000.Erzeugung.Monat  auf ein anderes, zum Beispiel Rep.Report.

Und stelle dann ein List davon in den DbRep Thread oder mache wegen mir auch einen neuen auf. Dann schauen wir uns das am späten Nachmittag gemeinsam an. Bin grad etwas beschäftigt.  ;)

Wenn du allein schon mal schauen willst, fetchrows istvdas Stichwort für DbRep.

LG,
Heiko

Hallo Heiko,

ich denke der Übeltäter ist gefunden:

2020-05-17_20-57-41__1__SMA_Wechselrichter__etotal    455.958           2020-05-18 13:07:09
2020-05-18_04-55-24__1__SMA_Wechselrichter__etotal    4294967.295       2020-05-18 13:07:09
2020-05-18_05-28-56__1__SMA_Wechselrichter__etotal    455.958           2020-05-18 13:07:09


CFGFN     
   DATABASE   /opt/fhem/fhem.db
   DEF        logdb
   FUUID      5ec26a8e-f33f-cd72-b513-8c4f195609a12cf4
   FVERSION   93_DbRep.pm:v8.40.0-s21546/2020-03-30
   LASTCMD    fetchrows history
   MODEL      Client
   NAME       Rep.Report
   NOTIFYDEV  global,Rep.Report
   NR         33412
   NTFY_ORDER 50-Rep.Report
   ROLE       Client
   STATE      <html>done - Warning: present rows exceed specified limit, adjust attribute <a href='https://fhem.de/commandref_DE.html#limit' target='_blank'>limit</a></html>
   TYPE       DbRep
   UTF8       0
   HELPER:
     DBLOGDEVICE logdb
     IDRETRIES  3
     MINTS      2020-04-13 21:54:39
     PACKAGE    main
     UEFN_REGEXP .*:.*
     USEREXITFN setDumEnergy
     VERSION    8.40.0
     CV:
       aggregation no
       aggsec     1
       destr      2020-05-31
       dsstr      2020-05-01
       epoch_seconds_end 1590962399
       mestr      05
       msstr      05
       testr      23:59:59
       tsstr      00:00:00
       wdadd      259200
       yestr      2020
       ysstr      2020
     DBREPCOL:
       COLSET     1
       DEVICE     64
       EVENT      512
       READING    64
       TYPE       64
       UNIT       32
       VALUE      128
   Helper:
     DBLOG:
       state:
         logdb:
           TIME       1589800029.40616
           VALUE      <html>done - Warning
   OLDREADINGS:
   READINGS:
     2020-05-18 13:07:09   2020-05-17_09-58-04__1__SMA_Wechselrichter__etotal 421.511
     2020-05-18 13:07:09   2020-05-17_09-59-05__1__SMA_Wechselrichter__etotal 421.587
     2020-05-18 13:07:09   2020-05-17_10-00-06__1__SMA_Wechselrichter__etotal 421.663
     2020-05-18 13:07:09   2020-05-17_10-01-07__1__SMA_Wechselrichter__etotal 421.739
     2020-05-18 13:07:09   2020-05-17_10-02-08__1__SMA_Wechselrichter__etotal 421.816
     2020-05-18 13:07:09   2020-05-17_10-03-09__1__SMA_Wechselrichter__etotal 421.893
     2020-05-18 13:07:09   2020-05-17_10-04-10__1__SMA_Wechselrichter__etotal 421.97
     2020-05-18 13:07:09   2020-05-17_10-05-11__1__SMA_Wechselrichter__etotal 422.047
     2020-05-18 13:07:09   2020-05-17_10-06-12__1__SMA_Wechselrichter__etotal 422.124
     2020-05-18 13:07:09   2020-05-17_10-07-13__1__SMA_Wechselrichter__etotal 422.202
     2020-05-18 13:07:09   2020-05-17_10-08-14__1__SMA_Wechselrichter__etotal 422.28
     2020-05-18 13:07:09   2020-05-17_10-09-15__1__SMA_Wechselrichter__etotal 422.358
     2020-05-18 13:07:09   2020-05-17_10-10-16__1__SMA_Wechselrichter__etotal 422.435
     2020-05-18 13:07:09   2020-05-17_10-11-17__1__SMA_Wechselrichter__etotal 422.514
     2020-05-18 13:07:09   2020-05-17_10-12-18__1__SMA_Wechselrichter__etotal 422.593
     2020-05-18 13:07:09   2020-05-17_10-13-19__1__SMA_Wechselrichter__etotal 422.672
     2020-05-18 13:07:09   2020-05-17_10-14-20__1__SMA_Wechselrichter__etotal 422.751
     2020-05-18 13:07:09   2020-05-17_10-15-21__1__SMA_Wechselrichter__etotal 422.831
     2020-05-18 13:07:09   2020-05-17_10-16-22__1__SMA_Wechselrichter__etotal 422.911
     2020-05-18 13:07:09   2020-05-17_10-17-23__1__SMA_Wechselrichter__etotal 422.991
     2020-05-18 13:07:09   2020-05-17_10-18-23__1__SMA_Wechselrichter__etotal 423.069
     2020-05-18 13:07:09   2020-05-17_10-19-24__1__SMA_Wechselrichter__etotal 423.15
     2020-05-18 13:07:09   2020-05-17_10-20-25__1__SMA_Wechselrichter__etotal 423.229
     2020-05-18 13:07:09   2020-05-17_10-21-26__1__SMA_Wechselrichter__etotal 423.31
     2020-05-18 13:07:09   2020-05-17_10-23-28__1__SMA_Wechselrichter__etotal 423.473
     2020-05-18 13:07:09   2020-05-17_10-24-29__1__SMA_Wechselrichter__etotal 423.555
     2020-05-18 13:07:09   2020-05-17_10-26-31__1__SMA_Wechselrichter__etotal 423.719
     2020-05-18 13:07:09   2020-05-17_10-27-32__1__SMA_Wechselrichter__etotal 423.801
     2020-05-18 13:07:09   2020-05-17_10-28-33__1__SMA_Wechselrichter__etotal 423.883
     2020-05-18 13:07:09   2020-05-17_10-32-37__1__SMA_Wechselrichter__etotal 424.212
     2020-05-18 13:07:09   2020-05-17_10-33-38__1__SMA_Wechselrichter__etotal 424.295
     2020-05-18 13:07:09   2020-05-17_10-34-39__1__SMA_Wechselrichter__etotal 424.379
     2020-05-18 13:07:09   2020-05-17_10-35-40__1__SMA_Wechselrichter__etotal 424.462
     2020-05-18 13:07:09   2020-05-17_10-36-41__1__SMA_Wechselrichter__etotal 424.545
     2020-05-18 13:07:09   2020-05-17_10-37-42__1__SMA_Wechselrichter__etotal 424.629
     2020-05-18 13:07:09   2020-05-17_10-38-43__1__SMA_Wechselrichter__etotal 424.713
     2020-05-18 13:07:09   2020-05-17_10-39-44__1__SMA_Wechselrichter__etotal 424.797
     2020-05-18 13:07:09   2020-05-17_10-40-45__1__SMA_Wechselrichter__etotal 424.882
     2020-05-18 13:07:09   2020-05-17_10-41-46__1__SMA_Wechselrichter__etotal 424.966
     2020-05-18 13:07:09   2020-05-17_10-42-47__1__SMA_Wechselrichter__etotal 425.05
     2020-05-18 13:07:09   2020-05-17_10-43-48__1__SMA_Wechselrichter__etotal 425.134
     2020-05-18 13:07:09   2020-05-17_10-44-49__1__SMA_Wechselrichter__etotal 425.219
     2020-05-18 13:07:09   2020-05-17_10-45-50__1__SMA_Wechselrichter__etotal 425.305
     2020-05-18 13:07:09   2020-05-17_10-46-51__1__SMA_Wechselrichter__etotal 425.39
     2020-05-18 13:07:09   2020-05-17_10-47-52__1__SMA_Wechselrichter__etotal 425.476
     2020-05-18 13:07:09   2020-05-17_10-48-53__1__SMA_Wechselrichter__etotal 425.561
     2020-05-18 13:07:09   2020-05-17_10-49-54__1__SMA_Wechselrichter__etotal 425.647
     2020-05-18 13:07:09   2020-05-17_10-50-55__1__SMA_Wechselrichter__etotal 425.733
     2020-05-18 13:07:09   2020-05-17_10-51-56__1__SMA_Wechselrichter__etotal 425.819
     2020-05-18 13:07:09   2020-05-17_10-52-56__1__SMA_Wechselrichter__etotal 425.906
     2020-05-18 13:07:09   2020-05-17_10-53-57__1__SMA_Wechselrichter__etotal 425.992
     2020-05-18 13:07:09   2020-05-17_10-54-58__1__SMA_Wechselrichter__etotal 426.078
     2020-05-18 13:07:09   2020-05-17_10-55-59__1__SMA_Wechselrichter__etotal 426.165
     2020-05-18 13:07:09   2020-05-17_10-57-00__1__SMA_Wechselrichter__etotal 426.251
     2020-05-18 13:07:09   2020-05-17_10-58-01__1__SMA_Wechselrichter__etotal 426.338
     2020-05-18 13:07:09   2020-05-17_10-59-02__1__SMA_Wechselrichter__etotal 426.425
     2020-05-18 13:07:09   2020-05-17_11-00-03__1__SMA_Wechselrichter__etotal 426.512
     2020-05-18 13:07:09   2020-05-17_11-01-04__1__SMA_Wechselrichter__etotal 426.6
     2020-05-18 13:07:09   2020-05-17_11-02-05__1__SMA_Wechselrichter__etotal 426.688
     2020-05-18 13:07:09   2020-05-17_11-04-07__1__SMA_Wechselrichter__etotal 426.863
     2020-05-18 13:07:09   2020-05-17_11-06-09__1__SMA_Wechselrichter__etotal 427.04
     2020-05-18 13:07:09   2020-05-17_11-07-10__1__SMA_Wechselrichter__etotal 427.129
     2020-05-18 13:07:09   2020-05-17_11-08-11__1__SMA_Wechselrichter__etotal 427.218
     2020-05-18 13:07:09   2020-05-17_11-09-12__1__SMA_Wechselrichter__etotal 427.308
     2020-05-18 13:07:09   2020-05-17_11-10-13__1__SMA_Wechselrichter__etotal 427.397
     2020-05-18 13:07:09   2020-05-17_11-11-14__1__SMA_Wechselrichter__etotal 427.486
     2020-05-18 13:07:09   2020-05-17_11-12-16__1__SMA_Wechselrichter__etotal 427.575
     2020-05-18 13:07:09   2020-05-17_11-13-16__1__SMA_Wechselrichter__etotal 427.664
     2020-05-18 13:07:09   2020-05-17_11-14-17__1__SMA_Wechselrichter__etotal 427.752
     2020-05-18 13:07:09   2020-05-17_11-15-18__1__SMA_Wechselrichter__etotal 427.841
     2020-05-18 13:07:09   2020-05-17_11-16-19__1__SMA_Wechselrichter__etotal 427.931
     2020-05-18 13:07:09   2020-05-17_11-17-20__1__SMA_Wechselrichter__etotal 428.02
     2020-05-18 13:07:09   2020-05-17_11-18-21__1__SMA_Wechselrichter__etotal 428.109
     2020-05-18 13:07:09   2020-05-17_11-19-22__1__SMA_Wechselrichter__etotal 428.199
     2020-05-18 13:07:09   2020-05-17_11-20-23__1__SMA_Wechselrichter__etotal 428.29
     2020-05-18 13:07:09   2020-05-17_11-21-24__1__SMA_Wechselrichter__etotal 428.381
     2020-05-18 13:07:09   2020-05-17_11-22-25__1__SMA_Wechselrichter__etotal 428.471
     2020-05-18 13:07:09   2020-05-17_11-23-26__1__SMA_Wechselrichter__etotal 428.563
     2020-05-18 13:07:09   2020-05-17_11-24-27__1__SMA_Wechselrichter__etotal 428.655
     2020-05-18 13:07:09   2020-05-17_11-25-28__1__SMA_Wechselrichter__etotal 428.746
     2020-05-18 13:07:09   2020-05-17_11-26-29__1__SMA_Wechselrichter__etotal 428.837


     2020-05-18 13:07:09   background_processing_time 0.0247
     2020-05-18 13:07:09   number_fetched_rows 1000
     2020-05-18 13:07:09   sql_processing_time 0.0216
     2020-05-18 13:07:09   state           <html>done - Warning: present rows exceed specified limit, adjust attribute <a href='https://fhem.de/commandref_DE.html#limit' target='_blank'>limit</a></html>
Attributes:
   aggregation no
   devStateIcon connected:10px-kreis-gelb .*disconnect:10px-kreis-rot .*done:10px-kreis-gruen
   device     SMA_Wechselrichter
   event-on-update-reading state
   reading    etotal
   room       Photovoltaik
   showproctime 1
   timeout    180
   timestamp_begin current_month_begin
   timestamp_end current_month_end
   userExitFn setDumEnergy .*:.*
   verbose    3


Wie muss ich den Eintrag jetzt löschen?

Danke und VG Dieter

DS_Starter

Hallo Dieter,

ja, das ist der Datensatz.
Ich zeige dir die Löschmöglichkeit in DbRep mit der man ohne SQL-Kenntnisse auskommt (geht auch mit sqlCmd).

Stell dir bitte die Zeitattribute auf den Timestamp des Datensatzes ein:

   
timestamp_begin 2020-05-18 04:55:24
timestamp_end   2020-05-18 04:55:24


Und führe dann ein fetchrows aus. Es darf nur noch dieser eine Datensatz angezeigt werden !!
Wenn das so ist,schalte dir die Löschfunktion des Devices frei mit:

attr <name> allowDeletion 1

Und dann löscht du den Satz mit:

set <name> delEntries

In den Readings wird die Anzahl der gelöschten Datensätze angezeigt, im Idealfall nur einer  ;)
Danach schaltest du aus Sicherheitsgründen die Löschfreigabe wieder aus -> "allowDeletion 0".

Und ein erneuter fetchrow-Lauf zeigt dir dass der Datensatz gelöscht ist. Fertig.
Das neue Device kannst du behalten, kann man immer mal gebrauchen für einen Blick in die DB oder diverse Pflegeaktionen.

LG,
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

dk3572

Noch mal Danke für deine Hilfe.

Alles so gemacht wie beschrieben.

Nach erneutem fetchrows sieht es so aus:

CFGFN     
   DATABASE   /opt/fhem/fhem.db
   DEF        logdb
   FUUID      5ec26a8e-f33f-cd72-b513-8c4f195609a12cf4
   FVERSION   93_DbRep.pm:v8.40.0-s21546/2020-03-30
   LASTCMD    fetchrows history
   MODEL      Client
   NAME       Rep.Report
   NOTIFYDEV  global,Rep.Report
   NR         33412
   NTFY_ORDER 50-Rep.Report
   ROLE       Client
   STATE      done
   TYPE       DbRep
   UTF8       0
   HELPER:
     DBLOGDEVICE logdb
     IDRETRIES  3
     MINTS      2020-04-13 21:54:39
     PACKAGE    main
     UEFN_REGEXP .*:.*
     USEREXITFN setDumEnergy
     VERSION    8.40.0
     CV:
       aggregation no
       aggsec     1
       destr      2020-05-14
       dsstr      2020-03-24
       epoch_seconds_end 1589468429.79918
       mestr      05
       msstr      03
       testr      17:00:29
       tsstr      17:00:29
       wdadd      518400
       yestr      2020
       ysstr      2020
     DBREPCOL:
       COLSET     1
       DEVICE     64
       EVENT      512
       READING    64
       TYPE       64
       UNIT       32
       VALUE      128
     DELENTRIES:
       Rep.Report
       delEntries
       2020-05-18
       04:55:24
   Helper:
     DBLOG:
       state:
         logdb:
           TIME       1589814030.85593
           VALUE      done
   OLDREADINGS:
   READINGS:
     2020-05-18 17:00:30   2020-05-14_16-50-55__1__SMA_Wechselrichter__etotal 325.952
     2020-05-18 17:00:30   2020-05-14_16-51-56__1__SMA_Wechselrichter__etotal 325.985
     2020-05-18 17:00:30   2020-05-14_16-52-57__1__SMA_Wechselrichter__etotal 326.032
     2020-05-18 17:00:30   2020-05-14_16-53-58__1__SMA_Wechselrichter__etotal 326.079
     2020-05-18 17:00:30   2020-05-14_16-54-59__1__SMA_Wechselrichter__etotal 326.124
     2020-05-18 17:00:30   2020-05-14_16-56-00__1__SMA_Wechselrichter__etotal 326.168
     2020-05-18 17:00:30   2020-05-14_16-58-02__1__SMA_Wechselrichter__etotal 326.252
     2020-05-18 17:00:30   2020-05-14_16-59-03__1__SMA_Wechselrichter__etotal 326.278
     2020-05-18 17:00:30   2020-05-14_17-00-04__1__SMA_Wechselrichter__etotal 326.303
     2020-05-18 17:00:30   background_processing_time 0.0028
     2020-05-18 17:00:30   number_fetched_rows 9
     2020-05-18 17:00:30   sql_processing_time 0.0003
     2020-05-18 17:00:30   state           done
Attributes:
   aggregation no
   allowDeletion 0
   devStateIcon connected:10px-kreis-gelb .*disconnect:10px-kreis-rot .*done:10px-kreis-gruen
   device     SMA_Wechselrichter
   event-on-update-reading state
   reading    etotal
   room       Photovoltaik
   showproctime 1
   timeout    180
   timestamp_begin 2020-05-18 04:55:24
   timestamp_end 2020-05-18 04:55:24
   userExitFn setDumEnergy .*:.*
   verbose    3


Da stimmt doch mit dem Datum was nicht?

Wenn ich begin + end wieder auf Monat stelle, erhalte ich auch nicht mehr Einträge.


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

dk3572

Asche auf mein Haupt.
Nicht geguckt  ???
Habe aber exakt nach deiner Anleitung gehandelt.

DS_Starter

Lösch mal die beiden Zeitattribute und setze

timeDiffToNow  d:1

Dann nochmal fetchrows.
Das sieht doch echt merkwürdig aus. Habe bei mir auch mal einen DS gelöscht und war alles gut.
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

dk3572

sieht genauso aus.
Ich befürchte das alle Einträge futsch sind.

Habe übrigens das gefunden:

2020.05.18 16:50:29.425 3: DbRep Rep.Report - Entries of /opt/fhem/fhem.db.history deleted: SMA_Wechselrichter--etotal--2451

DS_Starter

Ja da wurde zuviel gelöscht  :o
Da muss man echt aufpassen ...

Restore der DB !



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