Hi,
nach Commandref sollte folgender Syntax gelten:
set <name> addLog <devspec>:<Reading>
mein Device heist "TS_Frank_Temp", das Reading "temperature"
somit müsste ich eine Log-Zeile mit
set logdb addLog TS_Frank_Temp:temperature
erzeugen können.
EDIT: Lösung:
set logdb addLog TS_Frank_Temp:temperature !useExcludes
Aber: es passiert nichts im dblog. im FHEM-og finde ich:
Zitat2018.11.05 10:52:44 2: DbLog logdb -> Device: "TS_Frank_Temp", reading: ".*" excluded by attribute DbLogExclude from addLog !
List vom dblog:
Internals:
COLUMNS field length used for Device: 64, Type: 64, Event: 512, Reading: 64, Value: 128, Unit: 32
CONFIGURATION ./db.conf
DEF ./db.conf .*:.*
MODE asynchronous
MODEL SQLITE
NAME logdb
NR 44
NTFY_ORDER 50-logdb
PID 406
REGEXP .*:.*
STATE 228 MB, 1678103 Zeilen
TYPE DbLog
VERSION 3.12.6
dbconn SQLite:dbname=/opt/fhem/fhem.db
dbuser
HELPER:
COLSET 1
DEVICECOL 64
EVENTCOL 512
OLDSTATE connected
READINGCOL 64
TYPECOL 64
UNITCOL 32
VALUECOL 128
Helper:
DBLOG:
DbFileSize:
logdb:
TIME 1541382300.40768
VALUE 228
countHistory:
logdb:
TIME 1541382300.40768
VALUE 1678103
READINGS:
2018-11-05 10:53:06 CacheUsage 0
2018-11-05 02:45:00 DbFileSize 228
2018-11-05 10:53:06 NextSync 2018-11-05 10:53:36 or if CacheUsage 500 reached
2018-11-05 02:45:00 countHistory 1678103
2018-11-05 10:53:06 state connected
2018-11-04 23:55:00 userCommand delete from HISTORY where DEVICE like "%_rH" and READING = "rH" and cast(VALUE as Integer) >115
2018-11-04 23:55:03 userCommandResult no result
cache:
index 89391
Attributes:
DbLogExclude .*
DbLogInclude DbFileSize,countHistory
DbLogSelectionMode Exclude/Include
DbLogType History
asyncMode 1
group Logfiles
room SYSTEM
stateFormat DbFileSize MB, countHistory Zeilen
userReadings DbFileSize:countHistory.* { (split(' ',`du -m fhem.db`))[0] }
List vom Sensor:
Internals:
ALARM 1
ASYNC 0
DEF DS18B20 BD3E60070000
ERRCOUNT 0
INTERVAL 300
IODev 1wire
NAME TS_Frank_Temp
NOTIFYDEV global
NR 21
NTFY_ORDER 50-TS_Frank_Temp
OW_FAMILY 28
OW_ID BD3E60070000
PRESENT 1
ROM_ID 28.BD3E60070000.9F
STATE 22.375 °C
TYPE OWTHERM
owg_temp 23.375
owg_th 75
owg_tl 70
Helper:
DBLOG:
temperature:
logdb:
TIME 1541411529.36751
VALUE 22.375
READINGS:
2018-11-05 10:52:09 state T: 22.38 °C ↓
2018-11-05 10:52:09 temperature 22.375
tempf:
factor 1
offset -1
Attributes:
DbLogExclude .*
DbLogInclude temperature
IODev 1wire
group Sensoren
model DS18B20
room Klima
stateFormat temperature °C
tempHigh 74
tempLow 69
tempOffset -1
DbLog Version:
93_DbLog.pm 17599 2018-10-22 19:25:46Z DS_Starter
jemand ne Idee?
Heiko?
Danke & Grüße
Frank
Hi Frank,
du hast den Zusatz !useExcludes vergessen.
Steht in der commandref ;)
LG,
Heiko
Ich will doch aber das reading temperature loggen.
Das ist nicht excludiert. Das ist über include mit drin.
Gesendet von meinem Doogee S60 mit Tapatalk
DbLogExclude .* , da ist es ja mit betroffen
OK, also arbeitet addlog anderst.
Im device kann ich ja mit exclude .* und include gezielte readings loggen.
addlog kuckt nur auf exclude, nicht auf include.
Damit ist es geklärt woran es liegt.
Wenn es auch im gesamten etwas uneinheitlich scheint.
Gesendet von meinem Doogee S60 mit Tapatalk
Ich schaue mal ob ich das Include mit berücksichtigen kann damit die Einheitlichkeit gewahrt wird.
Muss aber darauf achten, dass ich nichts verschlimmbessere.
wäre schön wenn du bei Tests hilfst wenn ich es implementiert habe.
Grüße
Heiko
klar gerne.
Ich nutze die exclude/include Kombi recht oft. das ist einfacher als bei manchen Geräten zig Readings einzeln ins exclude zu packen.
aber nur keine Eile. mit dem !useexcludes geht es jetzt.
Hallo Frank,
Im contrib-Verzeichnis:
https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter
liegt eine DbLog-Version die DbLogInclude mit berücksichtigt.
set <name> addLog <devspec>:<Reading> [Value] [CN=<caller name>] [!useExcludes]
Fügt einen zusatzlichen Logeintrag einer Device/Reading-Kombination in die Datenbank ein. Die eventuell in den Attributen "DbLogExclude" spezifizierten Readings (im Quelldevice) werden nicht nicht geloggt, es sei denn sie sind im Attribut "DbLogInclude" enthalten bzw. der addLog-Aufruf erfolgte mit der Option "!useExcludes".
....
Probier's mal aus ...
Grüße
Heiko
Zitat von: DS_Starter am 10 November 2018, 07:52:20
Hallo Frank,
Im contrib-Verzeichnis:
https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter
liegt eine DbLog-Version die DbLogInclude mit berücksichtigt.
Probier's mal aus ...
Grüße
Heiko
Danke! Wird getestet! Aber erst Mo/Di. Bis morgen ist LAN Party. [emoji16]
Grüße
Frank
Gesendet von meinem Doogee S60 mit Tapatalk
Zitat von: DS_Starter am 10 November 2018, 07:52:20
Im contrib-Verzeichnis:
https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter
liegt eine DbLog-Version die DbLogInclude mit berücksichtigt.
Probier's mal aus ...
oh:
2018.11.14 10:05:03 0: Server shutdown
2018.11.14 10:05:19 1: Including fhem.cfg
2018.11.14 10:05:20 3: telnetPort: port 7072 opened
2018.11.14 10:05:21 3: WEB: port 8083 opened
2018.11.14 10:05:21 2: eventTypes: loaded 539 events from ./log/eventTypes.txt
2018.11.14 10:05:21 3: Opening 1wire device /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_DAE002xu-if00-port0
2018.11.14 10:05:21 3: 1wire device opened
2018.11.14 10:05:21 3: OWX_SER: opened serial device /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_DAE002xu-if00-port0: Illegal seek
2018.11.14 10:05:31 3: OWTHERM: Device TS_Frank_Temp defined.
2018.11.14 10:05:40 3: OWMULTI: Device TS_Frank_rH defined.
2018.11.14 10:05:41 1: PERL WARNING: Bareword found where operator expected at ./FHEM/93_DbLog.pm line 9, near "93_DbLog"
2018.11.14 10:05:41 1: PERL WARNING: (Missing operator before DbLog?)
2018.11.14 10:05:41 1: reload: Error:Modul 93_DbLog deactivated:
syntax error at ./FHEM/93_DbLog.pm line 8, near "<"
Unknown regexp modifier "/D" at ./FHEM/93_DbLog.pm line 9, at end of line
Unknown regexp modifier "/S" at ./FHEM/93_DbLog.pm line 9, at end of line
Unknown regexp modifier "/_" at ./FHEM/93_DbLog.pm line 9, at end of line
Unknown regexp modifier "/S" at ./FHEM/93_DbLog.pm line 9, at end of line
Unknown regexp modifier "/t" at ./FHEM/93_DbLog.pm line 9, at end of line
Unknown regexp modifier "/r" at ./FHEM/93_DbLog.pm line 9, at end of line
Unknown regexp modifier "/t" at ./FHEM/93_DbLog.pm line 9, at end of line
Unknown regexp modifier "/e" at ./FHEM/93_DbLog.pm line 9, at end of line
Unknown regexp modifier "/r" at ./FHEM/93_DbLog.pm line 9, at end of line
./FHEM/93_DbLog.pm has too many errors.
2018.11.14 10:05:41 0: syntax error at ./FHEM/93_DbLog.pm line 8, near "<"
Unknown regexp modifier "/D" at ./FHEM/93_DbLog.pm line 9, at end of line
Unknown regexp modifier "/S" at ./FHEM/93_DbLog.pm line 9, at end of line
Unknown regexp modifier "/_" at ./FHEM/93_DbLog.pm line 9, at end of line
Unknown regexp modifier "/S" at ./FHEM/93_DbLog.pm line 9, at end of line
Unknown regexp modifier "/t" at ./FHEM/93_DbLog.pm line 9, at end of line
Unknown regexp modifier "/r" at ./FHEM/93_DbLog.pm line 9, at end of line
Unknown regexp modifier "/t" at ./FHEM/93_DbLog.pm line 9, at end of line
Unknown regexp modifier "/e" at ./FHEM/93_DbLog.pm line 9, at end of line
Unknown regexp modifier "/r" at ./FHEM/93_DbLog.pm line 9, at end of line
./FHEM/93_DbLog.pm has too many errors.
root@FHEM-PI-TEST:/opt/fhem/FHEM# ls -la 93_D*
-rwxrwxrwx 1 fhem dialout 1646408 Nov 14 10:02 93_DbLog.pm
-rwxrwxrwx 1 fhem dialout 3251520 Nov 14 10:02 93_DbRep.pm
root@FHEM-PI-TEST:/opt/fhem/FHEM#
vorhin aus dem Contrib geladen. Raspbian und FHEM tagesaktuell
Du musst den Downloadbutton benutzen !!!
Lg
Zitat von: DS_Starter am 14 November 2018, 10:25:35
Du musst den Downloadbutton benutzen !!!
Ah, habs mit rechtsklick, "speichern unter" gemacht.
Hab mit dem SVN keine Erfahrung, wird gleich nochmal geholt.
wenn man den download button mal findet... :-)
Testversion ist drauf, FHEM fehlerlos gestartet.
meld mich später wieder.
Zitat von: DS_Starter am 10 November 2018, 07:52:20
Im contrib-Verzeichnis liegt eine DbLog-Version die DbLogInclude mit berücksichtigt.
Probier's mal aus ...
Hallo Heiko,
läuft bestens. hat jetzt auf dem Testsystem nahezu 5 Stunden Betrieb hinter sich ohne Auffälligkeiten.
Danke!
Grüße
Frank
Sehr schön, freut mich :)
Wenn du magst und Spaß daran hast, kannst du auch mal die neuen Attribute traceFlag und traceLevel ausprobieren. Die sind noch nicht beschrieben, generieren aber DB-Traces z.B. zur Fehlersuche. Nur mal schauen, ob das auch bei dir fluffig läuft. Diese Möglichkeit hatte ich wegen einem aktuellen Bedarf schon mit eingebaut. Generieren halt recht viele Daten.
Wenn alles weiter smooth läuft passe ich die commandref noch an und übernehme die Version ins Repository.
Grüße
Heiko
OK gerne, auf was soll ich das Traceflag setzen?
Hab SQLite am laufen.
Spiele einfach etwas rum. Vielleicht mit SQL beginnen.
OK, wie sollte es sich auswirken?
Also mit traceFlag SQL und traceLevel 3 kommt so etwas im FHEM Log:
DBI::db=HASH(0x55b3e98d6070) trace level set to 0x100/3 (DBI @ 0x0/0) in DBI 1.636-ithread (pid 6877)
DBI::st=HASH(0x55b3e97c96b0) trace level set to 0x100/3 (DBI @ 0x0/0) in DBI 1.636-ithread (pid 6877)
-> FETCH for DBD::mysql::db (DBI::db=HASH(0x55b3e98d6070)~INNER 'AutoCommit') thr#55b3ddefd010
<- FETCH= ( 1 ) [1 items] at 93_DbLog.pm line 2088 via at 93_DbLog.pm line 2088
-> begin_work for DBD::mysql::db (DBI::db=HASH(0x55b3e923dad0)~0x55b3e98d6070) thr#55b3ddefd010
1 <- _async_check= ( 1 ) [1 items] at mysql.pm line 846 via at 93_DbLog.pm line 2088
1 <- FETCH= ( 1 ) [1 items] at DBI.pm line 1753 via at 93_DbLog.pm line 2088
1 <- STORE= ( 1 ) [1 items] at DBI.pm line 1755 via at 93_DbLog.pm line 2088
STORE DBI::db=HASH(0x55b3e98d6070) 'BegunWork' => 1
1 <- STORE= ( 1 ) [1 items] at DBI.pm line 1756 via at 93_DbLog.pm line 2088
<- begin_work= ( 1 ) [1 items] at 93_DbLog.pm line 2088 via at 93_DbLog.pm line 2088
-> execute_array in DBD::_::st for DBD::mysql::st (DBI::st=HASH(0x55b3e98c8568)~0x55b3e97c96b0 HASH(0x55b3e979da00)) thr#55b3ddefd010
-> dbd_st_FETCH_attrib for 55b3dfc4c3f8, key NUM_OF_PARAMS
.. FETCH DBI::st=HASH(0x55b3e97c96b0) 'NUM_OF_PARAMS' = 7 (cached)
1 <- FETCH= ( 7 ) [1 items] at DBI.pm line 1936 via at 93_DbLog.pm line 2094
2 <- _async_check= ( 1 ) [1 items] at mysql.pm line 879 via at 93_DbLog.pm line 2092
Called: dbd_bind_ph
Called: dbd_bind_ph
Called: dbd_bind_ph
Called: dbd_bind_ph
Called: dbd_bind_ph
Called: dbd_bind_ph
Called: dbd_bind_ph
-> dbd_st_execute for 55b3dfc5e8c8
>- dbd_st_free_result_sets
<- dbd_st_free_result_sets RC -1
<- dbd_st_free_result_sets
mysql_st_internal_execute MYSQL_VERSION_ID 100121
>parse_params statement INSERT INTO history (TIMESTAMP, DEVICE, TYPE, EVENT, READING, VALUE, UNIT) VALUES (?,?,?,?,?,?,?)
Binding parameters: INSERT INTO history (TIMESTAMP, DEVICE, TYPE, EVENT, READING, VALUE, UNIT) VALUES ('2018-11-14 15:37:03','SMA_Energymeter','SMAEM','Bezug_WirkP_Zaehler_Diff: 0.0049','Bezug_WirkP_Zaehler_Diff','0.0049','')
<- dbd_st_execute returning imp_sth->row_num 1
2 <- execute= ( 1 ) [1 items] at DBI.pm line 2020 via at 93_DbLog.pm line 2094
Called: dbd_bind_ph
Called: dbd_bind_ph
Called: dbd_bind_ph
Called: dbd_bind_ph
Called: dbd_bind_ph
Called: dbd_bind_ph
Called: dbd_bind_ph
-> dbd_st_execute for 55b3dfc5e8c8
>- dbd_st_free_result_sets
<- dbd_st_free_result_sets RC -1
<- dbd_st_free_result_sets
mysql_st_internal_execute MYSQL_VERSION_ID 100121
>parse_params statement INSERT INTO history (TIMESTAMP, DEVICE, TYPE, EVENT, READING, VALUE, UNIT) VALUES (?,?,?,?,?,?,?)
Binding parameters: INSERT INTO history (TIMESTAMP, DEVICE, TYPE, EVENT, READING, VALUE, UNIT) VALUES ('2018-11-14 15:37:03','SMA_Energymeter','SMAEM','Bezug_WirkP_Kosten_Diff: 0.0013','Bezug_WirkP_Kosten_Diff','0.0013','')
<- dbd_st_execute returning imp_sth->row_num 1
2 <- execute= ( 1 ) [1 items] at DBI.pm line 2020 via at 93_DbLog.pm line 2094
Called: dbd_bind_ph
Called: dbd_bind_ph
Called: dbd_bind_ph
Called: dbd_bind_ph
Called: dbd_bind_ph
Called: dbd_bind_ph
Called: dbd_bind_ph
-> dbd_st_execute for 55b3dfc5e8c8
>- dbd_st_free_result_sets
<- dbd_st_free_result_sets RC -1
<- dbd_st_free_result_sets
mysql_st_internal_execute MYSQL_VERSION_ID 100121
>parse_params statement INSERT INTO history (TIMESTAMP, DEVICE, TYPE, EVENT, READING, VALUE, UNIT) VALUES (?,?,?,?,?,?,?)
Binding parameters: INSERT INTO history (TIMESTAMP, DEVICE, TYPE, EVENT, READING, VALUE, UNIT) VALUES ('2018-11-14 15:37:03','SMA_Energymeter','SMAEM','Einspeisung_WirkP_Zaehler_Diff: 0','Einspeisung_WirkP_Zaehler_Diff','0','')
<- dbd_st_execute returning imp_sth->row_num 1
2 <- execute= ( 1 ) [1 items] at DBI.pm line 2020 via at 93_DbLog.pm line 2094
Called: dbd_bind_ph
Called: dbd_bind_ph
Called: dbd_bind_ph
Called: dbd_bind_ph
Called: dbd_bind_ph
Called: dbd_bind_ph
Called: dbd_bind_ph
-> dbd_st_execute for 55b3dfc5e8c8
>- dbd_st_free_result_sets
<- dbd_st_free_result_sets RC -1
<- dbd_st_free_result_sets
mysql_st_internal_execute MYSQL_VERSION_ID 100121
>parse_params statement INSERT INTO history (TIMESTAMP, DEVICE, TYPE, EVENT, READING, VALUE, UNIT) VALUES (?,?,?,?,?,?,?)
Binding parameters: INSERT INTO history (TIMESTAMP, DEVICE, TYPE, EVENT, READING, VALUE, UNIT) VALUES ('2018-11-14 15:37:03','SMA_Energymeter','SMAEM','Einspeisung_WirkP_Verguet_Diff: 0.0000','Einspeisung_WirkP_Verguet_Diff','0.0000','')
<- dbd_st_execute returning imp_sth->row_num 1
Das wäre ein fehlerfreier Ablauf. Man braucht etwas Phantasie um die Ausgaben zu deuten, aber hat uns bei dem aktuellen Fall schon geholfen und auf eine Spur geführt.
Wichtig ist mir nur, dass nichts abstürzt oder ähnliche unschöne Dinge. Da du ja auch keine Fehler hast sollte auch nichts spektakuläres zu sehen sein.
OK, danke!
werd mit rumspielen und das log beobachten.
So, mit traceFlag SQL und traceLevel 3 bringt 15MB Log in ca 15 Stunden. also 1 MB pro Stunde.
Ich logge hier nicht viel, nur eine Hand voll Temperatursensoren.
Denke da muss ein Hinweis mit in die Commandref.
gerade auf einem PI istdas Log so nicht mehr aufrufbar.
Ich stell jetzt mal auf "CON" um und erneuere die Log Datei.
Hallo Frank,
ja danke für den Hinweis. Da kommt auf jeden Fall eine Warnung mit rein dass diese Attr nur im Supportfall und mit Bedacht zu verwenden sind.
Aber ich entnehme deinen Worten dass du ansonsten nichts negatives bemerkt hast.
Grüße,
Heiko
korrekt. ausser dass es eine Ewigkeit dauert das Log zu öffnen läuft alles sauber weiter.
Hallo Heiko,
Bis heute nichts negatives aufgefallen. Hab heute wieder auf normal umgestellt.
Danke und Grüße
Frank
Gesendet von meinem Doogee S60 mit Tapatalk
Danke für deine Unterstützung ! 8)
LG,
Heiko