logProxy modul zum manipulieren und ergänzen von SVG plots

Begonnen von justme1968, 26 August 2014, 22:47:55

Vorheriges Thema - Nächstes Thema

justme1968

zur zeit noch einfach von hand. d.h. für die zweite $fld[2]=~"present"?3:2 verwendet.

ich überlege ob ich auch noch ein shift in y richtung einbaue.

gruss
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

klausw

Zitat von: justme1968 am 18 November 2014, 09:54:05
zur zeit noch einfach von hand. d.h. für die zweite $fld[2]=~"present"?3:2 verwendet.

ich überlege ob ich auch noch ein shift in y richtung einbaue.

Danke für den Tip. Eine shift Option würde das Ganze natürlich vereinfachen.

Mir ist noch eine Kleinigkeit aufgefallen.
Wenn am aktuellen Tag noch kein Ereignis aufgetreten ist, dann wird die Linie trotz predict bis zum Tagesende durchgezogen.

Grüße
Klaus
RasPi B v2 mit FHEM 18B20 über 1Wire, LED PWM Treiber über I2C, Luchtdruck-, Feuchtesensor und ein paar Schalter/LED\'s zum testen
Module: RPI_GPIO, RPII2C, I2C_EEPROM, I2C_MCP23008, I2C_MCP23017, I2C_MCP342x, I2C_PCA9532, I2C_PCF8574, I2C_SHT21, I2C_BME280

fruit

This looks to be very versatile module, I have read and re-read the thread and the wiki many times but my lack of German has not helped - google hasn't helped much either though I usually manage with it.

I thought I would start with something simple - plot a weekprofile for one of my MAX HeatingThermostats, but I can't even manage that!

The device is named MAX_075bb2, its log is FileLog_MAX_075bb2

I have defined the logProxy device
define myProxy logProxy

created a .gplot file, named my_logP.gplot, containing

#logProxy Func:logProxy_WeekProfile2Plot("MAX_075bb2",$from,$to)

plot "<IN>" using 1:2 axes x1y1 title 'profile' ls l2 lw 1 with steps


It seems I need to call this with something like
define myTest SVG myProxy:my_logP:FileLog_MAX_075bb2

but I see no plot.

Editing some of the log 3 lines in the module shows it is parsing the weekprofile OK

Can anyone tell me where I'm going wrong please?
Feel free to follow up in German if you prefer

justme1968

the logfle is not needed as the weekprovile is read from the device readings directly. so the SVG define should bedefine myTest SVG myProxy:my_logP:CURRENTbut that is probably not the problem.

please show me a 'list' of the MAX_075bb2 device.

what do you get in the log if you enable Log 3 in the line 243 ?
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

fruit

I wasn't sure about the logfile from looking at the module code. I removed it with no difference but put it back just in case :)

Zitatbut that is probably not the problem.

No difference with CURRENT.

