logProxy modul zum manipulieren und ergänzen von SVG plots

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

Vorheriges Thema - Nächstes Thema

maxritti

Hi Andre,

gerade zufällig bin ich über Dein Modul gestolpert.
Ich finde das klasse und wollte es "mal eben" einsetzen.
Irgendwie stelle ich mich aber wohl zu doof an.

Ich habe DbLog (das Device heisst myDbLog) und in FHEM u.a. ein Plot, wo der Ertrag meiner PV Anlage ein wenig geglättet angezeigt wird.
In Abhängigkeit der Kurve möchte ich Rollos steueren. Klappt auch wunderbar.

Nun wollte ich die Schwellwerte, wo die Rollos geändert werden als horizontale Linie einzeichnen.
Da kommt logProxy doch gerade Recht dachte ich zumindest ;-)

Also habe ich mal ein LogProxy Device definiert, die gplot Datei vom ersten Chart kopiert, dann den Wert des Rollos mal rausgenommen.
Da kommt dann die Kurve im ersten Screenshot bei raus.

Internals:
   CFGFN
   NAME       myLP
   NR         1019
   STATE      Initialized
   TYPE       logProxy
Attributes:
   verbose    5


Hier die gplot des obersten Charts:


# Created by FHEM/98_SVG.pm, 2014-08-24 10:40:41
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 'Solarlog'
set ytics
set y2tics
set grid
set ylabel "Rollo"
set y2label "PV"
set yrange [0:110]

#DbLog mySL:Pac_avg
#DbLog EG_wz_RO_TerrasseRechts:pct
#DbLog EG_wz_RO_Carport:pct

plot "<IN>" using 1:2 axes x1y2 title 'Pac_avg' ls l5 lw 1 with lines,\
     "<IN>" using 1:2 axes x1y1 title 'Terrasse' ls l1fill lw 1 with steps,\
     "<IN>" using 1:2 axes x1y1 title 'Carport' ls l2fill lw 1 with steps



Und wenn ich das nun richtig lese, muss doch die erste #DbLog Zeile einfach ausgetauscht werden in:

#logProxy DbLog:myDbLog:mySL:Pac_avg

Also komplett in:

# Created by FHEM/98_SVG.pm, 2014-09-04 12:48:34
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 'Solarlog'
set ytics
set y2tics
set grid
set ylabel "Rollo"
set y2label "PV"
set yrange [0:110]

#logProxy DbLog:myDbLog:mySL:Pac_avg

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


Damit sollte doch dann zumindest die Pac Kurve angezeigt werden oder?
Das Chart allerdings bleibt leer. Keine Kurve mehr vom Pac. Schau mal in Screenshot 2.
Verbose habe ich mal auf 5 gesetzt, aber auch das Log sagt nichts.

Und das wo ich noch gar keine Konstante mit eingefügt habe.

Du kannst bestimmt aus der Pistole sagen, was hier falsch läuft oder?

justme1968

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
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

maxritti

Supi.
Ich wusste doch, dass es nur ne Kleinigkeit ist.
Da habe ich mal wieder nicht richtig gelesen.  :o

wkarl

Hallo Andre,

