NEWS
CCU Systemprotokoll anzeigen lassen
-
-
Mir fällt nur ein ziemlicher Hack ein:
Es gibt eine Möglichkeit das Systemprotokoll per ReGa Script auszulesen (https://homematic-forum.de/forum/viewtopic.php?t=10210). Das könnte man so umschreiben, das dieses in einer Systamvariablen landet. Den Inhalt der Systemvariablen könnte mann dann wiederum in IOBroker weiterverarbeiten und z.B. in vis darstelen.
Das Script könnte wie folgt aussehen:
! Systemprotokoll auslesen und in Systemvariable speichern !----------------------------------------------------------------- ! Info: History Daten löschen mit ! var clearHistory = dom.ClearHistoryData(); !----------------------------------------------------------------- !Name der Systemvariablen string sv_id = "SV_STAT_SYSPROT"; !----------------------------------------------------------------- string drop = ""; integer iLastGroupIndex = 1; string sCollectedNames = ""; string sCollectedValues = ""; string sCollectedDateTimes = ""; string s; integer iStart = 0; integer iCount = dom.GetHistoryDataCount(); integer rCount; foreach( s, dom.GetHistoryData( iStart, iCount, &rCount ) ) { integer iGroupIndex = s.StrValueByIndex(";",0).ToInteger(); string sDatapointId = s.StrValueByIndex(";",1); string sRecordedValue = s.StrValueByIndex(";",2); string sDateTime = s.StrValueByIndex(";",3); string sDatapointName = ""; object oHistDP = dom.GetObject( sDatapointId ); if( oHistDP ) { object oDP = dom.GetObject( oHistDP.ArchiveDP() ); if( oDP ) { sDatapointName = oDP.Name(); boolean bSysVar = (oDP.IsTypeOf(OT_VARDP) || oDP.IsTypeOf(OT_ALARMDP)); if( !bSysVar ) { object oCH = dom.GetObject( oDP.Channel() ); if( oCH ) { sDatapointName = oCH.Name(); } } if( iLastGroupIndex <> iGroupIndex ) { drop = drop # sCollectedDateTimes # " " # sCollectedNames # " " # sCollectedValues # "\n"; sCollectedNames = ""; sCollectedValues = ""; iLastGroupIndex = iGroupIndex; } string id = oDP.ID(); string sRet = ""; string sValue = sRecordedValue; Call("/esp/functions.fn::WriteDPText()"); sRecordedValue = system.GetVar("sRet"); sCollectedNames = sDatapointName; sCollectedDateTimes = sDateTime; if( !sCollectedValues.Length() ) { sCollectedValues = sRecordedValue; } else { sCollectedValues = sCollectedValues#", "#sRecordedValue; } } } } if( sCollectedValues.Length() ) { drop = drop # sCollectedDateTimes # " " # sCollectedNames # " " # sCollectedValues; (dom.GetObject(ID_SYSTEM_VARIABLES)).Get(sv_id).State(drop); } if (drop == "") { drop = "Keine Einträge im Protokoll !!!"; } ! Textausgabe Konsole !---------------------------- !WriteLine(drop); WriteLine("OK!"); ! Systemprotokoll löschen !-------------------------------- !var clearHistory = dom.ClearHistoryData();