how to create a gplot for the keymatic

Begonnen von alex, 17 November 2014, 16:45:04

Vorheriges Thema - Nächstes Thema

alex

Hello,

I have installed the keymatic from Homematic and now I would like to create a plot which displays when the door is locked or unlocked. I tried the following gplot syntax but it doesn't show the correct information. And now I'm using two FileLog entries, but I think I need to use only one if I would like to display the locked/unlocked status by lines or bars.
Who can point me in the right direction?

Thanks,
Alex

---
# Created by FHEM/98_SVG.pm, 2014-11-17 16:39:40
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 ("locked" 1.5, "unlocked" 0.3)
set y2tics ("locked" 0.3, "unlocked" 1.5)
set grid
set ylabel "Status"
set y2label "Status"
set yrange [-0.1:2]
set y2range [-0.1:2]

#FileLog 3:key.washok.lock\x3a:0:$fld[3]=~"locked"?1.5:-0.2
#FileLog 3:key.washok.lock\x3a:0:$fld[3]=~"unlocked"?0.3:-1

plot "<IN>" using 1:2 axes x1y1 title 'Locked' ls l0fill lw 2 with points,\
     "<IN>" using 1:2 axes x1y2 title 'Unlocked' ls l1fill lw 2 with points
----

rudolfkoenig

I strongly recommend using the Plot-Editor by creating a new plot from the FileLog Detail-View in FHEMWEB.

alex

I thought I started from there creating the SVG plot.
Anyway, I created a new plot from the FileLog screen with the command 'Create SVG Plot'. From there I started entering the details but I still don't get the result that I want and that is:
A simple line in time that shows the different possible status of the keymatic: locked, unlocked, locked (uncertain), unlocked (uncertain).
Even trying to get only the 'locked' status in a plot result in some strange behaviour as it seems that is also includes the 'unlocked' lines:

With below logfile and gplot the graph shows 3 dots on 20.03, 20.44 and 20.57 while it should show the dot at 20.03.
What am I doing wrong?
(and yes, I've updated fhem to the latest version


Logfile:
---
2014-11-18_20:03:45 key.washok battery: ok
2014-11-18_20:03:45 key.washok uncertain: no
2014-11-18_20:03:45 key.washok direction: none
2014-11-18_20:03:45 key.washok error: none
2014-11-18_20:03:45 key.washok lock: unlocked
2014-11-18_20:03:45 key.washok unlocked
2014-11-18_20:44:13 key.washok set_lock
2014-11-18_20:44:14 key.washok aesKeyNbr: 00
2014-11-18_20:44:15 key.washok battery: ok
2014-11-18_20:44:15 key.washok uncertain: yes
2014-11-18_20:44:15 key.washok direction: down
2014-11-18_20:44:15 key.washok error: none
2014-11-18_20:44:15 key.washok lock: unlocked
2014-11-18_20:44:15 key.washok unlocked (uncertain)
2014-11-18_20:44:23 key.washok battery: ok
2014-11-18_20:44:23 key.washok uncertain: no
2014-11-18_20:44:23 key.washok direction: none
2014-11-18_20:44:23 key.washok error: none
2014-11-18_20:44:23 key.washok lock: locked
2014-11-18_20:44:23 key.washok locked
2014-11-18_20:57:29 key.washok battery: ok
2014-11-18_20:57:29 key.washok uncertain: no
2014-11-18_20:57:29 key.washok direction: none
2014-11-18_20:57:29 key.washok error: none
2014-11-18_20:57:29 key.washok lock: locked
2014-11-18_20:57:29 key.washok locked
---

Gplot file:
---
# Created by FHEM/98_SVG.pm, 2014-11-18 21:00:07
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 '<TL>'
set ytics ("locked" 1.5, "unlocked" 0.3)
set y2tics
set grid
set ylabel "Status"
set y2label "Temperature"
set yrange [-0.1:2]

#FileLog 3:key.washok.lock\x3a::$fld[3]=~"locked"?1.5:0

plot "<IN>" using 1:2 axes x1y1 title 'Line 1' ls l0 lw 1 with points
---



rudolfkoenig

$fld[3]=~"locked" will also match "unlocked".
You probably should use $fld[3]=~"^locked"

alex

How simple can it be  :D Thanks, that part works now.
And I started directly to study a bit more on the rexexp possibilities.

Alex