habe eben nochmal logProxy in Verbindung mit
#logProxy Func:logProxy_WeekProfile2Plot("Buero_TC_Climate",$from,$to)
getestet und fhem in der Console gestartet.
Dabei ergibt sich Folgendes in der Console:
Useless use of subtraction (-) in void context at (eval 98) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 98) line 1.
Useless use of subtraction (-) in void context at (eval 98) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 98) line 1.
Useless use of a constant ("humidity") in void context at (eval 98) line 1.
Useless use of a constant ("%.1f %") in void context at (eval 98) line 1.
Useless use of a constant ("actuator") in void context at (eval 98) line 1.
Useless use of subtraction (-) in void context at (eval 100) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 100) line 1.
Useless use of subtraction (-) in void context at (eval 100) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 100) line 1.
Useless use of a constant ("humidity") in void context at (eval 100) line 1.
Useless use of a constant ("%.1f %") in void context at (eval 100) line 1.
Useless use of a constant ("actuator") in void context at (eval 100) line 1.
Useless use of subtraction (-) in void context at (eval 101) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 101) line 1.
Useless use of subtraction (-) in void context at (eval 101) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 101) line 1.
Useless use of a constant ("humidity") in void context at (eval 101) line 1.
Useless use of a constant ("%.1f %") in void context at (eval 101) line 1.
Useless use of a constant ("actuator") in void context at (eval 101) line 1.
Useless use of subtraction (-) in void context at (eval 102) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 102) line 1.
Useless use of subtraction (-) in void context at (eval 102) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 102) line 1.
Useless use of a constant ("humidity") in void context at (eval 102) line 1.
Useless use of a constant ("%.1f %") in void context at (eval 102) line 1.
Useless use of a constant ("actuator") in void context at (eval 102) line 1.
Useless use of subtraction (-) in void context at (eval 103) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 103) line 1.
Useless use of subtraction (-) in void context at (eval 103) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 103) line 1.
Useless use of a constant ("humidity") in void context at (eval 103) line 1.
Useless use of a constant ("%.1f %") in void context at (eval 103) line 1.
Useless use of a constant ("actuator") in void context at (eval 103) line 1.
Useless use of subtraction (-) in void context at (eval 104) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 104) line 1.
Useless use of subtraction (-) in void context at (eval 104) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 104) line 1.
Useless use of a constant ("humidity") in void context at (eval 104) line 1.
Useless use of a constant ("%.1f %") in void context at (eval 104) line 1.
Useless use of a constant ("actuator") in void context at (eval 104) line 1.
Useless use of subtraction (-) in void context at (eval 105) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 105) line 1.
Useless use of subtraction (-) in void context at (eval 105) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 105) line 1.
Useless use of a constant ("humidity") in void context at (eval 105) line 1.
Useless use of a constant ("%.1f %") in void context at (eval 105) line 1.
Useless use of a constant ("actuator") in void context at (eval 105) line 1.
Useless use of subtraction (-) in void context at (eval 106) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 106) line 1.
Useless use of subtraction (-) in void context at (eval 106) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 106) line 1.
Useless use of a constant ("humidity") in void context at (eval 106) line 1.
Useless use of a constant ("%.1f %") in void context at (eval 106) line 1.
Useless use of a constant ("actuator") in void context at (eval 106) line 1.
Missing argument in sprintf at /opt/fhem/FHEM/33_readingsGroup.pm line 612.
Invalid conversion in sprintf: end of string at /opt/fhem/FHEM/33_readingsGroup.pm line 612.
Useless use of subtraction (-) in void context at (eval 109) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 109) line 1.
Useless use of subtraction (-) in void context at (eval 109) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 109) line 1.
Useless use of a constant ("actuator") in void context at (eval 109) line 1.
Useless use of subtraction (-) in void context at (eval 111) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 111) line 1.
Useless use of subtraction (-) in void context at (eval 111) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 111) line 1.
Useless use of a constant ("actuator") in void context at (eval 111) line 1.
Useless use of subtraction (-) in void context at (eval 112) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 112) line 1.
Useless use of subtraction (-) in void context at (eval 112) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 112) line 1.
Useless use of a constant ("actuator") in void context at (eval 112) line 1.
Useless use of subtraction (-) in void context at (eval 113) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 113) line 1.
Useless use of subtraction (-) in void context at (eval 113) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 113) line 1.
Useless use of a constant ("actuator") in void context at (eval 113) line 1.
Useless use of subtraction (-) in void context at (eval 114) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 114) line 1.
Useless use of subtraction (-) in void context at (eval 114) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 114) line 1.
Useless use of a constant ("actuator") in void context at (eval 114) line 1.
Useless use of subtraction (-) in void context at (eval 115) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 115) line 1.
Useless use of subtraction (-) in void context at (eval 115) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 115) line 1.
Useless use of a constant ("actuator") in void context at (eval 115) line 1.
Missing argument in sprintf at /opt/fhem/FHEM/33_readingsGroup.pm line 900.
Invalid conversion in sprintf: end of string at /opt/fhem/FHEM/33_readingsGroup.pm line 900.
Useless use of subtraction (-) in void context at (eval 128) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 128) line 1.
Useless use of subtraction (-) in void context at (eval 128) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 128) line 1.
Useless use of a constant ("humidity") in void context at (eval 128) line 1.
Useless use of a constant ("%.1f %") in void context at (eval 128) line 1.
Useless use of a constant ("actuator") in void context at (eval 128) line 1.
Useless use of subtraction (-) in void context at (eval 129) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 129) line 1.
Useless use of subtraction (-) in void context at (eval 129) line 1.
Useless use of a constant ("%.1f C") in void context at (eval 129) line 1.
Useless use of a constant ("humidity") in void context at (eval 129) line 1.
Useless use of a constant ("%.1f %") in void context at (eval 129) line 1.
Useless use of a constant ("actuator") in void context at (eval 129) line 1.

