diff --git a/fhem/docs/commandref.html b/fhem/docs/commandref.html
index 8b3590835..b54714daa 100644
--- a/fhem/docs/commandref.html
+++ b/fhem/docs/commandref.html
@@ -3,106 +3,252 @@
- fhem.pl command reference
+ fhem reference
-fhem.pl command reference
+fhem.pl reference
+Contents
+
-Device specification
-Perl specials
Introduction
-You can use all of the following commands in in two ways:
-- In the configuration file, which must be specified if you startup the
- server. Example:
-
-
- A minimal configuration file would look like:
-
- attr global logfile /tmp/fhem.log
- attr global statefile /tmp/fhem.save
- attr global verbose 3
- attr global port 7072
- attr global modpath /usr/local/lib
- define FHZ FHZ /dev/tts/USB0
+Fhem is mainly used for home automation, but it is suitable for other tasks
+too, where notification, timers and logging plays an important role.
+
+
+It supports different hardware devices to interface with certain protocols
+(e.g. FHZ1000 to interface FS20 and HMS, CM11 to access X10), and logical
+devices like FS20 or FHT to digest the messages for a certain device type using
+this protocol.
+
+
+Fhem is modular. The different devices are represented through modules which
+implement certain functions (e.g. define, get, set). Even seemingly integral
+parts of fhem like triggers (notify) and timers (at) are implemented this way, giving the possibility to
+replace/extend this functionality.
+
+Fhem is controlled through readable / ascii commands, which are specified in
+files (e.g. the configuration file), or issued over a TCP/IP connection, either
+directly in a telnet session, with a fhem.pl in client mode or from one of the
+web frontends.
+
+When starting the server you have to specify a configuration file:
+
+
+
+A minimal configuration file:
+ attr global logfile /tmp/fhem.log
+ attr global statefile /tmp/fhem.save
+ attr global verbose 3
+ attr global port 7072
+ attr global modpath /usr/local/lib
+ define FHZ FHZ /dev/tts/USB0
+
+ define lamp FS20 8765 01
- define lamp FS20 8765 01
For other configuration files see the examples subdirectory.
-
-- Through the TCP/IP connection, which you can either use in a "session"
- (via telnet) or single client command (via fhem.pl). Example:
-
+TCP/IP communication with fhem can either happen in a "session" (via
+telnet) or single client command (via fhem.pl). Example:
+
telnet localhost 7072
<NL> (This newline switches into "prompt" mode)
<command>...
quit
-
+
or
-
+
fhem.pl 7072 "set lamp off"
-
-
+
-There are three types of commands: "fhem" commands (described in this document),
-shell commands (they must be enclosed in double quotes ") and perl expressions
-(enclosed in curly brackets {}). shell commands or perl expressions are needed for
-complex at or notify arguments.
-Shell commands will be executed in the
-background, the perl program and the fhem commands will be executed in the main
-"thread".
-In order to make perl expressions easier to write, some special functions and
-variables are available. See the section Perl special for a
-description.
-To trigger "fhem" commands from a shell script, use the client form of
-fhem.pl (described above).
+
+Fhem command types
+
+There are three types of commands: "fhem" commands (described in this
+document), shell commands (they must be enclosed in double quotes ") and perl
+expressions (enclosed in curly brackets {}). shell commands or perl expressions
+are needed for complex at or notify
+arguments, but can also issued as a "normal" command.
+
+E.g. the following three commands all do the same when issued from a telnet
+prompt:
+
+ set lamp off
+ "fhem.pl 7072 "set lamp off""
+ {fhem("set lamp off")}
+
+
+
+Shell commands will be executed in the background, perl expressions and
+fhem commands will be executed in the main "thread". In order to make perl
+expressions easier to write, some special functions and variables are
+available. See the section Perl special for a description.
+To trigger fhem commands from a shell script (this is the "other way round"),
+use the client form of fhem.pl (described above).
+
Multiple fhem commands are separated by semicolon (;). In order to use semicolon
in perl code or shell programs, they have to be escaped by the double semicolon
-(;;).
+(;;).
+
+E.g. the following first command switches Lamp1 off at 07:00 and Lamp2
+immediately (at the point of definition), the second one switches both lamps
+off at 07:00.
+
+ define lampoff at 07:00 set Lamp1 off; set Lamp2 off
+ define lampoff at 07:00 set Lamp1 off;; set Lamp2 off
+
+
+
Commands can be either typed in plain, or read from a file (e.g. the
configuration file at startup). The commands are either executed directly, or
later if they are arguments to the at and notify fhem commands.
+href="#notify">notify fhem commands.
+
A line ending with \ will be concatenated with the next one, so long lines
(e.g. multiple perl commands) can be split in multiple lines. Some web fronteds
-make editing of multiline commands transparent.
+(e.g. webpgm2) make editing of multiline commands transparent for you (i.e. there is no need for \) .
+
+
+
+Device specification (devspec)
+
+ The commands
+ attr,
+ deleteattr,
+ delete,
+ get,
+ list,
+ set,
+ setstate,
+ trigger
+ can take a more complex device specification as argument, which will be
+ expanded to a list of devices. A device specification (short devspec) can be:
+
+ - a single device name. This is the most common case.
+ - a list of devices, separated by comma (,)
+ - a range of devices, separated by dash (-)
+ - a regular expression, if the the spec contains on e of the following
+ characters: ^*[]$
+ - an internal attribute of the device, followed by a colon and then a
+ regexp for this attribute. Known attributes are DEF, STATE and TYPE.
+
+ Example:
+
+ set lamp1 on
+ set lamp1,lamp2,lamp3 on
+ set lamp[1-3] on
+ set lamp.* on
+ set lamp1-lamp3 on
+ set lamp1-lamp3,lamp3 on
+ list DEF:1234.*
+ list TYPE:FS20
+
+ Notes:
+
+ - first the spec is separated by komma, then the range or the regular
+ expression operations are executed.
+ - if there is a device which exactly corresponds to the spec, then
+ no special processing is done.
+ - the returned list can contain the same device more than once, so
+ int tha last example the list will contain lamp3 twice.
+
+
+
?, help
@@ -112,148 +258,19 @@ make editing of multiline commands transparent.
Get a list of all commands and short description for each one
-
-
attr
attr <devspec> <attrname> [<value>]
- or
- attr at <at-spec-regexp> <attribute>
-
Set an attribute to something defined by define.
- There are some special attributes used by the fhem.pl itself or the
- web-frontends, but you can define your own to use them in other applications.
- You have to define them first with userattr, see
- below.
+
Set an attribute for a device defined by define.
+ You can define your own attributes too to use them in other applications.
Use "attr <name> ?" to get a list of possible attributes.
See the Device specification section for details on
<devspec>.
- Following are attributes of the global device:
-
-
-
-
- - configfile
- Contains the name of the configuration file. If save is called without argument, then the output will
- be written to this file.
-
-
-
- - lastinclude
- If this attribute is set, then the last command of the generated
- configfile (see the save command) will be
- include <lastinclude-value>
- This file is needed, as the save command will write only defines and
- attributes to the config file, any other commands / includes will be
- lost. E.g. it makes sense to set the FHTcode in
- this file or the coordinates of your house via
- sunrise_coord
-
-
-
- - logfile
- Specify the logfile to write. You can use "-" for
- stdout, in this case the server won't background itself.
- The logfile name can also take wildcards for easier logfile rotation,
- see the FileLog section.
-
-
-
- - nofork
- If set and the logfile is not "-", do not try to background. Needed
- on some Fritzbox installations.
-
-
-
- - nofork
- If set, the timestamp in the logfile will contain a millisecond part.
-
-
-
-
- - modpath
- Specify the path to the modules directory FHEM. The path
- should not contain the directory FHEM. Upon setting the
- attribute, the directory will be scanned for filenames of the form
- NN_<NAME>.pm, and make them available for device definition under
- <NAME>. If the first device of type <NAME> is defined, the
- module will be loaded, and its function with the name
- <NAME>_initialize will be called. Exception to this rule are
- modules with NN=99, these are considered to be utility modules
- containing only perl helper functions, they are loaded at startup (i.e.
- modpath attribute definition time).
-
-
-
-
- - pidfilename
- Write the process id of the perl process to the specified file. The
- server runs as a daemon, and some distributions would like to check by
- the pid if we are still running. The file will be deleted upon
- shutdown.
-
-
-
- - pidfilename
- Works for the global "device"
-
-
-
- - port
- Listen on the TCP/IP port <number> for incoming
- connections. To offer at least a little bit of security, the server
- will only listen for connections from the localhost per default. If
- there is a second value "global" then the server will listen for
- non-localhost connections too.
-
-
-
- - allowfrom
- Comma (,) separated list of ip-addresses or hostnames. If set,
- only connections from these addresses are allowed.
-
-
-
-
- - statefile
- Set the filename where the state and certain at
- information will be saved before shutdown. If it is not specified, then
- no information will be saved.
-
-
-
- - title
- Used by the web frontend fhemweb.pl (webpgm2) as a Page title.
-
-
-
- - userattr
- A space separated list which contains the names of additional
- attributes. Without specifying them you will not be able to set them
- (in order to prevent typos).
-
-
-
- - verbose
- Set the verbosity level. Possible values:
-
- - 0 - server start/stop
-
- 1 - error messages or unknown packets
-
- 2 - major events/alarms.
-
- 3 - commands sent out will be logged.
-
- 4 - you'll see whats received by the different devices.
-
- 5 - debugging.
-
- Recommended level is 3 for normal use.
-
-
-
-
Attributes used by all devices:
@@ -263,7 +280,7 @@ make editing of multiline commands transparent.
- room
Filter/group devices. Recognized by web-pgm2 and web-pgm3.
- Devices in the room hidden will not appear in the web output.
+ Devices in the room hidden will not appear in the web output.
- showtime
@@ -272,290 +289,16 @@ make editing of multiline commands transparent.
devices.
-
- Attributes used by some device types:
-
-
- - archivecmd / archivedir / nrarchive
- Can be applied to FileLog devices.
- When a new FileLog file is opened, the FileLog archiver wil be called.
- This happens only, if the name of the logfile has changed (due to
- time-specific wildcards, see the FileLog
- section), and there is a new entry to be written into the file.
-
- If the attribute archivecmd is specified, then it will be started as a
- shell command (no enclosing " is needed), and each % in the command
- will be replaced with the name of the old logfile.
-
- If this attribute is not set, but nrarchive and/or archivecmd is set,
- then all superfluous logfiles will be moved to archivedir (or deleted if
- archivedir is not set).
-
-
- - disable
- Can be applied to at/watchdog/notify/FileLog devices.
- Disables the corresponding at/notify or FileLog device. Note:
- If applied to an at, the command will not be executed,
- but the next time will be computed.
-
-
- - do_not_notify
- Can be applied to FHZ/FS20/FHT/HMS/KS300/WS300 devices.
- Disable FileLog/notify/inform notification for a device. This affects
- the received signal, the set and trigger commands.
-
-
- - dummy
- Can be applied to FS20/FHT devices.
- Set the device attribute dummy to define devices which should not
- output any radio signals. Associated notifys will be executed if
- the signal is received. Used e.g. to react to a code from a sender, but
- it will not emit radio signal if triggered in the web frontend.
- Implemented for FS20 and FHT devices.
-
-
- - filtertimeout
- Can be applied to FHZ devices.
- Ignore duplicate messages for this amount of time. The time is in
- seconds, fractions are allowed. It affects installations with more then
- one FHZ device or repeater, see the repeater
- entry.
-
-
-
- - follow-on-for-timer
- Can be applied to FS20 devices.
- the program automatically schedules a "setstate off" for the time
- specified as argument to the on-for-timer command (for the specified
- device only).
-
-
-
- - loglevel
- Can be applied to FHZ/FS20/FHT/HMS/KS300/WS300 devices.
- Set the device loglevel to e.g. 6 if you do not wish messages from a
- given device to appear in the global logfile (FHZ/FS20/FHT). E.g. to
- set the FHT time, you should schedule "set FHZ time" every minute, but
- this in turn makes your logfile unreadable. These messages will not be
- generated if the FHZ attribute loglevel is set to 6.
-
-
- - logtype
- Can be applied to FileLog devices.
- Used by the pgm2 webfrontend to offer gnuplot/SVG images made from the
- logs. The string is made up of tokens separated by comma (,), each
- token specifies a different gnuplot program. The token may contain a
- colon (:), the part before the colon defines the name of the program,
- the part after is the string displayed in the web frontend. Currently
- following types of gnuplot programs are implemented:
-
- - fs20
- Plots on as 1 and off as 0. The corresponding filelog definition
- for the device fs20dev is:
- define FileLog fslog fs20dev /var/log/fs20dev-%Y-%U.log
-
- - fht
- Plots the measured-temp/desired-temp/actuator lines. The
- corresponding filelog definitions (for the FHT device named
- fht1) looks like:
- define FileLog fhtlog1 fht1:.*(temp|actuator).*
- /var/log/fht1-%Y-%U.log
-
- - ks300_1
- Plots the temperature and rain (per hour and per day) of a
- ks300. The corresponding filelog definitions (for the KS300
- device named ks300) looks like:
- define FileLog ks300log ks300:.*H:.*
- /var/log/ks300-%Y-%U.log
-
- - ks300_2
- Plots the humidity and wind values of a
- ks300. The corresponding filelog definition is the same as
- above, both programs evaluate the same log.
-
- - text
- Shows the logfile as it is (plain text). Not gnuplot definition
- is needed.
-
-
- Example:
- attr fhtlog1 logtype ks300_1:Temp/Rain,ks300_2:Hum/Wind,text:Raw-data
-
-
-
-
- - model
- Can be applied to FHZ/FS20/FHT/HMS/KS300/WS300 devices.
- The model attribute denotes the model type of the device.
- The attributes will (currently) not be used by the fhem.pl directly.
- It can be used by e.g. external programs or web interfaces to
- distinguish classes of devices and send the appropriate commands
- (e.g. "on" or "off" to a fs20st, "dim..%" to fs20du etc.).
- The spelling of the model names are as quoted on the printed
- documentation which comes which each device. This name is used
- without blanks in all lower-case letters. Valid characters should be
- a-z 0-9 and - (dash),
- other characters should be ommited. Here is a list of "official"
- devices:
-
-
-
-
- - repeater
- Can be applied to FHZ devices.
- Set the attribute "repeater" for an FHZ device to 1 to ignore events
- received from a FS20 repeater. In fact we are not sure that they are
- repeater messages, we just ignore messages which were sent out by our
- device for the next 3 seconds (see the next attribute)
-
-
-
- - skip_next
- Can be applied to at devices.
- Used for at commands: skip the execution of the command the next
- time.
-
-
- - fhtsoftbuffer
- Can be applied to FHZ devices.
- As the FHZ command buffer for FHT devices is limited (see fhtbuf),
- and commands are only sent to the FHT device every 120 seconds,
- the hardware buffer may overflow and FHT commands get lost.
- Setting this attribute implements an "unlimited" software buffer
- Default is disabled (i.e. not set or set to 0).
-
-
- - retrycount
- Can be applied to FHT devices.
- If the fhtsoftbuffer attribute is set, then
- resend commands retrycount times if after 240 seconds
- no confirmation message is received from the corresponding FHT
- device.
- Default is 3.
-
-
- - minfhtbuffer
- Can be applied to FHT devices.
- FHEM wont send commands to the FHZ if its fhtbuffer is below
- this value, default is 0. If this value is low, then the ordering of
- fht commands (see the note in the FHT section of set)
- has little effect, as only commands in the softbuffer can be
- prioritized. The maximum value should be 7 below the hardware maximum
- (see fhtbuf).
-
-
-
-
- - webname
- Can be applied to FHEMWEB devices. (webfrontend/pgm2)
- Path after the http://hostname:port/ specification. Defaults to fhem,
- i.e the default http address is http://localhost:8083/fhem
-
-
-
- - refresh
- Can be applied to FHEMWEB devices. (webfrontend/pgm2)
- If set, a http-equiv="refresh" entry will be genererated with the given
- argument (i.e. the browser will reload the page after the given
- seconds).
-
-
-
- - plotmode
- Can be applied to FHEMWEB devices. (webfrontend/pgm2)
- Specifies how to generate the plots:
-
- - gnuplot
- Call the gnuplot script with each logfile. The filename
- specification of the FileLog device will
- determine what is in the plot. The data is converted into an
- image on the backend with gnuplot.
- - gnuplot-scroll
- Fhemweb will offer zoom and scroll buttons in order to navigate
- in the current logfile, i.e. you can select just a part of the
- data to be displayed. The more data is contained in a single
- logfile, the easier you can navigate. The recommendation is to
- store the data for a whole year in one logfile. The data is
- converted into an image on the backend with gnuplot.
- - SVG
- The same scrolling as with gnuplot scroll, but the data is sent
- as an SVG script to the frontend, which will compute
- the image: no need for gnuplot on the backend.
-
- See also the attribute fixedrange.
-
-
-
- - plotsize
- Can be applied to FHEMWEB devices. (webfrontend/pgm2)
Specifies
- the default size of the plot, in pixels, separated by comma:
- width,height. You can set individual sizes by setting the plotsize of
- the weblink.
-
-
-
- - fixedrange
- Can be applied to weblink devices (FHEMWEB).
- Contains two time specs in the form YYYY-MM-DD separated by a space.
- In plotmode gnuplot-scroll or SVG the given time-range will be used,
- and no scrolling for this weblinks will be possible. Needed e.g. for
- looking at last-years data without scrolling.
-
+ Device specific attributes are documented in the corresponding device section.
+
Examples:
attr global verbose 3
attr lamp room kitchen
- attr lamp dummy
attr lamp loglevel 6
-
- attr FHZ fhtsoftbuffer 0 # disable the fhtsoftbuffer
- attr FHZ retrycount 4 # resend commands to FHT devices at most 4 times.
@@ -570,10 +313,9 @@ fs20usr
setdefaultattr [<attrname> [<value>]]
-
Set the default attribute. Each device defined from now on will receive
- this attribute (see the attr entry for details on
- attribute names and values).
- If no attrname is specified, then the default attribute list will be deleted.
+
Add a default attribute. Each device defined from now on will receive
+ this attribute.
If no attrname is specified, then the default attribute
+ list will be deleted.
Example to set the attribute "room kitchen" and "loglevel 4" to
@@ -605,816 +347,11 @@ fs20usr
set on/off), and the logfile is also more readable if it contains e.g.
"lamp off" instead of "Device 5673, Button 00, Code 00 (off)".
Use "define <name> ?" to get a list of possible types.
+
+
+ Each device takes different additional arguments at definition, see the
+ corresponding device section for details.
-
-
- Type FHZ
-
- define <name> FHZ <serial-device>
-
- Specifies the serial port to communicate with the FHZ 1000 PC. The name(s)
- of the serial-device(s) depends on your distribution. The program can
- service multiple devices, FS20 and FHT device commands will be sent out
- through the last FHZ device defined before the definition of the FS20/FHT
- device. To change the association, use the set command
- activefor. Important: this definition must occur after the
- modpath command but before any other (FHZ related) device definition,
- else you'll see "no I/O device found" messages.
- If the serial-device is called none, then no device will be opened, so you
- can experiment without hardware attached.
-
- Set the attribute "repeater" for this device to 1 to ignore events received
- from a FS20 repeater. In fact we are not sure that they are repeater
- messages, we just ignore messages which were sent out by our device for the
- next 3 seconds (or configured otherwise by filtertimeout).
-
- For GNU/Linux you may want to read our hints for
- GNU/Linux about multiple USB
- devices.
-
- Note:The firmware of the FHZ1x00 will drop commands if the airtime
- for the last hour would exceed 1% (which corresponds roughly to 163
- commands). For this purpose there is a command counter for the last hour
- (see list FHZDEVICE), which triggers with "TRANSMIT LIMIT EXCEEDED" if
- there were more than 163 commands in the last hour.
- If you experience problems (for verbose 4 you get a lot of "Bad CRC message"
- in the log), then try to define your device as
- define <name> FHZ <serial-device> strangetty
-
-
-
-
-
- Type FS20
-
- define <name> FS20 <housecode> <button>
- [fg <fgaddr>] [lm <lmaddr>] [gm FF]
-
-
- The values of housecode, button, fg, lm, and gm can be either defined as
- hexadecimal value or as ELV-like "quad-decimal" value with digits 1-4. We
- will reference this ELV-like notation as ELV4 later in this document. You
- may even mix both hexadecimal and ELV4 notations, because FHEM can detect
- the used notation automatically by counting the digits.
-
-
- <housecode> is a 4 digit hex or 8 digit ELV4 number,
- corresponding to the housecode address.
- <button> is a 2 digit hex or 4 digit ELV4 number,
- corresponding to a button of the transmitter.
- - The optional
<fgaddr> specifies the function group.
- It is a 2 digit hex or 4 digit ELV address. The first digit of the hex
- adress must be F or the first 2 digits of the ELV4 address must be
- 44.
- - The optional
<lmaddr> specifies the local
- master. It is a 2 digit hex or 4 digit ELV address. The last digit of the
- hex address must be F or the last 2 digits of the ELV4 address must be
- 44.
- - The optional gm specifies the global master, the adress must be FF if
- defined as hex value or 4444 if defined as ELV4 value.
-
-
-
- Examples:
-
- define lamp FS20 7777 00 fg F1 gm F
- define roll1 FS20 7777 01
- define otherlamp FS20 24242424 1111 fg 4412 gm 4444
- define otherroll1 FS20 24242424 1114
-
-
-
-
-
- Type FHT
-
- define <name> FHT <housecode>
-
-
- <housecode> is a four digit hex number,
- corresponding to the adress of the FHT80b device.
-
-
- Examples:
-
-
- See the FHT section in set for more.
-
-
-
-
- Type HMS
-
- define <name> HMS <housecode>
-
-
- <housecode> is a four digit hex number,
- corresponding to the adress of the HMS device.
-
-
- Examples:
-
- Notes:
-
- - There is _NO_ guarantee that the code will work as expected in all
- circumstances, the authors are not liable for any damage occuring as a
- result of incomplete or buggy code
-
- - Currently supported devices are the HMS100-T HMS100-TF HMS100-WD
- HMS100-MG HMS100-TFK HMS100-CO HMS100-FIT RM100-2
-
- - The housecode of the HMS devices may change if the battery is renewed.
- In order to make life easier, you can define a "wildcard" device for each
- type of HMS device. First the real device-id will be checked, then the
- wildcard device id. The wildcards are:
-
- - 1000 for the HMS100-TF
- - 1001 for the HMS100-T
- - 1002 for the HMS100-WD
- - 1003 for the RM100-2
- - 1004 for the HMS100-TFK/li>
-
- 1006 for the HMS100-MG
- - 1008 for the HMS100-CO
- - 100e for the HMS100-FIT
-
-
-
- - Some battery low notifications are not yet implemented (RM100,
- HMS100WD).
- - Please test your installation before relying on the
- functionality.
-
-
-
-
-
-
-
- Type KS300
-
- define <name> KS300 <housecode> [ml/raincounter [wind-factor]]
-
-
- <housecode> is a four digit hex number,
- corresponding to the adress of the KS300 device, right now it is ignored.
- The ml/raincounter defaults to 255 ml, but it must be specified if you wish
- to set the wind factor, which defaults to 1.0.
-
-
-
- Examples:
-
- define ks1 KS300 1234
-
-
-
-
-
-
- Type WS300
-
- define WS300Device WS300 <serial device>
- or
- define <devname> WS300 [0-9]
-
- The first line is mandatory if you have a WS300 device: it defines the
- input device with its USB port. The name of this device is fixed and must
- be WS300Device. It must be the first defined WS300 device.
-
- For each additional device (with number 0 to 9) you have to define another
- WS300 device, with an arbitrary name. The WS300 device which reports the
- readings will be defined with the port number 9, an optional KS300 with the
- port number 8.
-
- Examples:
-
- define WS300Device WS300 /dev/ttyUSB1
- define ash2200.1 WS300 0
- define ks300 WS300 8
- define ws300 WS300 9
-
-
-
-
-
- Type EM
-
- define <name> EM <em1010pc-device>
-
-
- Define a EM1010PC USB device. From the software point of view there should
- be no problems if you attach/define more than one EM1010PC, but it is
- unknown if the low-level radio protocol supports this.
Currently there
- is no way to read the internal log of the EM1010PC, use the program
- em1010.pl in the contrib directory for this purpose.
-
- Examples:
-
- define em EM /dev/elv_em1010pc
-
-
-
-
-
- Type EMWZ
-
- define <name> EMWZ <device-number>
-
-
- Define up to 4 EM1000WZ attached to the EM1010PC. The device number must
- be between 1 and 4 (else you have a differnt device connected to the
- EM1010PC). Defining an EMWZ will schedule an internal task, which reads the
- status of the device every 5 minutes, and triggers notify/filelog commands.
-
-
- Example:
-
-
-
-
-
- Type EMEM
-
- define <name> EMEM <device-number>
-
-
- Define up to 4 EM1000EM attached to the EM1010PC. The device number must
- be between 5 and 8.
- Defining an EMEM will schedule an internal task, which reads the
- status of the device every 5 minutes, and triggers notify/filelog commands.
-
Note: Currently this device does not support a "set" function.
-
-
- Example:
-
-
-
-
-
- Type EMGZ
-
- define <name> EMGZ <device-number>
-
-
- Define up to 4 EM1000GZ attached to the EM1010PC. The device number must
- be 9.
- Defining an EMGZ will schedule an internal task, which reads the
- status of the device every 5 minutes, and triggers notify/filelog commands.
-
-
- Example:
-
-
-
-
-
-
- Type M232
-
- define <name> M232 <m232-device>
-
-
- Define a M232 device. You can attach as many M232 devices as you like. A
- M232 device provides 6 analog inputs (voltage 0..5V with 10 bit resolution)
- and 8 bidirectional digital ports. The eighth digital port can be used as a
- 16 bit counter (maximum frequency 3kHz). The M232 device needs to be
- connected to a 25pin sub-d RS232 serial port. A USB-to-serial converter
- works fine if no serial port is available.
-
- Examples:
-
- define m232 M232 /dev/ttyUSB2
-
-
-
-
-
- Type M232Counter
-
- define <name> M232Counter [unit [factor]]
-
-
- Define at most one M232Counter for a M232 device. Defining a M232Counter
- will schedule an internal task, which reads the status of the counter every
- minute, and triggers notify/filelog commands. unit is the unit
- name, factor is used to calculate the reading of the counter
- from number of ticks.
Note: the unit defaults to the string
- "ticks", but it must be specified if you wish to set the factor, which
- defaults to 1.0. In the second example below one tick equals 1/1250th kWh.
- Do not forget to start the counter (with set .. start for
- M232) or to start the counter and set the reading to a specified value
- (with set ... value for M232Counter).
- Example:
-
- define counter M232Counter turns
- define counter M232Counter kWh 0.0008
-
-
-
-
-
- Type M232Voltage
-
- define <name> M232Voltage [an0..an5] [unit [factor]]
-
-
- Define as many M232Voltages as you like for a M232 device. Defining a
- M232Voltage will schedule an internal task, which reads the status of the
- analog input every minute, and triggers notify/filelog commands.
- unit is the unit name, factor is used to
- calibrate the reading of the analog input.
-
- Note: the unit defaults to the string "volts", but it must be specified
- if you wish to set the factor, which defaults to 1.0.
-
- Example:
-
- define volt M232Voltage an0
- define brightness M232Voltage an5 lx 200.0
-
-
-
-
-
-
- Type SCIVT
-
- define <name> SCIVT <SCD-device>
-
-
- Define a SCD series solar controler device. Details see here.
- You probably need a Serial to USB controller like the PL2303.
-
- Defining an SCIVT device will schedule an internal task, which reads the
- status of the device every 5 minutes, and triggers notify/filelog commands.
-
Note: Currently this device does not support a "set" function, only
- a single get function which reads the device status immediately.
-
-
- Example:
-
- define scd SCIVT /dev/ttyUSB2
-
-
-
-
-
- Type WS2000
-
- define <name> WS2000<device_to_connect>
-
-
- Define a WS2000 series raw receiver device sold by ELV. Details see here.
- Unlike 86_FS10.pm it will handle the complete device communication itself and
- doesnt require an external program.
- For this reason you can now use this also on windows.
-
- This Device will be usually connect to a serial port, but you can also
- define a raw network redirector like lantronix XPORT(TM).
-
Note: Currently this device does not support a "set" function
-
-
- Attributes:
-
- rain: factor for calculating amount of rain in ml/count
- altitude: height in meters to calculate pressure for NN(not used yet)
-
-
- Example:
-
- define WS2000 WS2000 /dev/ttyS0
-
-
- define WS2000 WS2000 xport:10001
-
-
- attr WS2000 rain 366 : use factor 366 ml/count for rain sensor S2000R
-
-
-
-
-
- Type IPWE
-
- define <name> IPWE <hostname> [<delay>]
-
-
- Define a IPWE network attached weather data receiver device sold by ELV. Details see here.
- It's intended to receive the same sensors as WS300 (8 T/H-Sensors and one kombi sensor),
- but can be accessed via http and telnet.
-
- For unknown reason, my try to use the telnet interface was not working neither with raw sockets
- nor with Net::Telnet module. Therefore i choosed here the "easy" way
- to simple readout the http page and extract all data from the offered table. For this reason this module doesnt
- contain any option to configure this device.
-
Note: You should give your sensors a name within the web interface, once they a received the first time.
-
To extract a single sensor simply match for this name or sensor id
-
-
- Attributes:
-
- delay: seconds between read accesses(default 300s)
-
-
-
- Example:
-
- define ipwe IPWE ipwe1 120
-
-
- attr ipwe delay 600 : 10min between readouts
-
-
-
-
-
- Type CM11
-
- define <name> CM11 <serial-device>
-
- CM11 is the X10 module to interface X10 devices with the PC.
-
- The current implementation can evaluate incoming data on the powerline of
- any kind. It can send on, off, dimdown and dimup commands.
-
- This statement specifies the serial port to communicate with the CM11.
- The name of the serial-device depends on your distribution. If serial-device
- is none, then no device will be opened, so youcan experiment without
- hardware attached.
-
- If you experience problems (for verbose 4 you get a lot of "Bad CRC message"
- in the log), then try to define your device as
- define <name> FHZ <serial-device> strangetty
-
-
- Example:
-
- define x10if CM11 /dev/ttyUSB3
-
-
-
-
-
- Type X10
-
- define <name> X10 <model> <housecode>
- <unitcode>
-
-
- Defines an X10 device via its model, housecode and unitcode.
-
- Notes:
-
- <model> is one of
-
- lm12: lamp module, dimmable
- lm15: lamp module, not dimmable
- am12: appliance module, not dimmable
- tm12: tranceiver module, not dimmable. Its
- unitcode is 1.
-
- Model determines whether a dim command is reasonable to be sent
- or not.
- <housecode> ranges from A to P.
- <unitcode> ranges from 1 to 16.
-
-
-
- Examples:
-
- define lamp1 X10 lm12 N 10
- define pump X10 am12 B 7
- define lamp2 X10 lm15 N 11
-
-
-
-
-
-
- Type FileLog
-
- define <name> FileLog <filename> <regexp>
-
-
- Log events to <filename>. The log format is
-
- YYYY:MM:DD_HH:MM:SS <device> <event>
- The regexp will be checked against the (complete!) device name
- or against the (complete!) devicename:event combination.
-
- <filename> may contain one or more of the following
- wildcards (a subset of the Unix date command arguments):
-
- %d day of month (01..31)
- %m month (01..12)
- %Y year (1970...)
- %w day of week (0..6); 0 represents Sunday
- %j day of year (001..366)
- %U week number of year with Sunday as first day of week (00..53)
- %V week number of year with Monday as first day of week (01..53)
-
-
- Examples:
-
- define lamplog FileLog /var/tmp/lamp.log lamp
- define wzlog FileLog /var/tmp/wz-%Y-%U.log
- wz:(measured-temp|actuator).*
-
-
-
-
-
- Type DbLog
-
- define <name> DbLog <configfilename> <regexp>
-
-
- Log events to a database. The database connection is defined in
- <configfilename> (see sample configuration file
- db.conf). The configuration is stored in a separate file
- to avoid storing the password in the main configuration file and to have it
- visible in the output of the list command.
-
-
- You must have 93_DbLog.pm in the FHEM subdirectory
- to make this work. Additionally, the modules DBI and
- DBD::<dbtype> need to be installed (use
- cpan -i <module> if your distribution does not have it).
-
- <regexp> is the same as in FileLog.
-
- Sample code to create a MySQL database is in fhemdb_create.sql.
- The database contains two tables: current and
- history. The latter contains all events whereas the former only
- contains the last event for any given reading and device.
- The columns have the following meaning:
-
- - TIMESTAMP: timestamp of event, e.g.
2007-12-30 21:45:22
- - DEVICE: device name, e.g.
Wetterstation
- - TYPE: device type, e.g.
KS300
- - EVENT: event specification as full string,
- e.g.
humidity: 71 (%)
- - READING: name of reading extracted from event,
- e.g.
humidity
- - VALUE: actual reading extracted from event,
- e.g.
71
- - UNIT: unit extracted from event, e.g.
%
-
- The content of VALUE is optimized for automated post-processing, e.g.
- yes is translated to 1.
-
- The current values can be retrieved by means of the perl script
- fhemdb_get.pl. Its output is adapted to what a
- Cacti data input method expects.
- Call fhemdb_get.pl without parameters to see the usage
- information.
-
- Examples:
-
- # log everything to database
- define logdb DbLog /etc/fhem/db.conf .*:.*
-
-
-
-
-
- Type at
-
- define <name> at <timespec> <command>
-
- Start an arbitrary fhem.pl command at a later time.
- <timespec> format: [+][*{N}]<timedet>
-
- The optional + indicates that the specification is
- relative(i.e. it will be added to the current time).
- The optional * indicates that the command should be
- executed repeatedly.
- The optional {N} after the * indicates,that the command
- should be repeated N-times only.
- <timedet> is either HH:MM, HH:MM:SS or {perlfunc()}, where perlfunc
- must return a HH:MM or HH:MM:SS date.
-
-
-
- Examples:
-
- # absolute ones:
- define a1 at 17:00:00 set lamp on # fhem command
- define a2 at 17:00:00 { Log 1, "Teetime" } # Perl command
- define a3 at 17:00:00 "/bin/echo "Teetime" > /dev/console" # shell command
- define a4 at *17:00:00 set lamp on # every day
-
- # relative ones
- define a5 at +00:00:10 set lamp on # switch the lamp on in 10 seconds
- define a6 at +00:00:02 set lamp on-for-timer 1 # Blink once in 2 seconds
- define a7 at +*{3}00:00:02 set lamp on-for-timer 1 # Blink 3 times
-
- # Blink 3 times if the piri sends a command
- define n1 notify piri:on.* define a8 at +*{3}00:00:02 set lamp on-for-timer 1
-
- # Switch the lamp on from sunset to 11 PM
- # Copy 99_SUNRISE_EL.pm in the FHEM directory to have sunset_rel()
- { sunrise_coord("8.686", "50.112", "") }
- define a9 at +*{sunset_rel()} set lamp on
- define a10 at *23:00:00 set lamp off
-
- # More elegant version, works for sunset > 23:00 too
- define a11 at +*{sunset_rel()} set lamp on-till 23:00
-
- # Only do this on weekend
- define a12 at +*{sunset_rel()} { fhem("set lamp on-till 23:00") if($we) }
-
- # Switch lamp1 and lamp2 on from 7:00 till 10 minutes after sunrise
- define a13 at *07:00 set lamp1,lamp2 on-till {sunrise_abs(+600)}
-
- # Switch the lamp off 2 minutes after sunrise each day
- define a14 at +*{sunrise_rel(+120)} set lamp on
-
-
- Notes:
-
- - if no
* is specified, then a command will be executed
- only once, and then the at entry will be deleted. In
- this case the command will be saved to the statefile (as it
- considered volatile, i.e. entered by cronjob) and not to the
- configfile (see the save command.)
-
-
- - if the current time is greater then the time specified, then the
- command will be executed tomorrow. This is why the relative forms
- of the sunset/sunrise functions should be used with the relative
- (+) flag
-
- - In order to use the sunrise_rel()/sunset_rel() functions,
- put { sunrise_coord(long, lat, "") } into your
- lastinclude file, as in the above example.
- If you are not using sunrise_coord, then the coordinates for
- Frankfurt am Main, Germany will be used.
-
-
- - For even more complex date handling you either have to call fhem from
- cron or filter the date in a perl expression, see the last example and
- the section Perl special.
-
-
-
-
-
-
-
- Type watchdog
-
- define <name> watchdog <regexp1> <timespec> <regexp2> <command>
-
- Start an arbitrary fhem.pl command if after <timespec> receiving an
- event matching <regexp1> no event matching <regexp2> is
- received.
- The syntax for <regexp1> and <regexp2> is the same as the
- regexp for notify.
- <timespec> is HH:MM[:SS]
- <command> is a usual fhem command like used int the at or notify
-
-
- Examples:
-
- # "Reset" the FHT80 if we do not receive any message for 15 Minutes
- define w watchdog FHT80 00:15:00 SAME set FHT80 refreshvalues
- # Shout if the HMS100-FIT is not alive
- define w watchdog HMS100-FIT 01:00:00 SAME "alarm-fit.sh"
-
-
- Notes:
-
- - if <regexp1> is . (dot), then activate the watchdog at
- definition time. Else it will be activated when the first matching event
- is received.
-
- - if <regexp2> is SAME, then it will be the same as the first
- regexp, and it will be reactivated, when it is received. This is probably
- the normal operation.
-
-
-
-
-
- Type notify
-
- define <name> notify <pattern> <command>
-
- Execute a command when received an event for the definition <pattern>. If
- <command> is enclosed in {}, then it is a perl expression, if it is
- enclosed in "", then it is a shell command, else it is a "plain" fhem.pl
- command (chain). See the trigger command for
- testing it.
-
- Examples:
-
- define b3lampV1 notify btn3 set lamp %
- define b3lampV2 notify btn3 { fhem "set lamp %" }
- define b3lampV3 notify btn3 "/usr/local/bin/setlamp "%""
- define b3lampV3 notify btn3 set lamp1 %;;set lamp2 %
- define wzMessLg notify wz:measured.* "/usr/local/bin/logfht @ "%""
-
- define LogUndef notify UNDEFINED "send-me-mail.sh "%""
-
-
-
- Notes:
-
- - The character
% will be replaced with the received event,
- e.g. with on or off or measured-temp: 21.7
- (Celsius)
It is advisable to put the % into double
- quotes, else the shell may get a syntax error.
-
- - The character
@ will be replaced with the device
- name.
-
- - To use % or @ in the text itself, use the double mode (%% or @@).
-
- - Instead of
% and @, the parameters
- %EVENT (same as %), %NAME
- (same as @) and %TYPE (contains the device
- type, e.g. FHT) can be used. A single %
- looses its special meaning if any of these parameters appears in the
- definition.
-
- <pattern> may also be a compound of
- definition:event to filter for events.
-
- <pattern> must completely (!)
- match either the device name, or the compound of the device name and the
- event. The event is either the string you see in the list output in paranthesis after the device name, or the
- string you see when you do a detailed list of the device.
-
- - To use database logging, copy the file contrib/91_DbLog.pm into your
- modules directory, and change the $dbconn parameter in the file.
-
- - Each undefined device (FS20, HMS, FHT) will be reported with the
- device name "UNDEFINED". The % parameter will contain the type (FS20,
- HMS100T, etc) and device number, separated by a space.
-
-
-
-
-
- Type weblink
-
- define <name> weblink [link|fileplot] <argument>
-
- This is a placeholder used with webpgm2 to be able to integrate links
- into it, and to be able to put more than one gnuplot/SVG picture on one
- page. It has no set or get methods.
-
- Examples:
-
- define wl_1 weblink link http://www.fhem.de
- define wl_2 weblink fileplot <logdevice>:<gnuplot-file>:<logfile>
-
-
-
- Notes:
-
- - Normally you won't have to define fileplot weblinks manually, as
- FHEMWEB makes it easy for you, just plot a logfile (see
- logtype) and convert it to weblink. Now you
- can group these weblinks by putting them into rooms. If you convert
- the current logfile to a weblink, it will always refer to the current
- file (and not the one you originally specified).
-
-
-
-
- Type dummy
-
- define <name> dummy
-
-
- Define a dummy. A dummy can take via set any values.
- Used for programming.
- Example:
-
- define myvar dummy
- set myvar 7
-
-
-
@@ -1427,6 +364,7 @@ fs20usr
or all attributes for a device (if no <attrname> is defined).
See the Device specification section for details on
<devspec>.
+
Examples:
@@ -1457,182 +395,16 @@ fs20usr
get <devspec> <type-specific>
Ask a value directly from the device, and wait for an answer. In general, you
- can get a list of possible commands by
get <device> ?
-
+ can get a list of possible parameters by
+
See the Device specification section for details on
<devspec>.
-
-
- Type FHZ:
-
- get FHZ <value>
-
- where value is one of:
-
- init1
- init2
- init3
- serial
- fhtbuf
- Notes:
-
- - The mentioned codes are needed for initializing the FHZ1X00
- - The answer for a command is also displayed by
list FHZ
-
- -
- The FHZ1x00PC has a message buffer for the FHT (see the FHT entry in
- the set section). If the buffer is full, then newly
- issued commands will be dropped, if the attribute fhtsoftbuffer is not set.
-
fhtbuf returns the free memory in this buffer (in hex),
- an empty buffer in the FHZ1000 is 2c (42 bytes), in the FHZ1300 is 4a
- (74 bytes). A message occupies 3 + 2x(number of FHT commands) bytes,
- this is the second reason why sending multiple FHT commands with one
- set is a good idea. The first reason is, that
- these FHT commands are sent at once to the FHT.
-
-
-
-
-
- Type EM:
-
- get EM <value>
-
- where value is either version or time.
-
-
-
- Type EMWZ:
-
- get EMWZ status
-
- This is the same command which is scheduled every 5 minutes internally.
-
-
-
- Type M232:
-
- get <name> [an0..an5]
-
- Gets the reading of analog input 0..5 in volts.
-
- get <name> [io0..io7]
-
- Gets the state of digital ports 0..7, result is 0 or 1.
-
- get <name> octet
-
- Gets the state of all digital ports at once, result is 0..255.
-
- get <name> counter
-
- Gets the number of ticks of the counter since the last reset. The counter
- wraps around from 65535 to 0.
-
-
-
-
- Type M232Counter:
-
- get <name> status
-
- Gets the reading of the counter multiplied by the factor from the
- define statement. Wraparounds of the counter are accounted for
- by an offset (see reading basis in the output of the
- list statement for the device).
-
-
-
-
- Type WS2000:
-
- get <name> list
-
- Gets the last reading of all received sensord
-
- get <name> [TH0..TH7, T0..T7, I0..I7, R0..R7, W0..W7, L0..L7, P0..P7,LAST,RAW]
- get the last reading for the name sensor,
- LAST: Last received Sensor
-
- RAW: original Data from interface
-
-
-
-
-
- Type IPWE
-
- get <name> status
-
- Gets actual data from device for sensors with data
-
- get <name> < sensorname>
-
- will grep output from device for this sensorname
-
-
-
-
- Type FileLog
-
- get <name> <infile> <outfile> <from>
- <to> <column_spec>
-
- Read data from the logfile.
-
- - <infile>
- Name of the logfile to grep. "-" is the current logfile, or you can
- specify an older file (or a file from the archive).
- - <outfile>
- If it is "-", you get the data back on the current connection, else it
- is the prefix for the output file. If more than one file is specified,
- the data is separated by a comment line for "-", else it is written in
- separate files, numerated from 0.
-
- - <from> <to>
- Used to grep the data. The elements should correspond to the
- timeformat or be an initial substring of it.
- - <column_spec>
- For each column_spec return a set of data in a separate file or
- separated by a comment line on the current connection.
- Syntax: <col>:<regexp>:<default>:<fn>
-
- - <col>
- The column number to return, starting at 1 with the date.
- If the column is enclosed in double quotes, then it is a fix text,
- not a column nuber.
- - <regexp>
- If present, return only lines containing the regexp. Case sensitive.
-
- - <default>
- If no values were found and the default value is set, then return
- one line containing the from value and this default. We need this
- feature as gnuplot aborts if a dataset has no value at all.
-
- - <fn>
- One of the following:
-
- - int
- Extract the integer at the beginning og the string. Used e.g.
- for constructs like 10%
- - delta-h or delta-d
- Return the delta of the values for a given hour or a given day.
- Used if the column contains a counter, as is the case for the
- KS300 rain column.
- - everything else
- The string is evaluated as a perl expression. @fld is the
- current line splitted by spaces. Note: The string/perl
- expression cannot contain spaces, as the part after the space
- will be considered as the next column_spec.
-
-
-
-
- Example:
-
get outlog out-2008.log - 2008-01-01 2008-01-08 4:IR:int: 9:IR::
-
-
+
+ Each device has different get parameters, see the corresponding device
+ section for details.
+
@@ -1650,11 +422,15 @@ fs20usr
inform
- inform [on|off]
+ inform [on|off|timer]
If set to on, and a device state changes, send a notification to the current
client. This command can be used by other programs/modules to receive a
- notification.
+ notification.
+ The option timer prepends a timerstamp to the line. Note: this command is
+ a nice way to check which events are generated, to help you when creating
+ notify or FileLog entries.
+
@@ -1717,36 +493,7 @@ fs20usr
room Heizung
Readings:
2006-11-02 09:45:56 actuator 19%
- 2006-10-28 15:10:58 code_0000aa 17
- 2006-10-07 10:52:09 code_0000ba 0
- 2006-11-02 10:40:08 code_4b004b 0
- 2006-11-02 08:24:46 code_7e0067 0
- 2006-11-02 04:13:35 day-temp 21.0 (Celsius)
- 2006-11-02 06:03:37 desired-temp 21.0 (Celsius)
- 2006-11-02 04:13:31 fri-from1 06:00
- 2006-11-02 04:13:31 fri-to1 23:50
- 2006-11-02 04:13:36 lowtemp-offset 2.0 (Celsius)
- 2006-11-02 10:40:06 measured-high 0
- 2006-11-02 10:40:06 measured-low 211
- 2006-11-02 10:40:06 measured-temp 21.1 (Celsius)
- 2006-11-02 04:13:39 mode auto
- 2006-11-02 04:13:25 mon-from1 06:00
- 2006-11-02 04:13:25 mon-to1 23:00
- 2006-11-02 04:13:35 night-temp 18.0 (Celsius)
- 2006-11-02 04:13:32 sat-from1 08:00
- 2006-11-02 04:13:33 sat-to1 23:50
- 2006-11-02 04:13:34 sun-from1 08:00
- 2006-11-02 04:13:34 sun-to1 23:00
- 2006-11-02 04:13:29 thu-from1 06:00
- 2006-11-02 04:13:29 thu-to1 23:00
- 2006-11-02 04:13:26 tue-from1 06:00
- 2006-11-02 04:13:26 tue-to1 23:00
- 2006-11-02 10:40:07 warnings Battery low
- 2006-11-02 04:13:27 wed-from1 06:00
- 2006-11-02 04:13:28 wed-to1 23:00
- 2006-11-02 04:13:36 windowopen-temp 12.0 (Celsius)
-Send buffer:
2007-10-19 00:31:24 desired-temp 22.5
- 2007-10-19 00:33:20 mode auto
+ [...]
@@ -1759,7 +506,7 @@ Send buffer:
2007-10-19 00:31:24 desired-temp 22.5
Used to modify some definitions. Useful for changing some at or notify definitions. If specifying
- one argument to an at type deinition, only the time part will be changed. In
+ one argument to an at type definition, only the time part will be changed. In
case of a notify type definition, only the regex part will be changed. All
other values (state, attributes, etc) will remain intact.
@@ -1791,8 +538,8 @@ Send buffer:
2007-10-19 00:31:24 desired-temp 22.5
reload <module>
- Reload the given module from the module directory. Mainly intended to reload
- the 99_PRIV file (or equivalent) in order to test perl-scripts.
+ Reload the given module from the module directory. It is a convenient way to
+ test modules whithout restarting the program.
Example:
@@ -1807,7 +554,8 @@ Send buffer:
2007-10-19 00:31:24 desired-temp 22.5
Re-read the configuration file.
Note: The statefile will be saved first, then the config file will be read
- (all devices will be initialized again), and at last the statefile will be reloaded again.
+ (all devices will be initialized again), and at last the statefile will be
+ reloaded.
Example:
@@ -1838,26 +586,306 @@ Send buffer:
2007-10-19 00:31:24 desired-temp 22.5
set <devspec> <type-specific>
Set parameters of a device / send signals to a device. You can
- get a list of possible commands by
set <name> ?
-
+ get a list of possible parameters by
+
See the Device specification section for details on
- <devspec>.
+ <devspec>. The set command returns only a value on error.
+
+ Each device has different set parameters, see the corresponding device
+ section for details.
+
+
+
+
+
+
+setstate
+
+ setstate <devspec> <value>
+
+ Set the "STATE" for <name> as shown in paranthesis in the
+ list command
+ to <value> without sending any signals to the device
+ itself. This command is also used in the statefile.
+ See the Device specification section for details on
+ <devspec>.
+
+ Examples:
+
+ Note:
+
+ - The statefile uses another version of this command, don't be surprised.
+
+
+
+
+
+
+shutdown
+
+
+
+
+trigger
+
+ trigger <devspec> <state>
+
+ Trigger a notify definition.
+ See the Device specification section for details on
+ <devspec>.
+
+
+ Example:
+
+
+
+
+sleep
+
+ sleep <sec>
+
+ Sleep for a given amount, millisecond accuracy.
+
+ Example:
+
+ sleep 0.5
+ notify btn3 set lamp toggle;;sleep 0.5;;set lamp toggle
+
+
+ Note: As the server is not multithreaded, everything is blocked for
+ the given amount.
+
+
+
+
+
+xmllist
+
+ xmllist
+
+ Returns an XML tree of all definitions, all notify settings and all at
+ entries. It is not intended for human consumption.
+
+ Example:
+
FHZ> xmllist
+ <FHZINFO>
+ <internal_LIST>
+ <internal name="global" state="internal" sets="" attrs="room configfile logfile modpath pidfilename port statefile userattr verbose version">
+ <INT key="DEF" value="<no definition>"/>
+ <INT key="NR" value="0"/>
+ <INT key="STATE" value="internal"/>
+ [...]
+
+
+
+
+Devices
+
+
+global
+
+ The global device is used to set different global attributes. It will be
+ automatically defined, it cannot be deleted or renamed and has no set or get
+ parameters
+
+
+ Define
+
+ Set
+
+ Get
+
+ Attributes
+
+
+ - configfile
+ Contains the name of the fhem configuration file. If save is called without argument, then the output will
+ be written to this file.
+
+
+
+ - lastinclude
+ If this attribute is set, then the last command of the generated
+ configfile (see the save command) will be
+ include <lastinclude-value>
+ This file is needed, as the save command will write only defines and
+ attributes to the config file, any other commands / includes will be
+ lost. E.g. it makes sense to set the FHTcode in
+ this file or the coordinates of your house via
+ sunrise_coord
+
+
+
+ - logfile
+ Specify the logfile to write. You can use "-" for
+ stdout, in this case the server won't background itself.
+ The logfile name can also take wildcards for easier logfile rotation,
+ see the FileLog section.
+
+
+
+ - nofork
+ If set and the logfile is not "-", do not try to background. Needed
+ on some Fritzbox installations.
+
+
+
+ - mseclog
+ If set, the timestamp in the logfile will contain a millisecond part.
+
+
+
+ - modpath
+ Specify the path to the modules directory FHEM. The path
+ does not contain the directory FHEM. Upon setting the
+ attribute, the directory will be scanned for filenames of the form
+ NN_<NAME>.pm, and make them available for device definition under
+ <NAME>. If the first device of type <NAME> is defined, the
+ module will be loaded, and its function with the name
+ <NAME>_Initialize will be called. Exception to this rule are
+ modules with NN=99, these are considered to be utility modules
+ containing only perl helper functions, they are loaded at startup (i.e.
+ modpath attribute definition time).
+
+
+
+ - pidfilename
+ Write the process id of the perl process to the specified file. The
+ server runs as a daemon, and some distributions would like to check by
+ the pid if we are still running. The file will be deleted upon
+ shutdown.
+
+
+
+ - port
+ Listen on the TCP/IP port <number> for incoming
+ connections. To offer at least a little bit of security, the server
+ will only listen for connections from the localhost per default. If
+ there is a second value "global" then the server will listen for
+ non-localhost connections too.
+
+
+
+ - allowfrom
+ Comma (,) separated list of ip-addresses or hostnames. If set,
+ only connections from these addresses are allowed.
+
+
+
+
+ - statefile
+ Set the filename where the state and certain at
+ information will be saved before shutdown. If it is not specified, then
+ no information will be saved.
+
+
+
+ - title
+ Used by the web frontend fhemweb.pl (webpgm2) as a Page title.
+
+
+
+ - userattr
+ A space separated list which contains the names of additional
+ attributes. Without specifying them you will not be able to set them
+ (in order to prevent typos).
+
+
+
+ - verbose
+ Set the verbosity level. Possible values:
+
+ - 0 - server start/stop
+
- 1 - error messages or unknown packets
+
- 2 - major events/alarms.
+
- 3 - commands sent out will be logged.
+
- 4 - you'll see whats received by the different devices.
+
- 5 - debugging.
+
+ Recommended level is 3 for normal use.
+
+
+
+
+
+
+
+FHZ
+
+
+
+ Define
+
+ define <name> FHZ <serial-device>
+
+ Specifies the serial port to communicate with the FHZ1000PC or FHZ1300PC.
+ The name(s) of the serial-device(s) depends on your distribution.
+
+ If the serial-device is called none, then no device will be opened, so you
+ can experiment without hardware attached.
+
+ The program can service multiple devices, FS20 and FHT device commands will
+ be sent out through the last FHZ device defined before the definition of
+ the FS20/FHT device. To change the association, use the set command activefor. Important: this definition
+ must occur after the modpath command but before any other (FHZ related)
+ device definition, else you'll see "no I/O device found" messages.
+
+ Set the attribute "repeater" for this device to 1 to ignore events received
+ from a FS20 repeater. In fact we are not sure that they are repeater
+ messages, we just ignore messages which were sent out by our device for the
+ next 3 seconds (or configured otherwise by filtertimeout).
+
+
+ For GNU/Linux you may want to read our hints for
+ GNU/Linux about multiple USB
+ devices.
+
+ Note:The firmware of the FHZ1x00 will drop commands if the airtime
+ for the last hour would exceed 1% (which corresponds roughly to 163
+ commands). For this purpose there is a command counter for the last hour
+ (see list FHZDEVICE), which triggers with "TRANSMIT LIMIT EXCEEDED" if
+ there were more than 163 commands in the last hour.
+
+ If you experience problems (for verbose 4 you get a lot of "Bad CRC
+ message" in the log), then try to define your device as
define
+ <name> FHZ <serial-device> strangetty
+
+
- Type FHZ:
+ Set
set FHZ <variable> [<value>]
where value is one of:
-
- initFS20
- initHMS
- time
- FHTcode
- activefor
- raw
- initfull
- reopen
+
+ FHTcode
+ activefor
+ initFS20
+ initHMS
+ initfull
+ raw
+ reopen
+ time
+
Notes:
- use activefor if you have multiple FHZ devices, and you want to
@@ -1893,14 +921,150 @@ Send buffer:
2007-10-19 00:31:24 desired-temp 22.5
set FHZ time
set FHZ raw 04 01010100010000
reopen closes and reopens the serial device port. This
- implicitely initializes the FHZ and issues the
+ implicitly initializes the FHZ and issues the
initfull command sequence.
+
+
+
+ Get
+
+ get FHZ <value>
+
+ where value is one of:
+
+ init1
+ init2
+ init3
+ serial
+ fhtbuf
+
+ Notes:
+
+ - The mentioned codes are needed for initializing the FHZ1X00
+ - The answer for a command is also displayed by
list FHZ
+
+ -
+ The FHZ1x00PC has a message buffer for the FHT (see the FHT entry in
+ the set section). If the buffer is full, then newly
+ issued commands will be dropped, if the attribute fhtsoftbuffer is not set.
+
fhtbuf returns the free memory in this buffer (in hex),
+ an empty buffer in the FHZ1000 is 2c (42 bytes), in the FHZ1300 is 4a
+ (74 bytes). A message occupies 3 + 2x(number of FHT commands) bytes,
+ this is the second reason why sending multiple FHT commands with one
+ set is a good idea. The first reason is, that
+ these FHT commands are sent at once to the FHT.
+
+
+
+
+
+ Attributes
+
+
+ - do_not_notify
+ Disable FileLog/notify/inform notification for a device. This affects
+ the received signal, the set and trigger commands.
+
+ - dummy
+
+
+ - filtertimeout
+ Ignore duplicate messages for this amount of time. The time is in
+ seconds, fractions are allowed. It affects installations with more then
+ one FHZ device or repeater, see the repeater
+ entry.
+
+
+
+ - repeater
+ Set the attribute "repeater" for an FHZ device to 1 to ignore events
+ received from a FS20 repeater. In fact we are not sure that they are
+ repeater messages, we just ignore messages which were sent out by our
+ device for the next 3 seconds (see the next attribute)
+
+
+ - showtime
+
+
+ - loglevel
+ Set the device loglevel to e.g. 6 if you do not wish messages from a
+ given device to appear in the global logfile (FHZ/FS20/FHT). E.g. to
+ set the FHT time, you should schedule "set FHZ time" every minute, but
+ this in turn makes your logfile unreadable. These messages will not be
+ generated if the FHZ attribute loglevel is set to 6.
+
+ - model (fhz1000,fhz1300)
+
+
+ - fhtsoftbuffer
+ Can be applied to FHZ devices.
+ As the FHZ command buffer for FHT devices is limited (see fhtbuf),
+ and commands are only sent to the FHT device every 120 seconds,
+ the hardware buffer may overflow and FHT commands get lost.
+ Setting this attribute implements an "unlimited" software buffer
+ Default is disabled (i.e. not set or set to 0).
+
+
+
-
- Type FS20:
+
+
+FS20
+
+ The FS20 protocol is used by a wide range of devices, which are either of
+ the sender/sensor category or the receiver/actuator category. The radio
+ (868.35 MHz) messages are either received through an FHZ
+ or an CUL device, so this must be defined first.
+
+
+
+
+ Define
+
+ define <name> FS20 <housecode> <button>
+ [fg <fgaddr>] [lm <lmaddr>] [gm FF]
+
+
+ The values of housecode, button, fg, lm, and gm can be either defined as
+ hexadecimal value or as ELV-like "quad-decimal" value with digits 1-4. We
+ will reference this ELV-like notation as ELV4 later in this document. You
+ may even mix both hexadecimal and ELV4 notations, because FHEM can detect
+ the used notation automatically by counting the digits.
+
+
+ <housecode> is a 4 digit hex or 8 digit ELV4 number,
+ corresponding to the housecode address.
+ <button> is a 2 digit hex or 4 digit ELV4 number,
+ corresponding to a button of the transmitter.
+ - The optional
<fgaddr> specifies the function group.
+ It is a 2 digit hex or 4 digit ELV address. The first digit of the hex
+ adress must be F or the first 2 digits of the ELV4 address must be
+ 44.
+ - The optional
<lmaddr> specifies the local
+ master. It is a 2 digit hex or 4 digit ELV address. The last digit of the
+ hex address must be F or the last 2 digits of the ELV4 address must be
+ 44.
+ - The optional gm specifies the global master, the adress must be FF if
+ defined as hex value or 4444 if defined as ELV4 value.
+
+
+
+ Examples:
+
+ define lamp FS20 7777 00 fg F1 gm F
+ define roll1 FS20 7777 01
+ define otherlamp FS20 24242424 1111 fg 4412 gm 4444
+ define otherroll1 FS20 24242424 1114
+
+
+
+
+
+ Set
set <name> <value> [<time>]
@@ -1966,10 +1130,86 @@ Send buffer:
2007-10-19 00:31:24 desired-temp 22.5
+
+ Get
+
+ Attributes
+
+ - do_not_notify
+
+ - dummy
+ Can be applied to FS20/FHT devices.
+ Set the device attribute dummy to define devices which should not
+ output any radio signals. Associated notifys will be executed if
+ the signal is received. Used e.g. to react to a code from a sender, but
+ it will not emit radio signal if triggered in the web frontend.
+ Implemented for FS20 and FHT devices.
+
+
+ - follow-on-for-timer
+ the program automatically schedules a "setstate off" for the time
+ specified as argument to the on-for-timer command (for the specified
+ device only).
+
+
+ - loglevel
+
+ - showtime
+
+
+ - model
+ The model attribute denotes the model type of the device.
+ The attributes will (currently) not be used by the fhem.pl directly.
+ It can be used by e.g. external programs or web interfaces to
+ distinguish classes of devices and send the appropriate commands
+ (e.g. "on" or "off" to a fs20st, "dim..%" to fs20du etc.).
+ The spelling of the model names are as quoted on the printed
+ documentation which comes which each device. This name is used
+ without blanks in all lower-case letters. Valid characters should be
+ a-z 0-9 and - (dash),
+ other characters should be ommited. Here is a list of "official"
+ devices:
+ Sender/Sensor: fs20hgs fs20pira fs20piri fs20s20 fs20s8 fs20s4
+ fs20s4a fs20s4m fs20s4u fs20s4ub fs20sd fs20sn fs20sr fs20ss
+ fs20str fs20tfk fs20tfk fs20tk fs20uts fs20ze
+ Receiver/Actor: fs20as1 fs20as4 fs20di fs20du fs20ms2
+ fs20rst fs20sa fs20sig fs20st fs20sv fs20sv fs20usr
+
+
+
+
+
+
+
+
+FHT
+
+ Fhem can receive FHT radio (868.35 MHz) messages either through an FHZ or an CUL device, so this must be
+ defined first.
+
+
+ Define
+
+ define <name> FHT <housecode>
+
+
+ <housecode> is a four digit hex number,
+ corresponding to the adress of the FHT80b device.
+
+
+ Examples:
+
+
+ See the FHT section in set for more.
+
+
- Type FHT:
+ Set
set <name> <valuetype> <value>
@@ -2126,17 +1366,343 @@ Send buffer:
2007-10-19 00:31:24 desired-temp 22.5
+
-
- Type WS300:
+ Get
+
+ Attributes
- set WS300Device <interval(min.)> <height(m)> <rainvalume(ml)>
+ - do_not_notify
+ - dummy
+ - loglevel
+ - model (fht80b)
+ - showtime
+
+
+ - retrycount
+ Can be applied to FHT devices.
+ If the fhtsoftbuffer attribute is set, then
+ resend commands retrycount times if after 240 seconds
+ no confirmation message is received from the corresponding FHT
+ device.
+ Default is 3.
+
+
+ - minfhtbuffer
+ Can be applied to FHT devices.
+ FHEM wont send commands to the FHZ if its fhtbuffer is below
+ this value, default is 0. If this value is low, then the ordering of
+ fht commands (see the note in the FHT section of set)
+ has little effect, as only commands in the softbuffer can be
+ prioritized. The maximum value should be 7 below the hardware maximum
+ (see fhtbuf).
+
+
+
+
+
+
+
+HMS
+
+
+ Define
+
+ define <name> HMS <housecode>
- Set some WS300 configuration parameters.
+
+ <housecode> is a four digit hex number,
+ corresponding to the adress of the HMS device.
+
+
+ Examples:
+
+ Notes:
+
+ - There is _NO_ guarantee that the code will work as expected in all
+ circumstances, the authors are not liable for any damage occuring as a
+ result of incomplete or buggy code
+
+ - Currently supported devices are the HMS100-T HMS100-TF HMS100-WD
+ HMS100-MG HMS100-TFK HMS100-CO HMS100-FIT RM100-2
+
+ - The housecode of the HMS devices may change if the battery is renewed.
+ In order to make life easier, you can define a "wildcard" device for each
+ type of HMS device. First the real device-id will be checked, then the
+ wildcard device id. The wildcards are:
+
+ - 1000 for the HMS100-TF
+ - 1001 for the HMS100-T
+ - 1002 for the HMS100-WD
+ - 1003 for the RM100-2
+ - 1004 for the HMS100-TFK/li>
+
- 1006 for the HMS100-MG
+ - 1008 for the HMS100-CO
+ - 100e for the HMS100-FIT
+
+
+
+ - Some battery low notifications are not yet implemented (RM100,
+ HMS100WD).
+ - Please test your installation before relying on the
+ functionality.
+
+
+
+
+
+
+ Set
+
+ Get
+
+ Attributes
+
+
+
+
+
+
+CUL
+
+ The CUL is an USB device sold by busware.de
+ . With the opensource firmware (see this google discussion) it is
+ capable to receive/send different 868MHz protocols, e.g. FS20/FHT/S300/EM.
+
+ Some protocols (FS20/FHT) are converted by this module so that the same
+ logical device can be used, irrespective if the radio telegram is received by
+ a CUL or an FHZ device.
+ Other protocols (S300/EM) need their own modules. E.g. S300 devices are
+ processed by the CUL_WS module if the signals are received by the CUL,
+ similarly EMWZ/EMGZ/EMEM is handled by the CUL_EM module.
+
+
+
+ Define
+
+ define <name> CUL <serial-device> [mobile]
+
+ Specifies the serial port to communicate with the CUL or CUR.
+ The name(s) of the serial-device(s) depends on your distribution,
+ under linux the cdc_acm kernel module is responsible, and usually a
+ /dev/ttyACM0 device will be created.
+
+ If the serial-device is called none, then no device will be opened, so you
+ can experiment without hardware attached.
+ If you specify the "mobile" parameter, then fhem.pl won't block if the
+ device is removed. This is mainly intended for the CUR.
+
+
+
+
+ Set
+
+ - verbose
+ Set a CUL "verbose" level. See the CUL firmware README document for
+ details. Note: only X00/X01/X21/X25 is supported by the fhem CUL
+ module, the other flags may crash fhem.
+
+ - raw
+ Issue a CUL firmware command. See the CUL firmware README document for
+ details on CUL commands.
+
+ - freq / bandwidth
+ Set the CUL frequency / bandwidth. Use it with care, it may destroy
+ your hardware and it even may be illegal to do so.
+
+
+ Get
+
+ - version
+ return the CUL firmware version
+
+ - raw
+ Issue a CUL firmware command, and wait for one line of data returned by
+ the CUL. See the CUL firmware README document for details on CUL
+ commands.
+
+ - ccconf
+ Read some CUL radio-chip (cc1101) registers (frequency, bandwidth, etc),
+ and display them in human readable form.
+
+
+
+ Attributes
+
+
+
+
+
+CUL_WS
+
+ The CUL_WS module interprets S300 type of messages received by the CUL.
+
+
+
+ Define
+
+ define <name> CUL_WS <code> [corr1...corr4]
+
+ <code> is the code which must be set on the S300 device. Valid values
+ are 1 through 8.
+ corr1..corr4 are up to 4 numerical correction factors, which will be added
+ to the respective value to calibrate the device. Note: rain-values will be
+ multiplied and not added to the correction factor.
+
+
+
+
+ Set
+
+
+ Get
+
+ Attributes
+
+
+
+
+
+CUL_EM
+
+ The CUL_EM module interprets EM type of messages received by the CUL, notably
+ from EMEM, EMWZ or EMGZ devices.
+
+
+
+ Define
+
+ define <name> CUL_EM <code> [corr]
+
+ <code> is the code which must be set on the EM device. Valid values
+ are 1 through 12. 1-4 denotes EMWZ, 5-8 EMEM and 9-12 EMGZ devices.
+ corr (if specified) will be multiplied to the value delivered in the
+ message.
+
+ - for EMWZ devices you should specify the rotation speed (R/kW)
+ of your watt-meter (e.g. 150)
+ - for EMEM devices the correct value is 0.01.
+
+
+
+
+
+ Set
+
+
+ Get
+
+ Attributes
+
+
+
+
+
+
+EM
+
+
+ Define
+
+ define <name> EM <em1010pc-device>
+
+
+ Define a EM1010PC USB device. As the EM1010PC was not designed to be used
+ with a PC attached to it all the time, it won't transmit received signals
+ automatically, fhem has to poll it every 5 minutes.
+
+ Currently there is no way to read the internal log of the EM1010PC with
+ fhem, use the program em1010.pl in the contrib directory for this
+ purpose.
+
+ Examples:
+
+ define em EM /dev/elv_em1010pc
+
+
+
+
+
+ Set
+
+ set EM <value>
+
+ where value is either time or reset.
+ If time has arguments of the form YYYY-MM-DD HH:MM:SS, then the specified
+ time will be set, else the time from the host.
+ Note: after reset you should set the time.
+
+
+
+
+ Get
+
+ get EM <value>
+
+ where value is either version or time.
+
+
+ Attributes
+
+
+
+
+
+EMWZ
+
+
+ Define
+
+ define <name> EMWZ <device-number>
+
+
+ Define up to 4 EM1000WZ attached to the EM1010PC. The device number must
+ be between 1 and 4. Defining an EMWZ will schedule an internal task, which
+ reads the status of the device every 5 minutes, and triggers notify/filelog
+ commands.
+
+ Example:
+
+
+
+
- Type EMWZ:
+ Set
set EMWZdevice <param> <value>
where param is one of:
@@ -2155,38 +1721,264 @@ Send buffer:
2007-10-19 00:31:24 desired-temp 22.5
only on the EM1010PC display, it is of no interest for FHEM.
+
- Type M232:
+
+
+ Get
- set <name> stop
+ get EMWZ status
- Stops the counter.
+ This is the same command which is scheduled every 5 minutes internally.
+
+
+
+ Attributes
+
+
+
+
+
+
+EMGZ
+
+
+ Define
+
+ define <name> EMGZ <device-number>
- set <name> start
-
- Resets the counter to zero and starts it.
-
- set <name> octet
-
- Sets the state of all digital ports at once, value is 0..255.
-
- set <name> io0..io7 0|1
-
- Turns digital port 0..7 off or on.
+
+ Define up to 4 EM1000GZ attached to the EM1010PC. The device number must
+ be between 9 and 12.
+ Defining an EMGZ will schedule an internal task, which reads the
+ status of the device every 5 minutes, and triggers notify/filelog commands.
+
+ Example:
+
- Type M232Counter:
+
+ Set
- set <name> value <value>
-
- Sets the reading of the counter to the given value. The counter is reset
- and started and the offset is adjusted to value/unit.
-
+ set EMGZdevice <param> <value>
+ where param is:
+
+ - price
+ The price of one KW in EURO (use e.g. 0.20 for 20 Cents). It is used
+ only on the EM1010PC display, it is of no interest for FHEM.
+
+
+
+
+ Get
+
+ get EMGZ status
+
+ This is the same command which is scheduled every 5 minutes internally.
+
+
+
+ Attributes
+
+
+
+
+
+EMEM
+
+
+
+
+ Define
+
+ define <name> EMEM <device-number>
+
+
+ Define up to 4 EM1000EM attached to the EM1010PC. The device number must
+ be between 5 and 8.
+ Defining an EMEM will schedule an internal task, which reads the
+ status of the device every 5 minutes, and triggers notify/filelog commands.
+
Note: Currently this device does not support a "set" function.
+
+
+ Example:
+
+
+
+
+ Set
+
+
+
+ Get
+
+ get EMEM status
+
+ This is the same command which is scheduled every 5 minutes internally.
+
+
+
+ Attributes
+
+
+
+
+
+KS300
+
+ Fhem can receive the KS300 radio (868.35 MHz) messages through FHZ, WS300 or an CUL
+ device, so one of them must be defined first.
+ This module services messages received by the FHZ device, if you use one of
+ the other alternetives, see the WS300 or CUL_WS entries.
+
+
+
+ Define
+
+ define <name> KS300 <housecode> [ml/raincounter [wind-factor]]
+
+
+ <housecode> is a four digit hex number,
+ corresponding to the adress of the KS300 device, right now it is ignored.
+ The ml/raincounter defaults to 255 ml, but it must be specified if you wish
+ to set the wind factor, which defaults to 1.0.
+
+
+ Examples:
+
+ define ks1 KS300 1234
+
+
+
+
+ Set
+
+
+
+ Get
+
+
+
+ Attributes
+
+
+
+
+
+
+CM11
+
+
+
+
+ Define
+
+ define <name> CM11 <serial-device>
+
+ CM11 is the X10 module to interface X10 devices with the PC.
+
+ The current implementation can evaluate incoming data on the powerline of
+ any kind. It can send on, off, dimdown and dimup commands.
+
+ The name of the serial-device depends on your distribution. If
+ serial-device is none, then no device will be opened, so you can experiment
+ without hardware attached.
+
+ If you experience problems (for verbose 4 you get a lot of "Bad CRC message"
+ in the log), then try to define your device as
+ define <name> FHZ <serial-device> strangetty
+
+
+ Example:
+
+ define x10if CM11 /dev/ttyUSB3
+
+
+
+
+ Set
+
+ Get
+
+ Attributes
+
+
+
+
+
+X10
+
+
+ Define
+
+ define <name> X10 <model> <housecode>
+ <unitcode>
+
+
+ Defines an X10 device via its model, housecode and unitcode.
+
+ Notes:
+
+ <model> is one of
+
+ lm12: lamp module, dimmable
+ lm15: lamp module, not dimmable
+ am12: appliance module, not dimmable
+ tm12: tranceiver module, not dimmable. Its
+ unitcode is 1.
+
+ Model determines whether a dim command is reasonable to be sent
+ or not.
+ <housecode> ranges from A to P.
+ <unitcode> ranges from 1 to 16.
+
+
+
+ Examples:
+
+ define lamp1 X10 lm12 N 10
+ define pump X10 am12 B 7
+ define lamp2 X10 lm15 N 11
+
+
+
- Type X10:
+ Set
set <name> <value> [<argument>]
@@ -2236,8 +2028,969 @@ Send buffer:
2007-10-19 00:31:24 desired-temp 22.5
+
+
+ Get
+
+ Attributes
+
+
+
+
+
+LIRC
+
+
+
+ Define
+
+ define <name> LIRC <device>
+
+
+
+ Set
+
+ Get
+
+ Attributes
+
+
+
+WS300
+
+
+
+
+ Define
+
+ define WS300Device WS300 <serial device>
+ or
+ define <devname> WS300 [0-9]
+
+ The first line is mandatory if you have a WS300 device: it defines the
+ input device with its USB port. The name of this device is fixed and must
+ be WS300Device. It must be the first defined WS300 device.
+
+ For each additional device (with number 0 to 9) you have to define another
+ WS300 device, with an arbitrary name. The WS300 device which reports the
+ readings will be defined with the port number 9, an optional KS300 with the
+ port number 8.
+
+ Examples:
+
+ define WS300Device WS300 /dev/ttyUSB1
+ define ash2200.1 WS300 0
+ define ks300 WS300 8
+ define ws300 WS300 9
+
+
+
+
+
+ Set
+
+ set WS300Device <interval(min.)> <height(m)> <rainvalume(ml)>
+
+ Set some WS300 configuration parameters.
+
+
+
+ Get
+
+
+
+ Attributes
+
+
+
+
+
+
+SCIVT
+
+
+
+
+ Define
+
+ define <name> SCIVT <SCD-device>
+
+
+ Define a SCD series solar controler device. Details see here.
+ You probably need a Serial to USB controller like the PL2303.
+
+ Defining an SCIVT device will schedule an internal task, which reads the
+ status of the device every 5 minutes, and triggers notify/filelog commands.
+
Note: Currently this device does not support a "set" function, only
+ a single get function which reads the device status immediately.
+
+
+ Example:
+
+ define scd SCIVT /dev/ttyUSB2
+
+
+
+
+ Set
+
+ Get
+
+
+
+ Attributes
+
+
+
+
+
+
+M232
+
+
+
+
+ Define
+
+ define <name> M232 <m232-device>
+
+
+ Define a M232 device. You can attach as many M232 devices as you like. A
+ M232 device provides 6 analog inputs (voltage 0..5V with 10 bit resolution)
+ and 8 bidirectional digital ports. The eighth digital port can be used as a
+ 16 bit counter (maximum frequency 3kHz). The M232 device needs to be
+ connected to a 25pin sub-d RS232 serial port. A USB-to-serial converter
+ works fine if no serial port is available.
+
+ Examples:
+
+ define m232 M232 /dev/ttyUSB2
+
+
+
+
+
+ Set
+
+ set <name> stop
+
+ Stops the counter.
+
+ set <name> start
+
+ Resets the counter to zero and starts it.
+
+ set <name> octet
+
+ Sets the state of all digital ports at once, value is 0..255.
+
+ set <name> io0..io7 0|1
+
+ Turns digital port 0..7 off or on.
+
+
+
+
+
+ Get
+
+ get <name> [an0..an5]
+
+ Gets the reading of analog input 0..5 in volts.
+
+ get <name> [io0..io7]
+
+ Gets the state of digital ports 0..7, result is 0 or 1.
+
+ get <name> octet
+
+ Gets the state of all digital ports at once, result is 0..255.
+
+ get <name> counter
+
+ Gets the number of ticks of the counter since the last reset. The counter
+ wraps around from 65535 to 0.
+
+
+
+
+ Attributes
+
+
+
+
+
+
+
+M232Counter
+
+
+
+ Define
+
+ define <name> M232Counter [unit [factor]]
+
+
+ Define at most one M232Counter for a M232 device. Defining a M232Counter
+ will schedule an internal task, which reads the status of the counter every
+ minute, and triggers notify/filelog commands. unit is the unit
+ name, factor is used to calculate the reading of the counter
+ from number of ticks.
Note: the unit defaults to the string
+ "ticks", but it must be specified if you wish to set the factor, which
+ defaults to 1.0. In the second example below one tick equals 1/1250th kWh.
+ Do not forget to start the counter (with set .. start for
+ M232) or to start the counter and set the reading to a specified value
+ (with set ... value for M232Counter).
+ Example:
+
+ define counter M232Counter turns
+ define counter M232Counter kWh 0.0008
+
+
+
+
+
+ Set
+
+ set <name> value <value>
+
+ Sets the reading of the counter to the given value. The counter is reset
+ and started and the offset is adjusted to value/unit.
+
+
+
+
+
+ Get
+
+ get <name> status
+
+ Gets the reading of the counter multiplied by the factor from the
+ define statement. Wraparounds of the counter are accounted for
+ by an offset (see reading basis in the output of the
+ list statement for the device).
+
+
+
+ Attributes
+
+
+
+
+
+
+M232Voltage
+
+
+
+
+ Define
+
+ define <name> M232Voltage [an0..an5] [unit [factor]]
+
+
+ Define as many M232Voltages as you like for a M232 device. Defining a
+ M232Voltage will schedule an internal task, which reads the status of the
+ analog input every minute, and triggers notify/filelog commands.
+ unit is the unit name, factor is used to
+ calibrate the reading of the analog input.
+
+ Note: the unit defaults to the string "volts", but it must be specified
+ if you wish to set the factor, which defaults to 1.0.
+
+ Example:
+
+ define volt M232Voltage an0
+ define brightness M232Voltage an5 lx 200.0
+
+
+
+
+ Set
+
+
+ Get
+
+
+ Attributes
+
+
+
+
+
+
+FS10
+
+
+
+ Define
+
+ Set
+
+ Get
+
+ Attributes
+
+
+
+
+
+
+WS2000
+
+
+
+
+ Define
+
+ define <name> WS2000<device_to_connect>
+
+
+ Define a WS2000 series raw receiver device sold by ELV. Details see here.
+ Unlike 86_FS10.pm it will handle the complete device communication itself and
+ doesnt require an external program.
+ For this reason you can now use this also on windows.
+
+ This Device will be usually connect to a serial port, but you can also
+ define a raw network redirector like lantronix XPORT(TM).
+
Note: Currently this device does not support a "set" function
+
+
+ Attributes:
+
+ rain: factor for calculating amount of rain in ml/count
+ altitude: height in meters to calculate pressure for NN(not used yet)
+
+
+ Example:
+
+ define WS2000 WS2000 /dev/ttyS0
+
+
+ define WS2000 WS2000 xport:10001
+
+
+ attr WS2000 rain 366 : use factor 366 ml/count for rain sensor S2000R
+
+
+
+
+ Set
+
+
+ Get
+
+ get <name> list
+
+ Gets the last reading of all received sensord
+
+ get <name> [TH0..TH7, T0..T7, I0..I7, R0..R7, W0..W7, L0..L7, P0..P7,LAST,RAW]
+ get the last reading for the name sensor,
+ LAST: Last received Sensor
+
+ RAW: original Data from interface
+
+
+
+
+ Attributes
+
+
+
+
+
+
+IPWE
+
+
+
+
+ Define
+
+ define <name> IPWE <hostname> [<delay>]
+
+
+ Define a IPWE network attached weather data receiver device sold by ELV. Details see here.
+ It's intended to receive the same sensors as WS300 (8 T/H-Sensors and one kombi sensor),
+ but can be accessed via http and telnet.
+
+ For unknown reason, my try to use the telnet interface was not working neither with raw sockets
+ nor with Net::Telnet module. Therefore i choosed here the "easy" way
+ to simple readout the http page and extract all data from the offered table. For this reason this module doesnt
+ contain any option to configure this device.
+
Note: You should give your sensors a name within the web interface, once they a received the first time.
+
To extract a single sensor simply match for this name or sensor id
+
+
+ Attributes:
+
+ delay: seconds between read accesses(default 300s)
+
+
+
+ Example:
+
+ define ipwe IPWE ipwe1 120
+
+
+ attr ipwe delay 600 : 10min between readouts
+
+
+
+
+ Set
+
+
+ Get
+
+ get <name> status
+
+ Gets actual data from device for sensors with data
+
+ get <name> <sensorname>
+
+ will grep output from device for this sensorname
+
+
+
+
+ Attributes
+
+
+
+
+
+
+weblink
+
+
+
+ Define
+
+ define <name> weblink [link|fileplot] <argument>
+
+ This is a placeholder used with webpgm2 to be able to integrate links
+ into it, and to be able to put more than one gnuplot/SVG picture on one
+ page. It has no set or get methods.
+
+ Examples:
+
+ define wl_1 weblink link http://www.fhem.de
+ define wl_2 weblink fileplot <logdevice>:<gnuplot-file>:<logfile>
+
+
+
+ Notes:
+
+ - Normally you won't have to define fileplot weblinks manually, as
+ FHEMWEB makes it easy for you, just plot a logfile (see
+ logtype) and convert it to weblink. Now you
+ can group these weblinks by putting them into rooms. If you convert
+ the current logfile to a weblink, it will always refer to the current
+ file (and not the one you originally specified).
+
+
+
+ Set
+
+ Get
+
+ Attributes
+
+
+
+
+
+
+FHEMWEB
+
+ FHEMWEB is the builtin web-frontend (webpgm2). It implements a simple web
+ server, so no additional program is needed. However, if HTTPS is desired,
+ FHEMWEB must be configured to run behind a webserver (e.g. apache) which
+ translates the HTTPS from the outside to HTTP for FHEMWEB.
+
+
+ Define
+
+ define <name> FHEMWEB <tcp-portnr> [global]
+ Enable the webfrontend on port <tcp-portnr>. If global is specified,
+ then requests from all interfaces (not only localhost / 127.0.0.1) are
+ serviced.
+
+
+
+ Set
+
+ Get
+
+ Attributes
+
+
+ - webname
+ Path after the http://hostname:port/ specification. Defaults to fhem,
+ i.e the default http address is http://localhost:8083/fhem
+
+
+
+ - refresh
+ If set, a http-equiv="refresh" entry will be genererated with the given
+ argument (i.e. the browser will reload the page after the given
+ seconds).
+
+
+
+ - plotmode
+ Specifies how to generate the plots:
+
+ - gnuplot
+ Call the gnuplot script with each logfile. The filename
+ specification of the FileLog device will
+ determine what is in the plot. The data is converted into an
+ image on the backend with gnuplot.
+ - gnuplot-scroll
+ Fhemweb will offer zoom and scroll buttons in order to navigate
+ in the current logfile, i.e. you can select just a part of the
+ data to be displayed. The more data is contained in a single
+ logfile, the easier you can navigate. The recommendation is to
+ store the data for a whole year in one logfile. The data is
+ converted into an image on the backend with gnuplot.
+ - SVG
+ The same scrolling as with gnuplot scroll, but the data is sent
+ as an SVG script to the frontend, which will compute
+ the image: no need for gnuplot on the backend.
+
+ See also the attribute fixedrange.
+ Note: for gnuplot & gnuplot-scroll mode the gnuplot output is
+ redirected to the file gnuplot.err in the /tmp directory
+
+
+
+ - plotsize
+ the default size of the plot, in pixels, separated by comma:
+ width,height. You can set individual sizes by setting the plotsize of
+ the weblink.
+
+
+
+ - fixedrange
+ Can be applied to weblink devices (FHEMWEB).
+ Contains two time specs in the form YYYY-MM-DD separated by a space.
+ In plotmode gnuplot-scroll or SVG the given time-range will be used,
+ and no scrolling for this weblinks will be possible. Needed e.g. for
+ looking at last-years data without scrolling.
+
+
+
+
+
+
+
+
+at
+
+
+ Start an arbitrary fhem.pl command at a later time.
+
+
+
+ Define
+
+ define <name> at <timespec> <command>
+
+ <timespec> format: [+][*{N}]<timedet>
+
+ The optional + indicates that the specification is
+ relative(i.e. it will be added to the current time).
+ The optional * indicates that the command should be
+ executed repeatedly.
+ The optional {N} after the * indicates,that the command
+ should be repeated N-times only.
+ <timedet> is either HH:MM, HH:MM:SS or {perlfunc()}, where perlfunc
+ must return a HH:MM or HH:MM:SS date.
+
+
+
+ Examples:
+
+ # absolute ones:
+ define a1 at 17:00:00 set lamp on # fhem command
+ define a2 at 17:00:00 { Log 1, "Teetime" } # Perl command
+ define a3 at 17:00:00 "/bin/echo "Teetime" > /dev/console" # shell command
+ define a4 at *17:00:00 set lamp on # every day
+
+ # relative ones
+ define a5 at +00:00:10 set lamp on # switch the lamp on in 10 seconds
+ define a6 at +00:00:02 set lamp on-for-timer 1 # Blink once in 2 seconds
+ define a7 at +*{3}00:00:02 set lamp on-for-timer 1 # Blink 3 times
+
+ # Blink 3 times if the piri sends a command
+ define n1 notify piri:on.* define a8 at +*{3}00:00:02 set lamp on-for-timer 1
+
+ # Switch the lamp on from sunset to 11 PM
+ # Copy 99_SUNRISE_EL.pm in the FHEM directory to have sunset_rel()
+ { sunrise_coord("8.686", "50.112", "") }
+ define a9 at +*{sunset_rel()} set lamp on
+ define a10 at *23:00:00 set lamp off
+
+ # More elegant version, works for sunset > 23:00 too
+ define a11 at +*{sunset_rel()} set lamp on-till 23:00
+
+ # Only do this on weekend
+ define a12 at +*{sunset_rel()} { fhem("set lamp on-till 23:00") if($we) }
+
+ # Switch lamp1 and lamp2 on from 7:00 till 10 minutes after sunrise
+ define a13 at *07:00 set lamp1,lamp2 on-till {sunrise_abs(+600)}
+
+ # Switch the lamp off 2 minutes after sunrise each day
+ define a14 at +*{sunrise_rel(+120)} set lamp on
+
+
+ Notes:
+
+ - if no
* is specified, then a command will be executed
+ only once, and then the at entry will be deleted. In
+ this case the command will be saved to the statefile (as it
+ considered volatile, i.e. entered by cronjob) and not to the
+ configfile (see the save command.)
+
+
+ - if the current time is greater then the time specified, then the
+ command will be executed tomorrow. This is why the relative forms
+ of the sunset/sunrise functions should be used with the relative
+ (+) flag
+
+ - In order to use the sunrise_rel()/sunset_rel() functions,
+ put { sunrise_coord(long, lat, "") } into your
+ lastinclude file, as in the above example.
+ If you are not using sunrise_coord, then the coordinates for
+ Frankfurt am Main, Germany will be used.
+
+
+ - For even more complex date handling you either have to call fhem from
+ cron or filter the date in a perl expression, see the last example and
+ the section Perl special.
+
+
+
+
+
+
+ Set
+
+ Get
+
+ Attributes
+
+
+ - disable
+ Can be applied to at/watchdog/notify/FileLog devices.
+ Disables the corresponding at/notify or FileLog device. Note:
+ If applied to an at, the command will not be executed,
+ but the next time will be computed.
+
+
+ - skip_next
+ Used for at commands: skip the execution of the command the next
+ time.
+
+
+
+
+
+
+notify
+
+
+
+
+ Define
+
+ define <name> notify <pattern> <command>
+
+ Execute a command when received an event for the definition <pattern>. If
+ <command> is enclosed in {}, then it is a perl expression, if it is
+ enclosed in "", then it is a shell command, else it is a "plain" fhem.pl
+ command (chain). See the trigger command for
+ testing it.
+
+ Examples:
+
+ define b3lampV1 notify btn3 set lamp %
+ define b3lampV2 notify btn3 { fhem "set lamp %" }
+ define b3lampV3 notify btn3 "/usr/local/bin/setlamp "%""
+ define b3lampV3 notify btn3 set lamp1 %;;set lamp2 %
+ define wzMessLg notify wz:measured.* "/usr/local/bin/logfht @ "%""
+
+ define LogUndef notify UNDEFINED "send-me-mail.sh "%""
+
+
+
+ Notes:
+
+ - The character
% will be replaced with the received event,
+ e.g. with on or off or measured-temp: 21.7
+ (Celsius)
It is advisable to put the % into double
+ quotes, else the shell may get a syntax error.
+
+ - The character
@ will be replaced with the device
+ name.
+
+ - To use % or @ in the text itself, use the double mode (%% or @@).
+
+ - Instead of
% and @, the parameters
+ %EVENT (same as %), %NAME
+ (same as @) and %TYPE (contains the device
+ type, e.g. FHT) can be used. A single %
+ looses its special meaning if any of these parameters appears in the
+ definition.
+
+ <pattern> may also be a compound of
+ definition:event to filter for events.
+
+ <pattern> must completely (!)
+ match either the device name, or the compound of the device name and the
+ event. The event is either the string you see in the list output in paranthesis after the device name, or the
+ string you see when you do a detailed list of the device.
+
+ - To use database logging, copy the file contrib/91_DbLog.pm into your
+ modules directory, and change the $dbconn parameter in the file.
+
+ - Each undefined device (FS20, HMS, FHT) will be reported with the
+ device name "UNDEFINED". The % parameter will contain the type (FS20,
+ HMS100T, etc) and device number, separated by a space.
+
+
+
+
+
+ Set
+
+ Get
+
+ Attributes
+
+
+
+
+
+
+watchdog
+
+
+
+
+ Define
+
+ define <name> watchdog <regexp1> <timespec> <regexp2> <command>
+
+ Start an arbitrary fhem.pl command if after <timespec> receiving an
+ event matching <regexp1> no event matching <regexp2> is
+ received.
+ The syntax for <regexp1> and <regexp2> is the same as the
+ regexp for notify.
+ <timespec> is HH:MM[:SS]
+ <command> is a usual fhem command like used int the at or notify
+
+
+ Examples:
+
+ # "Reset" the FHT80 if we do not receive any message for 15 Minutes
+ define w watchdog FHT80 00:15:00 SAME set FHT80 refreshvalues
+ # Shout if the HMS100-FIT is not alive
+ define w watchdog HMS100-FIT 01:00:00 SAME "alarm-fit.sh"
+
+
+ Notes:
+
+ - if <regexp1> is . (dot), then activate the watchdog at
+ definition time. Else it will be activated when the first matching event
+ is received.
+
+ - if <regexp2> is SAME, then it will be the same as the first
+ regexp, and it will be reactivated, when it is received. This is probably
+ the normal operation.
+
+
+
+
+ Set
+
+ Get
+
+ Attributes
+
+
+
+
+
+
+DbLog
+
+
+
+
+ Define
+
+ define <name> DbLog <configfilename> <regexp>
+
+
+ Log events to a database. The database connection is defined in
+ <configfilename> (see sample configuration file
+ db.conf). The configuration is stored in a separate file
+ to avoid storing the password in the main configuration file and to have it
+ visible in the output of the list command.
+
+
+ You must have 93_DbLog.pm in the FHEM subdirectory
+ to make this work. Additionally, the modules DBI and
+ DBD::<dbtype> need to be installed (use
+ cpan -i <module> if your distribution does not have it).
+
+ <regexp> is the same as in FileLog.
+
+ Sample code to create a MySQL database is in fhemdb_create.sql.
+ The database contains two tables: current and
+ history. The latter contains all events whereas the former only
+ contains the last event for any given reading and device.
+ The columns have the following meaning:
+
+ - TIMESTAMP: timestamp of event, e.g.
2007-12-30 21:45:22
+ - DEVICE: device name, e.g.
Wetterstation
+ - TYPE: device type, e.g.
KS300
+ - EVENT: event specification as full string,
+ e.g.
humidity: 71 (%)
+ - READING: name of reading extracted from event,
+ e.g.
humidity
+ - VALUE: actual reading extracted from event,
+ e.g.
71
+ - UNIT: unit extracted from event, e.g.
%
+
+ The content of VALUE is optimized for automated post-processing, e.g.
+ yes is translated to 1.
+
+ The current values can be retrieved by means of the perl script
+ fhemdb_get.pl. Its output is adapted to what a
+ Cacti data input method expects.
+ Call fhemdb_get.pl without parameters to see the usage
+ information.
+
+ Examples:
+
+ # log everything to database
+ define logdb DbLog /etc/fhem/db.conf .*:.*
+
+
+
+
+ Set
+
+ Get
+
+ Attributes
+
+
+
+
+FileLog
+
+
+
+
+ Define
+
+ define <name> FileLog <filename> <regexp>
+
+
+ Log events to <filename>. The log format is
+
+ YYYY:MM:DD_HH:MM:SS <device> <event>
+ The regexp will be checked against the (complete!) device name
+ or against the (complete!) devicename:event combination.
+
+ <filename> may contain one or more of the following
+ wildcards (a subset of the Unix date command arguments):
+
+ %d day of month (01..31)
+ %m month (01..12)
+ %Y year (1970...)
+ %w day of week (0..6); 0 represents Sunday
+ %j day of year (001..366)
+ %U week number of year with Sunday as first day of week (00..53)
+ %V week number of year with Monday as first day of week (01..53)
+
+
+ Examples:
+
+ define lamplog FileLog /var/tmp/lamp.log lamp
+ define wzlog FileLog /var/tmp/wz-%Y-%U.log
+ wz:(measured-temp|actuator).*
+
+
+
+
- Type FileLog:
+ Set
set <name> reopen
@@ -2246,146 +2999,215 @@ Send buffer:
2007-10-19 00:31:24 desired-temp 22.5
-
-
-
-
-setstate
-
- setstate <devspec> <value>
-
- Set the "STATE" for <name> as shown in paranthesis in the
- list command
- to <value> without sending any signals to the device
- itself. This command is also used in the statefile.
- See the Device specification section for details on
- <devspec>.
-
- Examples:
+
+ Get
- setstate lamp on
+ get <name> <infile> <outfile> <from>
+ <to> <column_spec>
+
+ Read data from the logfile.
+
+ - <infile>
+ Name of the logfile to grep. "-" is the current logfile, or you can
+ specify an older file (or a file from the archive).
+ - <outfile>
+ If it is "-", you get the data back on the current connection, else it
+ is the prefix for the output file. If more than one file is specified,
+ the data is separated by a comment line for "-", else it is written in
+ separate files, numerated from 0.
+
+ - <from> <to>
+ Used to grep the data. The elements should correspond to the
+ timeformat or be an initial substring of it.
+ - <column_spec>
+ For each column_spec return a set of data in a separate file or
+ separated by a comment line on the current connection.
+ Syntax: <col>:<regexp>:<default>:<fn>
+
+ - <col>
+ The column number to return, starting at 1 with the date.
+ If the column is enclosed in double quotes, then it is a fix text,
+ not a column nuber.
+ - <regexp>
+ If present, return only lines containing the regexp. Case sensitive.
+
+ - <default>
+ If no values were found and the default value is set, then return
+ one line containing the from value and this default. We need this
+ feature as gnuplot aborts if a dataset has no value at all.
+
+ - <fn>
+ One of the following:
+
+ - int
+ Extract the integer at the beginning og the string. Used e.g.
+ for constructs like 10%
+ - delta-h or delta-d
+ Return the delta of the values for a given hour or a given day.
+ Used if the column contains a counter, as is the case for the
+ KS300 rain column.
+ - everything else
+ The string is evaluated as a perl expression. @fld is the
+ current line splitted by spaces. Note: The string/perl
+ expression cannot contain spaces, as the part after the space
+ will be considered as the next column_spec.
+
+
+
+
+ Example:
+ get outlog out-2008.log - 2008-01-01 2008-01-08 4:IR:int: 9:IR::
+
+
+
+ Attributes
+
+
+
+
+ - archivecmd / archivedir / nrarchive
+ When a new FileLog file is opened, the FileLog archiver wil be called.
+ This happens only, if the name of the logfile has changed (due to
+ time-specific wildcards, see the FileLog
+ section), and there is a new entry to be written into the file.
+
+
+ If the attribute archivecmd is specified, then it will be started as a
+ shell command (no enclosing " is needed), and each % in the command
+ will be replaced with the name of the old logfile.
+
+ If this attribute is not set, but nrarchive and/or archivecmd is set,
+ then all superfluous logfiles will be moved to archivedir (or deleted if
+ archivedir is not set).
+
+ - disable
+
+
+ - logtype
+ Used by the pgm2 webfrontend to offer gnuplot/SVG images made from the
+ logs. The string is made up of tokens separated by comma (,), each
+ token specifies a different gnuplot program. The token may contain a
+ colon (:), the part before the colon defines the name of the program,
+ the part after is the string displayed in the web frontend. Currently
+ following types of gnuplot programs are implemented:
+
+ - fs20
+ Plots on as 1 and off as 0. The corresponding filelog definition
+ for the device fs20dev is:
+ define FileLog fslog fs20dev /var/log/fs20dev-%Y-%U.log
+
+ - fht
+ Plots the measured-temp/desired-temp/actuator lines. The
+ corresponding filelog definitions (for the FHT device named
+ fht1) looks like:
+ define FileLog fhtlog1 fht1:.*(temp|actuator).*
+ /var/log/fht1-%Y-%U.log
+
+ - ks300_1
+ Plots the temperature and rain (per hour and per day) of a
+ ks300. The corresponding filelog definitions (for the KS300
+ device named ks300) looks like:
+ define FileLog ks300log ks300:.*H:.*
+ /var/log/ks300-%Y-%U.log
+
+ - ks300_2
+ Plots the humidity and wind values of a
+ ks300. The corresponding filelog definition is the same as
+ above, both programs evaluate the same log.
+
+ - text
+ Shows the logfile as it is (plain text). Not gnuplot definition
+ is needed.
+
+
+ Example:
+ attr fhtlog1 logtype ks300_1:Temp/Rain,ks300_2:Hum/Wind,text:Raw-data
+
+
+
+
- Note:
-
- - The statefile uses another version of this command, don't be surprised.
-
-
-
-
-shutdown
+
+dummy
- shutdown
+
+ Define a dummy. A dummy can take via set any values.
+ Used for programming.
- Shut down the server (after saving the state information
- )
-
- Example:
+
+
+ Define
-
+ define <name> dummy
+
-
-
-trigger
-
- trigger <devspec> <state>
-
- Trigger a notify definition.
- See the Device specification section for details on
- <devspec>.
-
-
- Example:
-
-
-
-
-sleep
-
- sleep <sec>
-
- Sleep for a given amount, millisecond accuracy.
-
- Example:
-
- sleep 0.5
- notify btn3 set lamp toggle;;sleep 0.5;;set lamp toggle
+ Example:
+
+ define myvar dummy
+ set myvar 7
+
+
+
+
+
+ Set
+
+ set <name> <value>
+ Set any value.
+
+
+
+ Get
+
+ Attributes
+
- Note: As the server is not multithreaded, everything is blocked for
- the given amount.
-
-
-xmllist
+
+SUNRISE_EL
- xmllist
-
- Returns an XML tree of all definitions, all notify settings and all at
- entries. It is not intended for human consumption.
-
- Example:
-
FHZ> xmllist
- <FHZINFO>
- <internal_LIST>
- <internal name="global" state="internal" sets="" attrs="room configfile logfile modpath pidfilename port statefile userattr verbose version">
- <INT key="DEF" value="<no definition>"/>
- <INT key="NR" value="0"/>
- <INT key="STATE" value="internal"/>
- [...]
+ This module is used to define the functions
+sunrise_rel, sunset_rel
+sunrise_abs, sunset_abs
+isday, sunrise_coord
+ perl functions, to be used in at or notify commands.
+ First you should call the sunrise_coord function with your exact longitude
+ and latitude (see e.g. maps.google.com for the exact values, which should be
+ in the form of a floating point value). This command should be part of the
+ lastinclude file. The default value is Frankfurt
+ am Main, Germany.
-
+ sunrise_rel()/sunset_rel() return the relative time to the next
+ sunrise/sunset. The argument (in seconds) will be added to this time. The
+ relative values should be used as arguments to the at, see
+ the examples there for details.
+
+ sunrise_abs()/sunset_abs() return the absolute time to the next
+ sunrise/sunset, with the argument added to the time. These are used e.g. in
+ arguments to the "on-till" FS20 command.
+
+ isday() can be used in some notify or at commands to check if the sun is up or
+ down.
+
+
+ Define
+
+ Set
+
+ Get
+
+ Attributes
-
-Device specification
-
- The commands
- attr,
- deleteattr,
- delete,
- get,
- list,
- set,
- setstate,
- trigger
- can take a more complex device specification as argument,
- which will be expanded to a list of devices. A devspec can be:
-
- - a list of devices, separated by comma (,)
- - a range of devices, separated by dash (-)
- - a regular expression, if the the spec contains on e of the following
- characters: ^*[]$
-
- Example:
-
- set lamp1,lamp2,lamp3 on
- set lamp[1-3] on
- set lamp.* on
- set lamp1-lamp3 on
- set lamp1-lamp3,lamp3 on
-
- Notes:
-
- - first the spec is separated by komma, then the range or the regular
- expression operations are executed.
- - if there is a device which xactly corresponds to the spec, then
- no special processing is done.
- - the returned list can contain the same device more than once, so
- int tha last example the list will contain lamp3 twice.
-
-
-
Perl specials