SVG Plot mit Einträgen in der Legende aber ohne Grafik

Begonnen von skamm71, 26 Oktober 2023, 17:50:07

Vorheriges Thema - Nächstes Thema

skamm71

Guten Abend

Ich bin da sehr neu und habe durch einen Kollegen grundsätzlich meine PV ins FHEM bekommen.
Nun habe ich eine schicke Grafik mit den Werten die ich auslesen und anzeigen will, aber ich möchte zusätzlich noch Werte ausschließlich in der Legende anzeigen.
Soweit funktioniert das auch, allerdings kann ich die Schriftfarbe nicht ändern. Die bleibt auf hellgrau (schlecht lesbar). Ich hätte sie gerne in schwarz.

Geht um die letzten vier Zeilen...

# Created by FHEM/98_SVG.pm, 2023-10-26 17:23:37
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 'Photvoltaik overview'
set ytics
set y2tics
set grid
set ylabel ""
set y2label ""

#Filelog_Solar 4:myEss./essinfo/common/LOAD/load_power\x3a::
#Filelog_Solar 4:myEss./essinfo/home/statistics/pcs_pv_total_power\x3a::
#Filelog_Solar 4:myEss./essinfo/common/PV/pv1_power\x3a::
#Filelog_Solar 4:myEss./essinfo/common/PV/pv2_power\x3a::
#Filelog_Solar 4:myEss./essinfo/home/statistics/grid_power\x3a::
#Filelog_Solar 4:myEss./essinfo/home/statistics/batconv_power\x3a::
#Filelog_Solar 4:myEss./essinfo/home/statistics/load_power\x3a::
#Filelog_Solar 4:myEss./essinfo/common/BATT/soc\x3a::
#Filelog_Solar 4:myEss.user_soc\x3a::
#Filelog_Solar 4:/essinfo/common/GRID/today_grid_feed_in_energy\x3a::
#Filelog_Solar 4:/essinfo/common/GRID/today_grid_power_purchase_energy\x3a::
#Filelog_Solar 4:/essinfo/common/PCS/today_pv_generation_sum\x3a::
#Filelog_Solar 4:/essinfo/common/LOAD/today_load_consumption_sum\x3a::
#Filelog_Solar 4:myEss./essinfo/common/LOAD/load_power\x3a::

plot "<IN>" using 1:2 axes x1y2 title 'overall consumption (W), current: <L7>W' ls l0 lw 1.5 with lines,\
     "<IN>" using 1:2 axes x1y2 title 'overall generation  (W), current: <L2>W' ls l1 lw 1.5 with lines,\
     "<IN>" using 1:2 axes x1y2 title 'generation east side (W), current: <L3>W' ls l2 lw 0.5 with lines,\
     "<IN>" using 1:2 axes x1y2 title 'generation west side (W), current: <L4>W' ls l3 lw 0.5 with lines,\
     "<IN>" using 1:2 axes x1y2 title 'grid transfer in/out (W), current: <L5>W' ls l4 lw 1.5 with lines,\
     "<IN>" using 1:2 axes x1y2 title 'battery transfer in/out (W), current: <L6>W' ls l5 lw 1.5 with lines,\
     "<IN>" using 1:2 axes x1y2 notitle ls l0 lw 1 with lines,\
     "<IN>" using 1:2 axes x1y2 notitle ls l0 lw 1 with lines,\
     "<IN>" using 1:2 axes x1y2 title 'battery load (%), current: <L8>%' ls l6 lw 2.5 with lines,\
     "<IN>" using 1:2 axes x1y2 notitle ls l6 lw 1 with lines,\
     "<IN>" title 'todays grid feed: <L10>W' ls l5,\
     "<IN>" title 'todays grid purchase: <L11>W' ls l5,\
     "<IN>" title 'todays overall pv generation: <L12>W' ls l5,\
     "<IN>" title 'todays overall power consumption: <L13>W' ls l5

rudolfkoenig

Einfach: anderes Hintergrund (z.Bsp. default) oder LinienStyle (nicht ls 5) nutzen.
Aufwendiger: svg_style.css anpassen/erweitern, und die Datei vom Ueberschreiben beim update schuetzen.
Oder gleich einen eigenen Style anlegen.

