[FHZ] FileLog/weblink hints case-insensitive?

Begonnen von Guest, 05 Februar 2010, 00:49:55

Vorheriges Thema - Nächstes Thema

Guest

Originally posted by: <email address deleted>

Hi,

running CUL_WS (actually: EnvSens; will upload later) that writes temperature
& humidity READINGS (and does notify for 'em), I get the following logfile
entries:

2010-02-05_00:37:09 Terrarium_TH T: 23.1  H: 51.4
2010-02-05_00:37:09 Terrarium_TH temperature: 23.1
2010-02-05_00:37:09 Terrarium_TH humidity: 51.4

fhem.cfg says:

define Terrarium_TH EnvSens 5
attr Terrarium_TH room Terrarium

define FileLog_Terrarium_TH FileLog /var/log/fhem/Terrarium_TH-%Y.log Terrarium_TH
attr FileLog_Terrarium_TH logtype hms:Temp/Hum,text
attr FileLog_Terrarium_TH room Wohnen

define weblink_Terrarium_TH weblink fileplot FileLog_Terrarium_TH:hms:CURRENT
attr weblink_Terrarium_TH label "Terrarium_TH Min $data{min1}, Max $data{max1}, Last $data{currval1}"
attr weblink_Terrarium_TH room Wohnen

The created image looks rather strange (see attachment); that seems to be
because the T:&H: lines are not separated from the others anymore, somehow
the temperature data get's intermixed with humidity values.

 From examining the code, I suspect (but haven't found proof) that is has to
do with the pattern matching done in, I think, 01_FHEMWEB.pm. If I change the
following lines in hms.gplot, the image is drawn correctly:

-#FileLog 4:T:0:
-#FileLog 6:H:0:
+#FileLog 4:temperature:0:
+#FileLog 4:humidity:0:

As this did not happen before I made CUL_WS write temperature and humidity
entries as well, something else seems to be broken here. Anyone any idea
on how to fix this/debug it further?
         kai

--
You received this message because you are subscribed to the Google Groups "FHEM users" group.
To post to this group, send email to fhem-users@googlegroups.com.
To unsubscribe from this group, send email to fhem-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/fhem-users?hl=en.

Guest

Originally posted by: <email address deleted>

Kai 'wusel' Siering wrote:
 > Hi,
 >
 > The created image looks rather strange (see attachment); that seems to be

Fsck!

Firefox plugin didn't capture the SVG image :( Oh, here we go again,
by other means ... Sorry,
         kai

--
You received this message because you are subscribed to the Google Groups "FHEM users" group.
To post to this group, send email to fhem-users@googlegroups.com.
To unsubscribe from this group, send email to fhem-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/fhem-users?hl=en.

rudolfkoenig

                                                   

> 2010-02-05_00:37:09 Terrarium_TH T: 23.1  H: 51.4
> 2010-02-05_00:37:09 Terrarium_TH temperature: 23.1
> 2010-02-05_00:37:09 Terrarium_TH humidity: 51.4

[...]

> -#FileLog 4:T:0:  

This means: "extract the 4'th field in each line which contains T, and return 0
if there are no such lines". You could try to replace both lines with:

#FileLog 4:\sT\x3a:0:  
#FileLog 6:\sT\x3a:0:

(not tested)

--
You received this message because you are subscribed to the Google Groups "FHEM users" group.
To post to this group, send email to fhem-users@googlegroups.com.
To unsubscribe from this group, send email to fhem-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/fhem-users?hl=en.

Guest

Originally posted by: <email address deleted>

Rudolf Koenig wrote:
>> 2010-02-05_00:37:09 Terrarium_TH T: 23.1  H: 51.4
>> 2010-02-05_00:37:09 Terrarium_TH temperature: 23.1
>> 2010-02-05_00:37:09 Terrarium_TH humidity: 51.4
>
> [...]
>
>> -#FileLog 4:T:0:  
>
> This means: "extract the 4'th field in each line which contains T, and return 0
> if there are no such lines". You could try to replace both lines with:

Does that mean that the awk lines later on aren't used, at least with SVG? (I
still haven't grokked that ;))

| plot \
|   "< awk '/T:/ {print $1, $4}' "\
|      using 1:2 axes x1y2 title 'Measured temperature' with lines lw 2,\
|   "< awk '/H:/ {print $1, $6}' "\
|      using 1:2 axes x1y1 title 'Humidity (%)' with lines lw 1\


> #FileLog 4:\sT\x3a:0:  
> #FileLog 6:\sT\x3a:0:
>
> (not tested)

Besides the typo (6 is for H, not T ;)), this works for me: with

#FileLog 4:\sT\x3a:0:
#FileLog 6:\sH\x3a:0:


it's possible again to plot HMS-T- and S300TH-style logs, even if the latter
now are "polluted" with "humidity" and "temperature" lines. Suggest someone
else tries it and if ok there too, it should move into CVS. (Still puzzling
to me: why didn't the original pattern work? "T" should not match "temperature"
and it's not falling back to 0 but oscilating between T and H values.)

Thanks,
         kai

--
You received this message because you are subscribed to the Google Groups "FHEM users" group.
To post to this group, send email to fhem-users@googlegroups.com.
To unsubscribe from this group, send email to fhem-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/fhem-users?hl=en.

rudolfkoenig

                                                   

> | plot \
> |   "< awk '/T:/ {print $1, $4}' "\
> |      using 1:2 axes x1y2 title 'Measured temperature' with lines lw 2,\

SVG extracts the following elements from the "plot" line:
- axes (x1y2)
- title (Measured temperature)
- with (lines, SVG understands histeps/steps/fsteps/points too)
I am unsure if this is a good idea.


> Still puzzling to me: why didn't the original pattern work? "T" should not
> match "temperature" and it's not falling back to 0 but oscilating between T
> and H values.

"2010-02-05_00:37:09 Terrarium_TH humidity: 51.4" matches both T and H as
Terrarium_TH contains both of them.

--
You received this message because you are subscribed to the Google Groups "FHEM users" group.
To post to this group, send email to fhem-users@googlegroups.com.
To unsubscribe from this group, send email to fhem-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/fhem-users?hl=en.

Guest

Originally posted by: <email address deleted>

Rudolf Koenig wrote:

>> Still puzzling to me: why didn't the original pattern work? "T" should not
>> match "temperature" and it's not falling back to 0 but oscilating between T
>> and H values.
>
> "2010-02-05_00:37:09 Terrarium_TH humidity: 51.4" matches both T and H as
> Terrarium_TH contains both of them.

Oh. Drat. Yeah, sure ... My ingenious namings hit me again :) Then
I strongly suggest to update CVS with the \x3a addition, as it's
"T:" and "H:" what is being looked for.

As for SVG, as of now I'm only "using" it, won't comment of that for
the time being.
         kai

--
You received this message because you are subscribed to the Google Groups "FHEM users" group.
To post to this group, send email to fhem-users@googlegroups.com.
To unsubscribe from this group, send email to fhem-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/fhem-users?hl=en.