LG walter
FHEM 5.7 & TabletUI 2.2 auf Fedora22 Server auf NUC5i5RYK
CUL 868 > FAST EnergyCam
HMLAN > HomeMatic TCs & VDs, Bewegungsmelder, Schalter, Taster, Steckdosen

justme1968

ich kann keine meldung vom logProxy sehen. d.h. es gibt zumindest keinen fehler. was steht im fhem log?

gruss
  andre

ps: die readingsGroup meldungen schauen ich mir noch an.
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

wkarl

Hallo Andre,

habe die gplot-Datei vereinfacht, dass keine meiner Kommentare das Ergebnis beeinflußt.
# Created by FHEM/98_SVG.pm, 2013-09-19 12:14:57
set terminal png transparent size <SIZE> crop
set output '<OUT>.png'
set xdata time
set timefmt "%Y-%m-%d_%H:%M:%S"
set xlabel "Zeit [h]"
set title '<TL>'
set ylabel '<L1>'
set y2label '<L2>'
set yrange [0:]
set y2range [0:]
set ytics nomirror
set y2tics
set grid y2tics

#logProxy DbLog:MyDbLog:<SPEC1>:measured-temp::
#logProxy constY:10

plot "<IN>" using 1:2 axes x1y1 title 'IST-Temperatur' ls l3 lw 2 with lines,\
     "<IN>" using 1:2 axes x1y2 title 'Linie 10' ls l5 lw 2 with lines

Das mit der konstanten Linie hat anfänglich funktioniert. Das tut jetzt auch nicht mehr. Habe nochmal die 98_logProxy.pm heruntergeladen und nach FHEM kopiert. Restart fhem. Gleiches Ergebnis - measured-temp wird angezeigt, constY:10 nicht.
Im fhem.log steht:
2014.09.05 11:12:27.790 3: logProxy_Get
2014.09.05 11:12:27.791 4: MyLogProxy: calling get MyDbLog HISTORY INT 2014-09-05_00:00:00 2014-09-06_00:00:01 Buero_TC:measured-temp::
2014.09.05 11:12:30.804 3: logProxy_Get
2014.09.05 11:12:30.804 4: MyLogProxy: calling get MyDbLog HISTORY INT 2014-09-05_00:00:00 2014-09-06_00:00:01 Buero_TC:measured-temp::


ciao walter
FHEM 5.7 & TabletUI 2.2 auf Fedora22 Server auf NUC5i5RYK
CUL 868 > FAST EnergyCam
HMLAN > HomeMatic TCs & VDs, Bewegungsmelder, Schalter, Taster, Steckdosen

justme1968

könnte es sein das du die 10 linie nicht siehst weil sie schwarz ist und genau an der oberen kante des plots verläuft?

was passiert wenn du die gleiche achse wie für die temperatur verwendest? oder wenn du einen range von 0-20 vorgibst.


kannst du auf das 'Linie 10' label im plot klicken? wenn ja was passiert?

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

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

wkarl