skamm71

So Problem gelöst.
Vielleicht etwas "russisch" aber es tut was es soll.
Wir haben eine Variable angelegt die immer den Wert "0" hat und somit nicht auftaucht in der Grafik.

Und dann im gplot file so:

# Created by FHEM/98_SVG.pm, 2023-10-26 17:23:37
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 'Photvoltaik overview'
set ytics
set y2tics
set grid
set ylabel ""
set y2label ""

#Filelog_Solar 4:myEss./essinfo/common/LOAD/load_power\x3a::
#Filelog_Solar 4:myEss./essinfo/home/statistics/pcs_pv_total_power\x3a::
#Filelog_Solar 4:myEss./essinfo/common/PV/pv1_power\x3a::
#Filelog_Solar 4:myEss./essinfo/common/PV/pv2_power\x3a::
#Filelog_Solar 4:myEss./essinfo/home/statistics/grid_power\x3a::
#Filelog_Solar 4:myEss./essinfo/home/statistics/batconv_power\x3a::
#Filelog_Solar 4:myEss./essinfo/home/statistics/load_power\x3a::
#Filelog_Solar 4:myEss./essinfo/common/BATT/soc\x3a::
#Filelog_Solar 4:myEss.user_soc\x3a::
#Filelog_Solar 4:myEss.user_null\x3a::
#Filelog_Solar 4:myEss.user_null\x3a::
#Filelog_Solar 4:myEss.user_null\x3a::
#Filelog_Solar 4:myEss.user_null\x3a::
#Filelog_Solar 4:/essinfo/common/GRID/today_grid_feed_in_energy\x3a::
#Filelog_Solar 4:/essinfo/common/GRID/today_grid_power_purchase_energy\x3a::
#Filelog_Solar 4:/essinfo/common/PCS/today_pv_generation_sum\x3a::
#Filelog_Solar 4:/essinfo/common/LOAD/today_load_consumption_sum\x3a::
#Filelog_Solar 4:myEss./essinfo/common/LOAD/load_power\x3a::
#Filelog_Solar 4:myEss.user_null\x3a::


plot "<IN>" using 1:2 axes x1y2 title 'overall consumption (W), current: <L7> W' ls l0 lw 1.5 with lines,\
     "<IN>" using 1:2 axes x1y2 title 'overall generation  (W), current: <L2> W' ls l1 lw 1.5 with lines,\
     "<IN>" using 1:2 axes x1y2 title 'generation east side (W), current: <L3> W' ls l2 lw 0.5 with lines,\
     "<IN>" using 1:2 axes x1y2 title 'generation west side (W), current: <L4> W' ls l3 lw 0.5 with lines,\
     "<IN>" using 1:2 axes x1y2 title 'grid transfer in/out (W), current: <L5> W' ls l4 lw 1.5 with lines,\
     "<IN>" using 1:2 axes x1y2 title 'battery transfer in/out (W), current: <L6>W' ls l5 lw 1.5 with lines,\
     "<IN>" using 1:2 axes x1y2 notitle ls l0 lw 1 with lines,\
     "<IN>" using 1:2 axes x1y2 notitle ls l0 lw 1 with lines,\
     "<IN>" using 1:2 axes x1y2 title 'battery load (%), current: <L8> %' ls l6 lw 2.5 with lines,\
     "<IN>" using 1:2 axes x1y2 notitle ls l6 lw 1 with lines,\
     "<IN>" using 1:2 axes x1y2 title 'todays grid feed: <L14> Wh' ls l5 lw 0.0 with lines,\
     "<IN>" using 1:2 axes x1y2 title 'todays grid purchase: <L15> Wh' ls l5 lw 0.0 with lines,\
     "<IN>" using 1:2 axes x1y2 title 'todays overall pv generation: <L16> Wh' ls l5 lw 0.0 with lines,\
     "<IN>" using 1:2 axes x1y2 title 'todays overall power consumption: <L17> Wh' ls l5 lw 0.0 with lines