list MAX_075bb2
Internals:
   CHANGED
   DEF        HeatingThermostat 075bb2
   IODev      ml
   LASTInputDev ml
   MSGCNT     1360
   NAME       MAX_075bb2
   NR         216
   STATE      18.0 °C
   TYPE       MAX
   addr       075bb2
   backend    ml
   dstsetting 1
   ml_MSGCNT  1360
   ml_TIME    2014-11-21 09:32:30
   mode       0
   rferror    0
   serial     KEQ0151254
   type       HeatingThermostat
   Readings:
     2014-11-21 09:32:30   MAXLAN_error    0
     2014-11-21 09:32:30   MAXLAN_errorInCommand
     2014-11-21 09:32:30   MAXLAN_initialized 1
     2014-11-21 09:32:30   MAXLAN_isAnswer 0
     2014-11-21 09:32:30   MAXLAN_valid    1
     2014-11-21 09:32:30   battery         ok
     2014-11-21 09:32:30   boostDuration   5
     2014-11-21 09:32:30   boostValveposition 80
     2014-11-21 09:32:30   comfortTemperature 20.0
     2014-11-21 09:32:30   decalcification Sat 16:00
     2014-11-21 02:59:35   desiredNew      00
     2014-11-21 09:32:30   desiredTemperature 18.0
     2014-11-21 09:32:30   ecoTemperature  15.0
     2014-11-21 09:32:30   firmware        1.8
     2014-11-21 09:32:30   groupid         4
     2014-11-17 07:49:01   humidity        0
     2014-11-21 09:32:30   maxValveSetting 100
     2014-11-21 09:32:30   maximumTemperature 21.0
     2014-11-21 09:32:30   measurementOffset 0.0
     2014-11-21 09:32:30   minimumTemperature off
     2014-11-21 09:32:30   mode            auto
     2014-11-21 09:32:30   state           18.0 °C
     2014-11-21 09:32:30   temperature     19.1
     2014-11-21 09:32:30   testresult      255
     2014-11-21 09:32:30   valveOffset     0
     2014-11-21 09:32:30   valveposition   22
     2014-11-21 09:32:30   weekprofile-0-Sat-temp 16.0 °C  /  16.0 °C  /  18.5 °C  /  18.5 °C  /  18.0 °C  /  18.0 °C  /  18.5 °C  /  19.5 °C  /  19.5 °C  /  19.0 °C  /  19.0 °C  /  16.0 °C
     2014-11-21 09:32:30   weekprofile-0-Sat-time 00:00-02:00  /  02:00-04:00  /  04:00-06:00  /  06:00-08:00  /  08:00-10:00  /  10:00-12:00  /  12:00-14:00  /  14:00-16:00  /  16:00-18:00  /  18:00-20:00  /  20:00-21:30  /  21:30-00:00
     2014-11-21 09:32:30   weekprofile-1-Sun-temp 16.0 °C  /  16.0 °C  /  18.5 °C  /  18.5 °C  /  18.0 °C  /  18.0 °C  /  18.5 °C  /  19.5 °C  /  19.5 °C  /  19.0 °C  /  19.0 °C  /  16.0 °C
     2014-11-21 09:32:30   weekprofile-1-Sun-time 00:00-02:00  /  02:00-04:00  /  04:00-06:00  /  06:00-08:00  /  08:00-10:00  /  10:00-12:00  /  12:00-14:00  /  14:00-16:00  /  16:00-18:00  /  18:00-20:00  /  20:00-21:30  /  21:30-00:00
     2014-11-21 09:32:30   weekprofile-2-Mon-temp 16.0 °C  /  16.0 °C  /  18.5 °C  /  18.5 °C  /  18.0 °C  /  18.0 °C  /  18.5 °C  /  19.5 °C  /  19.5 °C  /  19.0 °C  /  19.0 °C  /  16.0 °C
     2014-11-21 09:32:30   weekprofile-2-Mon-time 00:00-02:00  /  02:00-04:00  /  04:00-06:00  /  06:00-08:00  /  08:00-10:00  /  10:00-12:00  /  12:00-14:00  /  14:00-16:00  /  16:00-18:00  /  18:00-20:00  /  20:00-21:30  /  21:30-00:00
     2014-11-21 09:32:30   weekprofile-3-Tue-temp 16.0 °C  /  16.0 °C  /  18.5 °C  /  18.5 °C  /  18.0 °C  /  18.0 °C  /  18.5 °C  /  19.5 °C  /  19.5 °C  /  19.0 °C  /  19.0 °C  /  16.0 °C
     2014-11-21 09:32:30   weekprofile-3-Tue-time 00:00-02:00  /  02:00-04:00  /  04:00-06:00  /  06:00-08:00  /  08:00-10:00  /  10:00-12:00  /  12:00-14:00  /  14:00-16:00  /  16:00-18:00  /  18:00-20:00  /  20:00-21:30  /  21:30-00:00
     2014-11-21 09:32:30   weekprofile-4-Wed-temp 16.0 °C  /  16.0 °C  /  18.5 °C  /  18.5 °C  /  18.0 °C  /  18.0 °C  /  18.5 °C  /  19.5 °C  /  19.5 °C  /  19.0 °C  /  19.0 °C  /  16.0 °C
     2014-11-21 09:32:30   weekprofile-4-Wed-time 00:00-02:00  /  02:00-04:00  /  04:00-06:00  /  06:00-08:00  /  08:00-10:00  /  10:00-12:00  /  12:00-14:00  /  14:00-16:00  /  16:00-18:00  /  18:00-20:00  /  20:00-21:30  /  21:30-00:00
     2014-11-21 09:32:30   weekprofile-5-Thu-temp 16.0 °C  /  16.0 °C  /  18.5 °C  /  18.5 °C  /  18.0 °C  /  18.0 °C  /  18.5 °C  /  19.5 °C  /  19.5 °C  /  19.0 °C  /  19.0 °C  /  16.0 °C
     2014-11-21 09:32:30   weekprofile-5-Thu-time 00:00-02:00  /  02:00-04:00  /  04:00-06:00  /  06:00-08:00  /  08:00-10:00  /  10:00-12:00  /  12:00-14:00  /  14:00-16:00  /  16:00-18:00  /  18:00-20:00  /  20:00-21:30  /  21:30-00:00
     2014-11-21 09:32:30   weekprofile-6-Fri-temp 16.0 °C  /  16.0 °C  /  18.5 °C  /  18.5 °C  /  18.0 °C  /  18.0 °C  /  18.5 °C  /  19.5 °C  /  19.5 °C  /  19.0 °C  /  19.0 °C  /  16.0 °C
     2014-11-21 09:32:30   weekprofile-6-Fri-time 00:00-02:00  /  02:00-04:00  /  04:00-06:00  /  06:00-08:00  /  08:00-10:00  /  10:00-12:00  /  12:00-14:00  /  14:00-16:00  /  16:00-18:00  /  18:00-20:00  /  20:00-21:30  /  21:30-00:00
     2014-11-21 09:32:30   windowOpenDuration 15
     2014-11-21 09:32:30   windowOpenTemperature 12.0
   Internals:
     interfaces thermostat;battery;temperature
