Hauptmenü

Berechnung im Plotfile

Begonnen von ingo46, 28 November 2022, 15:30:23

Vorheriges Thema - Nächstes Thema

ingo46

Hallo,

meine .gplot-Datei sieht so aus:

#FileLog_StromZaehler 4:ESPEasy_Strom.*:0:$fld[3]=$fld[3]*0.1
#FileLog_StromZaehler 8:ESPEasy_Strom.*:0:delta-h
#FileLog_StromZaehler 8:ESPEasy_Strom.*:0:delta-d

plot "<IN>" using 1:2 axes x1y1 title '10 min Verbrauch ' ls l4 lw 0.5 with lines,\
      "<IN>" using 1:2 axes x1y1 title 'Strom/h' ls l1fill lw 0.5 with bars,\
      "<IN>" using 1:2 axes x1y2 title 'Strom/Tag' ls l2dot lw 2 with histeps


Für die Ausgabe in KWh müssten die Werte von delta-h und delta-d jeweils durch 100 geteilt werden.

Wie mache ich das

Ingo

JoWiemann

Hallo Ingo,

im Wiki findet sich folgender Eintrag: https://wiki.fhem.de/wiki/Creating_Plots#FileLog_objects

mit folgendem Abschnitt:

So you can do something like attr <weblink> title "Min $data{min1}, Max $data{max1}, Last $data{currval1}" Also implemented in this function is code which operates on the data retrieved. This can be specified at the "<fn>" tag. Up till now following functions are impemented:

int (to cut off % from a number, as for the actuator)
delta-h / delta-d to get rain/h and rain/d values from continuous data
And then there is this: the string is evaluated as a perl expression. @fld is the current line splitted by spaces (0-based). So you can do something like $fld[3]/1000 to plot values divided by 1000 or $fld[3]=~"on"?0.9:0.8 to map the 4th field which contains an on/off information into numerical values to be plotted in a graph. Be warned though: this string/perl expression cannot (!) contain any spaces.
For even more details see commandref/FileLog or the module 92_FileLog.pm.

Grüße Jörg
Jörg Wiemann

Slave: RPi B+ mit 512 MB, COC (868 MHz), CUL V3 (433.92MHz SlowRF); FHEMduino, Aktuelles FHEM

Master: CubieTruck; Debian; Aktuelles FHEM

ingo46

Hallo Jörg,

ich habe mir alles durchgelesen - kann aber mein Problem trotzdem noch nicht lösen.

Ingo