logProxy modul zum manipulieren und ergänzen von SVG plots

Begonnen von justme1968, 26 August 2014, 22:47:55

Vorheriges Thema - Nächstes Thema

olli84

#60
Zitat von: justme1968 am 04 September 2014, 13:05:25
es sind immer zwei änderungen nötig um einen bestehen plot umzustellen:
- die colum_spec zeile im gplot file ändern
- und zusätzlich noch in der definition des SVG device myDbLog durch das logProxy device ersetzen.

zur Erklärung: im SVG device gibt es einen verweis auf das logdevice in dem die daten stehen. das jeweilige log device wird dann mit den column_spec attributen aufgerufen um an die daten zu kommen. dein SVG device muss aber nicht mehr DbLog aufrufen sondern das logProxy device. der teil fehlt dir. logProxy ruft dann über die modifizierte zeile unter anderem DbLog auf um an die daten zu kommen. diesen teil hast du.

gruss
  nadre

Irgendwie stehe ich auf dem Schlauch. Ich habe genau das gleiche Problem wie maxritti. Wo stelle ich denn das Device um? Bei Type? Da kann ich doch Garnichts ändern?

Hilfe... :(

justme1968

im define des SVG devices gibst du das log device an:define <name> SVG <logDevice>:<gplotfile>:<logfile> und hier musst du statt des fileLog oder DbLog devices das logProxy device angeben.

gruss
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

olli84

#62
unglaublich, aber ich scheine tatsächlich zu blöd dafür zu sein.

Mein Plot hat nach der Änderung nur noch diesen Inhalt:

XML-Verarbeitungsfehler: Kein Element gefunden
Adresse: http://192.168.178.22:8083/fhem/SVG_showLog?dev=SVG_FileLog_Heizung.WZ.C_1&logdev=logProxy&gplotfile=SVG_FileLog_Heizung.WZ.C_1&logfile=FileLog_Heizung.WZ.C&pos=
Zeile Nr. 2, Spalte 1:

Ich will doch nur meine ganzen Thermostate Logs in ein schönes Plot... ich probier schon 2 Stunden rum :(

So sieht meine SVG_FileLog_Heizung.WZ._1.gplot aus:
# Created by FHEM/98_SVG.pm, 2014-10-25 18:39:07
set terminal png transparent size <SIZE> crop
set output '<OUT>.png'
set xdata time
set timefmt "%Y-%m-%d_%H:%M:%S"
set xlabel " "
set title '<TL>'
set ytics
set y2tics
set grid
set ylabel "Humidity"
set y2label "Temperature"

#logProxy FileLog:FileLog_Heizung.DG_Clima:4:.*::
#logProxy FileLog:FileLog_Heizung.SZ_Clima:4:.*::
#logProxy FileLog:FileLog_Heizung.Bad_Clima:4:.*::
#logProxy FileLog:FileLog_Heizung.WZ.A_Clima:4:.*::
#logProxy FileLog:FileLog_Heizung.WZ.B_Clima:4:.*::
#logProxy FileLog:FileLog_Heizung.WZ.C_Clima:4:.*::

plot "<IN>" using 1:2 axes x1y2 title 'Line 1' ls l0 lw 1 with lines

justme1968

zeig mal alle defines der beteiligten SVG, FileLog, DbLog und logProxy devices sowie das gplot file.

gruss
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

olli84

Das logproxy device habe ich wie in deiner Anleitung erstellt

define lp logProxy

Mein GPLOT (muss ich natürlich noch umnennen, habe quasi aus dem FileLog eines Thermostates ein gplot erstellt):
# Created by FHEM/98_SVG.pm, 2014-10-25 18:39:07
set terminal png transparent size <SIZE> crop
set output '<OUT>.png'
set xdata time
set timefmt "%Y-%m-%d_%H:%M:%S"
set xlabel " "
set title '<TL>'
set ytics
set y2tics
set grid
set ylabel "Humidity"
set y2label "Temperature"

#logProxy FileLog:FileLog_Heizung.DG_Clima:4:.*::
#logProxy FileLog:FileLog_Heizung.SZ_Clima:4:.*::
#logProxy FileLog:FileLog_Heizung.Bad_Clima:4:.*::
#logProxy FileLog:FileLog_Heizung.WZ.A_Clima:4:.*::
#logProxy FileLog:FileLog_Heizung.WZ.B_Clima:4:.*::
#logProxy FileLog:FileLog_Heizung.WZ.C_Clima:4:.*::

plot "<IN>" using 1:2 axes x1y2 title 'Line 1' ls l0 lw 1 with lines


Das FileLog schaut so aus:
./log/Heizung.WZ.C-%Y.log Heizung.WZ.C_Clima:T:.*

Sonst noch was?

Danke für deine Hilfe!

justme1968

hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

olli84

Sorry und Danke :)

SVG:

logProxy:SVG_FileLog_Heizung.WZ.C_1:FileLog_Heizung.WZ.C

justme1968

auf die schnelle sind mir nur zwei dinge aufgefallen:

- mach mal bitte aus dem SVG device ein:logProxy:SVG_FileLog_Heizung.WZ.C_1:CURRENT

- ansonten brauch dein plot file natürlich für jede #logProxy zeile auch eine zugehörige plot zeile.

wenn das noch nicht hilft bitte mal verbose 5 einschalten und schauen was im log steht.

gruss
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

olli84

#68
Dann ist mein Plot leer und folgendes steht mit verbose 5 in der log

2014.10.26 07:29:55 4: Connection accepted from FHEMWEB:193.197.148.126:3627
2014.10.26 07:29:55 4: HTTP FHEMWEB:193.197.148.126:3627 GET /fhem/SVG_showLog?dev=SVG_FileLog_Heizung.WZ.C_1&logdev=logProxy&gplotfile=SVG_FileLog_Heizung.WZ.C_1&logfile=CURRENT&pos=
2014.10.26 07:29:55 5: plotcommand: get logProxy CURRENT INT 2014-10-26_00:00:00 2014-10-27_00:00:01
2014.10.26 07:29:55 5: Cmd: >get logProxy CURRENT INT 2014-10-26_00:00:00 2014-10-27_00:00:01<
2014.10.26 07:29:55 1: PERL WARNING: Use of uninitialized value in hash element at fhem.pl line 1494.
2014.10.26 07:29:55 4: /fhem/SVG_showLog?dev=SVG_FileLog_Heizung.WZ.C_1&logdev=logProxy&gplotfile=SVG_FileLog_Heizung.WZ.C_1&logfile=CURRENT&pos= / RL:21 / image/svg+xml / Content-Encoding: gzip


kurz danach finde ich in der Weboberfläche nicht mal mehr mein Plot. Das ist einfach verschwunden. Im Log steht dafür folgendes:

2014.10.26 07:36:42 1: Error: logProxy has no TYPE
2014.10.26 07:36:42 1: Error: logProxy has no TYPE
2014.10.26 07:36:42 1: Error: logProxy has no TYPE
2014.10.26 07:36:42 1: Error: logProxy has no TYPE
2014.10.26 07:36:42 1: Error: logProxy has no TYPE
2014.10.26 07:36:42 1: Error: logProxy has no TYPE
2014.10.26 07:36:42 1: Error: logProxy has no TYPE
2014.10.26 07:36:42 1: Error: logProxy has no TYPE
2014.10.26 07:36:42 1: Error: logProxy has no TYPE
2014.10.26 07:36:42 1: Error: logProxy has no TYPE
2014.10.26 07:36:42 1: Error: logProxy has no TYPE
2014.10.26 07:36:42 1: Error: logProxy has no TYPE

justme1968

häng mal bitte eine abgespeckte config und alle relevanten log und plot files direkt als attacent hier an damit es ich nachstellen kann.

ich glaube irgendwo ist nur ein name falsch.

gruß
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

frank

ZitatlogProxy:SVG_FileLog_Heizung.WZ.C_1:FileLog_Heizung.WZ.C
für "logProxy" musst du natürlich den namen deines logproxy devices eingeben. also "lp", weil du es so genannt hast:

define lp logProxy
FHEM: 6.0(SVN) => Pi3(buster)
IO: CUL433|CUL868|HMLAN|HMUSB2|HMUART
CUL_HM: CC-TC|CC-VD|SEC-SD|SEC-SC|SEC-RHS|Sw1PBU-FM|Sw1-FM|Dim1TPBU-FM|Dim1T-FM|ES-PMSw1-Pl
IT: ITZ500|ITT1500|ITR1500|GRR3500
WebUI [HMdeviceTools.js (hm.js)]: https://forum.fhem.de/index.php/topic,106959.0.html

justme1968

hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

olli84


maxritti

Hallo zusammen,

bei mir im Log ist mir gerade eine der schon tausendfach angesprochenen Perl Warnungen aufgefallen.

Und zwar erhalte ich, wenn ich im FHEMWEB mein logProxy Device öffne folgenden Stacktrace:

2014.11.07 11:15:07.684 1: PERL WARNING: Use of uninitialized value $outf in string eq at ./FHEM/98_logProxy.pm line 398.
2014.11.07 11:15:07.685 3: stacktrace:
2014.11.07 11:15:07.685 3:     main::__ANON__                      called by ./FHEM/98_logProxy.pm (398)
2014.11.07 11:15:07.685 3:     main::logProxy_Get                  called by fhem.pl (2923)
2014.11.07 11:15:07.685 3:     main::CallFn                        called by fhem.pl (1502)
2014.11.07 11:15:07.686 3:     main::CommandGet                    called by fhem.pl (2100)
2014.11.07 11:15:07.686 3:     main::getAllGets                    called by ./FHEM/01_FHEMWEB.pm (1002)
2014.11.07 11:15:07.686 3:     main::FW_doDetail                   called by ./FHEM/01_FHEMWEB.pm (737)
2014.11.07 11:15:07.686 3:     main::FW_answerCall                 called by ./FHEM/01_FHEMWEB.pm (393)
2014.11.07 11:15:07.687 3:     main::FW_Read                       called by fhem.pl (2923)
2014.11.07 11:15:07.687 3:     main::CallFn                        called by fhem.pl (598)


Daraufhin habe ich in dem logProxy Modul mal ein wenig geschaut und bin für mich zu folgender Änderung gekommen.

Derzeitige Stand ab Zeile 398:

  if($outf eq "INT") {
    $outf = "-";
    $internal = 1;
  }


Ich habe dnn einfach mal das $outf abgefragt, ob dies definiert ist.

  if (defined $outf) {
    if($outf eq "INT") {
      $outf = "-";
      $internal = 1;
    }
  }


Scheint bei mir auch soweit zu klappen, denn die Warnung und der Stacktrace sind weg und die Plots sehen gut aus.

Kannst Du das mal prüfen, ob das allgemein in Dein Modul mit aufgenommen werden kann/sollte?

Eventuell klappt der Patch hier?

398,400c398,402
<   if($outf eq "INT") {
<     $outf = "-";
<     $internal = 1;
---
>   if (defined $outf) {
>     if($outf eq "INT") {
>       $outf = "-";
>       $internal = 1;
>     }

justme1968

bitte zeig mir mal die sog definition und das gplot file. ich meine das $outf normalerweise nicht undef sein kann.

ich baue die prüfung aber ein. eventuell ist ein hinweis auf die ursache sinnvoll.

gruss
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968