Hallo
Habe die Codezeile zusätzlich eingefügt und die vorherige noch davor stehen lassen.
964 $hash->{LASTCMD} = $prop ? "$opt $prop" : "$opt";
965 Log3 ($name, 5, "DbRep $name - all: $prop, dev: $i_device, reading: $i_reading, value: $i_value"); # 2 Zeilen zum Debuggen da einige DB Eintraege verkorkst
966 Log3 ($name, 5, "DbRep $name - all: $prop, dev_colsize: $hash->{HELPER}{DBREPCOL}{DEVICE}), reading_colsize: $hash->{HELPER}{DBREPCOL}{READING}, value_colsize: $hash->{HELPER}{DBREPCOL}{VALUE}");
967 if ($dbmodel ne 'SQLITE') { # Daten auf maximale Länge (entsprechend der Feldl$
968 $i_device = substr($i_device, 0, $hash->{HELPER}{DBREPCOL}{DEVICE});
969 $i_reading = substr($i_reading, 0, $hash->{HELPER}{DBREPCOL}{READING});
970 $i_value = substr($i_value, 0, $hash->{HELPER}{DBREPCOL}{VALUE});
971 $i_unit = substr($i_unit, 0, $hash->{HELPER}{DBREPCOL}{UNIT});
972 }
dann "reload 93_DbRep" und Test des AT über execNow. Ergebnis im Log sieht gut aus und ist parat für den Problemfall:
2022.05.16 12:40:01.212 5: DbRep DBRepPow - all: 2022-05-16,21:31:00,0, dev: shelly_plug_s_df2674, reading: power, value: 0
2022.05.16 12:40:01.213 5: DbRep DBRepPow - all: 2022-05-16,21:31:00,0, dev_colsize: 64), reading_colsize: 64, value_colsize: 128
2022.05.16 12:40:01.227 4: DbRep DBRepPow - -------- New selection ---------
2022.05.16 12:40:01.228 4: DbRep DBRepPow - Command: insert 2022-05-16 21:31:00,shelly_plug_s_df2674,power,0,
2022.05.16 12:40:01.250 5: DbRep DBRepPow - BlockingCall with PID "14960" started
2022.05.16 12:40:01.519 4: DbRep DBRepPow - Database connect - user: fhemuser, UTF-8 option set: yes
2022.05.16 12:40:01.587 5: DbRep DBRepPow -> Primary Key used in fhem.history: 1 (TIMESTAMP,DEVICE,READING)
2022.05.16 12:40:01.588 5: DbRep DBRepPow -> Primary Key used in fhem.current: 1 (DEVICE,READING)
2022.05.16 12:40:01.589 5: DbRep DBRepPow -> data to insert Timestamp: 2022-05-16 21:31:00, Device: shelly_plug_s_df2674, Type: manual, Event: manual, Reading: power, Value: 0, Unit:
2022.05.16 12:40:01.589 4: DbRep DBRepPow - SQL prepare: INSERT IGNORE INTO history (TIMESTAMP, DEVICE, TYPE, EVENT, READING, VALUE, UNIT) VALUES (?,?,?,?,?,?,?)
2022.05.16 12:40:01.592 4: DbRep DBRepPow - begin transaction
2022.05.16 12:40:01.604 4: DbRep DBRepPow - transaction committed
2022.05.16 12:40:01.607 4: DbRep DBRepPow - Inserted into fhem.history: 2022-05-16 21:31:00, shelly_plug_s_df2674, manual, manual, power, 0,
2022.05.16 12:40:01.665 5: DbRep DBRepPow - BlockingCall PID "14960" finished
Werde jetzt einen Restart von FHEM veranlassen um die Warning heute Abend zu provozieren.
Hinweis:
Das Device Anfang Mai für die beiden AT um 5:29 und 21:31 Uhr verwendet um per insert die "0" in die Datenbank zu schreiben.
Letzte Woche lief es ja morgens sauber und bis ich es gemerkt habe dreimal in Folge Abends falsch (zwischendurch kein Restart FHEM oder Reboot).
Habe mal die FHEM-Logs von diesem Jahr durch gegrept. Keine PERL Warnings mit "93_DbLog.pm"