dblog und gplot von HM Bewegungsmelder sinnvoll darstellen

Begonnen von fhem-challenge, 05 Januar 2017, 14:14:20

Vorheriges Thema - Nächstes Thema

fhem-challenge

Guten Tag,

ich habe ein etwas ominöses Problem. Ich habe etliche HM Bewegungsmelder im Haus und möchte dieses via gplot sinnvoll darstellen.

Das gelingt seit langer Zeit auch (fast) problemlos (siehe Bild).

Das Problem: ich nutze dblog (history) und habe beim gplot das Problem, dass ich natürlich die "motion" sowie "noMotion" Ereignisse der HM Bewegungsmelder in Zahlen umwandeln muss. Die HM Bewegungsmelder schicken ja ein "motion" bei Bewegungserkennung, sowie nach 2 Minuten ein "noMotion" automatisch. Das selbst ist nicht das Problem, nur benötige ich im gplot NUR! die "motion" Events und natürlich nicht die "noMotion" Events.

Ich bekomme es schlicht nicht hin, das lediglich die "motion" Events im gplot berücksichtigt werden.

Was mache ich falsch ?


Auszug aus dblog für den HM Bewegungsmelder:

---------------------------------------------------------------------
TIMESTAMP               DEVICE         TYPE    EVENT READING VALUE
---------------------------------------------------------------------

2017-01-05_10:35:13|move.i.HM.Wohnzimmer|CUL_HM|motion|state|motion|
2017-01-05_10:37:09|move.i.HM.Wohnzimmer|CUL_HM|noMotion|state|noMotion|



Das gplot File: Insbesondere die Zeile: #dblog move.i.HM.Wohnzimmer:state:::$val=~s/noMotion//eg,$val=8*0.69

# Created by FHEM/98_SVG.pm, 2016-08-09 14:45: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 'Bewegungen innen'
set ytics
set y2tics
set grid
set ylabel ""
set y2label ""
set yrange [0:6.7]

#dblog move.i.HM.Hausflur:state:::$val=~s/.*/0/eg,$val=$val+9*0.69
#dblog move.i.HM.Wohnzimmer:state:::$val=~s/noMotion//eg,$val=8*0.69
#dblog move.i.HM.1OG:state:::$val=~s/.*/0/eg,$val=$val+7*0.69
#dblog move.i.HM.Keller:state:::$val=~s/.*/0/eg,$val=$val+6*0.69
#dblog move.i.ow.Garage:reading:::$val=~s/.*/0/eg,$val=$val+5*0.69
#dblog move.i.it.beliebig:state:::$val=~s/.*/0/eg,$val=$val+4*0.69
#dblog move.i.it.hausflur:state:::$val=~s/.*/0/eg,$val=$val+3*0.69

plot "<IN>" using 1:2 axes x1y1 title 'Hausflur' ls l1 lw 1 with points,\
     "<IN>" using 1:2 axes x1y1 title 'Wohnzimmer' ls l0 lw 1 with points,\
     "<IN>" using 1:2 axes x1y1 title '1.OG' ls l2 lw 1 with points,\
     "<IN>" using 1:2 axes x1y1 title 'Keller' ls l8 lw 1 with points,\
     "<IN>" using 1:2 axes x1y1 title 'Garage' ls l3 lw 1 with points,\
     "<IN>" using 1:2 axes x1y1 title 'Beliebig' ls l4 lw 1 with points,\
     "<IN>" using 1:2 axes x1y1 title 'Hausflur IT' ls l5 lw 1 with points
   

Die im gplot verarbeiteten Werte: Gerade der letzte Wert um 2017-01-05_10:37:09, basiert auf einem "noMotion" im dblog und soll natürlich nicht dargestellt werden.

2017-01-05_07:49:46 5.52
2017-01-05_08:03:48 5.52
2017-01-05_08:05:49 5.52
2017-01-05_08:08:11 5.52
2017-01-05_08:10:11 5.52
2017-01-05_10:35:13 5.52
2017-01-05_10:37:09 5.52
#move.i.HM.Wohnzimmer:state:::$val=~s/.*/"noMotion"/eg,$val=$val+8*0.69


Viele Grüße!

Andreas