Ne, trotzdem ein Fehler von mir - hab mich bei ConstY vertippt! Kleines 'c'. Ok, das funktionert wieder. Teste weiter und melde mich.
FHEM 5.7 & TabletUI 2.2 auf Fedora22 Server auf NUC5i5RYK
CUL 868 > FAST EnergyCam
HMLAN > HomeMatic TCs & VDs, Bewegungsmelder, Schalter, Taster, Steckdosen

justme1968

ich baue eine log meldung ein damit das nicht mehr passieren kann :)

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

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

wkarl

Also, wenn ich
#logProxy Func:logProxy_WeekProfile2Plot("Buero_TC_Climate",$from,$to)
dazu definiere. Kommt folgender Fehler im Browser (siehe screenshot)

In der Console und log taucht nichts auf was Zusätzliches zu dieser Situation liefert.

ciao walter
FHEM 5.7 & TabletUI 2.2 auf Fedora22 Server auf NUC5i5RYK
CUL 868 > FAST EnergyCam
HMLAN > HomeMatic TCs & VDs, Bewegungsmelder, Schalter, Taster, Steckdosen

wkarl

#55
Hallo Andre,

habe mal wieder ein paar Minuten darauf verwendet mein Problem hier zu untersuchen. Dabei bin ich zu folgender Lösung gekommen.

In Deinem einleitenden post gibts Du folgende Anleitung
Zitat#logProxy Func:logProxy_WeekProfile2Plot("myTcClimate",$from,$to)

Dies führt bei mir zu dem beschriebenen Fehler. Verwende ich einfachen Hochkommata
Zitat#logProxy Func:logProxy_WeekProfile2Plot('myTcClimate',$from,$to)
funktioniert die GEschichte.

Ergänzung:
#logProxy DbLog:MyDbLog:<SPEC1>:measured-temp:::
#logProxy DbLog:MyDbLog:<SPEC1>:desired-temp:::
#logProxy DbLog:MyDbLog:<SPEC1>:actuator:::
#logProxy DbLog:MyDbLog:<SPEC1>:humidity:::
#logProxy Func:logProxy_WeekProfile2Plot('<SPEC2>',$from,$to)

Auch das funktioniert - SPEC1 ist das device, SPEC2 der Climate-Channel-

Danke für Deine Unterstützung
walter
FHEM 5.7 & TabletUI 2.2 auf Fedora22 Server auf NUC5i5RYK
CUL 868 > FAST EnergyCam
HMLAN > HomeMatic TCs & VDs, Bewegungsmelder, Schalter, Taster, Steckdosen

justme1968

ich kann mir zwar gerade nicht im geringsten vorstellen wie das sein kann aber schön das es erst mal geht.

hoffentlich komme ich am wochenende oder nächste woche dazu das interpolieren am anfang und ende des plots gegen den plotabriss einzubauen.

dann würde ich diese version posten und wenn es genügend interessenten gibt auch einchecken.

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

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

frank

Zitatdann würde ich diese version posten und wenn es genügend interessenten gibt auch einchecken.
ich bin dafür!  :)

gruss frank
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

Thomas_Homepilot

Hallo,

habe gerade mal dein Modul ausprobiert, um meine Plots ab Anfang zu ergänzen (mit extend). Die Plots werden jetzt allerdings über den Rand gezeichnet. Ich gehe davon aus, dass Du dieses Verhalten mit
ZitatTODO: plot am fenster clipen und nicht drüber hinaus zeichen
meinst. Bist Du hier schon weitergekommen? Ansonsten liefert Dein Modul eine Menge Möglichkeiten, die ich vorher vermisst hab. Vielen Dank!

Gruß
Thomas
Rock64, RasPi mit AddOn-Board
Devices: Homematic, LaCrosse, SMLUSB, OneWire, Viessmann, Dect200, ZWave, PCA301, Zigbee

justme1968

ja. genau das habe ich damit gemeint.

ich weiss schon wie aber es ist noch nicht fertig. wenn der harmony hub läuft kommt logProxy wieder dran.

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

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