Attributes:
   IODev      ml
   alias      Living_Rad
   event-on-change-reading .*
   icon       my_heating_automatic
   keepAuto   1
   room       Living


I have the results of yesterdays attempts (reversed), can do again if needed, but it looks to be extracting the profile OK, (same profile every day)

        };
                 }
                   '12:00' => '18.5'
                   '20:00' => '19.0',
                   '02:00' => '16.0',
                   '00:00' => '16.0',
                   '10:00' => '18.0',
                   '08:00' => '18.0',
                   '14:00' => '19.5',
                   '16:00' => '19.5',
                   '21:30' => '16.0',
                   '04:00' => '18.5',
                   '18:00' => '19.0',
                   '06:00' => '18.5',
          '5' => {
                 },
                   '12:00' => '18.5'
                   '20:00' => '19.0',
                   '02:00' => '16.0',
                   '00:00' => '16.0',
                   '10:00' => '18.0',
                   '08:00' => '18.0',
                   '14:00' => '19.5',
                   '16:00' => '19.5',
                   '21:30' => '16.0',
                   '04:00' => '18.5',
                   '18:00' => '19.0',
                   '06:00' => '18.5',
          '2' => {
                 },
                   '12:00' => '18.5'
                   '20:00' => '19.0',
                   '02:00' => '16.0',
                   '00:00' => '16.0',
                   '10:00' => '18.0',
                   '08:00' => '18.0',
                   '14:00' => '19.5',
                   '16:00' => '19.5',
                   '21:30' => '16.0',
                   '04:00' => '18.5',
                   '18:00' => '19.0',
                   '06:00' => '18.5',
          '0' => {
                 },
                   '12:00' => '18.5'
                   '20:00' => '19.0',
                   '02:00' => '16.0',
                   '00:00' => '16.0',
                   '10:00' => '18.0',
                   '08:00' => '18.0',
                   '14:00' => '19.5',
                   '16:00' => '19.5',
                   '21:30' => '16.0',
                   '04:00' => '18.5',
                   '18:00' => '19.0',
                   '06:00' => '18.5',
          '3' => {
                 },
                   '12:00' => '18.5'
                   '20:00' => '19.0',
                   '02:00' => '16.0',
                   '00:00' => '16.0',
                   '10:00' => '18.0',
                   '08:00' => '18.0',
                   '14:00' => '19.5',
                   '16:00' => '19.5',
                   '21:30' => '16.0',
                   '04:00' => '18.5',
                   '18:00' => '19.0',
                   '06:00' => '18.5',
          '1' => {
                 },
                   '12:00' => '18.5'
                   '20:00' => '19.0',
                   '02:00' => '16.0',
                   '00:00' => '16.0',
                   '10:00' => '18.0',
                   '08:00' => '18.0',
                   '14:00' => '19.5',
                   '16:00' => '19.5',
                   '21:30' => '16.0',
                   '04:00' => '18.5',
                   '18:00' => '19.0',
                   '06:00' => '18.5',
          '4' => {
                 },
                   '12:00' => '18.5'
                   '20:00' => '19.0',
                   '02:00' => '16.0',
                   '00:00' => '16.0',
                   '10:00' => '18.0',
                   '08:00' => '18.0',
                   '14:00' => '19.5',
                   '16:00' => '19.5',
                   '21:30' => '16.0',
                   '04:00' => '18.5',
                   '18:00' => '19.0',
                   '06:00' => '18.5',
          '6' => {
2014.11.20 18:04:06 3: $VAR1 = {
2014.11.20 18:04:06 3: logProxy_Get


Feel free to follow up in German if you prefer

justme1968

i just made a quick test with a completely new installation and it did work.

did you enable the Log 3, "logProxy_Get"; in line 580? if not then probably your version is not current.

please enable the debug output in line 825. are there values in the log?

how exactly does your plot window look like? are there any errors or is it just blank?
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

fruit

As far as I know I'm up to date,
# $Id: 98_logProxy.pm 7013 2014-11-17 20:11:17Z justme1968 $

I enabled just about everything yesterday! Last post was probably from line 580 looking at it again, now disabled

I've attached the log with lines 243 and 825 enabled, as it is quite long. I see there are some warnings that I had not seen before

Plot window is displayed OK but blank.

Feel free to follow up in German if you prefer

wkarl

Hello fruit,

not sure whether this helps - here my definitions.

Definition in fhem:
#================================================
#==== GraphPlot
#================================================
define Buero_HK_Tag SVG MyLogProxy:MyHomeMaticRTall:HISTORY
attr Buero_HK_Tag group Buero_Plots
attr Buero_HK_Tag icon time_graph
attr Buero_HK_Tag label "Temperatur [C]"::"Ventil/Luft [%]"
attr Buero_HK_Tag plotfunction Buero_HK Buero_HK_Clima
attr Buero_HK_Tag room H-EG-R-Buero
attr Buero_HK_Tag sortby 03
attr Buero_HK_Tag title "HK - IST:$data{currval1}C * SOLL:$data{currval2}C * Ventil:$data{currval3}%"


And my gplot file 'MyHomeMaticRTall.
set yrange [0:35]
set y2range [0:100]
set ytics nomirror
set y2tics
set grid y2tics
#set format y "%.1f"
#set format y2 "%.1f"
#================================================

#================================================
# if you need a ':' in regex or function replace it by '\x3a'
# syntax:  <col/spec>:<regexp>:<default>:<fn> (@fld,0-based,NO space)
#           <SPEC1>:attr:0:[int|delta-h,delta-d|$fld[3]=~"on"?0.9:0.1]
#================================================

#================================================
#DbLog <SPEC1>:measured-temp:::
#DbLog <SPEC1>:desired-temp:::
#DbLog <SPEC1>:actuator:::
#DbLog <SPEC1>:humidity:::
#================================================

#================================================
#logProxy DbLog:MyDbLog:<SPEC1>:measured-temp:::
#logProxy DbLog:MyDbLog:<SPEC1>:desired-temp:::
#logProxy DbLog:MyDbLog:<SPEC1>:actuator::int:
#logProxy DbLog:MyDbLog:<SPEC1>:humidity::int:
#logProxy Func:logProxy_WeekProfile2Plot('<SPEC2>',$from,$to)
#================================================

#================================================
# colors
# l0 ... red        l0fill ... red           l0dot ... red, dotted
# l1 ... green      l1fill ... green         l1dot ... green, dotted
# l2 ... blue       l2fill ... blue          l0fill_stripe ... red, filled, stripes
# l3 ... magenta    l3fill ... magenta       l1fill_stripe ... green, filled, stripes
# l4 ... brown      l4fill ... yellow        l0fill_gyr ... filled, multicolor
# l5 ... black      l5fill ... cyan
# l6 ... olive      l6fill ... black
# l7 ... gray
# l8 ... yellow
#================================================
# line types
# points
# lines
# steps
# fsteps
# histeps
# bars
#================================================
plot "<IN>" axes x1y1 title 'IST-Temperatur' ls l0 lw 2 with lines,\
     "<IN>" axes x1y1 title 'SOLL-Temperatur' ls l4 lw 2 with steps,\
     "<IN>" axes x1y2 title 'Ventil' ls l5 lw 2 with lines,\
     "<IN>" axes x1y2 title 'Luftfeuchtigkeit' ls l2 lw 1 with points,\
     "<IN>" axes x1y1 title 'TempProfil' ls l7 lw 1 with steps   
#================================================


For <SPEC1> and <SPEC2> the plotfunction parameters are used.

cheers walter
FHEM 5.7 & TabletUI 2.2 auf Fedora22 Server auf NUC5i5RYK
CUL 868 > FAST EnergyCam
HMLAN > HomeMatic TCs & VDs, Bewegungsmelder, Schalter, Taster, Steckdosen

justme1968

in the latest version of the SVG module there is a 'Show preprocessed input' button. do you see any data if you click it?
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

fruit

Zitatin the latest version of the SVG module there is a 'Show preprocessed input' button. do you see any data if you click it?

A single line, no data

get myProxy CURRENT - 2014-11-21_00:00:00 2014-11-22_00:00:01 Func:logProxy_WeekProfile2Plot("MAX_075bb2",$from,$to)


@wkarl thanks, that explains where the <SPECx> I've seen in this thread come from :)

I'll try something like that and see what happens
Feel free to follow up in German if you prefer

justme1968

the 'Show preprocessed input' was not working. i have just fixed this. it will be available with the update tomorrow. please try again then.
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

fruit

Fine, no problems, looking forward to it

I've tried a modified version of wkarl's code, nothing again - though perhaps to be expected until tomorrow
I do like that commented gplot file.

Thanks for your time
Feel free to follow up in German if you prefer

wkarl

here you see how it looks like. The light-grey one is the tempList.
FHEM 5.7 & TabletUI 2.2 auf Fedora22 Server auf NUC5i5RYK
CUL 868 > FAST EnergyCam
HMLAN > HomeMatic TCs & VDs, Bewegungsmelder, Schalter, Taster, Steckdosen

fruit

Thanks. I wonder if I'll be able to get something like that here tomorrow ;)
Feel free to follow up in German if you prefer

fruit

The Cubie watchdog rebooted overnight and this morning I have a weekprofile plot.

I have done a number of fhem restarts trying to set this plot up including one just before sending the last set of logs but that was not enough to get things going for some reason.
Odd.

I've lost wkarls' more complex version on the restart but will try adding that in again over the weekend.
Feel free to follow up in German if you prefer