diff --git a/fhem/webfrontend/pgm5/02_FHEMRENDERER.pm b/fhem/webfrontend/pgm5/02_FHEMRENDERER.pm index e43bb0c41..5186e9876 100644 --- a/fhem/webfrontend/pgm5/02_FHEMRENDERER.pm +++ b/fhem/webfrontend/pgm5/02_FHEMRENDERER.pm @@ -1,3 +1,6 @@ +#(c) Olaf Droegehorn +# o.droegehorn@dhs-computertechnik.de +# www.dhs-computertechnik.de ############################################## package main; diff --git a/fhem/webfrontend/pgm5/README-FHEMRENDERER.txt b/fhem/webfrontend/pgm5/README-FHEMRENDERER.txt new file mode 100644 index 000000000..00bc5ff5b --- /dev/null +++ b/fhem/webfrontend/pgm5/README-FHEMRENDERER.txt @@ -0,0 +1,155 @@ +Description of the 02_FHEMRENDERER Module: + +(c) Olaf Droegehorn + o.droegehorn@dhs-computertechnik.de + www.dhs-computertechnik.de + + +General Description: + +The FHEMRENDERER module is intended to render (draw) graphics based on the FHEM Log-Files. +This can be done either based on a timer (used in the module) or based on a direct call of GET. +The rendered graphics will be stored in a pre-defined directory with a predefined prefix of the files. + +The FHEMRENDERER uses attributes to control the behaviour: + plotmode gnuplot + plotsize 800,200 + refresh 00:10:00 + room Unsorted + status off + tmpfile /tmp/ + +These attributes have the following meaning: +plotmode, plotsize: Control gnuplot and the desired output +refresh: type HH:MM:SS, is the time-interval in which the re-rendering is done +status: Tells if the timer-based re-rendering is on/off +tmpfile: Is the path (and prefix, if given) of the graphic-files, that will be rendered + +NOTE: The timer-based rendering renders ONLY those fileplots, for which you have defined a WebLink ! + See WebLink for more details on how to define. + +NOTE: At the moment the renderer supports only GNUPLOT, meaning gnuplot is used to draw the graphics. The supported +modes are (gnuplot and gnuplot-scroll). + + +Supported commands are: + +define/set/get/attributes + + + +DEFINE + + define + + Define a device. You need devices if you want to manipulate them (e.g. set on/off). + Use "define ?" to get a list of possible types. + + Type FHEMRENDERER + + define FHEMRENDERER [global] + + This defines a new "device", that is of type FHEMRENDERER. The option 'global' can be used if needed for sorting reasons. + Otherwise this option has no real meaning for FHEMRENDERER. + + As a side-effect of defining this "device" the following attributes will be set for this "device": + plotmode gnuplot + plotsize 800,200 + refresh 00:10:00 + room Unsorted + status off + tmpfile /tmp/ + + + NOTE: The Logfile will report (with LogLevel 2) that the FHEMRENDERER has been defined. + + Examples: + define renderer FHEMRENDERER + +SET + + set + + Set parameters of a device / send signals to a device. You can get a list of possible commands by + set ? + + Type FHEMRENDERER: + set FHEMRENDERER on/off + + This switches the timer-based rendering on/off. The attribute 'status' will be modified accordingly. + NOTE: only WebLink based graphics will be rendered. + +GET + get + + Ask a value directly from the device, and wait for an answer. In general, you can get a list of possible commands by + get ? + + Type FHEMRENDERER: + get FHEMRENDERER [[file-name] device type logfile [pos=zoom=XX&off=YYY]] + + the get function supports different sets of arguments: + Arguments: + NONE: all WebLink based FilePlots will be rerendered + The resulting filename will be '.png' + THREE: ' ' + In this case only one specific graphic will be rendered: + A graphic will be rendered for 'device', where device is a FileLog, based on the type 'type' based on the given 'logfile' + The resulting filename will be 'logfile.png' + FOUR: ' ' + In this case only one specific graphic will be rendered: + A graphic will be rendered for 'device', where device is a FileLog, based on the type 'type' based on the given 'logfile' + The resulting filename will be '.png' + FIVE: ' pos=zoom=XX&off=YYY' + In this case only one specific graphic will be rendered assuming that plotmode is 'gnuplot-scroll': + A graphic will be rendered for 'device', where device is a FileLog, based on the type 'type' based on the given 'logfile' + The 'zoom' will be either qday/day/week/month/year (same as used in FHEMWEB). + The offset 'off' is either 0 (then the second part can be omitted, or -1/-2.... to jump back in time. + The resulting filename will be '.png' + + NOTE: If you want to use zoom AND offset then you have to concatenate via '&' !! + + NOTE: combinations are possible in limited ranges: + meaning: you can add the 'pos=zoom=XX&off=YY' to any of the first three sets. + This may e.g. result in rendering all WebLinks with a specific zoom or offset + (if you just pass the 'pos=zoom=xx&off=yy' parameter); + + Any rendered image (one or all WebLinks) will be stored in followed by a filename'.png'. The filename will be + either derived (from weblink-name or logfile-name) or, for single files, can be assigend. + + Examples: + get FHEMRENDERER + get FHEMRENDERER pos=zoom=week&off=-1 + get FHEMRENDERER azlog fht az-2008-38.log pos=zoom=0 + get FHEMRENDERER livingroomgraphics wzlog fht wz-2008-38.log pos=zoom=0 + + +ATTR + + attr + + Set an attribute to something defined by define. + Use "attr ?" to get a list of possible attributes. + + Type FHEMRENDERER: + attr FHEMRENDERER + + Attributes: + plotmode gnuplot / gnuplot-scroll + plotsize Dimension of graphic e.g. 800,200 + refresh Timer-Interval for rerendering (HH:MM:SS) + status Status of the Timer (off/on) + tmpfile Path and prefix of for the rendered graphics (e.g. /tmp/) + + + + +Installation: +Copy the file pgm5/02_FHEMRENDERER.pm to the installed FHEM directory. +This gives you a graphic rendering engine (gnuplot & gnuplot-scroll at the moment), which can be configured to renderer images in intervals. + +The *.gplot files should be reused from the built-in FHEMWEB and should reside in the installed FHEM directory. Here we don't provide specific *.gplot files as the mechanisms are exactly the same. + +If you want to have access to plotted logs, then make sure that gnuplot is installed and set the logtype for the FileLog device (see commandref.html and example/04_log). +Copy the file contrib/99_weblink.pm to the installed FHEM directory. + diff --git a/fhem/webfrontend/pgm5/README.txt b/fhem/webfrontend/pgm5/README.txt index 2ba20af15..b3f3594f0 100644 --- a/fhem/webfrontend/pgm5/README.txt +++ b/fhem/webfrontend/pgm5/README.txt @@ -1,71 +1,71 @@ -Web frontend 5 (webfrontend/pgm5) (known upto FHEM 4.2 as pgm2): - -This frontend is CGI/CSS based. It has support for rooms, and FHT/KS300 logs. - -This webfrontend is an update of the former know pgm2 (up to 4.2): -It resides in YOUR HTTP server, and doesn't provide an own, like the FHEMWEB module does. - -Why to use this: -1) If you want to stick with your Web-Servers (due to restrictions, - ports or any other reason) -2) If you have a NAS (Network attached storage) and limited CPU-Power. - This frontend can render the graphics in the background (in - intervals) and sends only the rendered graphics to the HTML-Page. -3) If you need the FHEMRENDERER to render the images for other/own - pages. - -How it works: -The WebFrontend works as usual and well known from before. -Main difference: -It creates and uses an instance of FHEMRENDERER (called renderer). -The renderer has plotmode, plotsize, tmpfile, status, refresh as attributes. -With this you can control, how it works (and when in renders: refresh: 00:15:00 means every 15 minutes it will render an update). - -What will be rendered: All FileLogs for which you have set a WebLink will be rendered in the given intervals. - -The GET method of the renderer is also able to render specific graphics only for single use on request. - -Supported methods of renderer: -DEFINE, SET, GET, ATTR -DEFINE: defines the renderer -SET: Set renderer ON/OFF toggels interval based rendering -GET: renders graphics, based on given parameters -ATTR: defines attributes, but all attributes will be set during define - to default values. - -The PGM5 webfrontend does all this for you, but if you want to use the FHEMRENDERER for own things, you can use it directly. - -Installation: -Copy the file fhemweb.pl and *.css to your cgi-bin directory (/home/httpd/cgi-bin), the icons (*.gif) to your httpd icons (/home/httpd/icons), and commandref.html to the html directory (/home/httpd/html) (or also to cgi-bin directory). - -The *.gplot files should be reused from the built-in FHEMWEB and should reside in the installed FHEM directory. Here we don't provide specific *.gplot files as the mechanisms are exactly the same. - -Note: The program looks for icons in the following order: -., , ., - -If you want to have access to plotted logs, then make sure that gnuplot is installed and set the logtype for the FileLog device (see commandref.html and example/04_log). -Copy the file contrib/99_weblink.pm to the installed FHEM directory. - -Copy the file pgm5/02_FHEMRENDERER.pm to the installed FHEM directory. -This gives you a grphic rendering engine (gnuplot & gnuplot-scroll at the moment), which can be configured to renderer images in intervals. - -Call /cgi-bin/fhemweb.pl - -If you want to show only a part of your devices on a single screen -(i.e divide them into separate rooms), then assign each device the -room attribute in the config file: - - attr ks300 room garden - attr ks300-log room garden - -The attribute title of the global device will be used as title on the first -screen, which shows the list of all rooms. Devices in the room -"hidden" will not be shown. Devices without a room attribute go -to the room "misc". - -To configure the absicondir and relicondir correctly, look into the -httpd.conf file (probably /etc/httpd/conf/httpd.conf), and check the -line which looks like: - Alias /icons/ "/home/httpd/icons/" -relicondir will then be /icons, and absicondir /home/httpd/icons. - +Description of the pgm5 webfrontend: + +(c) Olaf Droegehorn + o.droegehorn@dhs-computertechnik.de + www.dhs-computertechnik.de + +General description: + +Web frontend 5 (webfrontend/pgm5) (known upto FHEM 4.2 as pgm2): + +This frontend is CGI/CSS based. It has support for rooms, and FHT/KS300 logs. + +This webfrontend is an update of the former know pgm2 (up to 4.2): +It resides in YOUR HTTP server, and doesn't provide an own, like the FHEMWEB module does. + +Why to use this: +1) If you want to stick with your Web-Servers (due to restrictions, + ports or any other reason) +2) If you have a NAS (Network attached storage) and limited CPU-Power. + This frontend can render the graphics in the background (in + intervals) and sends only the rendered graphics to the HTML-Page. +3) If you need the FHEMRENDERER to render the images for other/own + pages. + +How it works: +The WebFrontend works as usual and well known from before. +Main difference: +It creates and uses an instance of FHEMRENDERER (called renderer). +The renderer has plotmode, plotsize, tmpfile, status, refresh as attributes. +With this you can control, how it works (and when in renders: refresh: 00:15:00 means every 15 minutes it will render an update). + +What will be rendered: All FileLogs for which you have set a WebLink will be rendered in the given intervals. +The GET method of the renderer is also able to render specific graphics only for single use on request. + +The PGM5 webfrontend does all this for you, but if you want to use the FHEMRENDERER for own things, you can use it directly. + + +INSTALLATION: +Copy the file fhemweb.pl and *.css to your cgi-bin directory (/home/httpd/cgi-bin), the icons (*.gif) to your httpd icons (/home/httpd/icons), and commandref.html to the html directory (/home/httpd/html) (or also to cgi-bin directory). + +The *.gplot files should be reused from the built-in FHEMWEB and should reside in the installed FHEM directory. Here we don't provide specific *.gplot files as the mechanisms are exactly the same. + +Note: The program looks for icons in the following order: +., , ., + +If you want to have access to plotted logs, then make sure that gnuplot is installed and set the logtype for the FileLog device (see commandref.html and example/04_log). +Copy the file contrib/99_weblink.pm to the installed FHEM directory. + +Copy the file pgm5/02_FHEMRENDERER.pm to the installed FHEM directory. +This gives you a grphic rendering engine (gnuplot & gnuplot-scroll at the moment), which can be configured to renderer images in intervals. + +Call /cgi-bin/fhemweb.pl + +If you want to show only a part of your devices on a single screen +(i.e divide them into separate rooms), then assign each device the +room attribute in the config file: + + attr ks300 room garden + attr ks300-log room garden + +The attribute title of the global device will be used as title on the first +screen, which shows the list of all rooms. Devices in the room +"hidden" will not be shown. Devices without a room attribute go +to the room "misc". + +To configure the absicondir and relicondir correctly, look into the +httpd.conf file (probably /etc/httpd/conf/httpd.conf), and check the +line which looks like: + Alias /icons/ "/home/httpd/icons/" +relicondir will then be /icons, and absicondir /home/httpd/icons. +