Darstellung eines Stati bei 85-90 (von range 10-90) ?

Begonnen von M_I_B, 17 Juli 2016, 15:37:11

Vorheriges Thema - Nächstes Thema

M_I_B

Hallo liebe Leute,

vermutlich geht das gar nicht und ich beiße mir hier für nix die Zähne aus, aber ich frage mal lieber...

In einem Plot werden drei Temperaturen dargestellt. Die Skalierung ist festgelegt auf 10-90. Nun wollte ich in diesen Plot zusätzlich den Schaltzustand zweier Aktoren einbringen, welche ich aber im Bereich 85-87 (Aktor 1) und 88-90 (Aktor 2) unterbringen möchte, damit diese Darstellung den Rest nicht "verschandelt" und es übersichtlicher bleibt. Und genau das bekomme ich nicht hin. Ich lese "pct" aus, welcher 0 oder 100 darstellt (level ginge auch oder state mit on/off). Also habe ich 100 den Wert 87 resp 90 und 0 85 resp 88 zugewiesen... nö... klappt nicht. Die Darstellung beginnt immer bei 10 und nicht bei 85/88.

Logfile- Ausschnitt:
2016-07-17_15:07:39 HM4SW9_2 pct: 0
2016-07-17_15:07:39 HM4SW9_3 pct: 0
2016-07-17_15:07:40 HM4SW9_2 pct: 0
2016-07-17_15:07:41 HM4SW9_1 pct: 0
2016-07-17_15:07:41 HM4SW9_4 pct: 0
2016-07-17_15:07:43 HM4SW9_2 pct: 100
2016-07-17_15:07:43 HM4SW9_1 pct: 100
2016-07-17_15:07:55 HM4SW9_3 pct: 100
2016-07-17_15:08:03 HM4SW9_4 pct: 100
2016-07-17_15:11:26 HM4SW9_1 pct: 0
2016-07-17_15:11:27 HM4SW9_2 pct: 0

gplot- Datei:
# Created by FHEM/98_SVG.pm, 2016-07-06 00:45: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 '<L1>'
set ytics
set y2tics
set grid y2tics
set ylabel ""
set y2label "Temperature"
set y2range [10:90]

#HM2TH1_log 4:HM2TH1_1.temperature\x3a::
#HM2TH1_log 4:HM2TH1_2.temperature\x3a::
#HM2TH3_log 4:HM2TH3_1.temperature\x3a::
#HM4SW9_log 4:HM4SW9_1.pct\x3a::$fld[3]=~"0"?87:85
#HM4SW9_log 4:HM4SW9_2.pct\x3a::$fld[3]=~"0"?90:88

plot "<IN>" using 1:2 axes x1y2 title 'VL' ls l0 lw 2 with lines,\
"<IN>" using 1:2 axes x1y2 title 'RL' ls l1 lw 2 with lines,\
"<IN>" using 1:2 axes x1y2 title 'SP' ls l6fill lw 1 with lines,\
"<IN>" using 1:2 axes x1y2 title 'BR' ls l4fill lw 1 with ibars,\
"<IN>" using 1:2 axes x1y2 title 'HZ' ls l5fill lw 1 with ibars


FRage ist also, ob das überhaupt geht und wenn ja, was ich anstellen muss?

rudolfkoenig

Ich wuerde fuer diesen Zweck beide Achsen verwenden.

M_I_B

... jupp, habe ich auch schon versucht ... Gleiches Ergebnis ...
Da dieses Vorhaben mit "lines" funktioniert und nur bei den "bars" Varianten immer von unten dargestellt wird, vermute ich mal dumpf, das es mit "bars" und/oder "...fill" nicht funktioniert.

Bis ich, oder eher ein Könner eine Lösung gefunden hat, lasse ich es erst einmal bei "lines" ...

rudolfkoenig

Bin zunehmend verwirrt.

$fld[3]=~"0"?87:85 ist uebrigens "unkonventionell".
Bedeutet, das der Wert 87 ist, falls es vorher ein 0 Ziffer enthalten hat, sonst 85.

M_I_B

ZitatBin zunehmend verwirrt.
;D ;D ;D Glaube ich gerne ;) Überseh' es einfach... Da steht real eine "100" (mitten während einer Umstrick-Test-Aktion rauskopiert)

#HM4SW9_log 4:HM4SW9_1.pct\x3a::$fld[3]=~"100"?85:83
#HM4SW9_log 4:HM4SW9_2.pct\x3a::$fld[3]=~"100"?82:80

rudolfkoenig

Du kannst mit "Show preprocessed input" pruefen, ob das an Werten bei SVG ankommt, was Du dir vorstellst.

M_I_B

... Dank für den Hinweis; das hat geholfen festzustellen, das es mit "lines" geht und mit allem anderen nicht (was meine Vermutung bestätigt)...

Inzwischen habe ich etwas umgebaut, da es mich störte, das bei "lines" halt nicht der letzte Status weiter gezeichnet wird. Also schreibe ich die Stati der 4 Aktoren alle (derzeit) 60 Sekunden in einen Dummy und logge den Dummy. Ist zwar nicht schön, aber wenn ein Plot eine Statianzeige in der gewünschten Form nicht nativ hergibt, dann geht es halt nur so; oder irre ich mich?
Hier mal aktueller Stand:

Zusammenbauen der Daten aus den 4 Aktoren und Schreiben in den Dummy:
define HM4SW9dy_set DOIF ([+60]) (set HM4SW9dy [HM4SW9_1] [HM4SW9_2] [HM4SW9_3] [HM4SW9_4])
attr HM4SW9dy_set do always


der Ziel- Dummy:
define HM4SW9dy dummy
attr HM4SW9dy devStateIcon .*:noIcon
attr HM4SW9dy room KG.Heizung


Dort steht dann z.B.:
state      on off on off         2016-07-17 20:24:44

Der Logfile- Auszug dazu:
2016-07-17_20:23:44 HM4SW9dy on off on off
2016-07-17_20:24:43 HM4SW9dy on off on off
2016-07-17_20:25:44 HM4SW9dy on off on off
2016-07-17_20:26:44 HM4SW9dy on off on off


Und das gplot:
#HM2TH1_log 4:HM2TH1_1.temperature\x3a::
#HM2TH1_log 4:HM2TH1_2.temperature\x3a::
#HM2TH3_log 4:HM2TH3_1.temperature\x3a::
#HM4SW9dy_log 3:HM4SW9dy::$fld[2]=~"on"?85:83
#HM4SW9dy_log 4:HM4SW9dy::$fld[3]=~"on"?82:80

plot "<IN>" using 1:2 axes x1y2 title 'VL' ls l0 lw 2 with lines,\
"<IN>" using 1:2 axes x1y2 title 'RL' ls l1 lw 2 with lines,\
"<IN>" using 1:2 axes x1y2 title 'SP' ls l6fill lw 1 with lines,\
"<IN>" using 1:2 axes x1y2 title 'BR' ls l6 lw 2 with steps,\
"<IN>" using 1:2 axes x1y2 title 'HZ' ls l7 lw 2 with steps