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. FHZ1000PC 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:
perl fhem.pl fhem.cfg
A minimal configuration file looks like:
attr global logfile log/fhem.log
attr global modpath .
attr global statefile log/fhem.save
attr global verbose 3
define telnetPort telnet 7072 global
define WEB FHEMWEB 8083 global
Note: the last two lines are optional and assume you wish to use the
builtin telnet and WEB interface.
The web interface can be reached at
http://<fhemhost>:8083
TCP/IP communication with fhem can either happen in a "session" (via
telnet) or single client command (via fhem.pl). Example:
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
(;;). See the Notes section of the notify
chapter on command parameters and escape rules.
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
For every further indirection you need to double the semicolons:, e.g. to
switch on every day 2 devices at 7:00 for 10 minutes you have to write:
define onAt at 07:00 set Lamp1 on;;set Lamp2 on;; define offAt at +00:10 set Lamp1 off;;;;set Lamp2 off
Don't dispair, the previous example can also be written as
define onAt at 07:00 set Lamp1,Lamp2 on-for-timer 600
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.
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
(e.g. webpgm2) make editing of multiline commands transparent for you (i.e. there is no need for \) .
a single device name. This is the most common case.
a list of devices, separated by comma (,)
a regular expression
a NAME=VALUE pair, where NAME can be an Internal value like TYPE, a
Reading-Name or an attribute. VALUE is a regexp. To negate the
comparison, use NAME!=VALUE
if the spec is followed by the expression :FILTER=NAME=VALUE, then the
values found in the first round are filtered by the second expression.
Examples:
set lamp1 on set lamp1,lamp2,lamp3 on set lamp.* on set room=kitchen off set room=kitchen:FILTER=STATE=on off set room=kitchen:FILTER=STATE!=off off list disabled= list TYPE=FS20 STATE
Notes:
the spec may not contain space characters.
if there is a device which exactly corresponds to the spec, then
no special processing is done.
first the spec is separated by comma, then the regular expression and
filter operations are executed.
the returned list can contain the same device more than once, so
"set lamp3,lamp3 on" switches lamp3 twice.
for more complex structuring demands see the
structure device.
Attributes
All devices have attributes. These can be set by means of the attr command, displayed with the displayattr command, and deleted by the deleteattr command.
There are global attributes that are used by all devices and local attributes
that apply to individual device classes only.
Some devices (like FHEMWEB) automatically define new
global attributes on the first definition of a device of such type.
You can use the command
attr global userattr
<attributelist>
for the global device to
declare new global attributes and
attr <devicespec> userattr
<attributelist>
for individual devices according to devspec to declare new local attributes.
<attributelist> is a space-separated list which contains the
names of the additional attributes. See the documentation of the attr command for examples.
Be careful not to overwrite additional global attributes previously defined by
yourself or a device. Use the attr global userattr
<attributelist> as early in your configuration as possible.
Device specific attributes
Device specific attributes are documented in the corresponding device section.
Global attributes used by all devices
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.
The value for the global device is a default for
other devices without own verbose attribute set.
comment
Add an arbitrary comment.
alias
Used by FHEMWEB to display a device with another name e.g. when using
special characters/spaces not accepted by device definition.
room
Filter/group devices. Recognized by web-pgm2 and web-pgm3. A device
can appear in more than one room, in this case the rooms have to be
specified comma-separated.
Devices in the room hidden will not appear in the web output, or set
the FHEMWEB attribute to selectively disable
rooms for certain FHEMWEB instances.
genericDisplayType
used by some frontends (but not FHEMWEB) to offer a default image or
appropriate commands for this device. Currently the following values
are supported: switch,outlet,light,blind,speaker,thermostat
group
Group devices. Recognized by web-pgm2 (module FHEMWEB), it makes
devices in the same group appear in the same box).
This is used to further group
devices together. A device can appear in more than one group, in this
case the groups have to be specified comma-separated.
If this attribute is not set then the device type is used as the
grouping attribute.
showtime
Used in the webfrontend pgm2 to show the time of last activity
instead of the state in the summary view. Useful e.g. for FS20 PIRI
devices.
eventMap
Replace event names and set arguments. The value of this attribute
consists of a list of space separated values, each value is a colon
separated pair. The first part specifies the "old" value, the second
the new/desired value. If the first character is slash(/) or comma(,)
then split not by space but by this character, enabling to embed spaces.
Examples:
attr store eventMap on:open off:closed
attr store eventMap /on-for-timer 10:open/off:closed/
set store open
The explicit variant of this attribute has the following syntax:
attr store eventMap { dev=>{"on"=>"open"}, usr=>{"open"=>"on"} }
attr store eventMap { dev=>{"^on(-for-timer)?(.*)"=>"open$2"},
usr=>{"^open(.*)"=>"on$1"},
fw=>{"^open(.*)"=>"open"} }
This variant must be used, if the mapping is not symmetrical, the first
part (dev) representing the device to user mapping, i.e. if the device
reports on 100 or on-for-timer 100, the user will see open 100. The
second part (usr) is the other direction, if the user specified open
10, the device will receive on 10. On both occasions the key will be
first compared directly with the text, and if it is not equal, then it
will be tried to match it as a regexp. When using regexps in the usr
part with wildcards, the fw part must be filled with the exact same
keys to enable a correct display in the FHEMWEB set dropdown list in
the detail view.
readingFnAttributes
The following global attributes are honored by the modules that make use of the
standardized readings updating mechanism in fhem.pl. Check the module's
attribute list if you want to know if a device supports these attributes.
stateFormat
Modifies the STATE of the device, shown by the list command or in the room
overview in FHEMWEB. If not set, its value is taken from the state reading.
If set, then every word in the argument is replaced by the value of the
reading if such a reading for the current device exists. If the value of
this attribute is enclused in {}, then it is evaluated. This attribute is
evaluated each time a reading is updated.
event-on-update-reading
If not set, every update of any reading creates an event, which e.g. is
handled by notify or FileLog.
The attribute takes a comma-separated list of readings. You may use regular
expressions in that list. If set, only updates of the listed readings
create events.
event-on-change-reading
The attribute takes a comma-separated list of readings. You may use regular
expressions in that list. If set, only changes of the listed readings
create events. In other words, if a reading listed here is updated with the
new value identical to the old value, no event is created. If an optional [:threshold]
is given after a reading name events are only generated if the change is >= threshold.
The precedence of event-on-update-reading and event-on-change-reading is as
follows:
If both attributes are not set, any update of any reading of the device
creates an event.
If any of the attributes is set, no events occur for updates or changes
of readings not listed in any of the attributes.
If a reading is listed in event-on-update-reading, an update of the
reading creates an event no matter whether the reading is also listed
in event-on-change-reading.
event-aggregator
The primary uses of this attribute are to calculate (time-weighted) averages of
readings over time periods and to throttle the update rate of readings and thus
the amount of data written to the logs.
This attribute takes a comma-separated list of reading:interval:method:function
quadruples. You may use regular expressions for reading. If set, updates for the
listed readings are ignored and associated events are suppressed for a black-out period of at
least interval seconds. After the black-out period has expired, the reading is
updated with a value that is calculated from the values and timestamps of the previously ignored
updates within the black-out period as follows:
function
description
v
the last value encountered
v0
the first value encountered
min
the smallest value encountered
max
the largest value encountered
mean
the arithmetic mean of all values
sd
the standard deviation from the mean
If method is none, then that's all there is. If method
is const or linear, the time-weighted series of values is taken into
account instead. The weight is the timespan between two subsequent updates.
With the const method, the value is the value of the reading at the beginning of
the timespan; with the linear method, the value is the arithmetic average of
the values at the beginning and the end of the timespan.
Rollovers of black-out periods are handled as one would expect it.
One would typically use the linear method with the mean function for
quantities continuously varying over time like electric power consumption, temperature or speed.
For cumulative quantities like energy consumed, rain fallen or distance covered,
the none method with the v function is used. The constant
method is for discrete quantities that stay constant until the corresponding reading is updated,
e.g. counters, switches and the like.
The event aggregator only takes into consideration those updates that remain after preprocessing
according to the event-on-update-reading and event-on-change-reading
directives. Besides which, any update of a reading that occurs within a timespan from the preceding
update that is smaller than the resolution of FHEM's time granularity is ditched.
event-min-interval
This attribute takes a comma-separated list of reading:minInterval pairs.
You may use regular expressions for reading. Events will only be
generated, if at least minInterval seconds elapsed since the last reading
of the matched type.
userReadings
A comma-separated list of definitions of user-defined readings. Each
definition has the form:
After a single or bulk readings update, the user-defined readings are set
by evaluating the perl code { <perl code>
} for all definitions and setting the value of the respective
user-defined reading <reading> to the result. If
<trigger> is given, then all processing for this specific user
reading is only done if one of the just updated "reading: value"
combinations matches <trigger>, which is treated as a regexp.
Examples:
none: the same as it would not have been given at all.
difference: the reading is set to the difference between the current
and the previously evaluated value.
differential: the reading is set to the difference between the
current and the previously evaluated value divided by the time in
seconds between the current and the previous evaluation. Granularity
of time is one second. No value is calculated if the time past is
below one second. Useful to calculate rates.
integral: reverse function of differential. The result is incremented
by the product of the time difference between the last two readings
and the avarage of the last two readings.
result += (time - timeold) * (oldval + value) / 2
offset: if the current evaluated value is smaler than the previously
evaluated value the reading is incremented by the previous value.
the reading can then be used as an offset correct for a counter that
is reset for example due to a power loss.
monotonic: if the difference between the current and the previously
evaluated value is positive the reading is incremented by this difference.
this allows to derive a monotonic growing counter from an original counter
even if the original will be rest by a power loss
Example:
attr myPowerMeter userReadings power
differential { ReadingsVal("myPowerMeter","counters.A",0)/1250.0;; }
Notes:
user readings with modifiers difference and differential store the
calculated values internally. The user reading is set earliest at the
second evaluation. Beware of stale values when changing
definitions!
the name of the defined Readings consists of alphanumeric characters
with underscore (_) and the minus (-) sign.
Common attributes
The following local attributes are used by a wider range of devices:
IODev
Set the IO or physical device which should be used for sending signals
for this "logical" device. An example for the physical device is an FHZ
or a CUL. Note: Upon startup FHEM assigns each logical device
(FS20/HMS/KS300/etc) the last physical device which can receive data
for this type of device. The attribute IODev needs to be used only if
you attached more than one physical device capable of receiving signals
for this logical device.
Special: attribute disable can be toggled
Attribute "disable" can be toggled by issuing the following command:
attr <device> disable toggle
Attribute "disable" must be offered by the corresponding module
attr
attr <devspec> <attrname> [<value>]
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>.
After setting the attribute, the global event "ATTR" will be generated.
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
each of the lamps:
There is no way to delete a single default-attribute from the list
define
define [option] <name> <type> <type-specific>
Define a device. You need devices if you want to manipulate them (e.g.
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)".
After definition, the global event "DEFINED" will be generated, see the
notify section for details.
Each device takes different additional arguments at definition, see the
corresponding device section for details.
Options:
-temporary
Add the TEMPORARY flag to the definition, which will prevent saving the
device to fhem.cfg.
-ignoreErr
Reduce the number of errors displayed when a certain FHEM-module cannot
be loaded. Used by fhem.cfg.demo, as using the RSS example requires the
installation of several uncommon perl modules.
defmod
defmod <name> <type> <type-specific>
Define a device or modify it, if it already exists. E.g. to switch off a lamp
10 Minutes after the last message from the motion detector, you may use
define mdNtfy notify motionDetector defmod mdOff at +00:10 set lamp off
Using define here for the mdOff will generate an error if the motion detector
triggers within the 10 minutes after the first event, as the mdOff at
definition still exists.
delete
delete <devspec>
Delete something created with the define command.
See the Device specification section for details on
<devspec>.
After deletion, the global event "DELETED" will be generated, see the notify
section for details.
Examples:
delete lamp
deleteattr
deleteattr <devspec> [<attrname>]
Delete either a single attribute (see the attr command)
or all attributes for a device (if no <attrname> is defined).
See the Device specification section for details on
<devspec>.
After deleting the attribute, the global event "DELETEATTR" will be generated.
Examples:
Delete the reading <readingname>
for a device. <readingname> is a perl regular expression that must match the whole name of the reading.
Use with greatest care! FHEM might crash if you delete vital readings of a device.
See the Device specification section for details on
<devspec>.
Display either the value of a single attribute (see the attr command)
or all attributes for a device (if no <attrname> is defined).
See the Device specification section for details on
<devspec>.
If more then one device is specified, then the device name will also included
in the output.
Examples:
fhem> di WEB
menuEntries AlarmOn,/fhem?cmd=set%20alarm%20on
room Misc.
fhem> di WEB room
Misc.
get
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 parameters by
Note: to use this command copy the file contrib/getstate/99_getstate.pm into
your FHEM directory.
include
include <filename>
Read in the file, and process every line as a fhem command. Makes
configuration files more modular and enables to reread them.
inform
inform {on|off|timer|raw} [regexp]
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.
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.
list
list [devspec] [value]
Output a list of all definitions, all notify settings and all at
entries. This is one of the few commands which return a string in a
normal case.
See the Device specification section for details on
<devspec>.
If value is specified, then output this property (like DEF, TYPE, etc) or
reading (actuator, measured-temp) for all devices from the devspec.
Example:
fhem> list
Type list for detailed info.
Internal:
global (Internal)
FHZ:
FHZ (fhtbuf: 23)
FS20:
Btn4 (on-old-for-timer)
Roll1 (on)
Stehlampe (off)
FHT:
fl (measured-temp: 21.1 (Celsius))
KS300:
out1 (T: 2.9 H: 74 W: 2.2 R: 8.2 IR: no)
at:
at_rollup (Next: 07:00:00)
notify:
ntfy_btn4 (active)
FileLog:
avglog (active)
If specifying name, then a detailed status for name
will be displayed, e.g.:
fhem> list fl
Internals:
CODE 5102
DEF 5102
NAME fl
NR 15
STATE measured-temp: 21.1 (Celsius)
TYPE FHT
IODev FHZ
Attributes:
room Heizung
Readings:
2006-11-02 09:45:56 actuator 19%
[...]
modify
modify <name> <type-dependent-options>
Used to modify some definitions. Useful for changing some at or notify definitions. If specifying
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.
After modify, the global event "MODIFIED" will be generated.
Example:
define lampon at 19:00 set lamp on modify lampon *19:00 modify lampon 19:00 set lamp on-for-timer 16
quit
quit
If used in a TCP/IP session, terminate the client session.
If used in a script, terminate the parsing of the current script.
Example:
quit
reload
reload <module>
Reload the given module from the module directory. It is a convenient way to
test modules whithout restarting the program.
Example:
reload 99_PRIV
rename
rename <oldname> <newname>
Rename a device from the <oldname> to <newname>, together with
its attributes. The global event RENAMED will be generated, see the notify
section for details.
Example:
rename FHT_1234 fht.kitchen
rereadcfg
rereadcfg [fhem-config-file]
Re-read the active configuration file, or the optionally specified file.
The sequence: the statefile will be saved first,
then all devices will be deleted, then the currently active config file (or
the specified file) will be read and at last the statefile will be
reloaded.
Upon completion it triggers the global:REREADCFG event. All existing
connections up to the one issuing the rereadcfg will be closed.
Example:
rereadcfg
save
save [<configfile>]
Save first the statefile, then the
configfile information. If a parameter is specified,
it will be used instead the global configfile attribute.
Notes:
save only writes out definitions and attributes, but no (set/get)
commands which were previously part of the config file. If you need such
commands after the initialization (e.g. FHTcode), you
should trigger them via notify, when receiving the
INITIALIZED event.
save tries to preserve comments (lines starting with #) and include
structures, but it won't work correctly if some of these files are not
writeable.
set
set <devspec> <type-specific>
Set parameters of a device / send signals to a device. You can
get a list of possible parameters by
set <name> ?
See the Device specification section for details on
<devspec>. The set command returns only a value on error.
Each device has different set parameters, see the corresponding device
section for details.
From featurelevel 5.7 on the set command replaces:
[device:reading] with the corresponding reading of device, if both device
and reading exists.
{(perlExpression)} with the result of perlExpression, if the expression
does not generates an error.
Some modules support a common list of set extensions, and point in
their documentation to this section. If the module itself implements one of
the following commands, then the module-implementation takes precedence.
on-for-timer <seconds>
Issue the on command for the device, and after <seconds> the off
command. For issuing the off command an internal timer will be
scheduled, which is deleted upon a restart. To delete this internal
timer without restart specify 0 as argument.
off-for-timer <seconds>
see on-for-timer above.
on-till <timedet>
Issue the on command for the device, and create an at definition with
<timedet> (in the form HH:MM[:SS]) to set it off. This definition
is visible, and its name is deviceName+"_till". To cancel the scheduled
off, delete the at definition. Note: on-till is not active, if the
specified time is after the current time, in order to make things like
define morningLight at *06:00 set Lamp on-till {sunrise()}
easy.
on-till-overnight <timedet>
Like on-till, but wont compare the current time with the timespec, so
following will work:
define nightLight at *{sunset()} set Lamp on-till-overnight 01:00
off-till <timedet>
see on-till above.
off-till-overnight <timedet>
see on-till-overnight above.
blink <number> <blink-period>
set the device on for <blink-period> then off for
<blink-period> and repeat this <number> times.
To stop blinking specify "0 0" as argument.
intervals <from1>-<till1> <from2>-<till2>...
set the device on for the specified intervals, which are all timespecs
in the form HH:MM[:SS]. The intervals are space separated.
Examples:
set switch on-for-timer 12.5
set switch on-till {sunset()}
set switch blink 3 1
set switch intervals 08:00-12:00 13:00-18:00
setreading
setreading <devspec> <reading> <value>
Set the reading <reading> for the device <name> to
<value> without sending out commands to the device, but triggering
events and eventMap/stateFormat transformations as usual.
Examples:
setreading lamp state on
Note: setreading won't generate an event for device X, if it is called from a
notify for device X. Use "sleep 0.1; setreading X Y Z" in this case.
setstate
setstate <devspec> <value>
Set the STATE entry for the device specified by <devspec>,
which is used for displaying the device state in different frontends.
No signals will be sent to the device, no events will be generated, and no
eventMap or stateFormat translation will be done either.
This command is also used in the statefile.
See the Device specification section for details on
<devspec>.
Examples:
setstate lamp on
shutdown
shutdown [restart]
Shut down the server (after saving the state information
). It triggers the global:SHUTDOWN event. If the optional restart
parameter is specified, fhem tries to restart itself.
sleep followed by another command is comparable to a nameless at, it executes the following commands after waiting the
specified time. The unit is seconds, with millisecond accuracy, as you can
specify decimal places.
When called in a notify/at/etc, then nonempty return values of the following
commands are logged to the global logfile with loglevel 2. If quiet is
specified, then skip this logging.
Example:
define n3 notify btn3.* set lamp on;;sleep 1.5;;set lamp off
define a3 at +*00:05 set Windsensor 1w_measure;; sleep 2 quiet;; get
Windsensor 1w_temp
Note: a sleep not followed by any command will block FHEM, is deprecated, and
it issues a WARNING in the FHEM log.
version
version [filter]
List the version of fhem.pl and all loaded modules. The optional parameter
can be used to filter the ouput.
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
autoload_undefined_devices
If set, automatically load the corresponding module when a message
of this type is received. This is used by the
autocreate device, to automatically create a fhem device upon
receiving a corresponding message.
backupcmd
You could pass the backup to your own command / script by using this attribute.
If this attribute is specified, then it will be started as a shell command and
passes a space separated list of files / directories as one
argument to the command, like e.g.:
Note: Your command / script has to return the string "backup done" or
everything else to report errors, to work properly with updatefhem!
This Attribute is used by the backup command.
Example:
attr global backupcmd /usr/local/bin/myBackupScript.sh
backupdir
A folder to store the compressed backup file.
This Attribute is used by the backup command.
Example:
attr global backupdir /Volumes/BigHD
backupsymlink
If this attribute is set to everything else as "no", the archive command tar
will support symlinks in your backup. Otherwise, if this attribute is set to
"no" symlinks are ignored by tar.
This Attribute is used by the backup command.
Example:
attr global backupsymlink yes
configfile
Contains the name of the fhem configuration file. If save is called without argument, then the output will
be written to this file.
holiday2we
If this attribute is set, then the $we variable
will be true, if the value of the holiday
variable referenced by this attribute is not none.
Example:
attr global holiday2we hessen
featurelevel
Enable/disable old or new features, based on FHEM version.
E.g. the $value hash for notify is only set for featurelevel up to 5.6,
as it is deprecated, use the Value() function instead.
lastinclude
If this attribute is set, then the last command of the generated
configfile (see the save command) will be
include <lastinclude-value>
This attribute is DEPRECATED and valid for featurelevel up to 5.6, use
notify, with the INITIALIZED event to execute
commands after initialization.
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. Just apply the
archivecmd / archivedir / nrarchive attributes to the
global device as you would do for a FileLog device.
You can access the current name of the logfile with
{ $currlogfile }.
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).
motd
Message Of The Day. Displayed on the homescreen of the FHEMWEB package,
or directly after the telnet logon, before displaying the fhem> prompt.
SecurityCheck is setting motd if it is not defined upon startup, to
avoid this set the motd value to none. motd is also used to show
collected error messages upon fhem start.
mseclog
If set, the timestamp in the logfile will contain a millisecond part.
nofork
If set and the logfile is not "-", do not try to background. Needed on
some Fritzbox installations, and it will be set automatically for
Windows.
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.
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 for all devices. Without specifying them you will not be
able to set them (in order to prevent typos).
userattr can also specified for other devices, in this case
these additinal attribute names are only valid for this device.
dupTimeout
Define the timeout for which 2 identical events from two different
receiver are considered a duplicate. Default is 0.5 seconds.
showInternalValues
Show data used for internal computations. If the name of an internal
value, reading or attribute starts with dot (.), then it is normally
hidden, and will only be visible, if this attribute is set to 1.
The attribute is checked by the list command, by the FHEMWEB room
overview and by xmllist.
sslVersion
Specifies the accepted cryptography algorithms by all modules using the
TcpServices helper module. The current default TLSv12:!SSLv3 is thought
to be more secure than the previously used SSLv23:!SSLv3:!SSLv2, but it
causes problems with some not updated web services.
stacktrace
if set (to 1), dump a stacktrace to the log for each "PERL WARNING".
restartDelay
set the delay for shutdown restart, default is 2 (seconds).
autosave
enable some modules to automatically trigger save after a configuration
change, e.g. after a new device was created. Default is 1 (true), you
can deactivate this feature by setting the value to 0.
ALL3076
Note: this module needs the HTTP::Request and LWP::UserAgent perl modules.
Define
define <name> ALL3076 <ip-address>
Defines an Allnet 3076 device (Dimmable lightswitch) via its ip address or dns name
Examples:
define lamp1 ALL3076 192.168.1.200
Set
set <name> <value>
where value is one of:
dimdown
dim10%
dim20%
dim30%
dim40%
dim50%
dim60%
dim70%
dim80%
dim90%
dim100%
dim[0-100]%
dimup
off
on
toggle
Examples:
set lamp1 on set lamp1 dim11% set lamp2 toggle
Notes:
Toggle is special implemented. List name returns "on" or "off" even after a toggle command
ALL4000T
Note: this module requires the following perl modules: XML::Simple LWP::UserAgent
HTTP::Request.
Defines an Allnet 4027 device (Box with 8 relays) connected to an ALL4000 via its ip address. The status of the device is also pooled (delay interval), because someone else is able to change the state via the webinterface of the device.
Examples:
define lamp1 ALL4027 192.168.8.200 0 7 60
Set
set <name> <value>
where value is one of:
off
on
on-for-timer <Seconds>
toggle
Examples:
set poolpump on
Notes:
Toggle is special implemented. List name returns "on" or "off" even after a toggle command
AMAD
AMAD - Auto Magic Android Device
This module provides, combination with the Android APP Auto Magic, a variety of information from Android devices.
The AndroidAPP Auto Magic (this 3rd party app costs 2.90Euro) works better than Tasker and is more user-friendly.
The following information can be displayed:
State of Automagic on the device
Bluetooth on / off
Connected Bluetooth devices
Current music album that is played my the media player
Current music artist that is played my the media player
Current music title that is played my the media player
State of the Android device - Online / Offline
Next alarm (day)
Next alarm (time)
Battery state in %
Charging state - charger connected / disconnected
Screen state on / off
Screen brightness
Full screen mode on / off
Screen orientation auto / landscape / portrait
Default volume
Media volume device speaker
Media volume Bluetooth speaker
With some experience lots of information from the Android device can be shown in FHEM. This requires only small adjustments of the "Informations" flow
With this module it is also possible to control an Android device as follows.
Switch Bluetooth on/off
Set or change the connection to a specific Bluetooth device
State of the device (online, offline)
Media Player control ( play / stop / next track / previous track)
Set next alarm time
Play a notification sound
Open an app on the device
Open a URL in the browser on the device
Set Screen on/off
Adjust the screen brightness
Switch to fullscreen mode
Send a message which appears on the screen
Set screen orientation (auto / landscape / portrait)
Request new status report of the device
Set system commands (reboot)
Send a message which will be announced (TTS)
Default media volume
To trigger actions and to obtain information you need the Android App Automagic and a matching Flow. The App you need to get from the app store (google play),
but the modul and the corresponding flow you get from me.
How to use AMAD?
installed the app "Auto Magic Premium" from the App Store or the trial version from here
installed the Flowset 74_AMADautomagicFlows$VERSION.xml from the folder $INSTALLFHEM/FHEM/lib/ to your Android device and first activates only the "information" flow.
Next you need to define a FHEM device.
Define
define <name> AMAD <IP-ADDRESS>
Example:
define TabletLivingRoom AMAD 192.168.0.23
This statement creates a new AMAD device. The parameter <IP-ADRESSE< specifies the ip-address of the Android device.
The default communication interval is set to 180 seconds and can be changed via attribute "interval". If you want to change the port,
you can do this via the attribute "port".
You should know what you are doing, because this port is set in the HTTP response trigger of the 2 flows. Consequently,
this must also be changed there.
Done! After connecting the device instance should already come in the first Readings within 3 minutes.
AMAD Communication Bridge
When you define the first AMAD device instance another device named AMADCommBridge will also be defined. Its room attribute is AMAD.YOU SHOULD NEVER CHANGE THIS NAME. Feel free to change all other properties. You need this device for the communication fom the Andoid unit to FHEM without having received any query from FHEM. The Android unit must know the IP address of FHEM, so you must enter the set command for the corresponding reading immediately after the definition of the bridge. This is extremly important to get the functionality working properly!
The command is
set AMADCommBridge fhemServerIP .
There is another reading expertMode which allows a direct communication with FHEM without haviung to use a notify or being limited to set commands.
Readings
automagic state - status messages from the AutomagicApp
bluetooth on / off - is Bluetooth switched on or off on the device
checkActiveTask - state of an app being defined before, 1=activ in the foreground, see the hint further down
connectedBTdevices - a list of the connected devices
connectedBTdevicesMAC – list f the MAC addresses of all connected BT devices
current Music Album - currently played music album of the media player used
current music artist - currently played music artist of the media player used
current Music Track - currently played music title of the media player used
deviceState - State of the Android device, must itself be set with setreading e.g. about the attendance check. When offline is set, the interval is set off for information retrieval.
flow_SetCommands active / inactive - indicates the status of SetCommands flow again
flow_informations active / inactive - indicates the status of the information flow again
lastSetCommandError - last error message from the set command successfully / not sent last status from the set command, command is successful - lastSetCommandState
lastSetCommandState cmd_done / cmd_error - state of last SetCommand command
lastStatusRequestError - last error message from the status request command successfully / not sent last status from the status request command, command is successful - load status RequestStateChange
lastStatusRequestState statusRequest_done / statusRequest_error - state of last statusRequest command
nextAlarmDay - active alarm day
next alarmTime - active alarm time
powerlevel - status of the battery in %
powerPlugged - connected power supply? 0=NO, 1|2=YES
volume - volume value which was set on "Set volume".
volume Music Bluetooth - Media volume of the Bluetooth speakers
volume music speaker - Media volume of the internal speakers
The Readings volume Music Bluetooth and music speaker volume reflect the respective media volume of the closed border is Bluetooth speakers or the internal speaker again.
Unless one the respective volumes relies exclusively on the Set command, one of the two will always agree with the "volume" Reading a.
Before using the Reading checkActivTask you must set the nme of the package name of te app to be checked innthe attribute checkActiveTask. Eample:
attr Nexus10Wohnzimmer checkActiveTask com.android.chrome for the Chrome browser.
Define user specific Readings in the AMAD device
You can specify your own reaqdings in the AMAD device and use them in combination with your Automagic flow. The transmission takes place immediately by means of the AMADCommBridge - so you should not update it too often. This is how you can do it:
first you need to define an Automagic flow for the information for the reading
diese Information speichert man nun mittels Automagic Action Script in eine globale Variable namens global_reading_ (beim auf Groß- und Kleinschreibung achten):
this information needs to be stored with the help of an Automagic action in a global variable (case sensitiv!). Example:
The Reading Touch should get the value "yes"
Action Script: global_reading_Touch="yes"
abschließend muss noch die Übertragung des Wertes initiiert werden. Dies erfolgt, indem der Wert der Variable global_own_reading auf den Wert _ gesetzt wird (auch hier auf Groß- und Kleinschreibung achten):
Finally you need to trigger the transmission of the value. This is dne by setting the the value of the variable global_own_reading to _ gesetzt wird (again: case sensitiv!):
Example: The Reading Touch should be transfered
Action Script: global_own_reading="{getDate()}_Touch"
Hint: you can put both actions in one script:
Asume you want to get an immediate information when the display of your tablet has been switched on or off then you can define the following flows:
Action Script when the display is activated: global_reading_Display="on";global_own_reading="{getDate()}_Display"
Action Script when the display is deactivated: global_reading_Display="off";global_own_reading="{getDate()}_Display"
Set
Device State - sets the Device Status Online / Offline. See Readings
Media Player - controls the default media player. Play, Stop, Back Route title, ahead of title.
NextAlarm time - sets the alarm time. only within the next 24hrs.
notifySndFile - plays the specified media file on the Android device. The file to be played must be in the folder /storage/emulated/0/Notifications/.
openURL - opens a URL in your default browser
screen - are sets the screen on / off with barrier in the car Magic settings must "Admin Function" set will not work "Screen off".
screenMsg - sends a message screen
Status Request - calls for a new Status Report in Device to
ttsMsg - sends a message which is output as a voice message
volume - sets the media volume. Either the internal speakers or when connected the Bluetooth speaker
Set depending on set attributes
changetoBtDevice - changes to another Bluetooth device. The attribute setBluetoothDevice must be set. See hint below!
mediaPlayer - controls the default media player. Play, Stop, Back Route title, ahead of title. Attribute fhemServerIP
openapp - opens a selected app. Attribute setOpenApp
screen Brightness - sets the screen brightness, 0-255 Attribute setScreenBrightness
If you want to use the "set screen brightness", a small adjustment in the flow SetCommands must be made. Opens the action (one of the squares very bottom) Set System Settings: System and makes a check "I have checked the settings, I know what I'm doing".
screen fullscreen - Switches to full screen mode on / off. Attribute SetFullscreen
screenOrientation - Switches the screen orientation Auto / Landscape / Portrait. Attribute setScreenOrientation
system - set system commands from (only rooted devices). Reboot Attribut root, in the Auto Magic Settings "root function" must be set
In order to use openApp you need an attribute where separated by a comma, several app names are set in order to use openapp. The app name is arbitrary and only required for recognition. The same app name must be used in the flow in SetCommands on the left below the hash expression: "openapp" be in one of the 5 paths (one app per path) entered in both diamonds. Thereafter, in the quadrangle selected the app which app through the attribute names should be started.
To switch between different Bluetooth devices, you need set the attribute setBluetoothDevice accordingly.
attr BTdeviceName1|MAC,BTDeviceName2|MAC
There may never be a sapce in BTdeviceName. There must also be the colon(:) in the MAC address after every second sign!
Example: attr Nexus10Wohnzimmer setBluetoothDevice Logitech_BT_Adapter|AB:12:CD:34:EF:32,Anker_A3565|GH:56:IJ:78:KL:76
state
initialized - If the status shortly after a define.
active - the device instance is in active status.
disabled - the device instance has been disabled via the disable attribute
Application examples:
I have the chargers for my Android devices on wireless switch sockets. a DOIF switches the charger on if the battery is below 30% and switches it off than the battery is charged 90% again. In the morning I'll wake up with music from my tablet in the bedroom. This involves the use of the wakeuptimer the RESIDENTS Modules. I stop the music manually. After that the weather forecast will be told (through TTS).
My 10 "Tablet in the living room is media player for the living room with Bluetooth speakers. The volume is automatically set down when the Fritzbox signals a incoming call on the living room handset.
And finally I would like to say thank you.
The biggest thank is for my mentor Andre (justme1968), who told me lots of useful hints that helped me to understandPerl code and made programming a real fun.
I would also like to thank Jens (jensb) who has supported me when I made my first steps in Perl code.
And lastbut not least a special thank to PAH (Prof. Dr. Peter Henning), without his statement "Keine Ahnung hatten wir alle mal, das ist keine Ausrede" (We had all times of 'I do not know', that's no excuse), - I would not have started to get interested in module development of FHEM :-)
Thanks to Jürgen (ujaudio) for the english translation
Alarm
FHEM module to set up a House Alarm System with 8 different alarm levels
set <name> locked set <name> unlocked sets the lockstate of the alarm module to locked (i.e., alarm setups may not be changed)
resp. unlocked (i.e., alarm setups may be changed>)
Get
get <name> version Display the version of the module
For each of the 8 alarm levels, several attributes hold the alarm setup.
They should not be changed by hand, but through the web interface to avoid confusion:
level<level>start, level<level>end, level<level>msg, level<level>xec,
level<level>onact, level<level>offact
The module BS allows to collect data from a brightness sensor through a
FHZ device. For details on the brightness sensor see
busware wiki.
You can have at most nine different brightness sensors in range of your
FHZ.
The state contains the brightness in % (reading brightness) and
the brightness in lux (reading lux). The flags
reading is always zero. The meaning of these readings is explained in more
detail on the above mentioned wiki page.
Define
define <name> BS <sensor#> [<RExt>]
<sensor#> is the number of sensor in the brightness
sensor address system that runs from 1 to 9.
<RExt> is the value of the resistor on your brightness
sensor in Ω (Ohm). The brightness reading in % is proportional to the resistance, the
lux reading is proportional to the resistance squared. The value is
optional. The default resistance is RExt= 50.000Ω.
This module creates a device with deadlines based on calendar-devices of the 57_Calendar.pm module.
Define
define <Name> CALVIEW <calendarname(s) separate with ','> <0 for modeAlarm;modeStart;modeStarted; 1 for modeAlarm;modeStart;modeStarted;modeUpcoming; 2 for all (reading all); 3 for modeAlarmOrStart;modeUpcoming > <updateintervall in sec (default 43200)>
maxreadings
defines the number of max term as readings
modes
here the CALENDAR modes can be selected , to be displayed in the view
oldStyledReadings
1 readings look like "2015.06.21-00:00" with value "Start of Summer"
0 the default style of readings
CM11
Note: this module requires the Device::SerialPort or Win32::SerialPort module.
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
set <name> reopen
Reopens the serial port.
Get
get <name> fwrev
Reads the firmware revision of the CM11 device. Returns error
if the serial connection to the device times out. Can be used for error
detection.
get <name> time
Reads the internal time of the device which is the total uptime (modulo one
year), since fhem sets the time to 0.00:00:00 if the device requests the time
to be set after being powered on. Returns error
if the serial connection to the device times out. Can be used for error
detection.
Module for measuring air quality with usb sticks based on the AppliedSensor iAQ-Engine sensor.
Products currently know to work are the VOLTCRAFT CO-20, the Sentinel Haus Institut RaumluftWächter
and the VELUX Raumluftfühler.
Probably works with all devices recognized as iAQ Stick (0x03eb:0x2013).
Notes:
Device::USB hast to be installed on the FHEM host.
It can be installed with 'cpan install Device::USB'
or on debian with 'sudo apt-get install libdevice-usb-perl''
Advanced features are only available after setting the attribute advanced.
Almost all the hidden settings from the Windows application are implemented in this mode.
Readout of values gathered in standalone mode is not possible yet.
Define
define <name> CO20 [bus:device]
Defines a CO20 device. bus:device hast to be used if more than one sensor is connected to the same host.
Examples:
define CO20 CO20
Readings
voc
CO2 equivalents in ppm
debug
debug value
pwm
pwm value
r_h
resistance of heating element in Ohm (?)
r_s
resistance of sensor element in Ohm (?)
Get
update / air_data
trigger an update
flag_data
get internal flag values
knob_data
get internal knob values
stick_data
get stick information
Set
KNOB_CO2_VOC_level_warn1
sets threshold for yellow led
KNOB_CO2_VOC_level_warn2
sets threshold for red led
KNOB_Reg_Set
internal value, affects voc reading
KNOB_Reg_P
internal pid value
KNOB_Reg_I
internal pid value
KNOB_Reg_D
internal pid value
KNOB_LogInterval
log interval for standalone mode
KNOB_ui16StartupBits
set to 0 for no automatic calibration on startup
FLAG_WARMUP
warmup time left in minutes
FLAG_BURN_IN
burn in time left in minutes
FLAG_RESET_BASELINE
reset voc baseline value
FLAG_CALIBRATE_HEATER
trigger calibration / burn in
FLAG_LOGGING
value count from external logging
Attributes
interval
the interval in seconds used to read updates [10..]. the default ist 300.
retries
number of retries on USB read/write failures [0..20]. the default is 3.
timeout
the USB connection timeout in milliseconds [250..10000]. the default is 1000.
advanced
1 -> enables most of the advanced settings and readings described here
disable
1 -> disconnect and stop polling
CUL
The CUL/CUN(O) is a family of RF devices sold by busware.de.
With the opensource firmware
culfw they are capable
to receive and send different 433/868 MHz protocols (FS20/FHT/S300/EM/HMS/MAX!).
It is even possible to use these devices as range extenders/routers, see the
CUL_RFR module for details.
Some protocols (FS20, FHT and KS300) 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.
It is possible to attach more than one device in order to get better
reception, FHEM will filter out duplicate messages.
Note: This module may require the Device::SerialPort or
Win32::SerialPort module if you attach the device via USB
and the OS sets strange default parameters for serial devices.
Define
define <name> CUL <device> <FHTID>
USB-connected devices (CUL/CUN):
<device> specifies the serial port to communicate with the CUL.
The name of the serial-device depends on your distribution, under
linux the cdc_acm kernel module is responsible, and usually a
/dev/ttyACM0 device will be created. If your distribution does not have a
cdc_acm module, you can force usbserial to handle the CUL by the
following command:
modprobe usbserial vendor=0x03eb product=0x204b
In this case the device is most probably /dev/ttyUSB0.
You can also specify a baudrate if the device name contains the @
character, e.g.: /dev/ttyACM0@38400
If the baudrate is "directio" (e.g.: /dev/ttyACM0@directio), then the
perl module Device::SerialPort is not needed, and FHEM
opens the device with simple file io. This might work if the operating
system uses sane defaults for the serial parameters, e.g. some Linux
distributions and OSX.
Network-connected devices (CUN(O)):
<device> specifies the host:port of the device, e.g.
192.168.0.244:2323
If the device is called none, then no device will be opened, so you
can experiment without hardware attached.
The FHTID is a 4 digit hex number, and it is used when the CUL talks to
FHT devices or when CUL requests data. Set it to 0000 to avoid answering
any FHT80b request by the CUL.
Set
reopen
Reopens the connection to the device and reinitializes it.
raw
Issue a CUL firmware command. See the this document
for details on CUL commands.
freq / bWidth / rAmpl / sens SlowRF mode only.
Set the CUL frequency / bandwidth / receiver-amplitude / sensitivity
Use it with care, it may destroy your hardware and it even may be
illegal to do so. Note: The parameters used for RFR transmission are
not affected.
freq sets both the reception and transmission frequency. Note:
Although the CC1101 can be set to frequencies between 315 and 915
MHz, the antenna interface and the antenna of the CUL is tuned for
exactly one frequency. Default is 868.3 MHz (or 433 MHz)
bWidth can be set to values between 58 kHz and 812 kHz. Large values
are susceptible to interference, but make possible to receive
inaccurately calibrated transmitters. It affects tranmission too.
Default is 325 kHz.
rAmpl is receiver amplification, with values between 24 and 42 dB.
Bigger values allow reception of weak signals. Default is 42.
sens is the decision boundary between the on and off values, and it
is 4, 8, 12 or 16 dB. Smaller values allow reception of less clear
signals. Default is 4 dB.
hmPairForSec HomeMatic mode only.
Set the CUL in Pairing-Mode for the given seconds. Any HM device set into
pairing mode in this time will be paired with FHEM.
hmPairSerial HomeMatic mode only.
Try to pair with the given device. The argument is a 10 character
string, usually starting with letters and ending with digits, printed on
the backside of the device. It is not necessary to put the given device
in learning mode if it is a receiver.
led
Set the CUL led off (00), on (01) or blinking (02).
Get
version
returns the CUL firmware version
uptime
returns the CUL uptime (time since CUL reset)
raw
Issues a CUL firmware command, and waits for one line of data returned by
the CUL. See the CUL firmware README document for details on CUL
commands.
fhtbuf
CUL has a message buffer for the FHT. If the buffer is full, then newly
issued commands will be dropped, and an "EOB" message is issued to the
FHEM log.
fhtbuf returns the free memory in this buffer (in hex),
an empty buffer in the CUL V2 is 74 bytes, in CUL V3/CUN(O) 200 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.
ccconf
Read some CUL radio-chip (cc1101) registers (frequency, bandwidth, etc.),
and display them in human readable form.
cmds
Depending on the firmware installed, CULs have a different set of
possible commands. Please refer to the README of the firmware of your
CUL to interpret the response of this command. See also the raw command.
credit10ms
One may send for a duration of credit10ms*10 ms before the send limit
is reached and a LOVF is generated.
sendpool
If using more than one CUL for covering a large area, sending
different events by the different CUL's might disturb each other. This
phenomenon is also known as the Palm-Beach-Resort effect.
Putting them in a common sendpool will serialize sending the events.
E.g. if you have three CUN's, you have to specify following
attributes: attr CUN1 sendpool CUN1,CUN2,CUN3
attr CUN2 sendpool CUN1,CUN2,CUN3
attr CUN3 sendpool CUN1,CUN2,CUN3
addvaltrigger
Create triggers for additional device values. Right now these are RSSI
and RAWMSG for the CUL family and RAWMSG for the FHZ.
rfmode
Configure the RF Transceiver of the CUL (the CC1101). Available
arguments are:
SlowRF
To communicate with FS20/FHT/HMS/EM1010/S300/Hoermann devices @1 kHz
datarate. This is the default.
HomeMatic
To communicate with HomeMatic type of devices @10 kHz datarate.
MAX
To communicate with MAX! type of devices @10 kHz datarate.
WMBus_S
WMBus_T
To communicate with Wireless M-Bus devices like water, gas or
electrical meters. Wireless M-Bus uses two different communication
modes, S-Mode and T-Mode. While in this mode, no reception of other
protocols like SlowRF or HomeMatic is possible. See also the WMBUS
FHEM Module.
hmId
Set the HomeMatic ID of this device. If this attribute is absent, the
ID will be F1<FHTID>. Note 1: After setting or changing this
attribute you have to relearn all your HomeMatic devices. Note 2: The
value must be a 6 digit hex number, and 000000 is not valid. FHEM
won't complain if it is not correct, but the communication won't work.
hmProtocolEvents
Generate events for HomeMatic protocol messages. These are normally
used for debugging, by activating "inform timer" in a telnet session,
or looking at the Event Monitor window in the FHEMWEB frontend.
Example:
<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.
corr1 is used to correct the current number, corr2
for the total number.
for EMWZ devices you should specify the rotation speed (R/kW)
of your watt-meter (e.g. 150) for corr1 and 12 times this value for
corr2
for EMEM devices the corr1 value is 0.01, and the corr2 value is
0.001
CostPerUnit and BasicFeePerMonth are used to compute your
daily and monthly fees. Your COST will appear in the log, generated once
daily (without the basic fee) or month (with the bassic fee included). Your
definition should look like e.g.:
Tip: You can configure your EMWZ device to show in the CUM column of the
STATE reading the current reading of your meter. For this purpose: multiply
the current reading (from the real device) with the corr1 value (RperKW),
and subtract the RAW CUM value from it. Now set the basis reading of your
EMWZ device (named emwz) to this value.
maxPeak <number>
Specifies the maximum possible peak value for the EM meter
("TOP:" value in logfile). Peak values greater than this value
are considered as EM read errors and are ignored.
For example if it's not possible to consume more than 40kW of
power set maxPeak to 40 to make the readings of the power meter
more robust.
CUL_FHTTK
This module handles messages from the FHT80 TF "Fenster-Tür-Kontakt" (Window-Door-Contact)
which are normally only acted upon by the FHT80B. With this module,
FHT80 TFs are in a limited way (see Wiki
for detailed explanation of TF's mode of operation) usable similar to HMS100 TFK. The name
of the module was chosen as a) only CUL will spill out the datagrams and b) "TF" designates
usually temperature+humidity sensors (no clue, why ELV didn't label this one "TFK" like with
FS20 and HMS).
As said before, FHEM can receive FHT80 TF radio (868.35 MHz) messages only through an
CUL device, so this must be defined first.
With the latest build on SVN
or next official version 1.62 or higher, it is possible to send out FHT80 TF data with a CUL or simular
devices. So it can be simulate up to four window sensor with one device
(see FHEM Wiki). To setup a window sensor, you have to
add and/or change the attribute "model" to dummy. The 6 digit hex number must not equal to FHTID.
Define
define <name> CUL_FHTTK <devicecode>
<devicecode> is a six digit hex number, given to the FHT80 TF during
production, i. e. it is not changeable. (Yes, it keeps this code after changing batteries
as well.)
Examples:
define TK_TEST CUL_FHTTK 965AB0
Set
Only available, if model is set to dummy.
set <name> <value>
where value is one of:
Syncing # start the sync with FHT80B (activate FHT80B sync mode before) - state after syncing is Closed
Closed # set window state to Closed
Open # set window state to Open
Correct device definition is the key for HM environment simple maintenance.
Background to define entities:
HM devices has a 3 byte (6 digit hex value) HMid - which is key for
addressing. Each device hosts one or more channels. HMid for a channel is
the device's HMid plus the channel number (1 byte, 2 digit) in hex.
Channels should be defined for all multi-channel devices. Channel entities
cannot be defined if the hosting device does not exist Note: FHEM
mappes channel 1 to the device if it is not defined explicitely. Therefore
it does not need to be defined for single channel devices.
Note: if a device is deleted all assotiated channels will be removed as
well. An example for a full definition of a 2 channel switch is given
below:
livingRoomSwitch is the device managing communication. This device is
defined prior to channels to be able to setup references.
LivingroomMainLight is channel 01 dealing with status of light, channel
peers and channel assotiated register. If not defined channel 01 is covered
by the device entity. LivingRoomBackLight is the second 'channel',
channel 02. Its definition is mandatory to operate this function.
Sender specials: HM threats each button of remotes, push buttons and
similar as channels. It is possible (not necessary) to define a channel per
button. If all channels are defined access to pairing informatin is
possible as well as access to channel related register. Furthermore names
make the traces better readable.
define may also be invoked by the autocreate
module, together with the necessary subType attribute.
Usually you issue a hmPairForSec and press the
corresponding button on the device to be paired, or issue a hmPairSerial set command if the device is a receiver
and you know its serial number. Autocreate will then create a fhem
device and set all necessary attributes. Without pairing the device
will not accept messages from fhem. fhem may create the device even if
the pairing is not successful. Upon a successful pairing you'll see a
CommandAccepted entry in the details section of the CUL_HM device.
If you cannot use autocreate, then you have to specify:
the <6-digit-hex-code>or HMid+ch <8-digit-hex-code>
It is the unique, hardcoded device-address and cannot be changed (no,
you cannot choose it arbitrarily like for FS20 devices). You may
detect it by inspecting the fhem log.
the subType attribute
which is one of switch dimmer blindActuator remote sensor swi
pushButton threeStateSensor motionDetector keyMatic winMatic
smokeDetector
Without these attributes fhem won't be able to decode device messages
appropriately.
Notes
If the interface is a CUL device, the rfmode
attribute of the corresponding CUL/CUN device must be set to HomeMatic.
Note: this mode is BidCos/Homematic only, you will not receive
FS20/HMS/EM/S300 messages via this device. Previously defined FS20/HMS
etc devices must be assigned to a different input device (CUL/FHZ/etc).
Currently supported device families: remote, switch, dimmer,
blindActuator, motionDetector, smokeDetector, threeStateSensor,
THSensor, winmatic. Special devices: KS550, HM-CC-TC and the KFM100.
Device messages can only be interpreted correctly if the device type is
known. fhem will extract the device type from a "pairing request"
message, even if it won't respond to it (see hmPairSerial and hmPairForSec to enable pairing).
As an alternative, set the correct subType and model attributes, for a
list of possible subType values see "attr hmdevice ?".
The so called "AES-Encryption" is in reality a signing request: if it is
enabled, an actor device will only execute a received command, if a
correct answer to a request generated by the actor is received. This
means:
Reaction to commands is noticably slower, as 3 messages are sent
instead of one before the action is processed by the actor.
Every command and its final ack from the device is sent in clear,
so an outside observer will know the status of each device.
The firmware implementation is buggy: the "toggle" event is executed
before the answer for the signing request is received, at
least by some switches (HM-LC-Sw1-Pl and HM-LC-SW2-PB-FM).
The HMLAN configurator will answer signing
requests by itself, and if it is configured with the 3-byte address
of a foreign CCU which is still configurerd with the default
password, it is able to answer signing requests correctly.
AES-Encryption is useable with a HMLAN or a CUL. When using
a CUL, the perl-module Crypt::Rijndael needs to be installed.
Due to the issues above I do not recommend using Homematic
encryption at all.
Set
Note: devices which are normally send-only (remote/sensor/etc) must be set
into pairing/learning mode in order to receive the following commands.
Universal commands (available to most hm devices):
assignHmKey
Initiates a key-exchange with the device, exchanging the old AES-key of the device with the key with the highest
index defined by the attribute hmKey* in the HMLAN or VCCU. The old key is determined by the reading aesKeyNbr,
which specifies the index of the old key when the reading is divided by 2.
clear <[rssi|readings|register|msgEvents|attack|all]>
A set of variables can be removed.
readings: all readings will be deleted. Any new reading will be added usual. May be used to eliminate old data
register: all captured register-readings in FHEM will be removed. This has NO impact to the values in the device.
msgEvents: all message event counter will be removed. Also commandstack will be cleared.
rssi: collected rssi values will be cleared.
attack: information regarding an attack will be removed.
all: all of the above.
getConfig
Will read major configuration items stored in the HM device. Executed
on a channel it will read pair Inforamtion, List0, List1 and List3 of
the 1st internal peer. Furthermore the peerlist will be retrieved for
teh given channel. If executed on a device the command will get the
above info or all assotated channels. Not included will be the
configuration for additional peers. The command is a shortcut
for a selection of other commands.
getRegRaw [List0|List1|List2|List3|List4|List5|List6]<peerChannel>
Read registerset in raw format. Description of the registers is beyond
the scope of this documentation.
Registers are structured in so called lists each containing a set of
registers.
List0: device-level settings e.g. CUL-pairing or dimmer thermal limit
settings.
List1: per channel settings e.g. time to drive the blind up and
down.
List3: per 'link' settings - means per peer-channel. This is a lot of
data!. It controlls actions taken upon receive of a trigger from the
peer.
List4: settings for channel (button) of a remote
<PeerChannel> paired HMid+ch, i.e. 4 byte (8 digit) value like
'12345601'. It is mendatory for List 3 and 4 and can be left out for
List 0 and 1.
'all' can be used to get data of each paired link of the channel.
'selfxx' can be used to address data for internal channels (associated
with the build-in switches if any). xx is the number of the channel in
decimal.
Note1: execution depends on the entity. If List1 is requested on a
device rather then a channel the command will retrieve List1 for all
channels assotiated. List3 with peerChannel = all will get all link
for all channel if executed on a device.
Note2: for 'sender' see remote
Note3: the information retrieval may take a while - especially for
devices with a lot of channels and links. It may be necessary to
refresh the web interface manually to view the results
Note4: the direct buttons on a HM device are hidden by default.
Nevertheless those are implemented as links as well. To get access to
the 'internal links' it is necessary to issue
'set <name> regSet intKeyVisib visib'
or
'set <name> regBulk RegL_0: 2:81'
Reset it by replacing '81' with '01' example:
set mydimmer getRegRaw List1
set mydimmer getRegRaw List3 all
getSerial
Read serial number from device and write it to attribute serialNr.
inhibit [on|off]
Block / unblock all changes to the actor channel, i.e. actor state is frozen
until inhibit is set off again. Inhibit can be executed on any actor channel
but obviously not on sensors - would not make any sense.
Practically it can be used to suspend any notifies as well as peered channel action
temporarily without the need to delete them.
Examples:
# Block operation
set keymatic inhibit on
pair
Pair the device with a known serialNumber (e.g. after a device reset)
to FHEM Central unit. FHEM Central is usualy represented by CUL/CUNO,
HMLAN,...
If paired, devices will report status information to
FHEM. If not paired, the device won't respond to some requests, and
certain status information is also not reported. Paring is on device
level. Channels cannot be paired to central separate from the device.
See also getPair and
unpair.
Don't confuse pair (to a central) with peer (channel to channel) with
peerChan.
peerBulk <peerch1,peerch2,...> [set|unset]
peerBulk will add peer channels to the channel. All peers in the list will be added.
with unset option the peers in the list will be subtracted from the device's peerList.
peering sets the configuration of this link to its defaults. As peers are not
added in pairs default will be as defined for 'single' by HM for this device.
More suffisticated funktionality is provided by
peerChan.
peerBulk will not delete existing peers, just handle the given peerlist.
Other already installed peers will not be touched.
peerBulk may be used to remove peers using unset option while default ist set.
Main purpose of this command is to re-store data to a device.
It is recommended to restore register configuration utilising
regBulk subsequent.
Example:
set myChannel peerBulk 12345601,
set myChannel peerBulk self01,self02,FB_Btn_04,FB_Btn_03,
set myChannel peerBulk 12345601 unset # remove peer 123456 channel 01
regBulk <reg List>:<peer> <addr1:data1> <addr2:data2>...
This command will replace the former regRaw. It allows to set register
in raw format. Its main purpose is to restore a complete register list
to values secured before.
Values may be read by getConfig. The
resulting readings can be used directly for this command.
<reg List> is the list data should be written to. Format could be
'00', 'RegL_00', '01'...
<peer> is an optional adder in case the list requires a peer.
The peer can be given as channel name or the 4 byte (8 chars) HM
channel ID.
<addr1:data1> is the list of register to be written in hex
format.
Example:
myblind will set the max drive time up for a blind actor to 25,6sec
regSet [prep|exec] <regName> <value> <peerChannel>
For some major register a readable version is implemented supporting
register names <regName> and value conversionsing. Only a subset
of register can be supproted.
Optional parameter [prep|exec] allowes to pack the messages and therefore greatly
improve data transmission.
Usage is to send the commands with paramenter "prep". The data will be accumulated for send.
The last command must have the parameter "exec" in order to transmitt the information.
<value> is the data in human readable manner that will be written
to the register.
<peerChannel> is required if this register is defined on a per
'peerChan' base. It can be set to '0' other wise.See getRegRaw for full description
Supported register for a device can be explored using
set regSet ? 0 0
Condensed register description will be printed
using
set regSet <regname> ? 0
reset
Factory reset the device. You need to pair it again to use it with
fhem.
sign [on|off]
Activate or deactivate signing (also called AES encryption, see the note above). Warning: if the device is attached via
a CUL, you need to install the perl-module Crypt::Rijndael to be
able to switch it (or deactivate signing) from fhem.
statusRequest
Update device status. For multichannel devices it should be issued on
an per channel base
unpair
"Unpair" the device, i.e. make it available to pair with other master
devices. See pair for description.
virtual <number of buttons>
configures a defined curcuit as virtual remote controll. Then number
of button being added is 1 to 255. If the command is issued a second
time for the same entity additional buttons will be added.
Example for usage:
define vRemote CUL_HM 100000 # the selected HMid must not be in use
set vRemote virtual 20 # define 20 button remote controll
set vRemote_Btn4 peerChan 0 <actorchannel> # peers Button 4 and 5 to the given channel
set vRemote_Btn4 press
set vRemote_Btn5 press long
deviceRename <newName>
rename the device and all its channels.
subType dependent commands:
switch
on - set level to 100%
off - set level to 0%
on-for-timer <sec> -
set the switch on for the given seconds [0-85825945]. Note:
off-for-timer like FS20 is not supported. It may to be programmed
thru channel register.
on-till <time> - set the switch on for the given end time.
set <name> on-till 20:32:10
Currently a max of 24h is supported with endtime.
press <[short|long]> <[on|off|<peer>]> <btnNo>
simulate a press of the local button or direct connected switch of the actor. [short|long] select simulation of short or long press of the button.
Parameter is optional, short is default [on|off|<peer>] is relevant for devices with direct buttons per channel (blind or dimmer).
Those are available for dimmer and blind-actor, usually not for switches <peer> allows to stimulate button-press of any peer of the actor.
i.e. if the actor is peered to any remote, virtual or io (HMLAN/CUL)
press can trigger the action defined. [noBurst] relevant for virtual only
It will cause the command being added to the command queue of the peer. No burst is
issued subsequent thus the command is pending until the peer wakes up. It therefore
delays the button-press, but will cause less traffic and performance cost. Example:
set actor press # trigger short of internal peer self assotiated to the channel
set actor press long # trigger long of internal peer self assotiated to the channel
set actor press on # trigger short of internal peer self related to 'on'
set actor press long off # trigger long of internal peer self related to 'of'
set actor press long FB_Btn01 # trigger long peer FB button 01
set actor press long FB_chn:8 # trigger long peer FB button 08
set actor press self01 # trigger short of internal peer 01
set actor press fhem02 # trigger short of FHEM channel 2
toggle - toggle the Actor. It will switch from any current
level to off or from off to 100%
dimmer, blindActuator
Dimmer may support virtual channels. Those are autocrated if applicable. Usually there are 2 virtual channels
in addition to the primary channel. Virtual dimmer channels are inactive by default but can be used in
in parallel to the primay channel to control light.
Virtual channels have default naming SW<channel>_V<no>. e.g. Dimmer_SW1_V1 and Dimmer_SW1_V2.
Dimmer virtual channels are completely different from FHEM virtual buttons and actors but
are part of the HM device. Documentation and capabilities for virtual channels is out of scope.
0 - 100 [on-time] [ramp-time]
set the actuator to the given value (in percent)
with a resolution of 0.5.
Optional for dimmer on-time and ramp time can be choosen, both in seconds with 0.1s granularity.
On-time is analog "on-for-timer".
Ramp-time default is 2.5s, 0 means instantanous
pct <level> [<ontime>] [<ramptime>] - set actor to a desired absolut level.
Optional ontime and ramptime could be given for dimmer.
ontime may be time in seconds. It may also be entered as end-time in format hh:mm:ss
up [changeValue] [<ontime>] [<ramptime>] dim up one step
down [changeValue] [<ontime>] [<ramptime>] dim up one step
changeValue is optional an gives the level to be changed up or down in percent. Granularity is 0.5%, default is 10%.
ontime is optional an gives the duration of the level to be kept. '0' means forever and is default.
ramptime is optional an defines the change speed to reach the new level. It is meaningful only for dimmer.
remotes, pushButton
This class of devices does not react on requests unless they are put
to learn mode. FHEM obeys this behavior by stacking all requests until
learn mode is detected. Manual interaction of the user is necessary to
activate learn mode. Whether commands are pending is reported on
device level with parameter 'protCmdPend'.
peerIODev [IO] <btn_no> [set|unset]
The command is similar to peerChan.
While peerChan
is executed on a remote and peers any remote to any actor channel peerIODev is
executed on an actor channel and peer this to an channel of an FHEM IO device.
An IO device according to eQ3 supports up to 50 virtual buttons. Those
will be peered/unpeerd to the actor. press can be
used to stimulate the related actions as defined in the actor register.
peerChan <btn_no> <actChan> [single|dual|reverse][set|unset] [both|actor|remote]
peerChan will establish a connection between a sender- channel and
an actuator-channel called link in HM nomenclatur. Peering must not be
confused with pairing. Pairing refers to assign a device to the central. Peering refers to virtally connect two channels.
Peering allowes direkt interaction between sender and aktor without
the necessity of a CCU
Peering a sender-channel causes the sender to expect an ack from -each-
of its peers after sending a trigger. It will give positive feedback (e.g. LED green)
only if all peers acknowledged.
Peering an aktor-channel will setup a parameter set which defines the action to be
taken once a trigger from -this- peer arrived. In other words an aktor will
- process trigger from peers only
- define the action to be taken dedicated for each peer's trigger
An actor channel will setup a default action upon peering - which is actor dependant.
It may also depend whether one or 2 buttons are peered in one command.
A swich may setup oen button for 'on' and the other for 'off' if 2 button are
peered. If only one button is peered the funktion will likely be 'toggle'.
The funtion can be modified by programming the register (aktor dependant).
Even though the command is executed on a remote or push-button it will
as well take effect on the actuator directly. Both sides' peering is
virtually independant and has different impact on sender and receiver
side.
Peering of one actuator-channel to multiple sender-channel as
well as one sender-channel to multiple Actuator-channel is
possible.
<actChan> is the actuator-channel to be peered.
<btn_no> is the sender-channel (button) to be peered. If
'single' is choosen buttons are counted from 1. For 'dual' btn_no is
the number of the Button-pair to be used. I.e. '3' in dual is the
3rd button pair correcponding to button 5 and 6 in single mode.
If the command is executed on a channel the btn_no is ignored.
It needs to be set, should be 0
[single|dual]: this mode impacts the default behavior of the
Actuator upon using this button. E.g. a dimmer can be learned to a
single button or to a button pair.
Defaults to dual.
'dual' (default) Button pairs two buttons to one actuator. With a
dimmer this means one button for dim-up and one for dim-down.
'reverse' identical to dual - but button order is reverse.
'single' uses only one button of the sender. It is useful for e.g. for
simple switch actuator to toggle on/off. Nevertheless also dimmer can
be learned to only one button.
[set|unset]: selects either enter a peering or remove it.
Defaults to set.
'set' will setup peering for the channels
'unset' will remove the peering for the channels
[actor|remote|both] limits the execution to only actor or only remote.
This gives the user the option to redo the peering on the remote
channel while the settings in the actor will not be removed.
Defaults to both.
Example:
set myRemote peerChan 2 mySwActChn single set #peer second button to an actuator channel
set myRmtBtn peerChan 0 mySwActChn single set #myRmtBtn is a button of the remote. '0' is not processed here
set myRemote peerChan 2 mySwActChn dual set #peer button 3 and 4
set myRemote peerChan 3 mySwActChn dual unset #remove peering for button 5 and 6
set myRemote peerChan 3 mySwActChn dual unset aktor #remove peering for button 5 and 6 in actor only
set myRemote peerChan 3 mySwActChn dual set remote #peer button 5 and 6 on remote only. Link settings il mySwActChn will be maintained
simulates button press for an actor from a peered sensor.
will be sent of type "long".
[long|short] defines whether long or short press shall be simulated. Defaults to short
[<peer>] define which peer's trigger shall be simulated.Defaults to self(channelNo).
[<repCount>] Valid for long press only. How long shall the button be pressed? Number of repetition of the messages is defined. Defaults to 1
[<repDelay>] Valid for long press only. defines wait time between the single messages.
virtTemp <[off -10..50]>
simulates a thermostat. If peered to a device it periodically sends the
temperature until "off" is given. See also virtHum
virtHum <[off -10..50]>
simulates the humidity part of a thermostat. If peered to a device it periodically sends
the temperature and humidity until both are "off". See also virtTemp
valvePos <[off 0..100]>
stimulates a VD
smokeDetector
Note: All these commands work right now only if you have more then one
smoekDetector, and you peered them to form a group. For issuing the
commands you have to use the master of this group, and currently you
have to guess which of the detectors is the master.
smokeDetector can be setup to teams using
peerChan. You need to peer all
team-members to the master. Don't forget to also peerChan the master
itself to the team - i.e. peer it to itself! doing that you have full
controll over the team and don't need to guess.
teamCall - execute a network test to all team members
text <btn_no> [on|off] <text1> <text2>
Set the text on the display of the device. To this purpose issue
this set command first (or a number of them), and then choose from
the teach-in menu of the 4Dis the "Central" to transmit the data.
If used on a channel btn_no and on|off must not be given but only pure text.
\_ will be replaced by blank character.
Example:
set 4Dis text 1 on On Lamp
set 4Dis text 1 off Kitchen Off
set 4Dis_chn4 text Kitchen Off
Climate-Control (HM-CC-TC)
desired-temp <temp>
Set different temperatures. <temp> must be between 6 and 30
Celsius, and precision is half a degree.
tempListSat [prep|exec] HH:MM temp ... 24:00 temp
tempListSun [prep|exec] HH:MM temp ... 24:00 temp
tempListMon [prep|exec] HH:MM temp ... 24:00 temp
tempListTue [prep|exec] HH:MM temp ... 24:00 temp
tempListThu [prep|exec] HH:MM temp ... 24:00 temp
tempListWed [prep|exec] HH:MM temp ... 24:00 temp
tempListFri [prep|exec] HH:MM temp ... 24:00 temp
Specify a list of temperature intervals. Up to 24 intervals can be
specified for each week day, the resolution is 10 Minutes. The
last time spec must always be 24:00.
Example: until 6:00 temperature shall be 19, from then until 23:00 temperature shall be
22.5, thereafter until midnight, 19 degrees celsius is desired. set th tempListSat 06:00 19 23:00 22.5 24:00 19
tempListTmpl =>"[verify|restore] [[ <file> :]templateName] ...
The tempList for one or more devices can be stored in a file. User can compare the
tempList in the file with the data read from the device.
Restore will write the tempList to the device.
Default opeartion is verify.
Default file is tempList.cfg.
Default templateName is the name of the actor
Default for file and templateName can be set with attribut tempListTmpl
Example for templist file. room1 and room2 are the names of the template: entities:room1
tempListSat>08:00 16.0 15:00 18.0 21:30 19.0 24:00 14.0
tempListSun>08:00 16.0 15:00 18.0 21:30 19.0 24:00 14.0
tempListMon>07:00 16.0 16:00 18.0 21:00 19.0 24:00 14.0
tempListTue>07:00 16.0 13:00 16.0 16:00 18.0 21:00 19.0 24:00 15.0
tempListWed>07:00 16.0 16:00 18.0 21:00 19.0 24:00 14.0
tempListThu>07:00 16.0 16:00 18.0 21:00 19.0 24:00 14.0
tempListFri>07:00 16.0 13:00 16.0 16:00 18.0 21:00 19.0 24:00 14.0
entities:room2
tempListSat>08:00 14.0 15:00 18.0 21:30 19.0 24:00 14.0
tempListSun>08:00 14.0 15:00 18.0 21:30 19.0 24:00 14.0
tempListMon>07:00 14.0 16:00 18.0 21:00 19.0 24:00 14.0
tempListTue>07:00 14.0 13:00 16.0 16:00 18.0 21:00 19.0 24:00 15.0
tempListWed>07:00 14.0 16:00 18.0 21:00 19.0 24:00 14.0
tempListThu>07:00 14.0 16:00 18.0 21:00 19.0 24:00 14.0
tempListFri>07:00 14.0 13:00 16.0 16:00 18.0 21:00 19.0 24:00 14.0
partyMode <HH:MM><durationDays>
set control mode to party and device ending time. Add the time it ends
and the number of days it shall last. If it shall end next day '1'
must be entered
sysTime
set time in climate channel to system time
Climate-Control (HM-CC-RT-DN|HM-CC-RT-DN-BoM)
fwUpdate <filename> [<waitTime>]
update Fw of the device. User must provide the appropriate file.
waitTime can be given optional. In case the device needs to be set to
FW update mode manually this is the time the system will wait.
controlMode <auto|boost|day|night>
controlManu <temp>
controlParty <temp><startDate><startTime><endDate><endTime>
set control mode to party, define temp and timeframe.
example: set controlParty 15 03.8.13 20:30 5.8.13 11:30
sysTime
set time in climate channel to system time
desired-temp <temp>
Set different temperatures. <temp> must be between 6 and 30
Celsius, and precision is half a degree.
tempListSat [prep|exec] HH:MM temp ... 24:00 temp
tempListSun [prep|exec] HH:MM temp ... 24:00 temp
tempListMon [prep|exec] HH:MM temp ... 24:00 temp
tempListTue [prep|exec] HH:MM temp ... 24:00 temp
tempListThu [prep|exec] HH:MM temp ... 24:00 temp
tempListWed [prep|exec] HH:MM temp ... 24:00 temp
tempListFri [prep|exec] HH:MM temp ... 24:00 temp
Specify a list of temperature intervals. Up to 24 intervals can be
specified for each week day, the resolution is 10 Minutes. The
last time spec must always be 24:00.
Optional parameter [prep|exec] allowes to pack the messages and therefore greatly
improve data transmission. This is especially helpful if device is operated in wakeup mode.
Usage is to send the commands with paramenter "prep". The data will be accumulated for send.
The last command must have the parameter "exec" in order to transmitt the information.
Example: until 6:00 temperature shall be 19, from then until 23:00 temperature shall be
22.5, thereafter until midnight, 19 degrees celsius is desired. set th tempListSat 06:00 19 23:00 22.5 24:00 19
set th tempListSat prep 06:00 19 23:00 22.5 24:00 19
set th tempListSun prep 06:00 19 23:00 22.5 24:00 19
set th tempListMon prep 06:00 19 23:00 22.5 24:00 19
set th tempListTue exec 06:00 19 23:00 22.5 24:00 19
OutputUnit (HM-OU-LED16)
led [off|red|green|yellow]
switches the LED of the channel to the color. If the command is
executed on a device it will set all LEDs to the specified
color.
For Expert all LEDs can be set individual by providing a 8-digit hex number to the device.
ilum <brightness><duration>
<brightness> [0-15] of backlight.
<duration> [0-127] in sec. 0 is permanent 'on'.
OutputUnit (HM-OU-CFM-PL)
led <color>[,<color>..] [<repeat>..]
Possible colors are [redL|greenL|yellowL|redS|greenS|yellowS|pause]. A
sequence of colors can be given separating the color entries by ','.
White spaces must not be used in the list. 'S' indicates short and
'L' long ilumination. repeat defines how often the sequence shall be executed. Defaults to 1.
playTone <MP3No>[,<MP3No>..] [<repeat>..]
Play a series of tones. List is to be entered separated by ','. White
spaces must not be used in the list. replay can be entered to repeat the last sound played once more. repeat defines how often the sequence shall be played. Defaults to 1.
Example:
# "hello" in display, symb bulb on, backlight, beep
set cfm_Mp3 playTone 3 # MP3 title 3 once
set cfm_Mp3 playTone 3 3 # MP3 title 3 3 times
set cfm_Mp3 playTone 3,6,8,3,4 # MP3 title list 3,6,8,3,4 once
set cfm_Mp3 playTone 3,6,8,3,4 255# MP3 title list 3,6,8,3,4 255 times
set cfm_Mp3 playTone replay # repeat last sequence
set cfm_Led led redL 4 # led red blink 3 times long
set cfm_Led led redS,redS,redS,redL,redL,redL,redS,redS,redS 255 # SOS 255 times
HM-RC-19xxx
alarm <count>
issue an alarm message to the remote
service <count>
issue an service message to the remote
symbol <symbol> [set|unset]
activate a symbol as available on the remote.
beep [off|1|2|3]
activate tone
backlight [off|on|slow|fast]
activate backlight
display <text> comma unit tone backlight <symbol(s)>
control display of the remote
<text> : up to 5 chars
comma : 'comma' activates the comma, 'no' leaves it off
[unit] : set the unit symbols.
[off|Proz|Watt|x3|C|x5|x6|x7|F|x9|x10|x11|x12|x13|x14|x15]. Currently
the x3..x15 display is not tested.
tone : activate one of the 3 tones [off|1|2|3]
backlight: activate backlight flash mode [off|on|slow|fast]
<symbol(s)> activate symbol display. Multople symbols can be
acticated at the same time, concatinating them comma separated. Don't
use spaces here. Possiblesymbols are
[bulb|switch|window|door|blind|scene|phone|bell|clock|arrowUp|arrowDown]
Example:
# "hello" in display, symb bulb on, backlight, beep
set FB1 display Hello no off 1 on bulb
# "1234,5" in display with unit 'W'. Symbols scene,phone,bell and
# clock are active. Backlight flashing fast, Beep is second tone
set FB1 display 12345 comma Watt 2 fast scene,phone,bell,clock
HM-Dis-WM55
displayWM help displayWM [long|short] <text1> <color1> <icon1> ... <text6> <color6> <icon6>displayWM [long|short] <lineX> <text> <color> <icon>
up to 6 lines can be addressed. lineX line number that shall be changed. If this is set the 3 parameter of a line can be adapted. textNo is the text to be dispalyed in line No. The text is assotiated with the text defined for the buttons.
txt<BtnNo>_<lineNo> references channel 1 to 10 and their lines 1 or 2.
Alternaly a free text of up to 12 char can be used color is one white, red, orange, yellow, green, blue icon is one off, on, open, closed, error, ok, noIcon
Example:
set disp01 displayWM short txt02_2 green noIcon txt10_1 red error txt05_2 yellow closed txt02_2 orange open
set disp01 displayWM long line3 txt02_2 green noIcon
set disp01 displayWM long line2 nc yellow noIcon
set disp01 displayWM long line6 txt02_2
set disp01 displayWM long line1 nc nc closed
keyMatic
The Keymatic uses the AES signed communication. Control
of the Keymatic is possible with the HM-LAN adapter and the CUL.
To control the KeyMatic with a CUL, the perl-module Crypt::Rijndael
needs to be installed.
lock
The lock bolt moves to the locking position
unlock [sec]
The lock bolt moves to the unlocking position.
[sec]: Sets the delay in seconds after the lock automatically locked again.
0 - 65535 seconds
open [sec]
Unlocked the door so that the door can be opened.
[sec]: Sets the delay in seconds after the lock automatically locked
again. 0 - 65535 seconds
winMatic
winMatic provides 2 channels, one for the window control and a second
for the accumulator.
level <level> <relockDelay> <speed>
set the level.
<level>: range is 0 to 100%
<relockDelay>: range 0 to 65535 sec. 'ignore' can be used to igneore the value alternaly
<speed>: range is 0 to 100%
stop
stop movement
CCU_FHEM
defIgnUnknown
define unknown devices which are present in the readings.
set attr ignore and remove the readingfrom the list.
HM-Sys-sRP-Pl
setup the repeater's entries. Up to 36entries can be applied.
setRepeat <entry> <sender> <receiver> <broadcast>
<entry> [1..36] entry number in repeater table. The repeater can handle up to 36 entries.
<sender> name or HMID of the sender or source which shall be repeated
<receiver> name or HMID of the receiver or destination which shall be repeated
<broadcast> [yes|no] determines whether broadcast from this ID shall be repeated
short application: setRepeat setAll 0 0 0
will rewrite the complete list to the deivce. Data will be taken from attribut repPeers.
attribut repPeers is formated:
src1:dst1:[y/n],src2:dst2:[y/n],src2:dst2:[y/n],...
Reading repPeer is formated:
Number src dst broadcast verify
number: entry sequence number
src: message source device - read from repeater
dst: message destination device - assembled from attributes
broadcast: shall broadcast be repeated for this source - read from repeater
verify: do attributes and readings match?
Debugging:
raw <data> ...
Only needed for experimentation.
send a list of "raw" commands. The first command will be
immediately sent, the next one after the previous one is acked by
the target. The length will be computed automatically, and the
message counter will be incremented if the first two charcters are
++. Example (enable AES):
set hm1 raw ++A001F100001234560105000000001\
++A001F10000123456010802010AF10B000C00\
++A001F1000012345601080801\
++A001F100001234560106
Get
configSave <filename>
Saves the configuration of an entity into a file. Data is stored in a
format to be executed from fhem command prompt.
The file is located in the fhem home directory aside of fhem.cfg. Data
will be stored cumulative - i.e. new data will be appended to the
file. It is up to the user to avoid duplicate storage of the same
entity.
Target of the data is ONLY the HM-device information which is located
IN the HM device. Explicitely this is the peer-list and the register.
With the register also the peering is included.
The file is readable and editable by the user. Additionaly timestamps
are stored to help user to validate.
Restrictions:
Even though all data of the entity will be secured to the file FHEM
stores the data that is avalilable to FHEM at time of save!. It is up
to the user to read the data from the HM-hardware prior to execution.
See recommended flow below.
This command will not store any FHEM attributes o device definitions.
This continues to remain in fhem.cfg.
Furthermore the secured data will not automatically be reloaded to the
HM-hardware. It is up to the user to perform a restore.
As with other commands also 'configSave' is best executed on a device
rather then on a channel. If executed on a device also the assotiated
channel data will be secured.
Recommended work-order for device 'HMdev':
set HMdev clear msgEvents # clear old events to better check flow
set HMdev getConfig # read device & channel inforamtion
# wait until operation is complete
# protState should be CMDs_done
# there shall be no warnings amongst prot... variables
get configSave myActorFile
param <paramName>
returns the content of the relevant parameter for the entity.
Note: if this command is executed on a channel and 'model' is
requested the content hosting device's 'model' will be returned.
reg <addr> <list> <peerID>
returns the value of a register. The data is taken from the storage in FHEM and not
read directly outof the device.
If register content is not present please use getConfig, getReg in advance.
<addr> address in hex of the register. Registername can be used alternaly
if decoded by FHEM. "all" will return all decoded register for this entity in one list.
<list> list from which the register is taken. If rgistername is used list
is ignored and can be set to 0.
<peerID> identifies the registerbank in case of list3 and list4. It an be set to dummy if not used.
regVal <addr> <list> <peerID>
returns the value of a register. It does the same as reg but strips off units
regList
returns a list of register that are decoded by FHEM for this device.
Note that there could be more register implemented for a device.
saveConfig <file>
stores peers and register to the file.
Stored will be the data as available in fhem. It is necessary to read the information from the device prior to the save.
The command supports device-level action. I.e. if executed on a device also all related channel entities will be stored implicitely.
Storage to the file will be cumulative.
If an entity is stored multiple times to the same file data will be appended.
User can identify time of storage in the file if necessary.
Content of the file can be used to restore device configuration.
It will restore all peers and all register to the entity.
Constrains/Restrictions:
prior to rewrite data to an entity it is necessary to pair the device with FHEM.
restore will not delete any peered channels, it will just add peer channels.
listDevice
when used with ccu it returns a list of Devices using the ccu service to assign an IO.
when used with ActionDetector user will get a comma separated list of entities being assigned to the action detector
get ActionDetector listDevice # returns all assigned entities
get ActionDetector listDevice notActive# returns entities which habe not status alive
get ActionDetector listDevice alive # returns entities with status alive
get ActionDetector listDevice unknown # returns entities with status unknown
get ActionDetector listDevice dead # returns entities with status dead
info
provides information about entities using ActionDetector
aesCommReq
if set HMLAN/USB is forced to request AES signature before sending ACK to the device.
This funktion strictly works with HMLAN/USB - it doesn't work for CUL type IOs.
actAutoTry
actAutoTry 0_off,1_on
setting this option enables Action Detector to send a statusrequest in case of a device is going to be marked dead.
The attribut may be useful in case a device is being checked that does not send messages regularely - e.g. an ordinary switch.
actCycle
actCycle <[hhh:mm]|off>
Supports 'alive' or better 'not alive' detection for devices. [hhh:mm] is the maximum silent time for the device.
Upon no message received in this period an event will be raised "<device> is dead".
If the device sends again another notification is posted "<device> is alive".
This actiondetect will be autocreated for each device with build in cyclic status report.
Controlling entity is a pseudo device "ActionDetector" with HMId "000000".
Due to performance considerations the report latency is set to 600sec (10min).
It can be controlled by the attribute "actCycle" of "ActionDetector".
Once entered to the supervision the HM device has 2 attributes:
actStatus: activity status of the device
actCycle: detection period [hhh:mm]
The overall function can be viewed checking out the "ActionDetector" entity. The status of all entities is present in the READING section.
Note: This function can be enabled for devices with non-cyclic messages as well. It is up to the user to enter a reasonable cycletime.
autoReadReg
'0' autoReadReg will be ignored.
'1' will execute a getConfig for the device automatically after each reboot of FHEM.
'2' like '1' plus execute after power_on.
'3' includes '2' plus updates on writes to the device
'4' includes '3' plus tries to request status if it seems to be missing
'5' checks reglist and peerlist. If reading seems incomplete getConfig will be scheduled
'8_stateOnly' will only update status information but not configuration
data like register and peer
Execution will be delayed in order to prevent congestion at startup. Therefore the update
of the readings and the display will be delayed depending on the size of the database.
Recommendations and constrains upon usage:
use this attribute on the device or channel 01. Do not use it separate on each channel
of a multi-channel device to avoid duplicate execution
usage on devices which only react to 'config' mode is not recommended since executen will
not start until config is triggered by the user
usage on devices which support wakeup-mode is usefull. But consider that execution is delayed
until the device "wakes up".
burstAccess
can be set for the device entity if the model allowes conditionalBurst.
The attribut will switch off burst operations (0_off) which causes less message load
on HMLAN and therefore reduces the chance of HMLAN overload.
Setting it on (1_auto) allowes shorter reaction time of the device. User does not
need to wait for the device to wake up.
Note that also the register burstRx needs to be set in the device.
expert
This attribut controls the visibility of the readings. This attibute controlls
the presentation of device parameter in the readings.
3 level can be choosen:
0_off: standart level. Display commonly used parameter
1_on: enhanced level. Display all decoded device parameter
2_full: display all parameter plus raw register information as well.
If expert is applied a device it is used for assotiated channels.
It can be overruled if expert attibute is also applied to the channel device.
Make sure to check out attribut showInternalValues in the global values as well.
extert takes benefit of the implementation.
Nevertheless - by definition - showInternalValues overrules expert.
IOgrp
can be given to devices and shall point to a virtual CCU. As a consequence the
CCU will take care of the assignment to the best suitable IO. It is necessary that a
virtual CCU is defined and all relevant IO devices are assigned to it. Upon sending the CCU will
check which IO is operational and has the best RSSI performance for this device.
Optional a prefered IO - perfIO can be given. In case this IO is operational it will be selected regardless
of rssi values.
Example:
levelRange
can be used with dimmer only. It defines the dimmable range to be used with this dimmer-channel.
It is meant to support e.g. LED light that starts at 10% and reaches maxbrightness at 40%.
levelrange will normalize the level to this range. I.e. set to 100% will physically set the
dimmer to 40%, 1% will set to 10% physically. 0% still switches physially off.
Impacted are commands on, up, down, toggle and pct. Not effected is the off command
which still set physically 0%.
To be considered:
dimmer level set by peers and buttons is not impacted. Those are controlled by device register
Readings level may go to negative or above 100%. This simply results from the calculation and reflects
physical level is above or below the given range.
In case of virtual dimmer channels available present the attribut needs to be set for
each channel
User should be careful to set min level other then '0'
Example:
model,
subType
These attributes are set automatically after a successful pairing.
They are not supposed to be set by hand, and are necessary in order to
correctly interpret device messages or to be able to send them.
msgRepeat
defines number of repetitions if a device doesn't answer in time.
Devices which donly support config mode no repeat ist allowed.
For devices with wakeup mode the device will wait for next wakeup. Lonng delay might be
considered in this case.
Repeat for burst devices will impact HMLAN transmission capacity.
rawToReadable
Used to convert raw KFM100 values to readable data, based on measured
values. E.g. fill slowly your container, while monitoring the
values reported with inform. You'll see:
10 (at 0%)
50 (at 20%)
79 (at 40%)
270 (at 100%)
Apply these values with: "attr KFM100 rawToReadable 10:0 50:20 79:40 270:100".
fhem will do a linear interpolation for values between the bounderies.
rssiLog
can be given to devices, denied for channels. If switched '1' each RSSI entry will be
written to a reading. User may use this to log and generate a graph of RSSI level.
Due to amount of readings and events it is NOT RECOMMENDED to switch it on by default.
tempListTmpl
Sets the default template for a heating controller. If not given the detault template is taken from
file tempList.cfg using the enitity name as template name (e.g. ./tempLict.cfg:RT1_Clima
To avoid template usage set this attribut to '0'.
Format is <file>:<templatename>. lt
unit
set the reported unit by the KFM100 if rawToReadable is active. E.g.
attr KFM100 unit Liter
HM-Sen-RD-O offAtPon heat channel only: force heating off after powerOn onAtRain heat channel only: force heating on while status changes to 'rain' and off when it changes to 'dry'
virtuals noOnOff virtual entity will not toggle state when trigger is received. If this parameter is
not given the entity will toggle its state between On and Off with each trigger msgReduce:<No> if channel is used for it skips every No message
in order to reduce transmit load. Numbers from 0 (no skip) up to 9 can be given.
VD will lose connection with more then 5 skips
blind levelInverse while HM considers 100% as open and 0% as closed this may not be
intuitive to all user. Ny default 100% is open and will be dislayed as 'on'. Setting this param the display will be inverted - 0% will be open and 100% is closed.
NOTE: This will apply to readings and set commands. It does not apply to any register.
HM-CC-VD,ROTO_ZEL-STG-RM-FSA
$vp %
battery:[critical|low|ok]
motorErr:[ok|blocked|loose|adjusting range too small|opening|closing|stop]
ValvePosition:$vp %
ValveErrorPosition:$vep %
ValveOffset:$of %
ValveDesired:$vp % # set by TC
operState:[errorTargetNotMet|onTarget|adjusting|changed] # operational condition
operStateErrCnt:$cnt # number of failed settings
HM-OU-LED16
color $value # hex - for device only
$value # hex - for device only
color [off|red|green|orange] # for channel
[off|red|green|orange] # for channel
remote/pushButton
battery [low|ok]
trigger [Long|Short]_$no trigger event from channel
swi
Btn$x Short
Btn$x Short (to $dest)
battery: [low|ok]
switch/dimmer/blindActuator
$val
powerOn [on|off|$val]
[unknown|motor|dim] [up|down|stop]:$val
timedOn [running|off] # on is temporary - e.g. started with on-for-timer
sensRain
$val
powerOn
level <val≥
timedOn [running|off] # on is temporary - e.g. started with on-for-timer
trigger [Long|Short]_$no trigger event from channel
smokeDetector
[off|smoke-Alarm|alive] # for team leader
[off|smoke-forward|smoke-alarm] # for team members
[normal|added|addedStrong] #HM-CC-SCD
SDteam [add|remove]_$dname
battery [low|ok]
smoke_detect [none|<src>]
teamCall:from $src
threeStateSensor
[open|tilted|closed]
[wet|damp|dry] #HM-SEC-WDS only
cover [open|closed] #HM-SEC-WDS and HM-Sec-RHS
alive yes
battery [low|ok]
contact [open|tilted|closed]
contact [wet|damp|dry] #HM-SEC-WDS only
sabotageError [on|off] #HM-SEC-SC only
aesCommToDev
gives information about success or fail of AES communication between IO-device and HM-Device
CUL_HOERMANN
The CUL_HOERMANN module registers the 868MHz Hoermann Garage-Door-Opener
signals received by the CUL. Note: As the structure of this signal is
not understood, no checksum is verified, so it is likely to receive bogus
messages.
The CUL_IR module interprets Infrared messages received by the CUN/CUNO/CUNOv2/TuxRadio.
Those devices can receive Infrared Signals from basically any Remote controller and will transform
that information in a so called Button-Code
<IODev> is the devicename of the IR-receivung device, e.g. CUNO1.
Your definition should look like E.g.:
define IR-Dev CUL_IR CUNO1
Set
irLearnForSec
Sets the CUL_IR device in an IR-Code Learning mode for the given seconds. Any received IR-Code will
be stored as a Button attribute for this devices. The name of these attributes is dependent on the two
attributes learncount and learnprefix.
Attention: Before learning IR-Codes the CUL_IR device needs to be set in IR-Receiving mode
by modifying the irReceive attribute.
irSend
Sends out IR-commands via the connected IODev. The IR-command can be specified as buttonname according
to Button.* or as IR-Code directly. If a buttonname is specified, the
corresponding IR-Code will be sent out.
Example:
set IR-Dev irSend ButtonA001
If defining an IR-Code directly the following Code-Syntax needs to be followed:
IRCode: <PP><AAAA><CCCC><FF>
with P = Protocol; A = Address; C = Command; F = Flags
With the Flags you can modify IR-Repetition. Flags between 00-0E will produce
0-15 IR-Repetitions.
You can type the IR-Code as plain as above, or with a heading "I" as learnt for the buttons.
Example: set IR-Dev irSend 0A07070F0F02
set IR-Dev irSend I0A07070F0F00
irReceive
Configure the IR Transceiver of the <IODev> (the CUNO1). Available
arguments are:
OFF
Switching off the reception of IR signals. This is the default.
ON
Switching on the reception of IR signals. This is WITHOUT filtering repetitions. This is
not recommended as many remote controls do repeat their signals.
ON_NR
Switching on the reception of IR signals with filtering of repetitions. This is
the recommended modus operandi.
Button.*
Button.* is the wildcard for all learnt IR-Codes. IR-Codes are learnt as Button-Attributes.
The name for a learnt Button - IR-Code is compiled out of three elements:
Button<learnprefix><learncount>
When the CUL_IR device is set into learning mode it will generate a
new button-attribute for each new IR-Code received.This is done according to the following syntax:
<Button-Attribute-Name> <IR-Code>
Examples of learnt button-attributes with EMPTY <learnprefix> and <learncount> starting from 1:
Button001 I02029A000000
Button002 I02029A000001
To make sure that something happens when this IR-code is received later on one has to modify the attribute
and to add commands as attribute values.
Examples:
Button001 I02029A000000 set WZ_Lamp on
Button002 I02029A000001 set Switch on
Group.*
Group.* is the wildcard for IR-Code groups. With these attributes one can define
IR-Code parts, which may match to several Button-IR-Codes.
This is done by defining group-attributes that contain only parts of the IR-Code.
The syntax is:
<Group-Attribute-Name> <IR-Code>
Examples of a group-attribute is:
Group001 I02029A
With this all IR-Codes starting with I02029A will match the Group001.
learncount
learncount is used to store the next button-code-number that needs to be learned.
By manually modifying this attribute new button sequences can be arranged.
learnprefix
learnprefix is a string which will be added to the button-attribute-name.
A button-attribute-name is constructed by:
Button<learnprefix><learncount>
If learnprefix is empty the button-attribute-name only contains the term
"Button" and the actual number of learncount.
CUL_MAX
The CUL_MAX module interprets MAX! messages received by the CUL. It will be automatically created by autocreate, just make sure
that you set the right rfmode like attr CUL0 rfmode MAX.
Define
define <name> CUL_MAX <addr>
Defines an CUL_MAX device of type <type> and rf address <addr>. The rf address
must not be in use by any other MAX device.
Set
pairmode
Sets the CUL_MAX into pairing mode for 60 seconds where it can be paired with
other devices (Thermostats, Buttons, etc.). You also have to set the other device
into pairing mode manually. (For Thermostats, this is pressing the "Boost" button
for 3 seconds, for example).
fakeSC <device> <open>
Sends a fake ShutterContactState message <open> must be 0 or 1 for
"window closed" or "window opened". If the <device> has a non-zero groupId,
the fake ShutterContactState message affects all devices with that groupId.
Make sure you associate the target device(s) with fakeShutterContact beforehand.
fakeWT <device> <desiredTemperature> <measuredTemperature>
Sends a fake WallThermostatControl message (parameters both may have one digit
after the decimal point, for desiredTemperature it may only by 0 or 5).
If the <device> has a non-zero groupId, the fake WallThermostatControl
message affects all devices with that groupId. Make sure you associate the target
device with fakeWallThermostat beforehand.
The CUL_REDIRECT modul receive additional protocols from CUL
and redirect them to other modules.
CUL_RFR
The CUL_RFR module is used to "attach" a second CUL to your base CUL, and
use it as a repeater / range extender. RFR is shorthand for RF_ROUTER.
Transmission of the data uses the CC1101 packet capabilities with GFSK
modulation at 250kBaud after pinging the base CUL at the usual 1kBaud. When
configured, the RFR device can be used like another CUL connected directly to
fhem.
Before you can use this feature in fhem, you have to enable/configure RF
ROUTING in both CUL's:
First give your base CUL (which remains connected to the PC) an RFR ID
by issuing the fhem command "set MyCUL raw ui0100". With this command
the base CUL will get the ID 01, and it will not relay messages to other
CUL's (as the second number is 00).
Now replace the base CUL with the RFR CUL, and set its id by issuing
the fhem command "set MyCUL raw ui0201". Now remove this CUL and attach the
original, base CUL again. The RFR CUL got the id 02, and will relay every
message to the base CUL with id 01.
Take the RFR CUL, and attach it to an USB power supply, as seen on
the image. As the configured base id is not 00, it will activate RF
reception on boot, and will start sending messages to the base CUL.
Now you have to define this RFR cul as a fhem device:
Define
define <name> CUL_RFR <own-id> <base-id>
<own-id> is the id of the RFR CUL not connected to the PC,
<base-id> is the id of the CUL connected to the PC. Both parameters
have two characters, each representing a one byte hex number.
Example:
set MyCUL raw ui0100
# Now replace the base CUL with the RFR CUL set MyCUL raw ui0201
# Reattach the base CUL to the PC and attach the RFR CUL to a
USB power supply define MyRFR CUL_RFR 02 01
The rest of the attributes is the same as for the CUL.
CUL_TCM97001
The CUL_TCM97001 module interprets temperature sensor messages received by a Device like CUL, CUN, SIGNALduino etc.
Supported models:
TCM97...
ABS700
TCM21....
Prologue
Rubicson
NC_WS
GT-WT-02
AURIOL
Eurochron
New received device packages are add in fhem category CUL_TCM97001 with autocreate.
Define
The received devices created automatically.
The ID of the defive are the first two Hex values of the package as dezimal.
Generated events:
temperature: The temperature
humidity: The humidity (if available)
battery: The battery state: low or ok (if available)
channel: The Channelnumber (if available)
trend: The temperature trend (if available)
Attributes
IODev
Note: by setting this attribute you can define different sets of 8
devices in FHEM, each set belonging to a Device which is capable of receiving the signals. It is important, however,
that a device is only received by the defined IO Device, e.g. by using
different Frquencies (433MHz vs 868MHz)
The CUL_TX module interprets TX2/TX3 type of messages received by the CUL,
see also http://www.f6fbb.org/domo/sensors/tx3_th.php.
This protocol is used by the La Crosse TX3-TH thermo/hygro sensor and other
wireless themperature sensors. Please report the manufacturer/model of other
working devices.
Define
define <name> CUL_TX <code> [corr] [minsecs]
<code> is the code of the autogenerated address of the TX device (0
to 127)
corr is a correction factor, which will be added to the value received from
the device.
minsecs are the minimum seconds between two log entries or notifications
from this device. E.g. if set to 300, logs of the same type will occure
with a minimum rate of one per 5 minutes even if the device sends a message
every minute. (Reduces the log file size and reduces the time to display
the plots)
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
N/A
Get
N/A
Attributes
IODev
Note: by setting this attribute you can define different sets of 8
devices in FHEM, each set belonging to a CUL. It is important, however,
that a device is only received by the CUL defined, e.g. by using
different Frquencies (433MHz vs 868MHz)
Download the firmware from a nightly SVN chekout and flash the
hardware.
Currently the CUL is supported with its versions:
CUL_V2, CUL_V2_HM, CUL_V3, CUL_V4.
If the fhem-device is none, than the inserted device must already be in the
flash-mode. Note:for flashing the CUL dfu-programmer has to be installed in the
path, this is already the case with the Fritz!Box 7390 image from
fhem.de
Example:
CULflash CUL CUL_V3
CULflash none CUL_V3
Note: the message "dfu-programmer: failed to release interface 0." is
normal on the FB7390.
A calendar device periodically gathers calendar events from the source calendar at the given URL or from a file.
The file must be in ICal format.
If the URL
starts with https://, the perl module IO::Socket::SSL must be installed
(use cpan -i IO::Socket::SSL).
Note for users of Google Calendar: You can literally use the private ICal URL from your Google Calendar.
If your Google Calendar
URL starts with https:// and the perl module IO::Socket::SSL is not installed on your system, you can
replace it by http:// if and only if there is no redirection to the https:// URL.
Check with your browser first if unsure.
The optional parameter interval is the time between subsequent updates
in seconds. It defaults to 3600 (1 hour).
Forces the retrieval of the calendar from the URL. The next automatic retrieval is scheduled to occur
interval seconds later.
set <name> reload
Same as update but all calendar events are removed first.
Get
get <name> full|text|summary|location|alarm|start|end <reading>|<uid> [max]
Returns, line by line, the full state or a textual representation or the summary (subject, title) or the
location or the alarm time or the start time or the end time
of the calendar event(s) listed in the
reading <reading> or identified by the UID <uid>. The optional parameter max limits
the number of returned lines.
get <name> find <regexp>
Returns, line by line, the UIDs of all calendar events whose summary matches the regular expression
<regexp>.
A calendar is a set of calendar events. A calendar event has a summary (usually the title shown in a visual
representation of the source calendar), a start time, an end time, and zero, one or more alarm times. The calendar events are
fetched from the source calendar at the given URL.
In case of multiple alarm times for a calendar event, only the
earliest alarm time is kept.
Recurring calendar events are currently supported to an extent:
FREQ INTERVAL UNTIL COUNT are interpreted, BYMONTHDAY BYMONTH WKST
are recognized but not interpreted. BYDAY is only correctly interpreted for weekly events.
The module will get it most likely wrong
if you have recurring calendar events with unrecognized or uninterpreted keywords.
A calendar event is identified by its UID. The UID is taken from the source calendar. All non-alphanumerical characters
are stripped off the UID to make your life easier.
A calendar event can be in one of the following states:
new
The calendar event was first seen at the most recent update. Either this was your first retrieval of
the calendar or you newly added the calendar event to the source calendar.
known
The calendar event was already there before the most recent update.
updated
The calendar event was already there before the most recent update but it has changed since it
was last retrieved.
deleted
The calendar event was there before the most recent update but is no longer. You removed it from the source calendar. The calendar event will be removed from all lists at the next update.
Calendar events that lie completely in the past (current time on wall clock is later than the calendar event's end time)
are not retrieved and are thus not accessible through the calendar.
A calendar event can be in one of the following modes:
upcoming
Neither the alarm time nor the start time of the calendar event is reached.
alarm
The alarm time has passed but the start time of the calendar event is not yet reached.
start
The start time has passed but the end time of the calendar event is not yet reached.
end
The end time of the calendar event has passed.
A calendar event transitions from one mode to another immediately when the time for the change has come. This is done by waiting
for the earliest future time among all alarm, start or end times of all calendar events.
A calendar device has several readings. Except for calname, each reading is a semicolon-separated list of UIDs of
calendar events that satisfy certain conditions:
calname
name of the calendar
all
all events
modeAlarm
events in alarm mode
modeAlarmOrStart
events in alarm or start mode
modeAlarmed
events that have just transitioned from upcoming to alarm mode
modeChanged
events that have just changed their mode somehow
modeEnd
events in end mode
modeEnded
events that have just transitioned from start to end mode
modeStart
events in start mode
modeStarted
events that have just transitioned to start mode
modeUpcoming
events in upcoming mode
stateChanged
events that have just changed their state somehow
stateDeleted
events in state deleted
stateNew
events in state new
stateUpdated
events in state updated
When a calendar event has changed, an event is created in the form
changed: UID mode with mode being the current mode the calendar event is in after the change.
Usage scenarios
Show all calendar events with details
get MyCalendar full all
2767324dsfretfvds7dsfn3e4dsa234r234sdfds6bh874googlecom known alarm 31.05.2012 17:00:00 07.06.2012 16:30:00-07.06.2012 18:00:00 Erna for coffee
992hydf4y44awer5466lhfdsrgl7tin6b6mckf8glmhui4googlecom known upcoming 08.06.2012 00:00:00-09.06.2012 00:00:00 Vacation
Show calendar events in your photo frame
Put a line in the layout description to show calendar events in alarm or start mode:
text 20 60 { fhem("get MyCalendar text modeAlarmOrStart") }
This may look like:
07.06.12 16:30 Erna for coffee
08.06.12 00:00 Vacation
Switch the light on when Erna comes
First find the UID of the calendar event:
get MyCalendar find .*Erna.*
2767324dsfretfvds7dsfn3e4dsa234r234sdfds6bh874googlecom
Then define a notify:
define ErnaComes notify MyCalendar:modeStarted.*2767324dsfretfvds7dsfn3e4dsa234r234sdfds6bh874googlecom.* set MyLight on
Think about a calendar with calendar events whose summaries (subjects, titles) are the names of devices in your fhem installation.
You want the respective devices to switch on when the calendar event starts and to switch off when the calendar event ends.
define SwitchActorOn notify MyCalendar:modeStarted.* {
my $reading="%EVTPART0";;
my $uid= "%EVTPART1";;
my $actor= fhem("get MyCalendar summary $uid");;
if(defined $actor) {
fhem("set $actor on")
}
}
define SwitchActorOff notify MyCalendar:modeEnded.* {
my $reading="%EVTPART0";;
my $uid= "%EVTPART1";;
my $actor= fhem("get MyCalendar summary $uid");;
if(defined $actor) {
fhem("set $actor off")
}
}
You can also do some logging:
define LogActors notify MyCalendar:mode(Started|Ended).* { my $reading= "%EVTPART0";; my $uid= "%EVTPART1";; my $actor= fhem("get MyCalendar summary $uid");; Log 3 %NAME, 1, "Actor: $actor, Reading $reading" }
ComfoAir
ComfoAir provides a way to communicate with ComfoAir ventilation systems from Zehnder, especially the ComfoAir 350 (CA350).
It seems that many other ventilation systems use the same communication device and protocol,
e.g. WHR930 from StorkAir, G90-380 from Wernig and Santos 370 DC from Paul.
They are connected via serial line to the fhem computer.
This module is based on the protocol description at http://www.see-solutions.de/sonstiges/Protokollbeschreibung_ComfoAir.pdf
and copies some ideas from earlier modules for the same devices that were posted in the fhem forum from danhauck(Santos) and Joachim (WHR962).
The module can be used in two ways depending on how fhem and / or a vendor supplied remote control device
like CC Ease or CC Luxe are connected to the system. If a remote control device is connected it is strongly advised that
fhem does not send data to the ventilation system as well and only listens to the communication betweem the vendor equipment.
The RS232 interface used is not made to support more than two parties communicating and connecting fhem in parallel to a CC Ease or similar device can lead to
collisions when sending data which can corrupt the ventilation system.
If connected in parallel fhem should only passively listen and <Interval> is to be set to 0.
If no remote control device is connected to the ventilation systems then fhem has to take control and actively request data
in the interval to be defined. Otherwiese fhem will not see any data. In this case fhem can also send commands to modify settings.
Prerequisites
This module requires the Device::SerialPort or Win32::SerialPort module.
Define
define <name> ComfoAir <device> <Interval>
The module connects to the ventialation system through the given Device and either passively listens to data that is communicated
between the ventialation system and its remote control device (e.g. CC Luxe) or it actively requests data from the
ventilation system every <Interval> seconds
Example:
define ZL ComfoAir /dev/ttyUSB1@9600 60
Configuration of the module
apart from the serial connection and the interval which both are specified in the define command there are several attributes that
can optionally be used to modify the behavior of the module.
The module internally gives names to all the protocol messages that are defined in the module and these names can be used
in attributes to define which requests are periodically sent to the ventilation device. The same nams can also be used with
set commands to manually send a request. Since all messages and readings are generically defined in a data structure in the module, it should be
quite easy to add more protocol details if needed without programming.
The names currently defined are:
if the attribute is set to 1, the corresponding data is requested every <Interval> seconds. If it is set to 0, then the data is not requested.
by default Ventilation-Levels, Temperaturen and Status-Bypass are requested if no attributes are set.
like with the attributes mentioned above, set commands can be used to send a request for data manually. The following set options are available for this:
Temp_Komfort (target temperature for comfort)
Stufe (ventilation level)
Get-Commands
All readings that are derived from the responses to protocol requests are also available as Get commands. Internally a Get command triggers the corresponding
request to the device and then interprets the data and returns the right field value. To avoid huge option lists in FHEMWEB, only the most important Get options
are visible in FHEMWEB. However this can easily be changed since all the readings and protocol messages are internally defined in the modue in a data structure
and to make a Reading visible as Get option only a little option (e.g. showget => 1 has to be added to this data structure
include a request for the data belonging to the named group when sending requests every interval seconds
hide-Bootloader-Version
hide-Firmware-Version
hide-RS232-Modus
hide-Sensordaten
hide-KonPlatine-Version
hide-Verzoegerungen
hide-Ventilation-Levels
hide-Temperaturen
hide-Betriebsstunden
hide-Status-Bypass
hide-Status-Vorheizung
prevent readings of the named group from being created even if used passively without polling and an external remote control requests this data.
please note that this attribute doesn't delete already existing readings.
queueDelay
modify the delay used when sending requests to the device from the internal queue, defaults to 1 second
queueMax
max length of the send queue, defaults to 50
timeout
set the timeout for reads, defaults to 2 seconds
CustomReadings
FHEM module to define own readings.
This module allows to define own readings. The readings can be defined in an attribute so that they can get changed without changing the code of the module.
To use this module you should have some perl and linux knowledge
The examples presuppose that you run FHEM on a linux machine like a Raspberry Pi or a Cubietruck.
Note: the "bullshit" definition is an example to show what happens if you define bullshit :-)
Optionally, to display the readings:
define myReadingsDisplay weblink htmlCode {CustomReadings_GetHTML('myReadings')}
attr myReadingsDisplay group Readings
attr myReadingsDisplay room 0-Test
Resulting readings:
ac_powersupply_current
0.236
2014-08-09 15:40:21
ac_powersupply_voltage
5.028
2014-08-09 15:40:21
bullshit
ERROR
2014-08-09 15:40:21
device_name
myReadings
2014-08-09 15:40:21
fhem_backup_folder_size
20M
2014-08-09 15:40:21
hdd_temperature
/dev/sda: TS128GSSD320: 47°C
2014-08-09 15:40:21
kernel
3.4.103-sun7i+
2014-08-09 15:40:21
perl_version
5.014002
2014-08-09 15:40:21
timezone
Europe/Berlin
2014-08-09 15:40:21
Define
define <name> CustomReadings
Readings
As defined
Attributes
interval
Refresh interval in seconds
readingDefinitions
The definitions are separated by a comma. A definition consists of two parts, separated by a colon.
The first part is the name of the reading and the second part the function.
The function gets evaluated and must return a result.
Example: kernel:qx(uname -r 2>&1)
Defines a reading with the name "kernel" and evaluates the linux function uname -r
Multiline output from commands, systemcall, scripts etc. can be use for more than one reading with
the keyword COMBINED as reading (which wont appear itself) while its command output
will be put line by line in the following readings defined (so they don't need a function defined
after the colon (it would be ignored)).But the lines given must match the number and order of the
following readings.
COMBINED can be used together or lets say after or even in between normal expressions if the
number of lines of the output matches exactly.
Example: COMBINED:qx(cat /proc/sys/vm/dirty_background*),dirty_bytes:,dirty_ration:
Defines two readings (dirty_bytes and dirty_ratio) which will get set by the lines of those
two files the cat command will find in the kernel proc directory.
In some cases this can give an noticeable performance boost as the readings are filled up all at once.
DOIF
DOIF is a universal module. It works event- and time-controlled.
It combines the functionality of a notify, at-, watchdog command with logical queries.
Complex problems can be solved with this module, which would otherwise be solved only with several modules at different locations in FHEM. This leads to clear solutions and simplifies their maintenance.
Logical queries are created in conditions using Perl operators.
These are combined with information from states, readings, internals of devices or times in square brackets.
Arbitrary Perl functions can also be specified that are defined in FHEM.
The module is triggered by time or by events information through the Devices specified in the condition.
If a condition is true, the associated FHEM- or Perl commands are executed.
The commands are always processed from left to right. There is only one command executed, namely the first, for which the corresponding condition in the processed sequence is true. In addition, only the conditions are checked, which include a matching device of the trigger (in square brackets).
Features
+ intuitive syntax, as used in branches (if - elseif-....elseif - else) in higher-level languages
+ in the condition of any logical queries can be made as well as perl functions are used (full perl support)
+ it can be any FHEM commands and perl commands are executed
+ syntax checking at the time of definition are identified missing brackets
+ status is specified with [<devicename>], readings with [<devicename>:<readingname>] or internals with [<devicename>:&<internal>]
+ time information on the condition: [HH:MM:SS] or [HH:MM] or [<seconds>]
+ indirect time on the condition: [[<devicename>]] or [[<devicename>:<readingname>]] or [{<perl-function>}]
+ time calculation on the condition: [(<time calculation in Perl with time syntax specified above>)]
+ time intervals: [<begin>-<end>] for <begin> and <end>, the above time format can be selected.
+ relative times preceded by a plus sign [+<time>] or [+<begin>-+<end>] combined with Perl functions
+ weekday control: [<time>|012345678] or [<begin>-<end>|012345678] (0-6 corresponds to Sunday through Saturday) such as 7 for $we and 8 for !$we
+ statuses, readings, internals und time intervals for only queries without trigger with [?...]
+ DOELSEIF cases and DOELSE at the end are optional
+ delay specification with resetting is possible (watchdog function)
+ the execution part can be left out in each case. So that the module can be used for pure status display.
+ definition of the status display with use of any readings or statuses
Many examples with english identifiers - see german section.
Dashboard
Creates a Dashboard in any group can be arranged. The positioning may depend the Groups and column width are made
arbitrarily by drag'n drop. Also, the width and height of a Group can be increased beyond the minimum size.
locks the Dashboard so that no position changes can be made set <name> unlock
unlock the Dashboard
Get
N/A
Attributes
dashboard_tabcount
Returns the number of displayed tabs. (Does not need to be set any more. It is read automatically from the configured tabs)
Default: 1
dashboard_activetab
Specifies which tab is activated. Can be set manually, but is also set by the switch "Set" to the currently active tab.
Default: 1
dashboard_tabXname
Title of Tab at position X.
dashboard_tabXsorting
Contains the position of each group in Tab X. Value is written by the "Set" button. It is not recommended to take manual changes.
dashboard_row
To select which rows are displayed. top only; center only; bottom only; top and center; center and bottom; top,center and bottom.
Default: center
dashboard_width
To determine the Dashboardwidth. The value can be specified, or an absolute width value (eg 1200) in pixels in% (eg 80%).
Default: 100%
dashboard_rowcenterheight
Height of the center row in which the groups may be positioned.
Default: 400
dashboard_rowcentercolwidth
About this attribute, the width of each column of the middle Dashboardrow can be set. It can be stored for each column a separate value.
The values ​​must be separated by a comma (no spaces). Each value determines the column width in%! The first value specifies the width of the first column,
the second value of the width of the second column, etc. Is the sum of the width greater than 100 it is reduced.
If more columns defined as widths the missing widths are determined by the difference to 100. However, are less columns are defined as the values ​​of
ignores the excess values​​.
Default: 100
dashboard_rowtopheight
Height of the top row in which the groups may be positioned.
Default: 250
"dashboard_rowbottomheight
Height of the bottom row in which the groups may be positioned.
Default: 250
dashboard_tabXgroups
Comma-separated list of the names of the groups to be displayed in Tab X.
Each group can be given an icon for this purpose the group name, the following must be completed ":<icon>@<color>"
Example: Light:Icon_Fisch@blue,AVIcon_Fisch@red,Single Lights:Icon_Fisch@yellow
Additionally a group can contain a regular expression to show all groups matching a criteria.
Example: .*Light.* to show all groups that contain the string "Light"
dashboard_tabXdevices
devspec list of devices that should appear in the tab. The format is:
GROUPNAME:devspec1,devspec2,...,devspecN:ICONNAME
THe icon name is optional. Also the group name is optional. In case of missing group name, the matching devices are not grouped but shown as separate widgets without titles. For further details on the devspec format see: Dev-Spec
dashboard_tabXicon
Set the icon for a Tab. There must exist an icon with the name ico.(png|svg) in the modpath directory. If the image is referencing an SVG icon, then you can use the @colorname suffix to color the image.
dashboard_colcount
Number of columns in which the groups can be displayed. Nevertheless, it is possible to have multiple groups
to be positioned in a column next to each other. This is depend on the width of columns and groups.
Default: 1
dashboard_tabXcolcount
Number of columns for a specific tab in which the groups can be displayed. Nevertheless, it is possible to have multiple groups
to be positioned in a column next to each other. This depends on the width of columns and groups.
Default:
dashboard_tabXbackgroundimage
Shows a background image for the X tab. The image is not stretched in any way, it should therefore match the tab size or extend it.
Standard:
dashboard_flexible
If set to a value > 0, the widgets are not positioned in columns any more but can be moved freely to any position in the tab.
The value for this parameter also defines the grid, in which the position "snaps in".
Default: 0
dashboard_showfullsize
Hide FHEMWEB Roomliste (complete left side) and Page Header if Value is 1.
Default: 0
dashboard_showtabs
Displays the Tabs/Buttonbar on top or bottom, or hides them. If the Buttonbar is hidden lockstate is "lock" is used.
Default: tabs-and-buttonbar-at-the-top
dashboard_showtogglebuttons
Displays a Toogle Button on each Group do collapse.
Default: 0
dashboard_backgroundimage
Displays a background image for the complete dashboard. The image is not stretched in any way so the size should match/extend the
dashboard height/width.
Default:
dashboard_debug
Show Hiddenfields. Only for Maintainer's use.
Default: 0
DbLog
Define
define <name> DbLog <configfilename> <regexp>
Log events to a database. The database connection is defined in
<configfilename> (see sample configuration file
contrib/dblog/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.
The modules DBI and DBD::<dbtype>
need to be installed (use cpan -i <module>
if your distribution does not have it).
Sample code to create a MySQL/PostgreSQL database is in
<DBType>_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 the following code like FileLog:
get myDbLog - - 2012-11-10 2012-11-10 KS300:temperature::
Examples:
# log everything to database define myDbLog DbLog /etc/fhem/db.conf .*:.*
Set
set <name> reopen
Perform a database disconnect and immediate reconnect to clear cache and flush journal file.
set <name> rereadcfg
Perform a database disconnect and immediate reconnect to clear cache and flush journal file.
Probably same behavior als reopen, but rereadcfg will read the configuration data before reconnect.
set <name> count
Count records in tables current and history and write results into readings countCurrent and countHistory.
set <name> deleteOldDays <n>
Delete records from history older than <n> days. Number of deleted record will be written into reading lastRowsDeleted.
set <name> reduceLog <n> [average[=day]] [exclude=deviceRegExp1:ReadingRegExp1,deviceRegExp2:ReadingRegExp2,...]
Reduce records older than <n> days to one record each hour (the 1st) per device & reading.
CAUTION: It is strongly recommended to check if the default INDEX 'Search_Idx' exists on the table 'history'!
The execution of this command may take (without INDEX) extremely long, FHEM will be completely blocked after issuing the command to completion!
With the optional argument 'average' not only the records will be reduced, but all numerical values of an hour will be reduced to a single average.
With the optional argument 'average=day' not only the records will be reduced, but all numerical values of a day will be reduced to a single average. (implies 'average')
You can optional set the last argument to "EXCLUDE=deviceRegExp1:ReadingRegExp1,deviceRegExp2:ReadingRegExp2,...." to exclude device/readings from reduceLog
You can optional set the last argument to "INCLUDE=Database-deviceRegExp:Database-ReadingRegExp" to delimit the SELECT statement which is executet on the database. This reduce the system RAM load and increase the performance. (Wildcards are % and _)
set <name> userCommand <validSqlStatement>
DO NOT USE THIS COMMAND UNLESS YOU REALLY (REALLY!) KNOW WHAT YOU ARE DOING!!!
Perform any (!!!) sql statement on connected database. Useercommand and result will be written into corresponding readings.
Get
get <name> ReadingsVal <device> <reading> <default> get <name> ReadingsTimestamp <device> <reading> <default>
Retrieve one single value, use and syntax are similar to ReadingsVal() and ReadingsTimestamp() functions.
get <name> <infile> <outfile> <from>
<to> <column_spec>
Read data from the Database, used by frontends to plot data without direct
access to the Database.
<in>
A dummy parameter for FileLog compatibility. Sessing by defaultto -
current: reading actual readings from table "current"
history: reading history readings from table "history"
-: identical to "history"
<out>
A dummy parameter for FileLog compatibility. Setting by default to -
to check the output for plot-computing.
Set it to the special keyword
all to get all columns from Database.
ALL: get all colums from table, including a header
Array: get the columns as array of hashes
INT: internally used by generating plots
-: default
<from> / <to>
Used to select the data. Please use the following timeformat or
an initial substring of it:
YYYY-MM-DD_HH24:MI:SS
<column_spec>
For each column_spec return a set of data separated by
a comment line on the current connection.
Syntax: <device>:<reading>:<default>:<fn>:<regexp>
<device>
The name of the device. Case sensitive. Using a the joker "%" is supported.
<reading>
The reading of the given device to select. Case sensitive. Using a the joker "%" is supported.
<default>
no implemented yet
<fn>
One of the following:
int
Extract the integer at the beginning of the string. Used e.g.
for constructs like 10%
int<digit>
Extract the decimal digits including negative character and
decimal point at the beginning og the string. Used e.g.
for constructs like 15.7°C
delta-h / 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.
delta-ts
Replaced the original value with a measured value of seconds since
the last and the actual logentry.
<regexp>
The string is evaluated as a perl expression. The regexp is executed
before <fn> parameter.
Note: The string/perl expression cannot contain spaces,
as the part after the space will be considered as the
next column_spec. Keywords
$val is the current value returned from the Database.
$ts is the current timestamp returned from the Database.
This Logentry will not print out if $val contains th keyword "hide".
This Logentry will not print out and not used in the following processing
if $val contains th keyword "ignore".
Examples:
get myDbLog - - 2012-11-10 2012-11-20 KS300:temperature
get myDbLog current ALL - - %:temperature
you will get all actual readings "temperature" from all logged devices.
Be carful by using "history" as inputfile because a long execution time will be expected!
get myDbLog - - 2012-11-10_10 2012-11-10_20 KS300:temperature::int1
like from 10am until 08pm at 10.11.2012
get myDbLog - all 2012-11-10 2012-11-20 KS300:temperature
get myDbLog - - 2012-11-10 2012-11-20 KS300:temperature KS300:rain::delta-h KS300:rain::delta-d
get myDbLog - - 2012-11-10 2012-11-20 MyFS20:data:::$val=~s/(on|off).*/$1eq"on"?1:0/eg
return 1 for all occurance of on* (on|on-for-timer etc) and 0 for all off*
get myDbLog - - 2012-11-10 2012-11-20 Bodenfeuchte:data:::$val=~s/.*B:\s([-\.\d]+).*/$1/eg
Example of OWAD: value like this: "A: 49.527 % B: 66.647 % C: 9.797 % D: 0.097 V"
and output for port B is like this: 2012-11-20_10:23:54 66.647
get DbLog - - 2013-05-26 2013-05-28 Pumpe:data::delta-ts:$val=~s/on/hide/
Setting up a "Counter of Uptime". The function delta-ts gets the seconds between the last and the
actual logentry. The keyword "hide" will hide the logentry of "on" because this time
is a "counter of Downtime"
Query the Database to retrieve JSON-Formatted Data, which is used by the charting frontend.
<name>
The name of the defined DbLog, like it is given in fhem.cfg.
<in>
A dummy parameter for FileLog compatibility. Always set to -
<out>
A dummy parameter for FileLog compatibility. Set it to webchart
to use the charting related get function.
<from> / <to>
Used to select the data. Please use the following timeformat:
YYYY-MM-DD_HH24:MI:SS
<device>
A string which represents the device to query.
<querytype>
A string which represents the method the query should use. Actually supported values are: getreadings to retrieve the possible readings for a given device getdevices to retrieve all available devices timerange to retrieve charting data, which requires a given xaxis, yaxis, device, to and from savechart to save a chart configuration in the database. Requires a given xaxis, yaxis, device, to and from, and a 'savename' used to save the chart deletechart to delete a saved chart. Requires a given id which was set on save of the chart getcharts to get a list of all saved charts. getTableData to get jsonformatted data from the database. Uses paging Parameters like start and limit. hourstats to get statistics for a given value (yaxis) for an hour. daystats to get statistics for a given value (yaxis) for a day. weekstats to get statistics for a given value (yaxis) for a week. monthstats to get statistics for a given value (yaxis) for a month. yearstats to get statistics for a given value (yaxis) for a year.
<xaxis>
A string which represents the xaxis
<yaxis>
A string which represents the yaxis
<savename>
A string which represents the name a chart will be saved with
<chartconfig>
A jsonstring which represents the chart to save
<pagingstart>
An integer used to determine the start for the sql used for query 'getTableData'
<paginglimit>
An integer used to set the limit for the sql used for query 'getTableData'
Examples:
get logdb - webchart "" "" "" getcharts
Retrieves all saved charts from the Database
get logdb - webchart "" "" "" getdevices
Retrieves all available devices from the Database
get logdb - webchart "" "" ESA2000_LED_011e getreadings
Retrieves all available Readings for a given device from the Database
get logdb - webchart 2013-02-11_00:00:00 2013-02-12_00:00:00 ESA2000_LED_011e timerange TIMESTAMP day_kwh
Retrieves charting data, which requires a given xaxis, yaxis, device, to and from
Will ouput a JSON like this: [{'TIMESTAMP':'2013-02-11 00:10:10','VALUE':'0.22431388090756'},{'TIMESTAMP'.....}]
get logdb - webchart 2013-02-11_00:00:00 2013-02-12_00:00:00 ESA2000_LED_011e savechart TIMESTAMP day_kwh tageskwh
Will save a chart in the database with the given name and the chart configuration parameters
get logdb - webchart "" "" "" deletechart "" "" 7
Will delete a chart from the database with the given id
Attributes
shutdownWait
attr <device> shutdownWait
causes fhem shutdown to wait n seconds for pending database commit
DbLogSelectionMode
attr <device> DbLogSelectionMode
Thise DbLog-Device-Attribute specifies how the device specific Attributes DbLogExclude and DbLogInclude are handled.
If this Attribute is missing it defaults to "Exclude".
Exclude: DbLog behaves just as usual. This means everything specified in the regex in DEF will be logged by default and anything excluded
via the DbLogExclude attribute will not be logged
Include: Nothing will be logged, except the readings specified via regex in the DbLogInclude attribute
Exclude/Include: Just almost the same as Exclude, but if the reading matches the DbLogExclude attribute, then
it will further be checked against the regex in DbLogInclude whicht may possibly re-include the already
excluded reading.
See also DbLogSelectionMode-Attribute of DbLog-Device which takes influence on
on how DbLogExclude and DbLogInclude are handled
DbLogInclude
set <device> DbLogInclude regex:MinInterval [regex:MinInterval] ...
A new Attribute DbLogInclude will be propagated
to all Devices if DBLog is used. DbLogInclude works just like DbLogExclude but
to include matching readings.
See also DbLogSelectionMode-Attribute of DbLog-Device which takes influence on
on how DbLogExclude and DbLogInclude are handled
Example
set <device> DbLogExclude regex:MinInterval [regex:MinInterval] ...
A new Attribute DbLogExclude will be propagated
to all Devices if DBLog is used. DbLogExclude will work as regexp to exclude
defined readings to log. Each individual regexp-group are separated by comma.
If a MinInterval is set, the logentry is dropped if the
defined interval is not reached and value vs. lastvalue is eqal .
Example
attr <device> ignoreUndef
suppresses all undef values when returning data from the DB via get
Example
#DbLog eMeter:power:::$val=($val>1500)?undef:$val
EC3000
The Energy Count C3000 is a AC mains plug with integrated power meter functionality from CONRAD.
It can be integrated in to FHEM via a JeeLink as the IODevice.
Define
define <name> EC3000 <addr>
addr is a 4 digit hex number to identify the EC3000 device.
Note: devices are autocreated on reception of the first message.
Set
Get
Readings
consumption
consumptionMax
consumptionNow
Attributes
offLevel
a power level less or equal offLevel is considered to be off
ECMD
Any physical device with request/response-like communication capabilities
over a TCP connection can be defined as ECMD device. A practical example
of such a device is the AVR microcontroller board AVR-NET-IO from
Pollin with
ECMD-enabled
Ethersex firmware. The original
NetServer firmware from Pollin works as well.
A physical ECMD device can host any number of logical ECMD devices. Logical
devices are defined as ECMDDevices in fhem.
ADC 0 to 3 and I/O port 0 to 3 of the above mentioned board
are examples of such logical devices. ADC 0 to 3 all belong to the same
device class ADC (analog/digital converter). I/O port 0 to 3 belong to the device
class I/O port. By means of extension boards you can make your physical
device drive as many logical devices as you can imagine, e.g. IR receivers,
LC displays, RF receivers/transmitters, 1-wire devices, etc.
Defining one fhem module for any device class would create an unmanageable
number of modules. Thus, an abstraction layer is used. You create a device class
on the fly and assign it to a logical ECMD device. The
class definition
names the parameters of the logical device, e.g. a placeholder for the number
of the ADC or port, as well as the get and set capabilities. Worked examples
are to be found in the documentation of the ECMDDevice device.
Note: this module requires the Device::SerialPort or Win32::SerialPort module
if the module is connected via serial Port or USB.
Define
define <name> ECMD telnet <IPAddress:Port>
or
define <name> ECMD serial <SerialDevice>[<@BaudRate>]
Defines a physical ECMD device. The keywords telnet or
serial are fixed.
Examples:
define AVRNETIO ECMD telnet 192.168.0.91:2701 define AVRNETIO ECMD serial /dev/ttyS0 define AVRNETIO ECMD serial /sev/ttyUSB0@38400
Set
set <name> classdef <classname> <filename>
Creates a new device class <classname> for logical devices.
The class definition is in the file <filename>. You must
create the device class before you create a logical device that adheres to
that definition.
Example:
define AVRNETIO classdef /etc/fhem/ADC.classdef
set <name> reopen
Closes and reopens the device. Could be handy if connection is lost and cannot be
reestablished automatically.
Get
get <name> raw <command>
Sends the command <command> to the physical ECMD device
<name> and reads the response. In the likely case that
the command needs to be terminated by a newline character, you have to
resort to a <perl special>.
Example:
get AVRNETIO raw { "ip\n" }
Attributes
classdefs A colon-separated list of <classname>=<filename>.
The list is automatically updated if a class definition is added. You can
directly set the attribute.
split
Some devices send several readings in one transmission. The split attribute defines the
separator to split such transmissions into separate messages. The regular expression for
matching a reading is then applied to each message in turn. After splitting, the separator
is not part of the single messages.
Example: attr myECMD \n splits foo 12\nbar off into
foo 12 and bar off.
logTraffic <loglevel> Enables logging of sent and received datagrams with the given loglevel. Control characters in the logged datagrams are escaped, i.e. a double backslash is shown for a single backslash, \n is shown for a line feed character, etc.
timeout <seconds> Time in seconds to wait for a reply from the physical ECMD device before FHEM assumes that something has gone wrong. The default is 3 seconds if this attribute is not set.
partial <seconds> Some physical ECMD devices split readings and replies into several transmissions. If the partial attribute is set, this behavior is accounted for as follows: (a) If a reply is expected for a get or set command, FHEM collects transmissions from the physical ECMD device until either the reply matches the expected reply or the time in seconds given with the partial attribute has expired. (b) If a spontaneous transmission does not match the regular expression for any reading, the transmission is recorded and prepended to the next transmission. If the line is quiet for longer than the time in seconds given with the partial attribute, the recorded transmission is discarded. Use regular expressions that produce exact matches.
requestSeparator
A single request from FHEM to the device might need to be split in several datagrams. A command string is split at all
occurrences of the requestSeparator. The requestSeparator itself is removed from the command string and thus
not part of the request.
This attribute is set by default. It defaults to the value \000 (octal representation of control char with code zero).
To disable this feature, delete the attribute from the device's attribute list.
responseSeparator
In order to identify the single responses from the device to FHEM for each part of a split command, a responseSeparator
can be appended to the response to each part. The responseSeparator is only appended to commands split by means of a
requestSeparator. The default is to have no responseSeparator, i.e. responses are simply concatenated.
Data to and from the physical device is processed as is. In particular, if you need to send a line feed you have to explicitely send a \n control character. On the other hand, control characters like line feeds are not stripped from the data received. This needs to be considered when defining a class definition.
For debugging purposes, especially when designing a class definition, it is advisable to turn traffic logging on. Use attr myECMD logTraffic 3 to log all data to and from the physical device at level 3. A typical response might look like 21.2\n, i.e. a floating point number followed by a newline.
Data received from the physical device is processed as it comes in chunks. If for some reason a datagram from the device is split in transit, pattern matching and processing will most likely fail. You can use the partial attribute to make FHEM collect and recombine the chunks.
Connection error handling
This modules handles unexpected disconnects of devices as follows (on Windows only for TCP connections):
Disconnects are detected if and only if data from the device in reply to data sent to the device cannot be received with at most two attempts. FHEM waits at most 3 seconds (or the time specified in the timeout attribute, see Attributes). After the first failed attempt, the connection to the device is closed and reopened again. The state of the device
is failed. Then the data is sent again to the device. If still no reply is received, the state of the device is disconnected, otherwise opened. You will have to fix the problem and then use set myECMD reopen to reconnect to the device.
Please design your class definitions in such a way that the double sending of data does not bite you in any case.
Class definition
The class definition for a logical ECMD device class is contained in a text file.
The text file is made up of single lines. Empty lines and text beginning with #
(hash) are ignored. Therefore make sure not to use hashes in commands.
The following commands are recognized in the device class definition:
Normally, the state reading is set to the latest command or reading name followed
by the value, if any. This command sets the state reading to the value of the
named reading if and only if the reading is updated.
Declares a new set or get command <commandname>. If the user invokes the set or get command <commandname>, the string that results from the execution of the <perl special> is sent to the physical device.
A request separator (see Attributes)
can be used to split the command into chunks. This is required for sending multiple Ethersex commands for one command in the class definition.
The result string for the command is the
concatenation of all responses received from the physical device, optionally with response separators
(see Attributes) in between.
set <commandname> expect "<regex>" get <commandname> expect "<regex>"
Declares what FHEM expects to receive after the execution of the get or set command <commandname>. <regex> is a Perl regular expression. The double quotes around the regular expression are mandatory and they are not part of the regular expression itself.
<regex> must match the entire reply, as in m/^<regex>$/.
Particularly, broken connections can only be detected if something is expected (see Connection error handling).
Declares a postprocessor for the command <commandname>. The data received from the physical device in reply to the get or set command <commandname> is processed by the Perl code <perl command>. The perl code operates on $_. Make sure to return the result in $_ as well. The result of the perl command is shown as the result of the get or set command.
set <commandname> params <parameter1> [<parameter2> [<parameter3> ... ]] get <commandname> params <parameter1> [<parameter2> [<parameter3> ... ]]
Declares the names of the named parameters that must be present in the
set or get command <commandname>. Be careful not to use a parameter name that
is already used in the device definition (see params above).
reading <reading> match "<regex>"
Declares a new reading named <reading>. A spontaneous data transmission from the physical device that matches the Perl regular expression <regex> is evaluated to become the value of the named reading. All ECMDDevice devices belonging to the ECMD device with readings with matching regular expressions will receive an update of the said readings.
<regex> must match the entire reply, as in m/^<regex>$/.
Declares a postprocessor for the reading <reading>. The data received for the named reading is processed by the Perl code <perl command>. This works analogously to the postproc spec for set and get commands.
The perl specials in the definitions above can
contain macros:
The macro %NAME will expand to the device name.
The macro %TYPE will expand to the device type.
The macro %<parameter> will expand to the
current value of the named parameter. This can be either a parameter
from the device definition or a parameter from the set or get
command.
The macro substitution occurs before perl evaluates the
expression. It is a plain text substitution. Be careful not to use parameters with overlapping names like
%pin and %pin1.
If in doubt what happens, run the commands with loglevel 5 and
inspect the log file.
The rules outlined in the documentation of perl specials
for the <perl command> in the postprocessor definitions apply.
Note: Beware of undesired side effects from e.g. doubling of semicolons!
Defines a logical ECMD device. The number of given parameters must match those given in
the class definition of the device class <classname>.
Normally, the logical ECMDDevice is attached to the latest previously defined physical ECMD device
for I/O. Use the IODev attribute of the logical ECMDDevice to attach to any
physical ECMD device, e.g. attr myRelais2 IODev myAVRNETIO. In such a case the correct
reference to the class cannot be made at the time of definition of the device. Thus, you need to
omit the <classname> and <parameter> references in the definition of the device and use the
classattribute instead.
set <name> <commandname> [<parameter1> [<parameter2> [<parameter3> ... ]]]
The number of given parameters must match those given for the set command <commandname> definition in
the class definition.
If set <commandname> is invoked the perl special in curly brackets from the command definition
is evaluated and the result is sent to the physical ECMD device.
Example:
set myRelais1 on set myDisplay text This\x20text\x20has\x20blanks!
Get
get <name> <commandname> [<parameter1> [<parameter2> [<parameter3> ... ]]]
The number of given parameters must match those given for the get command <commandname> definition in
the class definition.
If get <commandname> is invoked the perl special in curly brackets from the command definition
is evaluated and the result is sent to the physical ECMD device. The response from the physical ECMD device is returned
and the state of the logical ECMD device is updated accordingly.
Example:
get myADC value 3
Attributes
class
If you omit the <classname> and <parameter> references in the
definition of the device, you have to add them
separately as an attribute. Example: attr myRelais2 class relais 8.
The following example shows how to access the ADC of the AVR-NET-IO board from
Pollin with
ECMD-enabled
Ethersex firmware.
The class definition file /etc/fhem/ADC.classdef looks as follows:
get value cmd {"adc get %channel\n"}
get value params channel
get value expect "\d+\n"
get value postproc { s/^(\d+)\n$/$1/;; $_ }
In the fhem configuration file or on the fhem command line we do the following:
define AVRNETIO ECMD telnet 192.168.0.91:2701 # define the physical device
set AVRNETIO classdef ADC /etc/fhem/ADC.classdef # define the device class ADC
define myADC ECDMDevice ADC # define the logical device myADC with device class ADC
get myADC value 1 # retrieve the value of analog/digital converter number 1
The get command is evaluated as follows: get value has one named parameter
channel. In the example the literal 1 is given and thus %channel
is replaced by 1 to yield "adc get 1\n" after macro substitution. Perl
evaluates this to a literal string which is send as a plain ethersex command to the AVR-NET-IO. The
board returns something like 024\n for the current value of analog/digital converter number 1. The postprocessor keeps only the digits.
Example 2
The following example shows how to switch a relais driven by pin 3 (bit mask 0x08) of I/O port 2 on for
one second and then off again.
The class definition file /etc/fhem/relais.classdef looks as follows:
params pinmask
set on cmd {"io set ddr 2 ff\n\000ioset port 2 0%pinmask\n\000wait 1000\n\000io set port 2 00\n"}
set on expect ".*"
set on postproc {s/^OK\nOK\nOK\nOK\n$/success/; "$_" eq "success" ? "ok" : "error"; }
In the fhem configuration file or on the fhem command line we do the following:
define AVRNETIO ECMD telnet 192.168.0.91:2701 # define the physical device
set AVRNETIO classdef relais /etc/fhem/relais.classdef # define the device class relais
define myRelais ECMDDevice 8 # define the logical device myRelais with pin mask 8
set myRelais on # execute the "on" command
The set command is evaluated as follows: %pinmask
is replaced by 8 to yield
"io set ddr 2 ff\n\000io set port 2 08\n\000wait 1000\n\000io set port 2 00\n\000" after macro substitution. Perl
evaluates this to a literal string. This string is split into lines (with trailing newline characters)
io set ddr 2 ff\n
ioset port 2 08\n
wait 1000\n
io set port 2 00\n
These lines are sent as a plain ethersex commands to the AVR-NET-IO one by one. After
each line the answer from the physical device is read back. They are concatenated with \000 chars and returned
for further processing by the postproc command.
For any of the four plain ethersex commands, the AVR-NET-IO returns the string OK\n. They are
concatenated. The postprocessor takes the result from $_,
substitutes it by the string success if it is OK\nOK\nOK\nOK\n, and then either
returns the string ok or the string error.
Example 3
The following example shows how to implement a sandbox.
The class definition file /etc/fhem/DummyServer.classdef looks as follows:
In the fhem configuration file or on the fhem command line we do the following:
define myDummyServer ECMD telnet localhost:9999 # define the physical device
set myDummyServer classdef DummyServer /etc/fhem/DummyServer.classdef # define the device class DummyServer
define myDummyClient ECDMDevice DummyServer # define a logical device with device class DummyServer
On a Unix command line, run netcat -l 9999. This makes netcat listening on port 9999. Data received on that port are printed on stdout. Data input from stdin is sent to the other end of an incoming connection.
Start FHEM.
Then enter the number 4711 at the stdin of the running netcat server.
FHEM sees 4711\n coming in from the netcat dummy server. The incoming string matches the regular expression of the foo reading. The postprocessor is used to strip any trailing garbage from the digits. The result 4711 is used to update the foo reading.
EDIPLUG
FHEM module to control the Edimax Smart Plug Switches SP-2101W and SP-1101W (http://www.edimax.com)
FHEM Forum : http://forum.fhem.de/index.php/topic,29541.0.html
SP-2101W - Edimax Smart Plug Switch with Power Meter
SP-1101W - Edimax Smart Plug Switch
requires XML:Simple -> sudo apt-get install libxml-simple-perl
list => set a new list for one day with one entry : DayOfWeek(0-6) Starttime(hh:mm) Endtime(hh:mm) Command(on/off) e.g. 1 10:00 11:30 on
use (DayOfWeek) 00:00 24:00 on to switch the complete day on
addlist => add a new on/off time : DayOfWeek(0-6) Starttime(hh:mm) Endtime(hh:mm) Command(on/off) e.g. 1 10:00 11:30 on
dellist => remove a existing on/off time : DayOfWeek(0-6) Starttime(hh:mm) Endtime(hh:mm) e.g. 1 10:00 11:30
delete => delete timelist of one day : DayOfWeek(0-6)
day => enable/disable timeschedule for one day : DayOfWeek(0-6) on/off
Get
info => shows MAC , Firmware Version , Model , Name
power => shows all Power informations ( model SP-2101W only)
schedule => show all internal on/off timetables
status => show on/off state
Attributes
interval => polling interval (default 60)
timeout => max. time to wait in seconds (default 2)
read-only => only read (Get) from device (default 0)
user => username (default admin)
password => password (default 1234)
Readings
0.So -> switching times Sunday
0.So.state -> Sunday switching on/off
.
.
.
6.Sa -> switching times Saturday
6.Sa.state -> Saturday switching on/off ( model SP-2101W only )
last_Toggle_Time ( model SP-2101W only )
current ( model SP-2101W only )
power_now ( model SP-2101W only )
power_day ( model SP-2101W only )
power_week ( model SP-2101W only )
power_month ( model SP-2101W only )
EGPM Socket
Defines a Socket from EGPM2LAN Module. If the global Module AUTOCREATE is enabled,
this device will be created automatically. For manual Setup, pls. see the description of EGPM2LAN.
Define
define <name> EGPM <device> <socket-nr>
Set
set <name> <[on|off|toggle]>
Switches the socket on or of.
set <name> <[on-for-timer|off-for-timer|on-till|off-till|blink|intervals]>
Switches the socket for a specified time+duration or n-times. For Details see set extensions
Creates a Gembird ® Energenie EG-PM2-LAN device to switch up to 4 sockets over the network.
If you have more than one device, it is helpful to connect and set names for your sockets over the web-interface first.
The name settings will be adopted to FHEM and helps you to identify the sockets. Please make sure that you´re logged off from the Energenie web-interface otherwise you can´t control it with FHEM at the same time. EG-PMS2-LAN with surge protector feature was not tested until now.
Set
set <name> <[on|off|toggle]> <socketnr.>
Switch the socket on or off.
set <name> <[on|off]> <all>
Switch all available sockets on or off.
set <name> <staterequest>
Update the device information and the state of all sockets.
If autocreate is enabled, an EGPM device will be created for each socket.
set <name> <clearreadings>
Removes all readings from the list to get rid of old socketnames.
Get
N/A
Attributes
stateDisplay
Default: socketNumer changes between socketNumer and socketName in front of the current state. Call set statusrequest to update all states.
autocreate
Default: onEGPM-devices will be created automatically with a set-command.
Change this attribute to value off to avoid that mechanism.
define mainswitch EGPM2LAN 10.192.192.20 SecretGarden set mainswitch on 1
EIB / KNX
EIB/KNX is a standard for building automation / home automation.
It is mainly based on a twisted pair wiring, but also other mediums (ip, wireless) are specified.
While the module TUL represents the connection to the EIB network,
the EIB modules represent individual EIB devices. This module provides a basic set of operations (on, off, on-till, etc.)
to switch on/off EIB devices. Sophisticated setups can be achieved by combining a number of
EIB module instances or by sending raw hex values to the network (set <devname> raw <hexval>).
EIB/KNX defines a series of Datapoint Type as standard data types used
to allow general interpretation of values of devices manufactured by different companies.
These datatypes are used to interpret the status of a device, so the state in FHEM will then
show the correct value.
Define an EIB device, connected via a TUL. The
<group> parameters are either a group name notation (0-15/0-15/0-255) or the hex representation of the value (0-f0-f0-ff).
The <main group> is used for sending of commands to the EIB network.
The state of the instance will be updated when a new state is received from the network for any of the given groups.
This is useful for example for toggle switches where a on command is send to one group and the real state (on or off) is
responded back on a second group.
For actors and sensors the autocreate module may help.
on-for-timer <secs> switch on the device for the given time. After the specified seconds a switch off command is sent.
on-till <time spec> switches the device on. The device will be switched off at the given time.
raw <hexvalue> sends the given value as raw data to the device.
value <decimal value> transforms the value according to the chosen model and send the result to the device.
Example:
set lamp1 on
set lamp1 off
set lamp1 on-for-timer 10
set lamp1 on-till 13:15:00
set lamp1 raw 234578
set lamp1 value 23.44
When as last argument a g<groupnr> is present, the command will be sent
to the EIB group indexed by the groupnr (starting by 1, in the order as given in Define).
define lamp1 EIB 0/10/01 0/10/02
set lamp1 on g2 (will send "on" to 0/10/02)
A dimmer can be used with a slider as shown in following example:
define dim1 EIB 0/0/5
attr dim1 model percent
attr dim1 webCmd value
The current date and time can be sent to the bus by the following settings:
define timedev EIB 0/0/7
attr timedev model dpt10
attr timedev eventMap /value now:now/
attr timedev webCmd now
define datedev EIB 0/0/8
attr datedev model dpt11
attr datedev eventMap /value now:now/
attr datedev webCmd now
# send every midnight the new date
define dateset at *00:00:00 set datedev value now
# send every hour the current time
define timeset at +*01:00:00 set timedev value now
Get
If you execute get for a EIB/KNX-Element there will be requested a state from the device. The device has to be able to respond to a read - this is not given for all devices.
This function is not available for dummies.
The answer from the bus-device is not shown in the toolbox, but is treated like a regular telegram.
model -
set the model according to the datapoint types defined by the (EIB / KNX specifications). The device state in FHEM is interpreted and shown according to the specification.
dpt1 -> will be interpreted as on/off
dpt5
dpt5.003
angle
percent
dpt5.004
percent255
dpt6
dpt6.001
dpt6.010
dpt7
length-mm
current-mA
brightness
timeperiod-ms
timeperiod-min
timeperiod-h
dpt9
tempsensor
lightsensor
speedsensor
speedsensor-km/h
pressuresensor
rainsensor
time1sensor
time2sensor
humiditysensor
airqualitysensor
voltage-mV
current-mA2
current-mA2
power
powerdensity
dpt10 -> transferred from and to state, format hh:mm:ss
dpt10_ns -> same as DPT10, seconds always 0
time -> receiving has no effect, sending any value contains actual system time
dpt11 -> transferred from and to state, format hh:mm:ss
date -> receiving has no effect, sending any value contains actual system date
dpt12
dpt14
dpt16 -> has to be used with "set string"
EIBreadingX -
Enable additional readings for this EIB-device. With this Attribute set, a reading setG<x> will be updated when a set command is issued from FHEM, a reading getG<x> will be updated as soon a Value is received from EIB-Bus (<x> stands for the groupnr. - see define statement). The logic for the state reading remains unchanged. This is especially useful when the define statement contains more than one group parameter.
If set to 1, the following additional readings will be available:
setGx will be updated on a SET command issued by FHEM. <x> stands for the groupnr. - see define statement
getGx will be updated on reception of a message from EIB-bus.
Example:
define myDimmer EIB 0/1/1 0/1/2
attr myDimmer EIBreadingX 1
attr myDimmer model dpt1 dpt5.slider # GA 0/1/1 will be interpreted as on/off, GA 0/1/2 will be handled as dpt5 and show a slider on FHEMWEB
attr myDimmer eventmap /on:An/off:Aus/value g2:dim/
attr myDimmer webcmd on off dim
attr myDimmer stateFormat getG2 % # copies actual dim-level (as sent/received to/from dimmer) into STATE
If the EIBreadingX is set, you can specify multiple blank separated models to cope with multiple groups in the define statement. The setting cannot be done thru the pulldown-menu, you have to specify them with attr <device> model <dpt1> <dpt2> <dpt3>
EIBreadingSender -
Enable an additional reading for this EIB-device. With this Attribute set, a reading sender will be updated any time a new telegram arrives.
If set to 1, the following additional reading will be available:
sender will be updated any time a new telegram arrives at this group-adress
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.
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:
define emem EMEM 5
Set
N/A
Get
get EMEM status
This is the same command which is scheduled every 5 minutes internally.
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:
define emgz EMGZ 9
Set
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.
The EMT7110 is a plug with integrated power meter functionality.
It can be integrated into FHEM via a JeeLink as the IODevice.
The EMT7110 sends with 9.579 kbit/s. Therefore it is necessary to set the JeeLink to a mode where it recieves this data rate.
This can be done using the initCommands attribute of the JeeLink.
If you have only 9.579 kbit/s sensors use this setting: attr myJeeLink initCommands 1r v
If you have also 17.241 kbit/s sensors (like TX29...) use this setting: attr myJeeLink initCommands 30t v
30t means that the JeeLink toggles the data rate every 30 Seconds.
Definedefine <name> EMT7110 <addr>
addr is a 4 digit hex number to identify the EMT7110 device.
To enable autocreate for a certain time you must set LaCrossePairForSec in the JeeLink IODevice device.
Set
resetAccumulatedPower
Sets the accumulatedPowerOffset attribute to the current value of accumulatedPowerMeasured.
Don't forget to call save to write the new value to fhem.cfg
Get
Readings
accumulatedPowerMeasured
The accumulated power sent by the EMT7110. The EMT7110 accumulates the power even if it was removed and reconnected to the power outlet.
The only way to reset it is to remove and reinsert the batteries in the EMT7110.
accumulatedPower
Is accumulatedPowerMeasured minus the value of the accumulatedPowerOffset attribute value
This reading is used for the A: part of state
costs
Is accumulatedPower * pricePerKWH attribute value
current
The measured current in mA
power
The measured power in Watt
voltage
The measured voltage in Volt
Attributes
accumulatedPowerOffset
See accumulatedPower reading
pricePerKWH
See costs reading
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:
define emwz EMWZ 1
Set
set EMWZdevice <param> <value>
where param is one of:
rperkw
Number of rotations for a KiloWatt of the EM1000WZ device (actually
of the device where the EM1000WZ is attached to). Without setting
this correctly, all other readings will be incorrect.
alarm
Alarm in WATT. if you forget to set it, the default value is
rediculously low (random), and if a value above this threshold is
received, the EM1010PC will start beeping once every minute. It can
be very annoying.
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 EMWZ status
This is the same command which is scheduled every 5 minutes internally.
This module controls ENIGMA2 based devices like Dreambox or VUplus via network connection.
Defining an ENIGMA2 device will schedule an internal task (interval can be set with optional parameter <poll-interval> in seconds, if not set, the value is 45 seconds), which periodically reads the status of the device and triggers notify/filelog commands.
Example:
define SATReceiver ENIGMA2 192.168.0.10
# With custom port
define SATReceiver ENIGMA2 192.168.0.10 8080
# With custom interval of 20 seconds
define SATReceiver ENIGMA2 192.168.0.10 80 20
# With HTTP user credentials
define SATReceiver ENIGMA2 192.168.0.10 80 20 root secret
Set
set <name> <command> [<parameter>]
Currently, the following commands are defined.
on - powers on the device and send a WoL magic package if needed
off - turns the device in standby mode
toggle - switch between on and off
shutdown - turns the device in deepstandby mode
reboot - reboots the device
restartGui - restarts the GUI / ENIGMA2 process
channel channel,0...999,sRef - zap to specific channel or service reference
channelUp - zap to next channel
channelDown - zap to previous channel
volume 0...100 - set the volume level in percentage
volumeUp - increases the volume level
volumeDown - decreases the volume level
mute on,off,toggle - controls volume mute
play - starts/resumes playback
pause - pauses current playback or enables timeshift
stop - stops current playback
record - starts recording of current channel
input tv,radio - switches between tv and radio mode
statusRequest - requests the current status of the device
remoteControl UP,DOWN,... - sends remote control commands; see remoteControl help for full command list
Note: You may add the word "long" after the command to simulate a long key press.
showText text - sends info message to screen to be displayed for 8 seconds
msg yesno,info... - allows more complex messages as showText, see commands as listed below
Note: If you would like to restrict access to admin set-commands (-> statusRequest, reboot, restartGui, shutdown) you may set your FHEMWEB instance's attribute allowedCommands like 'set,set-user'.
The string 'set-user' will ensure only non-admin set-commands can be executed when accessing FHEM using this FHEMWEB instance.
Messaging
showText has predefined settings. If you would like to send more individual messages to your TV screen, the function msg can be used. For this application the following commands are available:
Type Selection:
msg yesno
msg info
msg message
msg attention
The following parameter are essentially needed after type specification:
bouquet-tv - service reference address where the favorite television bouquet can be found (initially set automatically during define)
bouquet-radio - service reference address where the favorite radio bouquet can be found (initially set automatically during define)
disable - Disable polling (true/false)
http-method - HTTP access method to be used; e.g. a FritzBox might need to use POST instead of GET (GET/POST)
http-noshutdown - Set FHEM-internal HttpUtils connection close behaviour (defaults=1)
https - Access box via secure HTTP (true/false)
lightMode - reduces regular queries (resulting in less functionality), e.g. for low performance devices. (true/false)
macaddr - manually set specific MAC address for device; overwrites value from reading "lanmac". (true/false)
remotecontrol - Explicitly set specific remote control unit format. This will only be considered for set-command remoteControl as of now.
timeout - Set different polling timeout in seconds (default=6)
wakeupCmd - Set a command to be executed when turning on an absent device. Can be an FHEM command or Perl command in {}. Available variables: ENIGMA2 device name -> $DEVICE, ENIGMA2 device MAC address -> $MACADDR (default=Wake-on-LAN)
Generated Readings/Events:
acg - Shows Automatic Gain Control value in percent; reflects overall signal quality strength
apid - Shows the audio process ID for current channel
ber - Shows Bit Error Rate for current channel
channel - Shows the service name of current channel or media file name; part of FHEM-4-AV-Devices compatibility
currentMedia - The service reference ID of current channel; part of FHEM-4-AV-Devices compatibility
currentTitle - Shows the title of the running event; part of FHEM-4-AV-Devices compatibility
enigmaversion - Shows the installed version of ENIGMA2
eventcurrenttime - Shows the current time of running event as UNIX timestamp
eventcurrenttime_hr - Shows the current time of running event in human-readable format
eventcurrenttime_next - Shows the current time of next event as UNIX timestamp
eventcurrenttime_next_hr - Shows the current time of next event in human-readable format
eventdescription - Shows the description of running event
eventdescription_next - Shows the description of next event
evenduration - Shows the total duration time of running event in seconds
evenduration_hr - Shows the total duration time of running event in human-readable format
evenduration_next - Shows the total duration time of next event in seconds
evenduration_next_hr - Shows the total duration time of next event in human-readable format
eventname - Shows the name of running event
eventname_next - Shows the name of next event
eventremaining - Shows the remaining duration time of running event in seconds
eventremaining_hr - Shows the remaining duration time of running event in human-readable format
eventremaining_next - Shows the remaining duration time of next event in seconds
eventremaining_next_hr - Shows the remaining duration time of next event in human-readable format
eventstart - Shows the starting time of running event as UNIX timestamp
eventstart_hr - Shows the starting time of running event in human readable format
eventstart_next - Shows the starting time of next event as UNIX timestamp
eventstart_next_hr - Shows the starting time of next event in human readable format
eventtitle - Shows the title of the running event
eventtitle_next - Shows the title of the next event
fpversion - Shows the firmware version for the front processor
hddX_capacity - Shows the total capacity of the installed hard drive in GB
hddX_free - Shows the free capacity of the installed hard drive in GB
hddX_model - Shows hardware details for the installed hard drive
imageversion - Shows the version for the installed software image
input - Shows currently used input; part of FHEM-4-AV-Devices compatibility
iswidescreen - Indicates widescreen format - 0=off 1=on
lanmac - Shows the device MAC address
model - Shows details about the device hardware
mute - Reports the mute status of the device (can be "on" or "off")
nextTitle - Shows the title of the next event; part of FHEM-4-AV-Devices compatibility
onid - The ON ID
pcrpid - The PCR process ID
pmtpid - The PMT process ID
power - Reports the power status of the device (can be "on" or "off")
presence - Reports the presence status of the receiver (can be "absent" or "present"). In case of an absent device, control is basically limited to turn it on again. This will only work if the device supports Wake-On-LAN packages, otherwise command "on" will have no effect.
providername - Service provider of current channel
recordings - Number of active recordings
recordingsX_name - name of active recording no. X
recordingsX_servicename - servicename of active recording no. X
recordings_next - Shows the time of next recording as UNIX timestamp
recordings_next_hr - Shows the time of next recording as human-readable format
recordings_next_counter - Shows the time until next recording starts in seconds
recordings_next_counter_hr - Shows the time until next recording starts human-readable format
recordings_next_name - name of next recording
recordings_next_servicename - servicename of next recording
recordings_error - counter for failed recordings in timerlist
recordings_finished - counter for finished recordings in timerlist
servicename - Name for current channel
servicereference - The service reference ID of current channel
servicevideosize - Video resolution for current channel
sid - The S-ID
snr - Shows Signal to Noise for current channel in percent
snrdb - Shows Signal to Noise in dB
state - Reports current power state and an absence of the device (can be "on", "off" or "absent")
tsid - The TS ID
tuner_X - Details about the used tuner hardware
txtpid - The TXT process ID
videoheight - Height of the video resolution for current channel
videowidth - Width of the video resolution for current channel
volume - Reports current volume level of the receiver in percentage values (between 0 and 100 %)
vpid - The Video process ID
webifversion - Type and version of the used web interface
ESA2000
The ESA2000 module interprets ESA1000 or ESA2000 type of messages received by the CUL.
Define
define <name> ESA2000 <code>
[base1 base2]
<code> is the 4 digit HEX code identifying the devices.
base1/2 is added to the total kwh as a base (Hoch- und Niedertarifzählerstand).
This mudule implements an Elero drive. It uses EleroStick as IO-Device.
Define
define <name> EleroDrive <channel>
<channel> specifies the channel of the transmitter stick that shall be used.
Set
moveDown
moveUp
stop
moveIntermediate
moveTilt
refresh
Get
no gets
Attributes
IODev
The name of the IO-Device, normally the name of the EleroStick definition
TopToBottomTime
The time in seconds this drive needs for a complete run from the top to the bottom or vice versa
Readings
position
Current position of the drive (top_position, bottom_position, ...)
percentOpen
0 ... 100
0 is completely closed, 100 is completely open
EleroStick
This module provides the IODevice for EleroDrive and other future modules that implement Elero components
It handles the communication with an "Elero Transmitter Stick"
Define
define <name> EleroStick <port>
<port> specifies the serial port where the transmitter stick is attached.
The name of the serial-device depends on your OS. Example: /dev/ttyUSB1@38400
The baud rate must be 38400 baud.
Set
no sets
Get
no gets
Attributes
Clients
The received data gets distributed to a client (e.g. EleroDrive, ...) that handles the data.
This attribute tells, which are the clients, that handle the data. If you add a new module to FHEM, that shall handle
data distributed by the EleroStick module, you must add it to the Clients attribute.
MatchList
The MatchList defines, which data shall be distributed to which device.
It can be set to a perl expression that returns a hash that is used as the MatchList
Example: attr myElero MatchList {'1:EleroDrive' => '.*'}
ChannelTimeout
The delay, how long the modul waits for an answer after sending a command to a drive.
Default is 5 seconds.
Interval
When all channels are checkt, this number of seconds will be waited, until the channels will be checked again.
Default is 60 seconds.
Readings
state
disconnected or opened if a transmitter stick is connected
SendType
Type of the last command sent to the stick
SendMsg
Last command sent to the stick
AnswerType
Type of the last Answer received from the stick
AnswerMsg
Last Answer received from the stick
EnOcean
EnOcean devices are sold by numerous hardware vendors (e.g. Eltako, Peha, etc),
using the RF Protocol provided by the EnOcean Alliance.
Depending on the function of the device an specific device profile is used, called
EnOcean Equipment Profile (EEP). The specific definition of a device is referenced by
the EEP (RORG-FUNC-TYPE). Basically four groups (RORG) will be differed, e. g.
RPS (switches), 1BS (contacts), 4BS, VLD (sensors and controller). Some manufacturers use
additional proprietary extensions. RORG MSC is not supported except for few exceptions.
Further technical information can be found at the
EnOcean Alliance,
see in particular the
EnOcean Equipment Profiles (EEP)
The supplementary Generic Profiles approach instead defines a language to communicate the
transmitted data types and ranges. The devices becomes self describing on their data
structures in communication. The Generic Profiles include a language definition with
a parameter selection that covers every possible measured value to be transmitted.
Therefore, the approach does not only define parameters for the value recalculation algorithm
but also includes specific signal definition. (e.g. physical units). Further technical
information can be found at the
Generic Profiles 1.0 Abstract (PDF)
Fhem recognizes a number of devices automatically. In order to teach-in, for
some devices the sending of confirmation telegrams has to be turned on.
Some equipment types and/or device models must be manually specified.
Do so using the attributessubType and model, see chapter
Set and
Generated events. With the help of additional
attributes, the behavior of the devices can be
changed separately.
Fhem and the EnOcean devices must be trained with each other. To this, Fhem
must be in the learning mode, see Teach-In / Teach-Out
and learningMode.
The teach-in procedure depends on the type of the devices. Switches (EEP RPS)
and contacts (EEP 1BS) are recognized when receiving the first message.
Contacts can also send a teach-in telegram. Fhem not need this telegram.
Sensors (EEP 4BS) has to send a teach-in telegram. The profile-less
4BS teach-in procedure transfers no EEP profile identifier and no manufacturer
ID. In this case Fhem does not recognize the device automatically. The proper
device type must be set manually, use the attributessubType, manufID and/or
model. If the EEP profile identifier and the manufacturer
ID are sent the device is clearly identifiable. Fhem automatically assigns
these devices to the correct profile. Some 4BS, VLD or MSC devices must be paired
bidirectional, see Teach-In / Teach-Out.
Fhem supports many of most common EnOcean profiles and manufacturer-specific
devices. Additional profiles and devices can be added if required.
In order to enable communication with EnOcean remote stations a
TCM module is necessary.
Please note that EnOcean repeaters also send Fhem data telegrams again.
Use the TCM attr <name> blockSenderID own
to block receiving telegrams with a TCM SenderIDs.
EnOcean Observing Functions
Interference or overloading of the radio transmission can prevent the reception of Fhem
commands at the receiver. With the help of the observing function Fhem checks the reception
of the acknowledgment telegrams of the actuator. If within one second no acknowledgment
telegram is received, the last set command is sent again.
The set command is repeated a maximum of 5 times. The maximum number can be specified in the attribute
observeCmdRepetition.
The function can only be used if the actuator immediately after the reception of
the set command sends an acknowledgment message.
The observing function is turned on by the Attribute observe.
In addition, further devices can be monitored. The names of this devices can be entered in the
observeRefDev attribute. If additional device are specified,
the monitoring is stopped as soon as the first acknowledgment telegram of one of the devices was received (OR logic).
If the observeLogic attribute is set to "and", the monitoring is stopped when a telegram
was received by all devices (AND logic). Please note that the name of the own device has also to be entered in the
observeRefDev if required.
If the maximum number of retries is reached and still no all acknowledgment telegrams has been received, the reading
"observeFailedDev" shows the faulty devices and the command can be executed, that is stored in the
observeErrorAction attribute.
Demand Response (DR) is a standard to allow utility companies to send requests for reduction in power
consumption during peak usage times. It is also used as a means to allow users to reduce overall power
comsumption as energy prices increase. The EEP was designed with a very flexible setting for the level
(0...15) as well as a default level whereby the transmitter can specify a specific level for all
controllers to use (0...100 % of either maximum or current power output, depending on the load type).
The profile also includes a timeout setting to indicate how long the DR event should last if the
DR transmitting device does not send heartbeats or subsequent new DR levels.
The DR actor controls the target actuators such as switches, dimmers etc. The DR actor
is linked to the FHEM target actors via the attribute demandRespRefDev.
Standard actions are available for the following profiles:
gateway/dimming (dim 0...100, relative to the max or current set value)
lightCtrl.01 (dim 0...255)
actuator.01 (dim 0...100)
roomSensorControl.01 (setpoint 0...255)
roomSensorControl.05 (setpoint 0...255 or nightReduction 0...5 for Eltako devices)
roomCtrlPanel.00 (roomCtrlMode comfort|economy)
On the target actuator can be specified alternatively a freely definable command.
The command sequence is stored in the attribute demandRespAction.
The command sequence can be designed similar to "notify". For the command sequence predefined variables can be used,
eg. $LEVEL. This actions can be executed very flexible depending on the given energy
reduction levels.
Alternatively or additionally, a custom command sequence in the DR profile itself
can be stored.
The profile has a master and slave mode.
In slave mode, demand response data telegrams received eg a control unit of the power utility,
evaluated and the corresponding commands triggered on the linked target actuators. The behavior in
slave mode can be changed by multiple attributes.
In master mode, the demand response level is set by set commands and thus sends a corresponding
data telegram and the associated target actuators are controlled. The demand response control
value are specified by "level", "power", "setpoint" "max" or "min". Each other settings are
calculated proportionally. In normal operation, ie without power reduction, the control value (level)
is 15. Through the optional parameters "powerUsageScale", "randomStart", "randomEnd" and "timeout"
the control behavior can be customized. The threshold at which the reading "powerUsageLevel"
between "min" and "max" switch is specified with the attribute
demandRespThreshold.
Additional information about the profile itself can be found in the EnOcean EEP documentation.
EnOcean Security features
The receiving and sending of encrypted messages is supported. This module currently allows the secure operating mode of PTM 215
based switches.
To receive secured telegrams, you first have to start the teach in mode via
set <IODev> teach <t/s>
and then doing the following on the PTM 215 module:
Remove the switch cover of the module
Press both buttons of one rocker side (A0 & A1 or B0 & B1)
While keeping the buttons pressed actuate the energy bow twice.
This generates two teach-in telegrams which create a Fhem device with the subType "switch.00" and synchronize the Fhem with
the PTM 215. Both the Fhem and the PTM 215 now maintain a counter which is used to generate a rolling code encryption scheme.
Also during teach-in, a private key is transmitted to the Fhem. The counter value is allowed to desynchronize for a maximum of
128 counts, to allow compensating for missed telegrams, if this value is crossed you need to teach-in the PTM 215 again. Also
if your Fhem installation gets erased including the state information, you need to teach in the PTM 215 modules again (which
you would need to do anyway).
To send secured telegrams, you first have send a secure teach-in to the remode device
set <name> teachInSec
As for the security of this solution, if someone manages to capture the teach-in telegrams, he can extract the private key,
so the added security isn't perfect but relies on the fact, that none listens to you setting up your installation.
The cryptographic functions need the additional Perl modules Crypt/Rijndael and Crypt/Random. The module must be installed manually.
With the help of CPAN at the operating system level, for example,
Define an EnOcean device, connected via a TCM modul. The
<DEF> is the SenderID/DestinationID of the device (8 digit hex number), for example
define switch1 EnOcean FFC54500
In order to control devices, you cannot reuse the SenderIDs/
DestinationID of other devices (like remotes), instead you have to create
your own, which must be in the allowed SenderID range of the underlying Fhem
IO device, see TCM BaseID, LastID. For this first query the
TCM with the get <tcm> baseID command
for the BaseID. You can use up to 128 IDs starting with the BaseID shown there.
If you are using an Fhem SenderID outside of the allowed range, you will see an
ERR_ID_RANGE message in the Fhem log.
FHEM can assign a free SenderID alternatively, for example
define switch1 EnOcean getNextID
If the EEP is known, the appropriate device can be created with the basic parameters, for example
define sensor1 EnOcean FFC54500 A5-02-05
or
define sensor1 EnOcean A5-02-05
Inofficial EEP for special devices
G5-38-08 Gateway, Dimming [Eltako FSG, FUD]
M5-38-08 Gateway, Switching [Eltako FSR14]
G5-3F-7F Shutter [Eltako FSB]
L6-02-01 Smoke Detector [Eltako FRW]
G5-ZZ-ZZ Light and Presence Sensor [Omnio Ratio eagle-PM101]
ZZ-ZZ-ZZ EnOcean RAW profile
The autocreate module may help you if the actor or sensor send
acknowledge messages or teach-in telegrams. In order to control this devices e. g. switches with
additional SenderIDs you can use the attributes subDef,
subDef0 and subDefI.
Fhem communicates unicast, if bidirectional 4BS or UTE teach-in is used, see
Bidirectional Teach-In / Teach-Out. In this case
Fhem send unicast telegrams with its SenderID and the DestinationID of the device.
Internals
DEF: 0000000 ... FFFFFFFF|<EEP>
EnOcean DestinationID or SenderID
If the attributes subDef* are set, this values are used as EnOcean SenderID.
For an existing device, the device can be re-parameterized by entering the EEP.
<IODev>_DestinationID: 0000000 ... FFFFFFFF
Received destination address, Broadcast radio: FFFFFFFF
<IODev>_RSSI: LP/dBm
Received signal strength indication (best value of all received subtelegrams)
Set Fhem in the learning mode.
A device, which is then also put in this state is to paired with
Fhem. Bidirectional Teach-In / Teach-Out is used for some 4BS, VLD and MSC devices,
e. g. EEP 4BS, RORG A5-20-01 (Battery Powered Actuator).
Bidirectional Teach-In for 4BS, UTE and Generic Profiles are supported. IODev is the name of the TCM Module. t/s is the time for the learning period.
Send teach-in telegram to remote device.
If no SenderID (attr subDef) was assigned before a learning telegram is sent for the first time, a free SenderID
is assigned automatically.
UTE - Universal Uni- and Bidirectional Teach-In
set <name> teachIn|teachOut
Send teach-in telegram to remote device.
If no SenderID (attr subDef) was assigned before a learning telegram is sent for the first time, a free SenderID
is assigned automatically.
Generic Profiles Teach-In
set <name> teachIn|teachOut
Send teach-in telegram to remote device.
If no SenderID (attr subDef) was assigned before a learning telegram is sent for the first time, a free SenderID
is assigned automatically.
where value is one of A0, AI, B0, BI, C0, CI, D0, DI,
combinations of these and released. First and second action can be sent
simultaneously. Separate first and second action with a comma.
In fact we are trying to emulate a PT200 type remote.
If you define an eventMap attribute with on/off,
then you will be able to easily set the device from the WEB frontend. set extensions are supported, if the corresponding
eventMap specifies the on and off
mappings, for example attr eventMap on-till:on-till AI:on A0:off.
With the help of additional attributes, the
behavior of the devices can be adapt.
The attr subType must be switch. This is done if the device was created by autocreate.
Example:
set switch1 BI
set switch1 B0,CI
attr eventMap BI:on B0:off
set switch1 on
Set attr eventMap to B0:on BI:off, attr subType to switch, attr
webCmd to on:released and if needed attr switchMode to pushbutton manually.
The attr subType must be switch. This is done if the device was created by autocreate.
Use the sensor type "Schalter" for Eltako devices. The Staircase
off-delay timer is switched on when pressing "on" and the time will be started
when pressing "released". "released" immediately after "on" is sent if
the attr switchMode is set to "pushbutton".
First and second action can be sent simultaneously. Separate first and second action with a comma.
If you define an eventMap attribute with on/off,
then you will be able to easily set the device from the WEB frontend. set extensions are supported, if the corresponding
eventMap specifies the on and off
mappings, for example attr eventMap on-till:on-till AI:on A0:off.
If comMode is set to biDir the device can be controlled bidirectionally.
With the help of additional attributes, the behavior of the devices can be adapt.
The attr subType must be switch.00. This is done if the device was created by autocreate.
Example:
set switch1 BI
set switch1 B0,CI
attr eventMap BI:on B0:off
set switch1 on
Single Input Contact, Door/Window Contact (EEP D5-00-01)
RORG 1BS [tested with Eltako FSR14]
set <name> <value>
where value is
closed
issue closed command
open
issue open command
teach
initiate teach-in
The attr subType must be contact. The attribute must be set manually.
Room Sensor and Control Unit (EEP A5-10-02)
[Thermokon SR04 PTS]
set <name> <value>
where value is
teach
initiate teach-in
setpoint [0 ... 255]
Set the actuator to the specifed setpoint.
setpointScaled [<floating-point number>]
Set the actuator to the scaled setpoint.
fanStage [auto|0|1|2|3]
Set fan stage
switch [on|off]
Set switch
The actual temperature will be taken from the temperature reported by
a temperature reference device temperatureRefDev
primarily or from the attribute actualTemp if it is set.
If the attribute setCmdTrigger is set to "refDev", a setpoint
command is sent when the reference device is updated.
The scaling of the setpoint adjustment is device- and vendor-specific. Set the
attributes scaleMax, scaleMin and
scaleDecimals for the additional scaled setting
setpointScaled.
The attr subType must be roomSensorControl.05. The attribute must be set manually.
Room Sensor and Control Unit (EEP A5-10-03)
[used for IntesisBox PA-AC-ENO-1i]
set <name> <value>
where value is
teach
initiate teach-in
setpoint [0 ... 255]
Set the actuator to the specifed setpoint.
setpointScaled [<floating-point number>]
Set the actuator to the scaled setpoint.
fanStage [auto|0|1|2|3]
Set fan stage
switch [on|off]
Set switch
The actual temperature will be taken from the temperature reported by
a temperature reference device temperatureRefDev
primarily or from the attribute actualTemp if it is set.
If the attribute setCmdTrigger is set to "refDev", a setpoint
command is sent when the reference device is updated.
The scaling of the setpoint adjustment is device- and vendor-specific. Set the
attributes scaleMax, scaleMin and
scaleDecimals for the additional scaled setting
setpointScaled.
The attr subType must be roomSensorControl.05 and attr manufID must be 019. The attribute must be set manually.
Room Sensor and Control Unit (A5-10-06 plus night reduction)
[Eltako FTR65DS, FTR65HS]
set <name> <value>
where value is
teach
initiate teach-in
desired-temp [t/°C [lock|unlock]]
Set the desired temperature.
nightReduction [t/K [lock|unlock]]
Set night reduction
setpointTemp [t/°C [lock|unlock]]
Set the desired temperature
The actual temperature will be taken from the temperature reported by
a temperature reference device temperatureRefDev
primarily or from the attribute actualTemp if it is set.
If the attribute setCmdTrigger is set to "refDev", a setpointTemp
command is sent when the reference device is updated.
This profil can be used with a further Room Sensor and Control Unit Eltako FTR55*
to control a heating/cooling relay FHK12, FHK14 or FHK61. If Fhem and FTR55*
is teached in, the temperature control of the FTR55* can be either blocked
or to a setpoint deviation of +/- 3 K be limited. For this use the optional parameter
[block] = lock|unlock, unlock is default.
The attr subType must be roomSensorControl.05 and attr manufID must be 00D.
The attributes must be set manually.
Room Sensor and Control Unit (EEP A5-10-10)
[Thermokon SR04 * rH, Thanos SR *]
set <name> <value>
where value is
teach
initiate teach-in
setpoint [0 ... 255]
Set the actuator to the specifed setpoint.
setpointScaled [<floating-point number>]
Set the actuator to the scaled setpoint.
switch [on|off]
Set switch
The actual temperature will be taken from the temperature reported by
a temperature reference device temperatureRefDev
primarily or from the attribute actualTemp if it is set.
The actual humidity will be taken from the humidity reported by
a humidity reference device humidityRefDev
primarily or from the attribute humidity if it is set.
If the attribute setCmdTrigger is set to "refDev", a setpoint
command is sent when the reference device is updated.
The scaling of the setpoint adjustment is device- and vendor-specific. Set the
attributes scaleMax, scaleMin and
scaleDecimals for the additional scaled setting
setpointScaled.
The attr subType must be roomSensorControl.01. The attribute must be set manually.
Room Sensor and Control Unit (EEP A5-10-12)
[Eltako FUTH65D]
set <name> <value>
where value is
teach
initiate teach-in
setpoint [0 ... 255]
Set the actuator to the specifed setpoint.
setpointScaled [<floating-point number>]
Set the actuator to the scaled setpoint.
switch [on|off]
Set switch
The actual temperature will be taken from the temperature reported by
a temperature reference device temperatureRefDev
primarily or from the attribute actualTemp if it is set.
If the attribute setCmdTrigger is set to "refDev", a setpoint
command is sent when the reference device is updated.
The attr subType must be roomSensorControl.01 and attr manufID must be 00D. The attribute must be set manually.
actuator setpoint/%
Set the actuator to the specifed setpoint (0...100)
desired-temp t/°C
Use the builtin PI regulator, and set the desired temperature to the
specified degree. The actual value will be taken from the temperature
reported by the Battery Powered Actuator, the temperatureRefDev
or from the attribute actualTemp if it is set.
setpoint setpoint/%
Set the actuator to the specifed setpoint (0...100)
setpointTemp t/°C
Use the builtin PI regulator, and set the desired temperature to the
specified degree. The actual value will be taken from the temperature
reported by the Battery Powered Actuator, the temperatureRefDev
or from the attribute actualTemp if it is set.
runInit
Maintenance Mode (service on): Run init sequence.
liftSet
Maintenance Mode (service on): Lift set
valveOpen
Maintenance Mode (service on): Valve open
The attr subType must be hvac.01. This is done if the device was
created by autocreate. To control the device, it must be bidirectional paired,
see Teach-In / Teach-Out.
The command is not sent until the device wakes up and sends a mesage, usually
every 10 minutes.
occupancy occupied|off|standby|unoccupied
Set room occupancy
on
Set on
off
Set off
mode auto|heat|morning_warmup|cool|night_purge|precool|off|test|emergency_heat|fan_only|free_cool|ice|max_heat|eco|dehumidification|calibration|emergency_cool|emergency_stream|max_cool|hvc_load|no_load|auto_heat|auto_cool
Set mode
teach
Teach-in
vanePosition auto|horizontal|position_2|position_3|position_4|vertical|swing|vertical_swing|horizontal_swing|hor_vert_swing|stop_swing
Set vane position
The attr subType must be hvac.10. This is done if the device was
created by autocreate. To control the device, it must be bidirectional paired,
see Teach-In / Teach-Out.
Generic HVAC Interface - Error Control (EEP A5-20-11)
[IntesisBox PA-AC-ENO-1i]
set <name> <value>
where value is
externalDisable disable|enable
Set external disablement
The attr subType must be hvac.11. This is done if the device was
created by autocreate. To control the device, it must be bidirectional paired,
see Teach-In / Teach-Out.
Energy management, demand response (EEP A5-37-01)
demand response master commands
set <name> <value>
where value is
level 0...15 [<powerUsageScale> [<randomStart> [<randomEnd> [timeout]]]]
set demand response level
max [<powerUsageScale> [<randomStart> [<randomEnd> [timeout]]]]
set power usage level to max
min [<powerUsageScale> [<randomStart> [<randomEnd> [timeout]]]]
set power usage level to min
power power/% [<powerUsageScale> [<randomStart> [<randomEnd> [timeout]]]]
set power
setpoint 0...255 [<powerUsageScale> [<randomStart> [<randomEnd> [timeout]]]]
set setpoint
teach
initiate teach-in
[<powerUsageScale>] = max|rel, [<powerUsageScale>] = max is default
[<randomStart>] = yes|no, [<randomStart>] = no is default
[<randomEnd>] = yes|no, [<randomEnd>] = no is default
[timeout] = 0/min | 15/min ... 3825/min, [timeout] = 0 is default
The attr subType must be energyManagement.01.
This is done if the device was created by autocreate.
Gateway (EEP A5-38-08)
The Gateway profile include 7 different commands (Switching, Dimming,
Setpoint Shift, Basic Setpoint, Control variable, Fan stage, Blind Central Command).
The commands can be selected by the attribute gwCmd or command line. The attribute
entry has priority.
set <name> <value>
where value is
<gwCmd> <cmd> [subCmd]
initiate Gateway commands by command line
<cmd> [subCmd]
initiate Gateway commands if attribute gwCmd is set.
The attr subType must be gateway. Attribute gwCmd can also be set to
switching|dimming|setpointShift|setpointBasic|controlVar|fanStage|blindCmd.
This is done if the device was created by autocreate.
For Eltako devices attributes must be set manually.
The attr subType must be gateway and gwCmd must be switching. This is done if the device was
created by autocreate.
For Eltako devices attributes must be set manually. For Eltako FSA12 attribute model must be set
to FSA12.
rampTime Range: t = 1 s ... 255 s or 0 if no time specified,
for Eltako: t = 1 = fast dimming ... 255 = slow dimming or 0 = dimming speed on the dimmer used
The attr subType must be gateway and gwCmd must be dimming. This is done if the device was
created by autocreate.
For Eltako devices attributes must be set manually. Use the sensor type "PC/FVS" for Eltako devices.
Gateway (EEP A5-38-08)
Dimming of fluorescent lamps
[Eltako FSG70, tested with Eltako FSG70 only]
The attr subType must be gateway and gwCmd must be dimming. Set attr eventMap to B0:on BI:off,
attr subTypeSet to switch and attr switchMode to pushbutton manually.
Use the sensor type "Richtungstaster" for Eltako devices.
Gateway (EEP A5-38-08)
Setpoint shift
[untested]
set <name> <value>
where value is
teach
initiate teach-in mode
shift 1/K
issue Setpoint shift
Shift Range: T = -12.7 K ... 12.8 K
The attr subType must be gateway and gwCmd must be setpointShift.
This is done if the device was created by autocreate.
Gateway (EEP A5-38-08)
Basic Setpoint
[untested]
set <name> <value>
where value is
teach
initiate teach-in mode
basic t/°C
issue Basic Setpoint
Setpoint Range: t = 0 °C ... 51.2 °C
The attr subType must be gateway and gwCmd must be setpointBasic.
This is done if the device was created by autocreate.
Gateway (EEP A5-38-08)
Control variable
[untested]
controllerState auto|override <0 ... 100>
issue Control variable override
Override Range: cvov = 0 % ... 100 %
The attr subType must be gateway and gwCmd must be controlVar.
This is done if the device was created by autocreate.
Gateway (EEP A5-38-08)
Fan stage
[untested]
set <name> <value>
where value is
teach
initiate teach-in mode
stage 0 ... 3|auto
issue Fan Stage override
The attr subType must be gateway and gwCmd must be fanStage.
This is done if the device was created by autocreate.
position position/% α/°
drive blinds to position with angle value
stop
issue blinds stops command
runtimeSet tu/s td/s
set runtime parameter
angleSet ta/s
set angle configuration
positionMinMax positionMin/% positionMax/%
set min, max values for position
angleMinMax αo/° αs/°
set slat angle for open and shut position
positionLogic normal|inverse
set position logic
Runtime Range: tu|td = 0 s ... 255 s
Select a runtime up and a runtime down that is at least as long as the
shading element or roller shutter needs to move from its end position to
the other position.
Position Range: position = 0 % ... 100 %
Angle Time Range: ta = 0 s ... 25.5 s
Runtime value for the sunblind reversion time. Select the time to revolve
the sunblind from one slat angle end position to the other end position.
Slat Angle: α|αo|αs = -180 ° ... 180 °
Position Logic, normal: Blinds fully opens corresponds to Position = 0 %
Position Logic, inverse: Blinds fully opens corresponds to Position = 100 %
The attr subType must be gateway and gwCmd must be blindCmd.
See also attributes sendDevStatus and serviceOn
The profile is linked with controller profile, see Blind Status.
Extended Lighting Control (EEP A5-38-09)
[untested]
set <name> <value>
where value is
teach
initiate remote teach-in
on
issue switch on command
off
issue switch off command
dim dim [rampTime/s]
issue dim command
dimup rampTime/s
issue dim command
dimdown rampTime/s
issue dim command
stop
stop dimming
rgb <red color value><green color value><blue color value>
issue color value command
scene drive|store 0..15
store actual value in the scene or drive to scene value
dimMinMax <min value> <max value>
set minimal and maximal dimmer value
lampOpHours 0..65535
set the operation hours of the lamp
block unlock|on|off|local
locking local operations
meteringValues 0..65535 mW|W|kW|MW|Wh|kWh|MWh|GWh|mA|mV
set a new value for the energy metering (overwrite the actual value with the selected unit)
meteringValues 0..6553.5 A|V
set a new value for the energy metering (overwrite the actual value with the selected unit)
color values: 00 ... FF hexadecimal
rampTime Range: t = 1 s ... 65535 s or 1 if no time specified, ramping time can be set by attribute
rampTime
The attr subType or subTypSet must be lightCtrl.01. This is done if the device was created by autocreate.
The subType is associated with the subtype lightCtrlState.02.
position position/% [α/°]
drive blinds to position with angle value
stop
issue stop command
Runtime Range: tu|td = 1 s ... 255 s
Position Range: position = 0 % ... 100 %
Slat Angle Range: α = -180 ° ... 180 °
Angle Time Range: ta = 0 s ... 6 s
The devive can only fully controlled if the attributes angleMax,
angleMin, angleTime,
shutTime and shutTimeCloses,
are set correctly.
Set attr subType to manufProfile, manufID to 00D and attr model to
FSB14|FSB61|FSB70 manually.
Use the sensor type "Szenentaster/PC" for Eltako devices.
Electronic switches and dimmers with Energy Measurement and Local Control (D2-01-00 - D2-01-11)
[Telefunken Funktionsstecker, PEHA Easyclick, AWAG Elektrotechnik AG Omnio UPS 230/xx,UPD 230/xx]
set <name> <value>
where value is
on [<channel>]
issue switch on command
off [<channel>]
issue switch off command
dim dim/% [<channel> [<rampTime>]]
issue dimming command
local dayNight day|night, day is default
set the user interface indication
local defaultState on|off|last, off is default
set the default setting of the output channels when switch on
local localControl enabled|disabled, disabled is default
enable the local control of the device
local overCurrentShutdown off|restart, off is default
set the behavior after a shutdown due to an overcurrent
local overCurrentShutdownReset not_active|trigger, not_active is default
trigger a reset after an overcurrent
local rampTime<1...3> 0/s, 0.5/s ... 7/s, 7.5/s, 0 is default
set the dimming time of timer 1 ... 3
local teachInDev enabled|disabled, disabled is default
enable the taught-in devices with different EEP
measurement delta 0/s ... 4095/s, 0 is default
define the difference between two displayed measurements
measurement mode energy|power, energy is default
define the measurand
measurement report query|auto, query is default
specify the measurement method
measurement reset not_active|trigger, not_active is default
resetting the measured values
measurement responseTimeMax 10/s ... 2550/s, 10 is default
set the maximum time between two outputs of measured values
measurement responseTimeMin 1/s ... 255/s, 1 is default
set the minimum time between two outputs of measured values
measurement unit Ws|Wh|KWh|W|KW, Ws is default
specify the measurement unit
[channel] = 0...29|all|input, all is default
The default channel can be specified with the attr defaultChannel.
[rampTime] = 1..3|switch|stop, switch is default
The attr subType must be actuator.01. This is done if the device was
created by autocreate. To control the device, it must be bidirectional paired,
see Bidirectional Teach-In / Teach-Out.
Blind Control for Position and Angle (D2-05-00)
[AWAG Elektrotechnik AG OMNIO UPJ 230/12]
set <name> <value>
where value is
opens
issue blinds opens command
closes
issue blinds closes command
position position/% [[α/%] [directly|opens|closes]]
drive blinds to position with angle value
angle α/%
drive blinds to angle value
stop
issue stop command
alarm
set actuator to the "alarm" mode. When the actuator ist set to the "alarm" mode neither local
nor central positioning and configuration commands will be executed. Before entering the "alarm"
mode, the actuator will execute the "alarm action" as configured by the attribute alarmAction
lock
set actuator to the "blockade" mode. When the actuator ist set to the "blockade" mode neither local
nor central positioning and configuration commands will be executed.
unlock
issue unlock command
Position Range: position = 0 % ... 100 %
Slat Angle Range: α = 0 % ... 100 %
The devive can only fully controlled if the attributes alarmAction,
angleTime, reposition and shutTime
are set correctly.
The attr subType must be blindsCtrl.00. This is done if the device was
created by autocreate. To control the device, it must be bidirectional paired,
see Bidirectional Teach-In / Teach-Out.
Room Control Panels (D2-10-00 - D2-10-02)
[Kieback & Peter RBW322-FTL]
set <name> <value>
where value is
buildingProtectionTemp t/°C
set building protection temperature
clearCmds [<channel>]
clear waiting commands
comfortTemp t/°C
set comfort temperature
config
Setting the configuration of the room controller, the configuration parameters are set using attributes.
cooling auto|off|on|no_change
switch cooling
deleteTimeProgram
delete time programs of the room controller
desired-temp t/°C
set setpoint temperature
economyTemp t/°C
set economy temperature
fanSpeed fanspeed/%
set fan speed
fanSpeedMode central|local
set fan speed mode
heating auto|off|on|no_change
switch heating
preComfortTemp t/°C
set pre comfort temperature
roomCtrlMode buildingProtectionTemp|comfortTemp|economyTemp|preComfortTemp
select setpoint temperature
setPointTemp t/°C
set current setpoint temperature
time
set time and date of the room controller
timeProgram
set time programms of the room contoller
window closed|open
put the window state
Setpoint Range: t = 0 °C ... 40 °C
The room controller is configured using the following attributes:
The attr subType must be roomCtrlPanel.00. This is done if the device was
created by autocreate. To control the device, it must be bidirectional paired,
see Bidirectional Teach-In / Teach-Out.
Fan Control (D2-20-00 - D2-20-02)
[Maico ECA x RC/RCH, ER 100 RC, untested]
set <name> <value>
where value is
on
fan on
off
fan off
desired-temp [t/°C]
set setpoint temperature
fanSpeed fanspeed/%|auto|default
set fan speed
humidityThreshold rH/%
set humidity threshold
roomSize 0...350/m2|default|not_used
set room size
setPointTemp [t/°C]
set current setpoint temperature
Setpoint Range: t = 0 °C ... 40 °C
The fan controller is configured using the following attributes:
The attr subType must be fanCtrl.00. This is done if the device was
created by autocreate. To control the device, it must be bidirectional paired,
see Bidirectional Teach-In / Teach-Out. The profile
behaves like a master. Only one fan can be taught as a slave.
Valve Control (EEP D2-A0-01)
set <name> <value>
where value is
closes
issue closes command (master)
opens
issue opens command (master)
closed
issue closed command (slave)
open
issue open command (slave)
teachIn
initiate UTE teach-in (slave)
teachOut
initiate UTE teach-out (slave)
The valve controller is configured using the following attributes:
The attr subType must be valveCtrl.00. This is done if the device was
created by autocreate. To control the device, it must be bidirectional paired,
see Bidirectional Teach-In / Teach-Out. The profile
behaves like a master or slave, see devMode.
Generic Profiles
set <name> <value>
where value is
<00 ... 64>-<channel name> <value>
set channel value
The attr subType must be genericProfile. This is done if the device was
created by autocreate. If the profile in slave mode is operated, especially the channel
definition in the gpDef attributes must be entered manually.
RAW Command
set <name> <value>
where value is
1BS|4BS|GPCD|GPSD|GPTI|GPTR|MSC|RPS|UTE|VLD data [status]
sent data telegram
[data] = <1-byte hex ... 512-byte hex>
[status] = 0x00 ... 0xFF
With the help of this command data messages in hexadecimal format can be sent.
Telegram types (RORG) 1BS, 4BS, RPS, MSC, UTE, VLD, GPCD, GPSD, GPTI and GPTR are supported.
For further information, see EnOcean Equipment Profiles (EEP) and
Generic Profiles.
Get
Electronic switches and dimmers with Energy Measurement and Local Control (D2-01-00 - D2-01-11)
[Telefunken Funktionsstecker, PEHA Easyclick, AWAG Elektrotechnik AG Omnio UPS 230/xx,UPD 230/xx]
get <name> <value>
where value is
state [<channel>]
measurement <channel> energy|power
special <channel> health|load|voltage|serialNumber
additional Permondo SmartPlug PSC234 commands
The default channel can be specified with the attr defaultChannel.
The attr subType must be actuator.01. This is done if the device was
created by autocreate. To control the device, it must be bidirectional paired,
see Bidirectional Teach-In / Teach-Out.
Extended Lighting Control (EEP A5-38-09)
[untested]
get <name> <value>
where value is
status
status request
The attr subType or subTypSet must be lightCtrl.01. This is done if the device was created by autocreate.
The subType is associated with the subtype lightCtrlState.02.
Blind Control for Position and Angle (D2-05-00)
[AWAG Elektrotechnik AG OMNIO UPJ 230/12]
get <name> <value>
where value is
position
query position and angle value
The devive can only fully controlled if the attributes alarmAction,
angleTime, reposition and shutTime
are set correctly.
The attr subType must be blindsCtrl.00. This is done if the device was
created by autocreate. To control the device, it must be bidirectional paired,
see Bidirectional Teach-In / Teach-Out.
Room Control Panels (D2-10-00 - D2-10-02)
[Kieback & Peter RBW322-FTL]
get <name> <value>
where value is
config
get the configuration of the room controler
data
get data
roomCtrl
get the parameter of the room controler
timeProgram
get the time program
The attr subType must be roomCtrlPanel.00. This is done if the device was
created by autocreate. To control the device, it must be bidirectional paired,
see Bidirectional Teach-In / Teach-Out.
Fan Control (D2-20-00 - D2-20-02)
[Maico ECA x RC/RCH, ER 100 RC, untested]
get <name> <value>
where value is
state
get the state of the room controler
The attr subType must be fanCtrl.00. This is done if the device was
created by autocreate. To control the device, it must be bidirectional paired,
see Bidirectional Teach-In / Teach-Out.
Valve Control (EEP D2-A0-01)
get <name> <value>
where value is
state
get the state of the valve controler (master)
The attr subType must be valveCtrl.00. This is done if the device was
created by autocreate. To control the device, it must be bidirectional paired,
see Bidirectional Teach-In / Teach-Out. The profile
behaves like a master or slave, see devMode.
Attributes
actualTemp t/°C
The value of the actual temperature, used by a Room Sensor and Control Unit
or when controlling HVAC components e. g. Battery Powered Actuators (MD15 devices). Should by
filled via a notify from a distinct temperature sensor.
If absent, the reported temperature from the HVAC components is used.
alarmAction no|stop|opens|closes
Action that is executed before the actuator is entering the "alarm" mode.
Notice subType blindsCrtl.00: The attribute can only be set while the actuator is online.
angleMax αs/°, [αs] = -180 ... 180, 90 is default.
Slat angle end position maximum.
angleMax is supported for shutter.
angleMin αo/°, [αo] = -180 ... 180, -90 is default.
Slat angle end position minimum.
angleMin is supported for shutter.
angleTime t/s,
subType blindsCtrl.00: [angleTime] = 0|0.01 .. 2.54, 0 is default.
subType manufProfile: [angleTime] = 0 ... 6, 0 is default.
Runtime value for the sunblind reversion time. Select the time to revolve
the sunblind from one slat angle end position to the other end position.
Notice subType blindsCrtl.00: The attribute can only be set while the actuator is online.
blockDateTime yes|no, [blockDateTime] = no is default.
blockDateTime is supported for roomCtrlPanel.00.
blockDisplay yes|no, [blockDisplay] = no is default.
blockDisplay is supported for roomCtrlPanel.00.
blockFanSpeed yes|no, [blockFanSpeed] = no is default.
blockFanSpeed is supported for roomCtrlPanel.00.
blockKey yes|no, [blockKey] = no is default.
blockKey is supported for roomCtrlPanel.00 and hvac.04.
blockMotion yes|no, [blockMotion] = no is default.
blockMotion is supported for roomCtrlPanel.00.
blockOccupancy yes|no, [blockOccupancy] = no is default.
blockOccupancy is supported for roomCtrlPanel.00.
blockTemp yes|no, [blockTemp] = no is default.
blockTemp is supported for roomCtrlPanel.00.
blockTimeProgram yes|no, [blockTimeProgram] = no is default.
blockTimeProgram is supported for roomCtrlPanel.00.
blockSetpointTemp yes|no, [blockSetpointTemp] = no is default.
blockSetPointTemp is supported for roomCtrlPanel.00.
blockUnknownMSC yes|no,
[blockUnknownMSC] = no is default.
If the structure of the MSC telegrams can not interpret the raw data to be output. Setting this attribute to yes,
the output can be suppressed.
comMode biDir|confirm|uniDir, [comMode] = uniDir is default.
Communication Mode between an enabled EnOcean device and Fhem.
Unidirectional communication means a point-to-multipoint communication
relationship. The EnOcean device e. g. sensors does not know the unique
Fhem SenderID.
If the attribute is set to confirm Fhem awaits confirmation telegrams from the remote device.
Bidirectional communication means a point-to-point communication
relationship between an enabled EnOcean device and Fhem. It requires all parties
involved to know the unique Sender ID of their partners. Bidirectional communication
needs a teach-in / teach-out process, see Bidirectional Teach-In / Teach-Out.
dataEnc VAES|AES-CBC, [dataEnc] = VAES is default
Data encryption algorithm
defaultChannel all|input|0 ... 29, [defaultChannel] = all is default
Default device channel
daylightSavingTime supported|not_supported, [daylightSavingTime] = supported is default.
daylightSavingTime is supported for roomCtrlPanel.00.
demandRespAction <command>
Command being executed after an demand response command is set. 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). In the <command> you can access the demand response
readings $TYPE, $NAME, $LEVEL, $SETPOINT, $POWERUSAGE, $POWERUSAGESCALE, $POWERUSAGELEVEL, $STATE. In addition,
the variables $TARGETNAME, $TARGETTYPE, $TARGETSTATE can be used if the action is executed
on the target device. This data is available as a local variable in perl, as environment variable for shell
scripts, and will be textually replaced for Fhem commands.
demandRespMax A0|AI|B0|BI|C0|CI|D0|DI, [demandRespMax] = B0 is default
Switch command which is executed if the demand response switches to a maximum.
demandRespMin A0|AI|B0|BI|C0|CI|D0|DI, [demandRespMax] = BI is default
Switch command which is executed if the demand response switches to a minimum.
demandRespRandomTime t/s [demandRespRandomTime] = 1 is default
Maximum length of the random delay at the start or end of a demand respose event in slave mode.
demandRespThreshold 0...15 [demandRespTheshold] = 8 is default
Threshold for switching the power usage level between minimum and maximum in the master mode.
demandRespTimeoutLevel max|last [demandRespTimeoutLevel] = max is default
Demand response timeout level in slave mode.
devChannel 00 ... FF, [devChannel] = FF is default
Number of the individual device channel, FF = all channels supported by the device
destinationID multicast|unicast|00000001 ... FFFFFFFF,
[destinationID] = multicast is default
Destination ID, special values: multicast = FFFFFFFF, unicast = [DEF]
devMode master|slave, [devMode] = master is default.
device operation mode.
dimMax dim/%|off, [dimMax] = 255 is default.
maximum brightness value
dimMax is supported for the profile gateway/dimming.
dimMin dim/%|off, [dimMax] = off is default.
minimum brightness value
If [dimMax] = off, then the actuator takes down the ramp time set there.
dimMin is supported for the profile gateway/dimming.
dimValueOn dim/%|last|stored,
[dimValueOn] = 100 is default.
Dim value for the command "on".
The dimmer switched on with the value 1 % ... 100 % if [dimValueOn] =
1 ... 100.
The dimmer switched to the last dim value received from the
bidirectional dimmer if [dimValueOn] = last.
The dimmer switched to the last Fhem dim value if [dimValueOn] =
stored.
dimValueOn is supported for the profile gateway/dimming.
disable 0|1
If applied set commands will not be executed.
disabledForIntervals HH:MM-HH:MM HH:MM-HH-MM...
Space separated list of HH:MM tupels. If the current time is between
the two time specifications, set commands will not be executed. Instead of
HH:MM you can also specify HH or HH:MM:SS. To specify an interval
spawning midnight, you have to specify two intervals, e.g.:
23:00-24:00 00:00-01:00
displayContent
humidity|off|setPointTemp|temperatureExtern|temperatureIntern|time|default|no_change, [displayContent] = no_change is default.
displayContent is supported for roomCtrlPanel.00.
gpDef <name of channel 00>:<O|I>:<channel type>:<signal type>:<value type>[:<resolution>[:<engineering min>:<scaling min>:<engineering max>:<scaling max>]] ...
<name of channel 64>:<O|I>:<channel type>:<signal type>:<value type>[:<resolution>[:<engineering min>:<scaling min>:<engineering max>:<scaling max>]]
Generic Profiles channel definitions are set automatically in master mode. If the profile in slave mode is operated, the channel
definition must be entered manually. For each channel, the channel definitions are to be given in ascending order. The channel
parameters to be specified in decimal. First, the outgoing channels (direction = O) are to be defined, then the incoming channels
(direction = I) should be described. The channel numbers are assigned automatically starting with 00th.
gwCmd switching|dimming|setpointShift|setpointBasic|controlVar|fanStage|blindCmd
Gateway Command Type, see Gateway profile
humidity t/°C
The value of the actual humidity, used by a Room Sensor and Control Unit. Should by
filled via a notify from a distinct humidity sensor.
humidityRefDev <name>
Name of the device whose reference value is read. The reference values is
the reading humidity.
observe off|on, [observe] = off is default.
Observing and repeating the execution of set commands
observeCmdRepetition 1..5, [observeCmdRepetition] = 2 is default.
Maximum number of command retries
observeErrorAction <command>
Command being executed after an error. 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). In the <command> you can access the set
command. $TYPE, $NAME, $FAILEDDEV, $EVENT, $EVTPART0, $EVTPART1, $EVTPART2, etc. contains the space separated
set parts. The eventMap replacements are taken into account. This data
is available as a local variable in perl, as environment variable for shell
scripts, and will be textually replaced for Fhem commands.
observeInterval 1/s ... 255/s, [observeInterval] = 1 is default.
Interval between two observations
observeLogic and|or, [observeLogic] = or is default.
Observe logic
observeRefDev <name> [<name> [<name>]],
[observeRefDev] = <name of the own device> is default
Names of the devices to be observed. The list must be separated by spaces.
pollInterval t/s, [pollInterval] = 10 is default.
[pollInterval] = 1 ... 1440.
pollInterval is supported for roomCtrlPanel.00.
rampTime t/s or relative, [rampTime] = 1 is default.
No ramping or for Eltako dimming speed set on the dimmer if [rampTime] = 0.
Gateway/dimmung: Ramping time 1 s to 255 s or relative fast to low dimming speed if [rampTime] = 1 ... 255.
lightCtrl.01: Ramping time 1 s to 65535 s
rampTime is supported for gateway, command dimming and lightCtrl.01.
remoteManagement off|on,
[remoteManagement] = off is default.
Enable Remote Management for the device.
repeatingAllowed yes|no,
[repeatingAllowed] = yes is default.
EnOcean Repeater in the transmission range of Fhem may forward data messages
of the device, if the attribute is set to yes.
releasedChannel A|B|C|D|I|0|auto, [releasedChannel] = auto is default.
Attribute releasedChannel determines via which SenderID (subDefA ... subDef0) the command released is sent.
If [releasedChannel] = auto, the SenderID the last command A0, AI, B0, BI, C0, CI, D0 or DI is used.
Attribute releasedChannel is supported for attr switchType = central and attr switchType = channel.
reposition directly|opens|closes, [reposition] = directly is default.
Attribute reposition specifies how to adjust the internal positioning tracker before going to the new position.
rlcRcv <rolling code 2 or 3 byte hex>
Rolling Code for receive direction
rlcSnd <rolling code 2 or 3 byte hex>
Rolling Code for send direction
rlcTX false|true
Rolling Code is expected in the received telegram
scaleDecimals 0 ... 9
Decimal rounding with x digits of the scaled reading setpoint
scaleMax <floating-point number>
Scaled maximum value of the reading setpoint
scaleMin <floating-point number>
Scaled minimum value of the reading setpoint
secLevel encapsulation|encryption|off, [secLevel] = off is default
Security level of the data
secMode rcv|snd|bidir
Telegram direction, which is secured
sendDevStatus no|yes, [sendDevStatus] = no is default.
Send new status of the device.
serviceOn no|yes,
[serviceOn] = no is default.
Device in Service Mode.
switchMode switch|pushbutton,
[sensorMode] = switch is default.
The status "released" will be shown in the reading state if the
attribute is set to "pushbutton".
setCmdTrigger man|refDev, [setCmdTrigger] = man is default.
Operation mode to send set commands
If the attribute is set to "refDev", a device-specific set command is sent when the reference device is updated.
For the subType "roomSensorControl.05" and "fanCrtl.00" the reference "temperatureRefDev" is supported.
For the subType "roomSensorControl.01" the references "humidityRefDev" and "temperatureRefDev" are supported.
shutTime t/s
subType blindsCtrl.00: [shutTime] = 5 ... 300, 300 is default.
subType manufProfile: [shutTime] = 1 ... 255, 255 is default.
Use the attr shutTime to set the time delay to the position "Halt" in
seconds. Select a delay time that is at least as long as the shading element
or roller shutter needs to move from its end position to the other position.
Notice subType blindsCrtl.00: The attribute can only be set while the actuator is online.
shutTimeCloses t/s, [shutTimeCloses] = 1 ... 255,
[shutTimeCloses] = [shutTime] is default.
Set the attr shutTimeCloses to define the runtime used by the commands opens and closes.
Select a runtime that is at least as long as the value set by the delay switch of the actuator.
shutTimeCloses is supported for shutter.
subDef <EnOcean SenderID>,
[subDef] = [DEF] is default.
SenderID (TCM BaseID + offset) to control a bidirectional switch or actor.
In order to control devices that send acknowledge telegrams, you cannot reuse the ID of this
devices, instead you have to create your own, which must be in the
allowed ID-Range of the underlying IO device. For this first query the
TCM with the "get <tcm> idbase" command. You can use
up to 128 IDs starting with the base shown there.
If [subDef] = getNextID FHEM can assign a free SenderID alternatively. The system configuration
needs to be reloaded. The assigned SenderID will only displayed after the system configuration
has been reloaded, e.g. Fhem command rereadcfg.
subDefA <EnOcean SenderID>,
[subDefA] = [subDef] is default.
SenderID (TCM BaseID + offset) for [value] = A0|AI|released
Used with switch type "channel". Set attr switchType to channel.
subDefA is supported for switches.
Second action is not sent.
If [subDefA] = getNextID FHEM can assign a free SenderID alternatively. The assigned SenderID will only
displayed after the system configuration has been reloaded, e.g. Fhem command rereadcfg.
subDefB <EnOcean SenderID>,
[subDefB] = [subDef] is default.
SenderID (TCM BaseID + offset) for [value] = B0|BI|released
Used with switch type "channel". Set attr switchType to channel.
subDefB is supported for switches.
Second action is not sent.
If [subDefB] = getNextID FHEM can assign a free SenderID alternatively. The assigned SenderID will only
displayed after the system configuration has been reloaded, e.g. Fhem command rereadcfg.
subDefC <EnOcean SenderID>,
[subDefC] = [subDef] is default.
SenderID (TCM BaseID + offset) for [value] = C0|CI|released
Used with switch type "channel". Set attr switchType to channel.
subDefC is supported for switches.
Second action is not sent.
If [subDefC] = getNextID FHEM can assign a free SenderID alternatively. The assigned SenderID will only
displayed after the system configuration has been reloaded, e.g. Fhem command rereadcfg.
subDefD <EnOcean SenderID>,
[subDefD] = [subDef] is default.
SenderID (TCM BaseID + offset) for [value] = D0|DI|released
Used with switch type "channel". Set attr switchType to channel.
subDefD is supported for switches.
Second action is not sent.
If [subDefD] = getNextID FHEM can assign a free SenderID alternatively. The assigned SenderID will only
displayed after the system configuration has been reloaded, e.g. Fhem command rereadcfg.
subDef0 <EnOcean SenderID>,
[subDef0] = [subDef] is default.
SenderID (TCM BaseID + offset) for [value] = A0|B0|C0|D0|released
Used with switch type "central". Set attr switchType to central.
Use the sensor type "zentral aus/ein" for Eltako devices.
subDef0 is supported for switches.
Second action is not sent.
If [subDef0] = getNextID FHEM can assign a free SenderID alternatively. The assigned SenderID will only
displayed after the system configuration has been reloaded, e.g. Fhem command rereadcfg.
subDefI <EnOcean SenderID>,
[subDefI] = [subDef] is default.
SenderID (TCM BaseID + offset) for [value] = AI|BI|CI|DI
Used with switch type "central". Set attr switchType to central.
Use the sensor type "zentral aus/ein" for Eltako devices.
subDefI is supported for switches.
Second action is not sent.
If [subDefI] = getNextID FHEM can assign a free SenderID alternatively. The assigned SenderID will only
displayed after the system configuration has been reloaded, e.g. Fhem command rereadcfg.
subTypeSet <type of device>, [subTypeSet] = [subType] is default.
Type of device (EEP Profile) used for sending commands. Set the Attribute manually.
The profile has to fit their basic profile. More information can be found in the basic profiles.
summerMode off|on,
[summerMode] = off is default.
Put Battery Powered Actuator (hvac.01) in summer operation to reduce energy consumption.
switchHysteresis <value>,
[switchHysteresis] = 1 is default.
Switch Hysteresis
switchMode switch|pushbutton,
[switchMode] = switch is default.
The set command "released" immediately after <value> is sent if the
attribute is set to "pushbutton".
switchType direction|universal|central|channel,
[switchType] = direction is default.
EnOcean Devices support different types of sensors, e. g. direction
switch, universal switch or pushbutton, central on/off.
For Eltako devices these are the sensor types "Richtungstaster",
"Universalschalter" or "Universaltaster", "Zentral aus/ein".
With the sensor type direction switch on/off commands are
accepted, e. g. B0, BI, released. Fhem can control an device with this
sensor type unique. This is the default function and should be
preferred.
Some devices only support the universal switch
or pushbutton. With a Fhem command, for example,
B0 or BI is switched between two states. In this case Fhem cannot
control this device unique. But if the Attribute switchType
is set to universal Fhem synchronized with
a bidirectional device and normal on/off commands can be used.
If the bidirectional device response with the channel B
confirmation telegrams also B0 and BI commands are to be sent,
e g. channel A with A0 and AI. Also note that confirmation telegrams
needs to be sent.
Partly for the switchType central two different SenderID
are required. In this case set the Attribute switchType to
central and define the Attributes
subDef0 and subDefI.
Furthermore, SenderIDs can be used depending on the channel A, B, C or D.
In this case set the Attribute switchType to channel and define
the Attributes subDefA, subDefB,
subDefC, or subDefD.
temperatureRefDev <name>
Name of the device whose reference value is read. The reference values is
the reading temperature.
temperatureScale F|C|default|no_change, [temperatureScale] = no_change is default.
temperatureScale is supported for roomCtrlPanel.00.
timeNotation 12|24|default|no_change, [timeNotation] = no_change is default.
timeNotation is supported for roomCtrlPanel.00.
timeProgram[1-4] <period> <starttime> <endtime> <roomCtrlMode>, [timeProgam[1-4]] = <none> is default.
[period] = FrMo|FrSu|ThFr|WeFr|TuTh|MoWe|SaSu|MoFr|MoSu|Su|Sa|Fr|Th|We|Tu|Mo
[starttime] = [00..23]:[00|15|30|45]
[endtime] = [00..23]:[00|15|30|45]
[roomCtrlMode] = buildingProtection|comfort|economy|preComfort
The Room Control Panel Kieback & Peter RBW322-FTL supports only [roomCtrlMode] = comfort.
timeProgram is supported for roomCtrlPanel.00.
updateState default|yes|no, [updateState] = default is default.
update reading state after set commands
uteResponseRequest yes|no
request UTE teach-in/teach-out response message, the standard value depends on the EEP profil
<BtnX,BtnY> First and second action where BtnX and BtnY is
one of the above, e.g. A0 BI or D0 CI
buttons: pressed|released
state: <BtnX>[,<BtnY>]
Switches (remote controls) or actors with more than one
(pair) keys may have multiple channels e. g. B0/BI, A0/AI with one
SenderID or with separate addresses.
<BtnX,BtnY> First and second action where BtnX and BtnY is
one of the above, e.g. A0,BI or D0,CI
released
buttons: pressed|released
state: <BtnX>[,<BtnY>] [released]
The status of the device may become "released", this is not the case for a normal switch.
Set attr model to FT55|FSM12|FSM61|FTS12 or attr sensorMode to pushbutton manually.
Pushbutton Switch (EEP F6-3F-7F)
[Eltako FGW14/FAM14 with internal decryption and RS-485 communication]
A0
AI
B0
BI
C0
CI
D0
DI
<BtnX,BtnY> First and second action where BtnX and BtnY is
one of the above, e.g. A0,BI or D0,CI
released
buttons: pressed|released
state: <BtnX>[,<BtnY>] [released]
Set attr subType to switch.7F and manufID to 00D.
The status of the device may become "released", this is not the case for
a normal switch. Set attr sensorMode to pushbutton manually.
Set attr subType to switch and model to FAE14|FHK14 manually. In addition
every telegram received from a teached-in temperature sensor (e.g. FTR55H)
is repeated as a confirmation telegram from the Heating/Cooling Relay
FAE14, FHK14. In this case set attr subType to e. g. roomSensorControl.05
and attr manufID to 00D.
Eltako devices only support Brightness.
The attr subType must be lightSensor.01 and attr manufID must be 00D
for Eltako Devices. This is done if the device was created by
autocreate.
Light Sensor (EEP A5-06-02)
[untested]
E/lx
brightness: E/lx (Sensor Range: 0 lx ... 1020 lx
voltage: U/V (Sensor Range: U = 0 V ... 5.1 V)
state: E/lx
The attr subType must be lightSensor.02. This is done if the device was
created by autocreate.
Light Sensor (EEP A5-06-03)
[untested]
E/lx
brightness: E/lx (Sensor Range: E = 0 lx ... 1000 lx, over range)
errorCode: 251 ... 255
state: E/lx
The attr subType must be lightSensor.03. This is done if the device was
created by autocreate.
current: I/µA (Sensor Range: I = 0 V ... 127.0 µA)
errorCode: 251 ... 255
motion: on|off
sensorType: ceiling|wall
voltage: U/V (Sensor Range: U = 0 V ... 5.0 V)
state: on|off
The attr subType must be occupSensor.<01|02>. This is done if the device was
created by autocreate. Current is the solar panel current. Some values are
displayed only for certain types of devices.
Occupancy Sensor (EEP A5-07-03)
[untested]
M: on|off E: E/lx U: U/V
battery: ok|low
brightness: E/lx (Sensor Range: E = 0 lx ... 1000 lx, over range)
errorCode: 251 ... 255
motion: on|off
voltage: U/V (Sensor Range: U = 0 V ... 5.0 V)
state: M: on|off E: E/lx U: U/V
The attr subType must be occupSensor.03. This is done if the device was
created by autocreate.
Light, Temperatur and Occupancy Sensor (EEP A5-08-01 ... A5-08-03)
[Eltako FABH63, FBH55, FBH63, FIBH63, Thermokon SR-MDS, PEHA 482 FU-BM DE]
Eltako and PEHA devices only support Brightness and Motion.
The attr subType must be lightTempOccupSensor.<01|02|03> and attr
manufID must be 00D for Eltako Devices. This is done if the device was
created by autocreate.
Gas Sensor, CO Sensor (EEP A5-09-01)
[untested]
CO: c/ppm (Sensor Range: c = 0 ppm ... 255 ppm)
temperature: t/°C (Sensor Range: t = 0 °C ... 255 °C)
state: c/ppm
The attr subType must be COSensor.01. This is done if the device was created by autocreate.
Gas Sensor, CO Sensor (EEP A5-09-02)
[untested]
CO: c/ppm (Sensor Range: c = 0 ppm ... 1020 ppm)
temperature: t/°C (Sensor Range: t = 0 °C ... 51.0 °C)
voltage: U/V
(Sensor Range: U = 0 V ... 5.1 V)
state: c/ppm
The attr subType must be COSensor.02. This is done if the device was
created by autocreate.
Gas Sensor, CO2 Sensor (EEP A5-09-04)
[Thermokon SR04 CO2 *, Eltako FCOTF63, untested]
airQuality: high|mean|moderate|low (Air Quality Classes DIN EN 13779)
CO2: c/ppm (Sensor Range: c = 0 ppm ... 2550 ppm)
humidity: rH/% (Sensor Range: rH = 0 % ... 100 %)
temperature: t/°C (Sensor Range: t = 0 °C ... 51 °C)
temperature: t/°C (Sensor Range: t = 0 °C ... 40 °C)
state: T: t/°C SPT: t/°C NR: t/K
The scaling of the setpoint adjustment is device- and vendor-specific. Set the
attributes scaleMax, scaleMin and
scaleDecimals for the additional scaled reading
setpointScaled. Use attribut userReadings to
adjust the scaling alternatively.
The attr subType must be roomSensorControl.05 and attr
manufID must be 00D for Eltako Devices. This is done if the device was
created by autocreate.
Room Sensor and Control Unit (EEP A5-04-01, A5-10-10 ... A5-10-14)
[Eltako FUTH65D, Thermokon SR04 * rH, Thanos SR *]
T: t/°C H: rH/% SP: 0 ... 255 SW: 0|1
humidity: rH/% (Sensor Range: rH = 0 % ... 100 %)
switch: 0|1
temperature: t/°C (Sensor Range: t = 0 °C ... 40 °C)
setpoint: 0 ... 255
setpointScaled: <floating-point number>
state: T: t/°C H: rH/% SP: 0 ... 255 SW: 0|1
The scaling of the setpoint adjustment is device- and vendor-specific. Set the
attributes scaleMax, scaleMin and
scaleDecimals for the additional scaled reading
setpointScaled. Use attribut userReadings to
adjust the scaling alternatively.
The attr subType must be roomSensorControl.01 and attr
manufID must be 00D for Eltako Devices. This is
done if the device was created by autocreate.
Room Sensor and Control Unit (EEP A5-10-15 ... A5-10-17)
[untested]
T: t/°C SP: 0 ... 63 P: absent|present
presence: absent|present
temperature: t/°C (Sensor Range: t = -10 °C ... 41.2 °C)
setpoint: 0 ... 63
setpointScaled: <floating-point number>
state: T: t/°C SP: 0 ... 63 P: absent|present
The scaling of the setpoint adjustment is device- and vendor-specific. Set the
attributes scaleMax, scaleMin and
scaleDecimals for the additional scaled reading
setpointScaled. Use attribut userReadings to
adjust the scaling alternatively.
The attr subType must be roomSensorControl.02. This is done if the device was
created by autocreate.
Room Sensor and Control Unit (EEP A5-10-18)
[untested]
The scaling of the setpoint adjustment is device- and vendor-specific. Set the
attributes scaleMax, scaleMin and
scaleDecimals for the additional scaled reading
setpointScaled. Use attribut userReadings to
adjust the scaling alternatively.
The attr subType must be roomSensorControl.1F. This is done if the device was
created by autocreate.
temperature: t/°C (Sensor Range: t = 0 °C ... 40 °C)
state: t/°C H: rH/% SP: 0 ... 255 B: ok|low
The scaling of the setpoint adjustment is device- and vendor-specific. Set the
attributes scaleMax, scaleMin and
scaleDecimals for the additional scaled reading
setpointScaled. Use attribut userReadings to
adjust the scaling alternatively.
The attr subType must be roomSensorControl.20 or roomSensorControl.21.
This is done if the device was created by autocreate.
Room Control Panels (D2-10-00 - D2-10-02)
[Kieback & Peter RBW322-FTL]
The attr subType must be roomCtrlPanel.00. This is done if the device was
created by autocreate. To control the device, it must be bidirectional paired,
see Bidirectional Teach-In / Teach-Out.
Lighting Controller State (EEP A5-11-01)
[untested]
The attr subType must be shutterCtrlState.01 This is done if the device was
created by autocreate.
The profile is linked with Blind Command Central.
The profile Blind Command Central
controls the devices centrally. For that the attributes subDef, subTypeSet
and gwCmd have to be set manually.
Extended Lighting Status (EEP A5-11-04)
[untested]
temperature: t/°C (Sensor Range: t = -40 °C ... 80 °C)
windSpeed: Vs/m (Sensor Range: V = 0 m/s ... 70 m/s)
state:T: t/°C B: E/lx W: Vs/m IR: yes|no
Brightness is the strength of the dawn light. SunEast,
sunSouth and sunWest are the solar radiation from the respective
compass direction. IsRaining is the rain indicator.
The attr subType must be environmentApp and attr manufID must be 00D
for Eltako Devices. This is done if the device was created by
autocreate.
The Eltako Weather Station FWS61 supports not the day/night indicator
(dayNight).
Environmental Applications
EEP A5-13-03 ... EEP A5-13-06 are not implemented.
Environmental Applications
Sun Position and Radiation (EEP A5-13-10)
[untested]
SRA: E m2/W SNA: α/° SNE: β/°
dayNight: day|night
solarRadiation: E m2/W (Sensor Range: E = 0 W/m2 ... 2000 W/m2)
executeTime: t/s (Sensor Range: t = 0.1 s ... 6553.5 s or 0 if no time specified)
executeType: duration|delay
block: lock|unlock
teach: <result of teach procedure>
state: on|off
The attr subType must be gateway and gwCmd must be switching. This is done if the device was
created by autocreate.
For Eltako devices attributes must be set manually. Eltako devices only send on/off.
dimValueLast: dim/%
Last value received from the bidirectional dimmer.
dimValueStored: dim/%
Last value saved by set <name> dim <value>.
rampTime: t/s (Sensor Range: t = 1 s ... 255 s or 0 if no time specified,
for Eltako: t = 1 = fast dimming ... 255 = slow dimming or 0 = dimming speed on the dimmer used)
teach: <result of teach procedure>
state: on|off
The attr subType must be gateway, gwCmd must be dimming and attr manufID must be 00D
for Eltako Devices. This is done if the device was created by autocreate.
For Eltako devices attributes must be set manually. Eltako devices only send on/off and dim.
Gateway (EEP A5-38-08)
Setpoint shift
[untested]
1/K
setpointShift: 1/K (Sensor Range: T = -12.7 K ... 12.8 K)
teach: <result of teach procedure>
state: 1/K
The attr subType must be gateway, gwCmd must be setpointShift.
This is done if the device was created by autocreate.
Gateway (EEP A5-38-08)
Basic Setpoint
[untested]
t/°C
setpoint: t/°C (Sensor Range: t = 0 °C ... 51.2 °C)
teach: <result of teach procedure>
state: t/°C
The attr subType must be gateway, gwCmd must be setpointBasic.
This is done if the device was created by autocreate.
Gateway (EEP A5-38-08)
Control variable
[untested]
The attr subType must be gateway, gwCmd must be controlVar.
This is done if the device was created by autocreate.
Gateway (EEP A5-38-08)
Fan stage
[untested]
0 ... 3|auto
teach: <result of teach procedure>
state: 0 ... 3|auto
The attr subType must be gateway, gwCmd must be fanStage.
This is done if the device was created by autocreate.
Extended Lighting Control (EEP A5-38-09)
[untested]
on
off
block: unlock|on|off|local
blue: <blue channel value> (Range: blue = 0 ... 255)
dimMax: <maximum dimming value> (Range: dim = 0 ... 255)
dimMin: <minimum dimming value> (Range: dim = 0 ... 255)
green: <green channel value> (Range: green = 0 ... 255)
rampTime: t/s (Range: t = 0 s ... 65535 s)
red: <red channel value> (Range: red = 0 ... 255)
rgb: RRGGBB (red (R), green (G) or blue (B) color component values: 00 ... FF)
teach: <result of teach procedure>
state: on|off
Another readings, see subtype lightCtrlState.02.
The attr subType or subTypSet must be lightCtrl.01. This is done if the device was created by autocreate.
The subType is associated with the subtype lightCtrlState.02.
Manufacturer Specific Applications (EEP A5-3F-7F)
Wireless Analog Input Module
[Thermokon SR65 3AI, untested]
I1: U/V I2: U/V I3: U/V
input1: U/V (Sensor Range: U = 0 V ... 10 V)
input2: U/V (Sensor Range: U = 0 V ... 10 V)
input3: U/V (Sensor Range: U = 0 V ... 10 V)
teach: <result of teach procedure>
state: I1: U/V I2: U/V I3: U/V
The attr subType must be manufProfile and attr manufID must be 002
for Thermokon Devices. This is done if the device was
created by autocreate.
Manufacturer Specific Applications (EEP A5-3F-7F)
Thermostat Actuator
[AWAG omnio UPH230/1x]
on|off
emergencyMode<channel>: on|off
nightReduction<channel>: on|off
setpointTemp<channel>: t/°C
teach: <result of teach procedure>
temperature<channel>: t/°C
window<channel>: on|off
state: on|off
The attr subType must be manufProfile and attr manufID must be 005
for AWAG omnio Devices. This is done if the device was created by autocreate.
The values of the reading position and anglePos are updated automatically,
if the command position is sent or the reading state was changed
manually to open or closed.
Set attr subType file, attr manufID to 00D and attr model to
FSB14|FSB61|FSB70 manually.
Electronic switches and dimmers with Energy Measurement and Local Control (D2-01-00 - D2-01-11)
[Telefunken Funktionsstecker, PEHA Easyclick, AWAG Elektrotechnik AG Omnio UPS 230/xx,UPD 230/xx]
The attr subType must be actuator.01. This is done if the device was
created by autocreate. To control the device, it must be bidirectional paired,
see Bidirectional Teach-In / Teach-Out.
Blind Control for Position and Angle (D2-05-00)
[AWAG Elektrotechnik AG OMNIO UPJ 230/12]
open
The status of the device will become "open" after the TOP endpoint is
reached, or it has finished an "opens" or "position 0" command.
closed
The status of the device will become "closed" if the BOTTOM endpoint is
reached
stop
The status of the device become "stop" if stop command is sent.
not_reached
The status of the device become "not_reached" between one of the endpoints.
The attr subType must be blindsCtrl.00. This is done if the device was
created by autocreate. To control the device, it must be bidirectional paired,
see Bidirectional Teach-In / Teach-Out.
Fan Control (D2-20-00 - D2-20-02)
[Maico ECA x RC/RCH, ER 100 RC, untested]
on|off|not_supported
fanSpeed: 0 ... 100/%
error: ok|air_filter|hardware|not_supported
humidity: rH/%|not_supported
humidityCtrl: disabled|enabled|not_supported
roomSize: 0...350/m2|max
roomSizeRef: unsed|not_used|not_supported
setpointTemp: t/°C (Range: t = 0 °C ... 40 °C)
teach: <result of teach procedure>
temperature: t/°C (Sensor Range: t = 0 °C ... 40 °C)
state: on|off|not_supported
The attr subType must be fanCtrl.00. This is done if the device was
created by autocreate. To control the device, it must be bidirectional paired,
see Bidirectional Teach-In / Teach-Out.
AC Current Clamp (D2-32-00 - D2-32-02)
[untested]
I1: I/A I2: I/A I3: I/A
current1: I/A (Range: I = 0 A ... 4095 A)
current2: I/A (Range: I = 0 A ... 4095 A)
current3: I/A (Range: I = 0 A ... 4095 A)
teach: <result of teach procedure>
state: I1: I/A I2: I/A I3: I/A
The attr subType must be currentClamp.00|currentClamp.01|currentClamp.02. This is done if the device was
created by autocreate.
LED Controller Status (EEP D2-40-00 - D2-40-01)
[untested]
on|off
blue: 0 % ... 100 %
daylightHarvesting: on|off
demandResp: on|off
dim: 0 % ... 100 %
green: 0 % ... 100 %
occupany: not_occupied|occupied|unknown
powerSwitch: on|off
red: 0 % ... 100 %
rgb: RRGGBB (red (R), green (G) or blue (B) color component values: 00 ... FF)
teach: <result of teach procedure>
telegramType: event|heartbeat
state: on|off
The attr subType must be ledCtrlState.00|ledCtrlState.01 This is done if the device was
created by autocreate.
Valve Control (EEP D2-A0-01)
opens
open
closes
closed
teach: <result of teach procedure>
state: opens|open|closes|closed|teachIn|teachOut
The attr subType must be valveCtrl.00. This is done if the device was
created by autocreate. To control the device, it must be bidirectional paired,
see Bidirectional Teach-In / Teach-Out.
The attr subType must be genericProfile. This is done if the device was
created by autocreate. If the profile in slave mode is operated, especially the channel
definition in the gpDef attributes must be entered manually.
RAW Command
RORG: 1BS|4BS|MCS|RPS|UTE|VLD
dataSent: data (Range: 1-byte hex ... 28-byte hex)
statusSent: status (Range: 0x00 ... 0xFF)
state: RORG: rorg DATA: data STATUS: status ODATA: odata
With the help of this command data messages in hexadecimal format can be sent and received.
The telegram types (RORG) 1BS and RPS are always received protocol-specific.
For further information, see
EnOcean Equipment Profiles (EEP).
Set attr subType to raw manually.
Light and Presence Sensor
[Omnio Ratio eagle-PM101]
channel1: on|off
Motion message in depending on the brightness threshold
channel2: on|off
Motion message
motion: on|off
Channel 2
state: on|off
Channel 2
The sensor also sends switching commands (RORG F6) with the SenderID-1.
Set attr subType to PM101 manually. Automatic teach-in is not possible,
since no EEP and manufacturer ID are sent.
FBAHA
This module connects to the AHA server (AVM Home Automation) on a FRITZ!Box.
It serves as the "physical" counterpart to the FBDECT
devices. Note: you have to enable the access to this feature in the FRITZ!Box
frontend first.
Define
define <name> FBAHA <device>
<device> is either a <host>:<port> combination, where
<host> is normally the address of the FRITZ!Box running the AHA server
(fritz.box or localhost), and <port> 2002, or
UNIX:SEQPACKET:/var/tmp/me_avm_home_external.ctl, the latter only works on
the fritz.box. With FRITZ!OS 5.50 the network port is available, on some
Labor variants only the UNIX socket is available.
Example:
As sometimes the FRITZ!Box reassigns the internal id's of the FBDECT devices,
the FBAHA module compares upon connect/reconnect the stored names (FBNAME)
with the current value. This feature will only work, if you assign each
FBDECT device a unique Name in the FRITZ!Box, and excecute the FHEM "get
FBDECTDEVICE devInfo" command, which saves the FBNAME reading.
FBDECT
This module is used to control AVM FRITZ!DECT devices via FHEM, see also the
FBAHA module for the base.
<id> is the id of the device, the classes argument ist ignored for now.
Example:
define lamp FBDECT 16 switch,powerMeter
Note:Usually the device is created via
autocreate. If you rename the corresponding FBAHA
device, take care to modify the FBDECT definitions, as it is not done
automatically.
control: on power < $v delay:$d sec do:state [on|off]
relaytimes: disabled
relaytimes: HEX
FB_CALLLIST
The FB_CALLLIST module creates a call history list by processing events of a FB_CALLMONITOR definition.
It logs all calls and displays them in a historic table.
You need a defined FB_CALLMONITOR instance where you can attach FB_CALLLIST to process the call events.
Depending on your configuration the status will be shown as icons or as text. You need to have the openautomation icon set configured in your corresponding FHEMWEB instance (see FHEMWEB attribute iconPath).
The icons have different colors.
blue - incoming call (active or finished)
green - outgoing call (active or finished)
red - missed incoming call
If you use no icons (see show-icons) the following states will be shown:
Optional attribute to disable the call list update during a specific time interval. The attribute contains a space separated list of HH:MM tupels.
If the current time is between the two time specifications, the callist will be disabled and no longer updated.
Instead of HH:MM you can also specify HH or HH:MM:SS.
To specify an interval spawning midnight, you have to specify two intervals, e.g.:
23:00-24:00 00:00-01:00
Default Value is empty (no intervals defined, calllist is always active)
If enabled, for all visible calls in the list, readings and events will be created. It is recommended to set the attribute event-on-change-reading to .* (all readings), to reduce the amount of generated readings for certain call events.
Possible values: 0 => no readings will be created, 1 => readings and events will be created.
Default Value is 0 (no readings will be created)
This attribute accepts a list of comma seperated internal numbers for
filtering incoming or outgoing calls by a specific list of internal numbers
or a hash for filtering and mapping numbers to text.
Important: Depending on your provider, the internal number can contain a location area code.
The internal-number-filter must contain the same number as it is displayed in the call list.
This can be with or without location area code depending on your provider.
If this attribute is set, only the configured internal numbers will be shown in the list. All calls which are not taken via the configured internal numbers, were not be shown in the call list.
Default Value: empty (all internal numbers should be used, no exclusions and no mapping is performed)
The mapped name will be displayed in the table instead of the original value from FB_CALLMONITOR. If you use SVG-based icons, you can set the desired color as name or HTML color code via an optional "@color".
Defines a format string which should be used to format the timestamp values.
It contains several placeholders for different elements of a date/time.
The possible values are standard POSIX strftime() values. Common placeholders are:
%a - The abbreviated weekday name
%b - The abbreviated month name
%S - The second as a decimal number
%M - The minutes as a decimal number
%H - The hours as a decimal number
%d - The day of the month as a decimal number
%m - The month as a decimal number
%Y - The year as a decimal number including the century.
There are further placeholders available.
Please consult the manpage of strftime() or the documentation of your perl interpreter to find out more.
Default value is "%a, %d %b %Y %H:%M:%S" ( = "Sun, 07 Jun 2015 12:50:09")
Defines the language of the table header, some keywords and the timestamp format. You need to have the selected locale installed and available in your operating system.
Possible values: en => English , de => German
Default Value is en (English)
Normally the call state is shown with icons (used from the openautomation icon set).
You need to have openautomation in your iconpath attribute of your appropriate FHEMWEB definition to use this icons.
If you don't want to use icons you can deactivate them with this attribute.
Possible values: 0 => no icons , 1 => use icons
Default Value is 1 (use icons)
Defines the visible columns, as well as the order in which these columns are displayed in the call list (from left to right).
Not all columns must be displayed, you can select only a subset of columns which will be displayed.
The possible values represents the corresponding column.
The column "row" represents the row number within the current list.
Possible values: a combination of row,state,timestamp,name,number,internal,external,connection,duration
Default Value is "row,state,timestamp,name,number,internal,external,connection,duration" (show all columns)
If activated the headline with a link to the detail page of the current definition will be hidden.
Possible values: 0 => the heading line will be shown , 1 => the heading line will not be shown
Default Value is 0 (the heading line will be shown)
Generated Events:
This module generates only readings if the attribute create-readings is activated. The number and names of the readings depends on the selected columns (see attribute visible-columns) and the configured number of calls (see attribute number-of-calls).
FB_CALLMONITOR
The FB_CALLMONITOR module connects to a AVM FritzBox Fon and listens for telephone
events (Receiving incoming call, Making a call)
In order to use this module with fhem you must enable the Callmonitor feature via
telephone shortcode.
#96*5* - for activating #96*4* - for deactivating
Just dial the shortcode for activating on one of your phones, after 3 seconds just hang up. The feature is now activated.
After activating the Callmonitor-Support in your FritzBox, this module is able to
generate an event for each external call. Internal calls were not be detected by the Callmonitor.
rereadPhonebook - Reloads the FritzBox phonebook (from given file, via telnet or directly if available)
rereadTextfile - Reloads the user given textfile if configured (see attribute: reverse-search-text-file)
password - set the FritzBox password (only available when password is really needed for network access to FritzBox phonebook, see attribute fritzbox-remote-phonebook)
Get
search <phone-number> - returns the name of the given number via reverse-search (internal phonebook, cache or internet lookup)
showPhonebookIds - returns a list of all available phonebooks on the FritzBox (not available when using telnet to retrieve remote phonebook)
showPhonebookEntries - returns a list of all currently known phonebook entries (only available when using phonebook funktionality)
showCacheEntries - returns a list of all currently known cache entries (only available when using reverse search caching funktionality)
showTextfileEntries - returns a list of all known entries from user given textfile (only available when using reverse search caching funktionality)
Enables the reverse searching of the external number (at dial and call receiving).
This attribute contains a comma separated list of providers which should be used to reverse search a name to a specific phone number.
The reverse search process will try to lookup the name according to the order of providers given in this attribute (from left to right). The first valid result from the given provider order will be used as reverse search result.
If this attribute is activated each reverse-search result from an internet provider is saved in an internal cache
and will be used instead of requesting each internet provider every time with the same number. The cache only contains reverse-search results from internet providers.
Possible values: 0 => off , 1 => on
Default Value is 0 (off)
Write the internal reverse-search-cache to the given file and use it next time FHEM starts.
So all reverse search results are persistent written to disk and will be used instantly after FHEM starts.
This attribute can be used to specify the (full) path to a phonebook file in FritzBox format (XML structure). Using this option it is possible to use the phonebook of a FritzBox even without FHEM running on a Fritzbox.
The phonebook file can be obtained by an export via FritzBox web UI
Default value is /var/flash/phonebook (phonebook filepath on FritzBox)
Your local country code. This is needed to identify phonenumbers in your phonebook with your local country code as a national phone number instead of an international one as well as handling Call-By-Call numbers in german speaking countries (e.g. 0049 for Germany, 0043 for Austria or 001 for USA)
If this attribute is activated, the phonebook should be obtained direct from the FritzBox via remote network connection (in case FHEM is not running on a FritzBox). This is only possible if a password (and depending on configuration a username as well) is configured.
Possible values: 0 => off , 1 => on (use remote telnet connection to obtain FritzBox phonebook)
Default Value is 0 (off)
Set the method how the phonebook should be requested via network. When set to "web", the phonebook is obtained from the web interface via HTTP. When set to "telnet", it uses a telnet connection to login and retrieve the phonebook (telnet must be activated via dial shortcode #96*7*). When set to "tr064" the phonebook is obtained via TR-064 SOAP request.
Possible values: web,telnet,tr064
Default Value is web (retrieve phonebooks via web interface)
A comma separated list of phonebook id's which should be excluded when retrieving all possible phonebooks via web method (see attribute fritzbox-remote-phonebook-via). All list possible values is provided by get commandshowPhonebookIds. This attribute is not applicable when using telnet method to obtain remote phonebook.
Default Value: empty (all phonebooks should be used, no exclusions)
Use the given user for remote connect to obtain the phonebook. This attribute is only needed, if you use multiple users on your FritzBox.
Generated Events:
event (call|ring|connect|disconnect) - which event in detail was triggerd
direction (incoming|outgoing) - the call direction in general (incoming or outgoing call)
external_number - The participants number which is calling (event: ring) or beeing called (event: call)
external_name - The result of the reverse lookup of the external_number via internet. Is only available if reverse-search is activated. Special values are "unknown" (no search results found) and "timeout" (got timeout while search request). In case of an timeout and activated caching, the number will be searched again next time a call occurs with the same number
internal_number - The internal number (fixed line, VoIP number, ...) on which the participant is calling (event: ring) or is used for calling (event: call)
internal_connection - The internal connection (FON1, FON2, ISDN, DECT, ...) which is used to take or perform the call
external_connection - The external connection (fixed line, VoIP account) which is used to take or perform the call
call_duration - The call duration in seconds. Is only generated at a disconnect event. The value 0 means, the call was not taken by anybody.
call_id - The call identification number to separate events of two or more different calls at the same time. This id number is equal for all events relating to one specific call.
missed_call - This event will be raised in case of a missing incoming call. If available, also the name of the calling number will be displayed.
missed_call_line - Will be raised together with "missed_call". It shows the number of the internal line which received the missed call.
Legal Notice:
klicktel.de reverse search is powered by telegate MEDIA
FHEM2FHEM
FHEM2FHEM is a helper module to connect separate FHEM installations.
Connect to the remote FHEM on <host>. <portnr> is a telnet
port on the remote FHEM, defaults to 7072. The optional :SSL suffix is
needed, if the remote FHEM configured SSL for this telnet port. In this case
the IO::Socket::SSL perl module must be installed for the local host too.
Note: if the remote FHEM is on a separate host, the telnet port on the remote
FHEM musst be specified with the global option.
The next parameter specifies the connection
type:
LOG
Using this type you will receive all events generated by the remote FHEM,
just like when using the inform on command, and you
can use these events just like any local event for FileLog or notify.
The regexp will prefilter the events distributed locally, for the syntax
see the notify definition.
Drawbacks: the remote devices wont be created locally, so list wont
show them and it is not possible to manipulate them from the local
FHEM. It is possible to create a device with the same name on both FHEM
instances, but if both of them receive the same event (e.g. because both
of them have a CUL attached), then all associated FileLogs/notifys will be
triggered twice.
RAW
By using this type the local FHEM will receive raw events from the remote
FHEM device devicename, just like if it would be attached to the
local FHEM.
Drawback: only devices using the Dispatch function (CUL, FHZ, CM11,
SISPM, RFXCOM, TCM, TRX, TUL) generate raw messages, and you must create a
FHEM2FHEM instance for each remote device. devicename must exist on the local
FHEM server too with the same name and same type as the remote device, but
with the device-node "none", so it is only a dummy device.
All necessary attributes (e.g. rfmode if the remote
CUL is in HomeMatic mode) must also be set for the local device.
Do not reuse a real local device, else duplicate filtering (see dupTimeout)
won't work correctly.
The last parameter specifies an optional portpassword, if the remote server
activated portpassword.
Examples:
define ds1 FHEM2FHEM 192.168.178.22:7072 LOG:.*
define RpiCUL CUL none 0000 define ds2 FHEM2FHEM 192.168.178.22:7072 RAW:RpiCUL
and on the RPi (192.168.178.22): rename CUL_0 RpiCUL
Set
reopen
Reopens the connection to the device and reinitializes it.
FHEMWEB is the builtin web-frontend, it also implements a simple web
server (optionally with Basic-Auth and HTTPS).
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.
To enable listening on IPV6 see the comments here.
Set
rereadicons
reads the names of the icons from the icon path. Use after adding or
deleting icons.
clearSvgCache
delete all files found in the www/SVGcache directory, which is used to
cache SVG data, if the SVGcache attribute is set.
Get
icon <logical icon>
returns the absolute path to the logical icon. Example:
get myFHEMWEB icon FS20.on
/data/Homeautomation/fhem/FHEM/FS20.on.png
pathlist
return FHEMWEB specific directories, where files for given types are
located
allowedCommands
A comma separated list of commands allowed from this FHEMWEB
instance. If set to an empty list , (i.e. comma only)
then this FHEMWEB instance will be read-only. If set to
get,set, then this FHEMWEB instance will only allow
regular usage of the frontend by clicking the icons/buttons/sliders but
not changing any configuration.
This attribute intended to be used together with hiddenroom/hiddengroup
Note:allowedCommands should work as intended, but no guarantee
can be given that there is no way to circumvent it. If a command is
allowed it can be issued by URL manipulation also for devices that are
hidden.
basicAuth, basicAuthMsg
request a username/password authentication for access. You have to set
the basicAuth attribute to the Base64 encoded value of
<user>:<password>, e.g.:
# Calculate first the encoded string with the commandline program
$ echo -n fhemuser:secret | base64
ZmhlbXVzZXI6c2VjcmV0
fhem.cfg:
attr WEB basicAuth ZmhlbXVzZXI6c2VjcmV0
You can of course use other means of base64 encoding, e.g. online
Base64 encoders. If basicAuthMsg is set, it will be displayed in the
popup window when requesting the username/password.
If the argument of basicAuth is enclosed in {}, then it will be
evaluated, and the $user and $password variable will be set to the
values entered. If the return value is true, then the password will be
accepted.
Example:
attr WEB basicAuth { "$user:$password" eq "admin:secret" }
closeConn
If set, a TCP Connection will only serve one HTTP request. Seems to
solve problems on iOS9 for WebApp startup.
column
Allows to display more than one column per room overview, by specifying
the groups for the columns. Example:
attr WEB column LivingRoom:FS20,notify|FHZ,notify DiningRoom:FS20|FHZ
In this example in the LivingRoom the FS20 and the notify group is in
the first column, the FHZ and the notify in the second.
Notes: some elements like SVG plots and readingsGroup can only be part of
a column if they are part of a group.
This attribute can be used to sort the groups in a room, just specify
the groups in one column.
Space in the room and group name has to be written as %20 for this
attribute.
csrfToken
If set, FHEMWEB requires the value of this attribute as fwcsrf
Parameter for each command. If the value is random, then a random
number will be generated on each FHEMWEB start. It is used as
countermeasure for Cross Site Resource Forgery attacks.
Default is not active.
CssFiles
Space separated list of .css files to be included. The filenames
are relative to the www directory. Example:
attr WEB CssFiles pgm2/mystyle.css
cmdIcon
Space separated list of cmd:iconName pairs. If set, the webCmd text is
replaced with the icon. An easy method to set this value is to use
"Extend devStateIcon" in the detail-view, and copy its value.
Example:
CORS
If set to 1, FHEMWEB will supply a "Cross origin resource sharing"
header, see the wikipedia for details.
defaultRoom
show the specified room if no room selected, e.g. on execution of some
commands. If set hides the motd. Example:
attr WEB defaultRoom Zentrale
devStateIcon
First form:
Space separated list of regexp:icon-name:cmd triples, icon-name and cmd
may be empty.
If the state of the device matches regexp, then icon-name will be
displayed as the status icon in the room, and (if specified) clicking
on the icon executes cmd. If fhem cannot find icon-name, then the
status text will be displayed.
Example:
If the cmd is noFhemwebLink, then no HTML-link will be generated, i.e.
nothing will happen when clicking on the icon or text.
Second form:
Perl regexp enclosed in {}. If the code returns undef, then the default
icon is used, if it retuns a string enclosed in <>, then it is
interpreted as an html string. Else the string is interpreted as a
devStateIcon of the first fom, see above.
Example:
{'<div style="width:32px;height:32px;background-color:green"></div>'}
devStateStyle
Specify an HTML style for the given device, e.g.:
editConfig
If this FHEMWEB attribute is set to 1, then you will be able to edit
the FHEM configuration file (fhem.cfg) in the "Edit files" section.
After saving this file a rereadcfg is executed automatically, which has
a lot of side effects.
editFileList
Specify the list of Files shown in "Edit Files" section. It is a
newline separated list of triples, the first is the Title, the next is
the directory to search for, the third the regular expression. Default
is:
Own modules and helper files:$MW_dir:^(.*sh|[0-9][0-9].*Util.*pm|.*cfg|.*holiday|myUtilsTemplate.pm|.*layout)$
Gplot files:$FW_gplotdir:^.*gplot$
Styles:$FW_cssdir:^.*(css|svg)$
endPlotNow
If this FHEMWEB attribute is set to 1, then day and hour plots will
end at current time. Else the whole day, the 6 hour period starting at
0, 6, 12 or 18 hour or the whole hour will be shown. This attribute
is not used if the SVG has the attribute startDate defined.
endPlotToday
If this FHEMWEB attribute is set to 1, then week and month plots will
end today. Else the current week or the current month will be shown.
fwcompress
Enable compressing the HTML data (default is 1, i.e. yes, use 0 to switch it off).
hiddenroom
Comma separated list of rooms to "hide", i.e. not to show. Special
values are input, detail and save, in which case the input areas, link
to the detailed views or save button is hidden (although each aspect
still can be addressed through URL manipulation).
The list can also contain values from the additional "Howto/Wiki/FAQ"
block.
hiddengroup
Comma separated list of groups to "hide", i.e. not to show in any room
of this FHEMWEB instance.
Example: attr WEBtablet hiddengroup FileLog,dummy,at,notify
HTTPS
Enable HTTPS connections. This feature requires the perl module
IO::Socket::SSL, to be installed with cpan -i IO::Socket::SSL or
apt-get install libio-socket-ssl-perl; OSX and the FritzBox-7390
already have this module.
A local certificate has to be generated into a directory called certs,
this directory must be in the modpath
directory, at the same level as the FHEM directory.
icon
Set the icon for a device in the room overview. There is an
icon-chooser in FHEMWEB to ease this task. Setting icons for the room
itself is indirect: there must exist an icon with the name
ico.png in the iconPath.
iconPath
colon separated list of directories where the icons are read from.
The directories start in the fhem/www/images directory. The default is
$styleSheetPrefix:default:fhemSVG:openautomation
Set it to fhemSVG:openautomation to get only SVG images.
JavaScripts
Space separated list of JavaScript files to be included. The filenames
are relative to the www directory. For each file an additional
user-settable FHEMWEB attribute will be created, to pass parameters to
the script. The name of this additional attribute gets the Param
suffix, directory and the fhem_ prefix will be deleted. Example:
attr WEB JavaScripts codemirror/fhem_codemirror.js
attr WEB codemirrorParam { "theme":"blackboard", "lineNumbers":true }
Note: if the filename starts with - then it will be excluded for the
automatically loaded list (e.g. -fhemweb_fbcalllist.js)
longpoll
Affects devices states in the room overview only.
In this mode status update is refreshed more or less instantaneously,
and state change (on/off only) is done without requesting a complete
refresh from the server.
Default is on.
longpollSVG
Reloads an SVG weblink, if an event should modify its content. Since
an exact determination of the affected events is too complicated, we
need some help from the definition in the .gplot file: the filter used
there (second parameter if the source is FileLog) must either contain
only the deviceName or have the form deviceName.event or deviceName.*.
This is always the case when using the Plot
editor. The SVG will be reloaded for any event triggered by
this deviceName. Default is off.
menuEntries
Comma separated list of name,html-link pairs to display in the
left-side list. Example:
attr WEB menuEntries fhem.de,http://fhem.de,culfw.de,http://culfw.de
attr WEB menuEntries AlarmOn,http://fhemhost:8083/fhem?cmd=set%20alarm%20on
nameDisplay
The argument is perl code, which is executed for each single device in
the room to determine the name displayed. $DEVICE is the name of the
current device, and $ALIAS is the value of the alias attribute or the
name of the device, if no alias is set. E.g. you can add a a global
userattr named alias_hu for the Hungarian translation, and specify
nameDisplay for the hungarian FHEMWEB instance as
AttrVal($d, "alias_hu", $devName)
nrAxis
the number of axis for which space should be reserved on the left and
right sides of a plot and optionaly how many axes should realy be used
on each side, separated by comma: left,right[,useLeft,useRight]. You
can set individual numbers by setting the nrAxis of the SVG. Default is
1,1.
ploteditor
Configures if the Plot editor should be shown
in the SVG detail view.
Can be set to always, onClick or never. Default is always.
plotEmbed 0
SVG plots are rendered as part of <embed> tags, as in the past
this was the only way to display SVG, and it allows to render them in
parallel, see plotfork.
Setting plotEmbed to 0 will render SVG in-place, but as a side-effect
makes the plotfork attribute meaningless.
plotfork [<Δp>]
If set to a nonzero value, run part of the processing (e.g. SVG plot generation or RSS feeds) in
parallel processes. Actually, child processes are forked whose
priorities are the FHEM process' priority plus Δp.
Higher values mean lower priority. e.g. use Δp= 10 to renice the
child processes and provide more CPU power to the main FHEM process.
Δp is optional and defaults to 0.
Note: do not use it
on Windows and on systems with small memory footprint.
plotmode
Specifies how to generate the plots:
SVG
The plots are created with the SVG module.
This is the default.
gnuplot-scroll
The plots are created with the gnuplot program. The gnuplot
output terminal PNG is assumed. Scrolling to historical values
is also possible, just like with SVG.
gnuplot-scroll-svg
Like gnuplot-scroll, but the output terminal SVG is assumed.
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 SVG. Default is 800,160 for desktop, and 480,160 for
smallscreen.
plotWeekStartDay
Start the week-zoom of the SVG plots with this day.
0 is Sunday, 1 is Monday, etc.
redirectCmds
Clear the browser URL window after issuing the command by redirecting
the browser, as a reload for the same site might have unintended
side-effects. Default is 1 (enabled). Disable it by setting this
attribute to 0 if you want to study the command syntax, in order to
communicate with FHEMWEB.
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).
reverseLogs
Display the lines from the logfile in a reversed order, newest on the
top, so that you dont have to scroll down to look at the latest entries.
Note: enabling this attribute will prevent FHEMWEB from streaming
logfiles, resulting in a considerably increased memory consumption
(about 6 times the size of the file on the disk).
roomIcons
Space separated list of room:icon pairs, to override the default
behaviour of showing an icon, if there is one with the name of
"icoRoomName". This is the correct way to remove the icon for the room
Everything, or to set one for rooms with / in the name (e.g.
Anlagen/EDV). The first part is treated as regexp, so space is
represented by a dot. Example:
attr WEB roomIcons Anlagen.EDV:icoEverything
smallscreenCommands
If set to 1, commands, slider and dropdown menues will appear in
smallscreen landscape mode.
sortby
Take the value of this attribute when sorting the devices in the room
overview instead of the alias, or if that is missing the devicename
itself.
showUsedFiles
In the Edit files section, show only the used files.
Note: currently this is only working for the "Gplot files" section.
sortRooms
Space separated list of rooms to override the default sort order of the
room links. As the rooms in this attribute are actually regexps, space
in the roomname has to be specified as dot (.).
Example:
attr WEB sortRooms DG OG EG Keller
sslVersion
See the global attribute sslVersion.
stylesheetPrefix
prefix for the files style.css, svg_style.css and svg_defs.svg. If the
file with the prefix is missing, the default file (without prefix) will
be used. These files have to be placed into the FHEM directory, and can
be selected directly from the "Select style" FHEMWEB menu entry. Example:
attr WEB stylesheetPrefix dark
Referenced files:
darksvg_defs.svg
darksvg_style.css
darkstyle.css
Note:if the argument contains the string smallscreen or touchpad,
then FHEMWEB will optimize the layout/access for small screen size (i.e.
smartphones) or touchpad devices (i.e. tablets)
The default configuration installs 3 FHEMWEB instances: port 8083 for
desktop browsers, port 8084 for smallscreen, and 8085 for touchpad.
If touchpad or smallscreen is specified, then WebApp support is
activated: After viewing the site on the iPhone or iPad in Safari, you
can add a link to the home-screen to get full-screen support. Links are
rendered differently in this mode to avoid switching back to the "normal"
browser.
SVGcache
if set, cache plots which won't change any more (the end-date is prior
to the current timestamp). The files are written to the www/SVGcache
directory. Default is off.
See also the clearSvgCache command for clearing the cache.
webCmd
Colon separated list of commands to be shown in the room overview for a
certain device. Has no effect on smallscreen devices, see the
devStateIcon command for an alternative.
Example:
attr lamp webCmd on:off:on-for-timer 10
The first specified command is looked up in the "set device ?" list
(see the setList attribute for dummy devices).
If there it contains some known modifiers (colon, followed
by a comma separated list), then a different widget will be displayed.
See also the widgetOverride attribute below. Examples:
If the command is state, then the value will be used as a command.
Note: this is an attribute for the displayed device, not for the FHEMWEB
instance.
webname
Path after the http://hostname:port/ specification. Defaults to fhem,
i.e the default http address is http://localhost:8083/fhem
widgetOverride
Space spearate list of name:modifier pairs, to override the widget
for a set/get/attribute specified by the module author.
if the modifier is ":noArg", then no further input field is
displayed
if the modifier is ":time", then a javascript driven timepicker is
displayed.
if the modifier is ":textField", an input field is displayed.
if the modifier is ":textField-long", is like textField, but upon
clicking on the input field a textArea (60x25) will be opened.
if the modifier is of the form
":slider,<min>,<step>,<max>[,1]", then a
javascript driven slider is displayed. The optional ,1 at the end
avoids the rounding of floating-point numbers.
if the modifier is of the form ":multiple,val1,val2,...", then
multiple values can be selected and own values can be written, the
result is comma separated.
if the modifier is of the form ":multiple-strict,val1,val2,...",
then multiple values can be selected and no new values can be
added, the result is comma separated.
if the modifier is of the form ":knob,min:1,max:100,...", then
the jQuery knob widget will be displayed. The parameters are
specified as a comma separated list of key:value pairs, where key
does not have to contain the "data-" prefix.
if the modifier is of the form ":sortable,val1,val2,...", then
the user can create a new list from the elements of the given
list, can add new elements by entering a text, or delete some from
the list. This new list can be sorted via drag & drop. The
result is a comma separated list.
if the modifier is of the form ":sortable-strict,val1,val2,...",
then it behaves like :sortable, without the possibility to enter
text.
if the modifier is of the form ":sortable-given,val1,val2,...",
then the specified list can be sorted via drag & drop, no
elements can be added or deleted.
if the modifier is of the form ":uzsuToggle,state1,state2",
a toggle button with two possible states is displayed. the first
is the active state.
if the modifier is of the form ":uzsuSelect,val1,val2,...",
a button bar with a button per value is displayed from which
multiple values can be selected. the result is comma separated.
if the modifier is of the form ":uzsuSelectRadio,val1,val2,...",
a button bar with a button per value is displayed from which only
one value can be selected.
if the modifier is of the form ":uzsuDropDown,val1,val2,...",
a dropdown with all values is displayed.
if the modifier is of the form ":uzsuTimerEntry[,modifier2]",
uzsuSelect, uzsuDropDown and uzsuToggle are combined into a single
line display to select a timer entry. an optional modifier can be
given to select the switching value. see examples below.
the result is a comma separated list of days followed by a time,
an enabled indicator and the switching value all separated by a|.
eg: Mo,Di,Sa,So|00:00|enabled|19.5
if the modifier is of the form ":uzsu[,modifier2]",
multiple uzsuTimerEntry widets are combined to allow the setting
of multiple switching times an optional modifier can be
given to select the switching value. see examples below.
the result is a space separeted list of uzsuTimerEntry results.
else a dropdown with all the modifier values is displayed
If this attribute is specified for a FHEMWEB instance, then it is
applied to all devices shown. Examples:
the following gives some examples of for the modifier2 parameter of uzsuTimerEntry and uzsu to
combine the setting of a timer with another widget to select the switching value :
... widgetOverride state:uzsu,slider,0,5,100 -> a slider
... widgetOverride state:uzsu,uzsuToggle,off,on -> a on/off button
... widgetOverride state:uzsu,uzsuDropDown,18,19,20,21,22,23 -> a dropDownMenue
... widgetOverride state:uzsu,knob,min:18,max:24,step:0.5,linecap:round,fgColor:red -> a knob widget
... widgetOverride state:uzsu,colorpicker -> a colorpicker
... widgetOverride state:uzsu,colorpicker,CT,2700,50,5000 -> a colortemperature selector
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 <fhtaddress>
<fhtaddress> is a four digit hex number,
corresponding to the address of the FHT80b device.
Examples:
desired-temp
day-temp night-temp
report1 report2
refreshvalues
mode
holiday1 holiday2 # see mode holiday_short or holiday
manu-temp # No clue what it does.
year month day hour minute
time date
lowtemp-offset # Alarm-Temp.-Differenz
windowopen-temp
mon-from1 mon-to1 mon-from2 mon-to2
tue-from1 tue-to1 tue-from2 tue-to2
wed-from1 wed-to1 wed-from2 wed-to2
thu-from1 thu-to1 thu-from2 thu-to2
fri-from1 fri-to1 fri-from2 fri-to2
sat-from1 sat-to1 sat-from2 sat-to2
sun-from1 sun-to1 sun-from2 sun-to2
Examples:
set wz desired-temp 22.5 set fl desired-temp 20.5 day-temp 19.0 night-temp 16.0
Notes:
Following events are reported (more or less regularly) by each FHT
device: measured-temp actuator actuator1...actuator8
warnings
You can use these strings for notify or
FileLog definitions.
warnings can contain following strings:
none, Battery low,Temperature too low, Window open,
Fault on window sensor
actuator (without a suffix) stands for all actuators.
actuator or actuator1..8 can take following values:
<value>%
This is the normal case, the actuator is instructed to
open to this value.
offset <value>%
The actuator is running with this offset.
lime-protection
The actuator was instructed to execute the lime-protection
procedure.
synctime
If you select Sond/Sync on the FHT80B, you'll see a count
down.
test
The actuator was instructed by the FHT80b to emit a beep.
pair
The the FHT80b sent a "you-belong-to-me" to this actuator.
The FHT is very economical (or lazy), it accepts one message from the
FHZ1x00 every 115+x seconds, where x depends on the fhtaddress. Don't
be surprised if your command is only accepted 10 minutes later by the
device. FHT commands are buffered in the FHZ1x00/CUL till they are
sent to the FHT, see the related fhtbuf entry in the
get section. You can send up to 8
commands in one message at once to the FHT if you specify them all as
arguments to the same set command, see the example above.
time sets hour and minute to local time
date sets year, month and date to local time
refreshvalues is an alias for report1 255 report2 255
All *-temp values need a temperature
as argument, which will be rounded to 0.5 Celsius.
Temperature values must between 5.5 and 30.5 Celsius. Value 5.5 sets
the actuator to OFF, value 30.5 set the actuator to ON
mode is one of auto, manual, holiday or
holiday_short.
If the mode is holiday, then the mode switches back to either auto or
manual at 00:00 of the day specified by the following:
holiday1 sets the end-day of the holiday
holiday2 sets the end-month of the holiday
For holiday_short (party mode)
holiday1 sets the absolute hour to switch back from this
mode (in 10-minute steps, max 144)
holiday2 sets the day of month to switch back from this mode
(can only be today or tomorrow, since holiday1 accepts only 24
hours).
Example:
current date is 29 Jan, time is 18:05
you want to switch to party mode until tomorrow 1:00
set holiday1 to 6 (6 x 10min = 1hour) and holiday2 to
30
The temperature for the holiday period is set by the desired-temperature
parameter. Note that you cannot set holiday mode for days earlier than the
day after tomorrow, for this you must use holiday_short.
Note also, you cannot set parameters seperately, you must set them in one command.
Example:
set FHT1 mode holiday holiday1 24 holiday2 12 desired-temp 14
The *-from1/*-from2/*-to1/*-to2 valuetypes need a time
spec as argument in the HH:MM format. They define the periods, where
the day-temp is valid. The minute (MM) will be rounded to 10, and
24:00 means off.
To synchronize the FHT time and to "wake" muted FHTs it is adviseable
to schedule following command: define fht_sync at +*3:30 set TYPE=FHT time
report1 with parameter 255 requests all settings for
monday till sunday to be sent. The argument is a bitfield, to request
unique values add up the following:
1: monday
2: tuesday
4: thursday
8: wednesday
16: friday
32: saturday
64: sunday
measured-temp and actuator is sent along if it is considered
appropriate
by the FHT.
Note: This command generates a lot of RF traffic, which can
lead to further problems, especially if the reception is not clear.
report2 with parameter 255 requests the following
settings to be reported: day-temp night-temp windowopen-temp
lowtemp-offset desired-temp measured-temp mode warnings.
The argument is (more or less) a bitfield, to request unique values
add up the following:
1: warnings
2: mode
4: day-temp, night-temp, windowopen-temp
8: desired-temp
64: lowtemp-offset
measured-temp and actuator is sent along if it is considered
appropriate by the FHT.
lowtemp-offset needs a temperature as argument, valid
values must be between 1.0 and 5.0 Celsius. It will trigger a
warning if desired-temp - measured-temp >
lowtemp-offset in a room for at least 1.5 hours after the last
desired-temp change.
FHEM optionally has an internal software buffer for FHT devices.
This buffer should prevent transmission errors. If there is no
confirmation for a given period, FHEM resends the command. You can
see the queued commands with list
<fht-device>.
See the fhtsoftbuffer,
retrycount and
minfhtbuffer attributes for details.
If a buffer is still in the softbuffer, it will be sent in the
following order: desired-temp,mode,report1,report2,
holiday1,holiday2,day-temp,night-temp, [all other commands]
Get
N/A
Attributes
dummy Note:It makes sense to define an FHT device even for an FHT8b,
else you will receive "unknown FHT device, please define one" message
for each FHT8b as the CUL is reporting the 8b valve messages. But you
should set the dummy attribute for these devices, else the internal FHT
buffer of the CUL will be filled with data for the 8b's which is never
consumed. If the buffer is full, you'll get "EOB" messages from the CUL,
and you cannot transmit any data to the 80b's
retrycount
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 1.
minfhtbuffer
FHEM won't 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).
lazy
If the lazy attribute is set, FHEM won't send commands to the FHT if
the current reading and the value to be set are already identical. This
may help avoiding conflicts with the max-1%-time-on-air rule in large
installations. Not set per default.
tmpcorr
Correct the temperature reported by the FHT by the value specified.
Note: only the measured-temp value reported by FHEM (used for logging)
will be modified.
ack can-xmit can-rcv ack2 start-xmit end-xmit
(only if the CUL is configured to transmit FHT protocol data)
FHT8V
Fhem can directly control FHT8V type valves via a CUL
device without an intermediate FHT. This paragraph documents one of the
building blocks, the other is the PID device.
Define
define <name> FHT8V <housecode> [IODev|FHTID]
<housecode> is a four digit hex number,
and must have the following relation to the housecode of the corresponding CUL
device:
given the CUL housecode as AABB, then this housecode must be
of the form CCBB, where CC is greater or equal to AA, but less then AA+8.
This form is chosen so that the CUL can update all FHT8V valve states
within 2 minutes.
<IODev> must be specified if the last defined CUL device
is not the one to use. Usually this is done voa the IODev attribute, but as the address checked is performed
at the definition, we must use an exception here.
As an alternative you can specify the FHTID of the assigned IODev device
(instead of the IODev itself), this method is needed if you are using FHT8V
through FHEM2FHEM.
Examples:
define wz FHT8V 3232
Set
set <name> valve <value;>
Set the valve to the given value (in percent, from 0 to 100).
set <name> pair
Pair the valve with the CUL.
set <name> decalc
Start a decalcifying cycle on the given valve
Get
get <name> valve
Read back the valve position from the CUL FHT buffer, and convert it to percent (from 0 to 100).
Note: this module requires the Device::SerialPort or Win32::SerialPort module
if the devices is connected via USB or a serial port.
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 IODev attribute.
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
Set
set FHZ <variable> [<value>]
where value is one of:
FHTcode
initFS20
initHMS
stopHMS
initfull
raw
open
reopen
close
time
Notes:
raw is used to send out "raw" FS20/FHT messages ("setters" only - no query messages!).
See message byte streams in FHEM/00_FHZ.pm and the doc directory for some examples.
In order to set the time of your FHT's, schedule this command every
minute: define fhz_timer at +*00:01:00 set FHZ time
See the verbose to prevent logging of
this command.
FHTcode is a two digit hex number (from 00 to 63?) and sets the
central FHT code, which is used by the FHT devices. After changing
it, you must reprogram each FHT80b with: PROG (until Sond
appears), then select CEnt, Prog, Select nA.
If the FHT ceases to work for FHT devices whereas other devices
(e.g. HMS, KS300) continue to work, a
set FHZ initfull
command could help. Try
set FHZ reopen
if the FHZ
ceases to work completely. If all else fails, shutdown fhem, unplug
and replug the FHZ device. Problems with FHZ may also be related to
long USB cables or insufficient power on the USB - use a powered hub
to improve this particular part of such issues.
See our USB page
for detailed USB / electromag. interference troubleshooting.
initfull issues the initialization sequence for the FHZ
device:
get FHZ init2
get FHZ serial
set FHZ initHMS
set FHZ initFS20
set FHZ time
set FHZ raw 04 01010100010000
reopen closes and reopens the serial device port. This
implicitly initializes the FHZ and issues the
initfull command sequence.
stopHMS probably is the inverse of initHMS
(I don't have authoritative info on what exactly it does).
close closes and frees the serial device port until you open
it again with open, e.g. useful if you need to temporarily
unload the ftdi_sio kernel module to use the bit-bang mode.
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.
loglevel Note:Deprecated! The module maintainer is encouraged to replace it
with verbose.
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.
On the other hand, if you have to debug a given device, setting its
loglevel to a smaller value than the value of the global verbose attribute,
it will output its messages normally seen only with higher global verbose
levels.
fhtsoftbuffer
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).
FLOORPLAN
Implements an additional entry "Floorplans" to your fhem menu, leading to a userinterface without fhem-menu, rooms or devicelists.
Devices can be displayed at a defined coordinate on the screen, usually with a clickable icon allowing to switch
the device on or off by clicking on it. A background-picture can be used - use e.g. a floorplan of your house, or any picture.
Use floorplanstyle.css to adapt the representation.
Step-by-step setup guides are available in
english and
german.
Define
define <name> FLOORPLAN
Hint: Store fp_<name>.png in your image folder (www/images/default , www/pgm2 or FHEM) to use it as background picture.
Example:
define Groundfloor FLOORPLAN
fp_Groundfloor.png
Set
N/A
Get
get <name> config
Displays the configuration of the floorplan with all attributes. Can be used in an include-file.
A userattr fp_<name> will be created automatically if it does not exist yet.
top = screen-position, pixels from top of screen
left = screen-position, pixels from left of screen
style =
0 icon/state only
1 devicename and icon/state
2 devicename, icon/state and commands
3 device-reading and optional description
4 S300TH-specific, displays temperature above humidity
5 icon/state and commands
6 device-reading, reading-timestamp and optional description
7 commands only
8 commands popup
description will be displayed instead of the original devicename
Examples:
attr lamp1 fp_Groundfloor 100,100
#display lamp1 with icon only at screenposition 100,100
attr lamp2 fp_Groundfloor 100,140,1,Art-Deco
#display lamp2 with description 'Art-Deco-Light' at 100,140
attr lamp2 fp_FirstFloor 130,100,1
#display the same device at different positions on other floorplans
attr myFHT fp_Groundfloor 300,20,10,Temperature
#display given Text + FHT-temperature
Hint: no blanks between parameters
fp_arrange
Activates the "arrange mode" which shows an additional menu on the screen to choose style and description.
When the arrange-mode is activated, devices can be placed freely on the screen by drag&drop.
allowing to place devices easily on the screen.
Example:
attr Groundfloor fp_arrange 1 attr Groundfloor fp_arrange WEB #activates arrange mode for frontend-device WEB only
stylesheet
Explicitely sets your personal stylesheet for the floorplan. This overrides the standard stylesheet.
The standard stylesheet for floorplans is floorplanstyle.css. If the stylesheetPrefix is set for the corresponding FHEMWEB instance, this same
stylesheetPrefix is also prepended to the stylesheet for floorplans.
All stylesheets must be stored in the stylesheet subfolder of the fhem filesystem hierarchy. Store your personal
stylesheet along with floorplanstyle.css in the same folder.
Example:
attr Groundfloor stylesheet myfloorplanstyle.css
fp_default
The floorplan startscreen is skipped if this attribute is assigned to one of the floorplans in your installation.
Example:
attr Groundfloor fp_default 1
fp_noMenu
Suppresses the menu which usually shows the links to all your floorplans.
Example:
attr Groundfloor fp_noMenu 1
commandfield
Adds a fhem-commandfield to the floorplan screen.
Example:
attr Groundfloor commandfield 1
fp_backgroundimg
Allows to choose a background-picture independent of the floorplan-name.
Example:
attr Groundfloor fp_backgroundimg foobar.png
fp_viewport
Allows usage of a user-defined viewport-value for touchpad.
Default-viewport-value is "width=768".
fp_roomIcons
Space separated list of floorplan:icon pairs, to assign icons
to the floorplan-menu, just like the functionality for rooms
in FHEMWEB. Example:
attr Grundriss fp_roomIcons Grundriss:control_building_empty Media:audio_eq
Provides a device to display arbitrary content on a linux framebuffer device
You need to have the perl module GD installed. This module is most likely not
available for small systems like Fritz!Box.
FRAMEBUFFER uses RSS to create an image that is displayed on the framebuffer.
The binary program fbvs is required to display the image. You can download it from github.
Defines a framebuffer device. <framebuffer_device_name> is the name of the linux
device file for the kernel framebuffer device, e.g. /dev/fb1 or /dev/fb0.
Examples:
define display FRAMEBUFFER /dev/fb1 define TV FRAMEBUFFER /dev/fb0
Set
set <name> absLayoutNo <number>
A list of layout files can be defined with attr layoutList, see below.
This command selects the layout with the given number from this list and displays it.
This can e.g. be useful if bound to a key of a remote control to display a specific layout.
set <name> layoutFilename <name> [<timeout in seconds>]
Displays the image described by the layout in file <name>. If <name> is an absolute path
name it is used as is to access the file. Otherwise the attribute <layoutBasedir> is prepended to
the <name>.
If a timeout is given, the image is only displayed for timeout seconds before the previously displayed image
is displayed again.
Useful for displaying an image only for a certain time after an event has occured.
set <name> relLayoutNo <number>
Like absLayoutNo this displays a certain image from the layoutList. Here <number> is added to the current
layout number.
So set <name> relLayoutNo 1
displays the next image from the list while set <name> relLayoutNo -1
displays the previous one.
Useful if bound to a next/previous key on a remote control to scroll through all defined layouts.
set <name> updateDisplay
Refreshes the display defined by the currently active layout.
Attributes
size <width>x<height>
The dimensions of the display in pixels.
Images will generated using this size. If the size is greater than the actual display
size they will be scaled to fit. As this requires computing performance it should be avoided by
defining the size to match the display size.
Example attr <name> size 128x160
layoutBasedir <directory name>
Directory that contains the layout files. If a layout filename is specified using a relative path
layoutBasedir will be prepended before accessing the file.
Example attr <name> layoutBasedir /opt/fhem/layouts
layoutList <file1> [<file2>] ... Space separated list of layout files.
These will be used by absLayoutNo and relLayoutNo.
layoutBasedir will be prepended to each file if it is a relative path.
Example attr <name> layoutList standard.txt wetter.txt schalter.txt
update_interval <interval> Update interval in minutes.
The currently displayed layout will be refreshed every <interval> minutes. The first
interval will be scheduled to the beginning of the next minute to help create an accurate
time display.
Example attr <name> update_interval 1
debugFile <file>
Normally the generated image isn't written to a file. To ease debugging of layouts the generated image is written to the
filename specified by this attribute.
This attribute shouldn't be set during normal operation.
startLayoutNo <number>
The number of the layout to be displayed on startup of the FRAMEBUFFER device.
bgcolor <color> Sets the background color. <color> is
a 6-digit hex number, every 2 digits determining the red, green and blue
color components as in HTML color codes (e.g.FF0000 for red, C0C0C0 for light gray).
enableCmd <fhem cmd>
if set this command is executed before a layout with a timeout is displayed. This can e.g. be used to enable a backlight.
disableCmd <fhem cmd>
if set this command is executed after a layout with a timeout has expired. This can e.g. be used to disable a backlight.
Usage information
This module requires the binary program fbvs to be installed in /usr/local/bin and it must be executable
by user fhem.
fbvs (framebuffer viewer simple) is a stripped down version of fbv that can only display png images. It reads
the image from stdin, displays it on the framebuffer and terminates afterwards.
This module generates a png image based on a layout description internally and then pipes it to fbvs for display.
Layout definition
FRAMEBUFFER uses the same layout definition as RSS. In fact FRAMEBUFFER calls RSS to generate an image.
Controls some features of a Fritz!Box router. Connected Fritz!Fon's (MT-F, MT-D, C3, C4) can be used as
signaling devices. MP3 files and Text2Speech can be played as ring tone or when calling phones.
For detail instructions, look at and please maintain the FHEM-Wiki.
The modul switches in local mode if FHEM runs on a Fritz!Box (as root user!). Otherwise, it tries to open a web or telnet connection to "fritz.box", so telnet (#96*7*) has to be enabled on the Fritz!Box. For remote access the password must once be set.
The box is partly controlled via the official TR-064 interface but also via undocumented interfaces between web interface and firmware kernel. The modul works best with Fritz!OS 6.24. AVM has removed internal interfaces from later Fritz!OS versions without replacement. For these versions, some modul functions are hence restricted or do not work at all (see remarks to required API).
The modul was tested on Fritz!Box 7390 and 7490 with Fritz!OS 6.20 and higher.
Check also the other Fritz!Box moduls: SYSMON and FB_CALLMONITOR.
The modul uses the Perl modul 'Net::Telnet', 'JSON::XS', 'LWP', 'SOAP::Lite' for remote access.
Define
define <name> FRITZBOX [host]
The attribute host is the web address (name or IP) of the Fritz!Box. If it is missing, the modul switches in local mode or uses the default host address "fritz.box".
Example: define Fritzbox FRITZBOX
The FritzOS has a hidden function (easter egg).
define MyEasterEgg weblink htmlCode { FRITZBOX_fritztris("Fritzbox") }
Set
set <name> alarm <number> [on|off] [time] [once|daily|Mo|Tu|We|Th|Fr|Sa|So]
Switches the alarm number (1, 2 or 3) on or off (default is on). Sets the time and weekday. If no state is given it is switched on.
Requires the API: Telnet or webcm.
set <name> call <number> [duration] [say:text|play:MP3URL]
Calls for 'duration' seconds (default 60) the given number from an internal port (default 1 or attribute 'ringWithIntern'). If the call is taken a text or sound can be played as music on hold (moh). The internal port will also ring.
set <name> checkAPIs
Restarts the initial check of the programming interfaces of the FRITZ!BOX.
set <name> customerRingTone <internalNumber> <fullFilePath>
Uploads the file fullFilePath on the given handset. Only mp3 or G722 format is allowed.
The file has to be placed on the file system of the fritzbox.
The upload takes about one minute before the tone is available.
set <name> dect <on|off>
Switches the DECT base of the box on or off. Requires the API: Telnet or webcm.
set <name> diversity <number> <on|off>
Switches the call diversity number (1, 2 ...) on or off.
A call diversity for an incoming number has to be created with the Fritz!Box web interface. Requires the API: Telnet or webcm.
Note! The Fritz!Box allows also forwarding in accordance to the calling number. This is not included in this feature.
set <name> guestWLAN <on|off>
Switches the guest WLAN on or off. The guest password must be set. If necessary, the normal WLAN is also switched on.
set <name> moh <default|sound|customer> [<MP3FileIncludingPath|say:Text>]
Example: set fritzbox moh customer say:Die Wanne ist voll set fritzbox moh customer /var/InternerSpeicher/warnung.mp3
Changes the 'music on hold' of the Box. The parameter 'customer' allows to upload a mp3 file. Alternatively a text can be spoken with "say:". The music on hold has always a length of 8.2 s. It is played continousely during the broking of calls or if the modul rings a phone and the call is taken. So, it can be used to transmit little messages of 8 s.
set <name> password <password>
Stores the password for remote telnet access.
set <name> ring <intNumbers> [duration [ringTone]] [show:Text] [say:Text | play:MP3URL]
Example:
set fritzbox ring 611,612 5 Budapest show:It is raining set fritzbox ring 611 say:(en)It is raining set fritzbox ring 610 play:http://raspberrypi/sound.mp3
Rings the internal numbers for "duration" seconds and (on Fritz!Fons) with the given "ring tone" name.
Different internal numbers have to be separated by a comma (without spaces).
Default duration is 5 seconds. Default ring tone is the internal ring tone of the device.
Ring tone will be ignored for collected calls (9 or 50).
If the attribute 'ringWithIntern' is specified, the text behind 'show:' will be shown as the callers name.
Maximal 30 characters are allowed.
On Fritz!Fons the parameter 'say:' can be used to let the phone speak a message (max. 100 characters).
Alternatively a MP3 link can be played with 'play:'. This creates the internet radio station 'FHEM' and uses translate.google.com for text2speech. It will always play the complete text/sound. It will than ring with standard ring tone until the end of the 'ring duration' is reached.
If the call is taken the callee hears the "music on hold" which can also be used to transmit messages.
set <name> sendMail [to:<Address>] [subject:<Subject>] [body:<Text>]
Sends an email via the email notification service that is configured in push service of the Fritz!Box.
Use "\n" for line breaks in the body.
All parameters can be omitted. Make sure the messages are not classified as junk by your email client.
Requires Telnet access to the box.
set <name> startRadio <internalNumber> [name or number]
Plays the internet radio on the given Fritz!Fon. Default is the current ring tone radio station of the phone.
So, not the station that is selected at the handset.
An available internet radio can be selected by its name or (reading) number.
set <name> tam <number> <on|off>
Switches the answering machine number (1, 2 ...) on or off.
The answering machine has to be created on the Fritz!Box web interface.
set <name> update
Starts an update of the device readings.
set <name> wlan <on|off>
Switches WLAN on or off.
Get
get <name> ringTones
Shows the list of ring tones that can be used.
get <name> shellCommand <Command>
Runs the given command on the Fritz!Box shell and returns the result.
Can be used to run shell commands not included in this modul.
Only available if the attribute "allowShellCommand" is set.
get <name> tr064Command <service> <control> <action> [[argName1 argValue1] ...]
Executes TR-064 actions (see API description of AVM)
Example: get Fritzbox tr064Command X_AVM-DE_OnTel:1 x_contact GetDECTHandsetInfo NewDectID 1
Only available if the attribute "allowTR064Command" is set.
get <name> tr064ServiceListe
Shows a list of TR-064 services and actions that are allowed on the device.
Attributes
allowShellCommand <0 | 1>
Enables the get command "shellCommand"
allowTR064Command <0 | 1>
Enables the get command "tr064Command"
boxUser <user name>
User name that is used for TR064 or other web based access. By default no user name is required to login.
If the Fritz!Box is configured differently, the user name has to be defined with this attribute.
defaultCallerName <Text>
The default text to show on the ringing phone as 'caller'.
This is done by temporarily changing the name of the calling internal number during the ring.
Maximal 30 characters are allowed. The attribute "ringWithIntern" must also be specified.
defaultUploadDir <fritzBoxPath>
This is the default path that will be used if a file name does not start with / (slash).
It needs to be the name of the path on the Fritz!Box. So, it should start with /var/InternerSpeicher if it equals in Windows \\ip-address\fritz.nas
forceTelnetConnection <0 | 1>
Always use telnet for remote access (instead of access via the WebGUI or TR-064).
This attribute should be enabled for older boxes/firmwares.
fritzBoxIP <IP Address>
Depreciated.
INTERVAL <seconds>
Polling-Interval. Default is 300 (seconds). Smallest possible value is 60.
m3uFileLocal </path/fileName>
Can be used as a work around if the ring tone of a Fritz!Fon cannot be changed because of firmware restrictions (missing telnet or webcm).
How it works: If the FHEM server has also a web server running, the FritzFon can play a m3u file from this web server as an internet radio station.
For this an internet radio station on the FritzFon must point to the server URL of this file and the internal ring tone must be changed to that station.
If the attribute is set, the server file "m3uFileLocal" (local address of the FritzFon URL) will be filled with the URL of the text2speech engine (say:) or a MP3-File (play:). The FritzFon will then play this URL.
telnetUser <user name>
User name that is used for telnet access. By default no user name is required to login.
If the Fritz!Box is configured differently, the user name has to be defined with this attribute.
ringWithIntern <1 | 2 | 3>
To ring a fon a caller must always be specified. Default of this modul is 50 "ISDN:Wählhilfe".
To show a message (default: "FHEM") during a ring the internal phone numbers 1-3 can be specified here.
The concerned analog phone socket must exist.
telnetTimeOut <seconds>
Maximal time to wait for an answer during a telnet session. Default is 10 s.
A single FRM device can serve multiple FRM-clients.
Clients of FRM are:
FRM_IN for digital input FRM_OUT for digital out FRM_AD for analog input FRM_PWM for analog output (pulse_width_modulated) FRM_RGB control multichannel/RGB-LEDs by pwm FRM_SERVO for pwm-controled servos as being used in modelmaking FRM_LCD output text to LCD attached via I2C FRM_I2C to read data from integrated circutes attached
to Arduino supporting the
i2c-protocol. OWX to read/write sensors and actors on 1-Wire bus.
Each client stands for a Pin of the Arduino configured for a specific use
(digital/analog in/out) or an integrated circuit connected to Arduino by i2c.
Note: this module is based on Device::Firmata module (perl-firmata).
perl-firmata is included in FHEM-distributions lib-directory. You can download the latest version as a single zip file from github.
Note: this module may require the Device::SerialPort or Win32::SerialPort
module if you attach the device via USB and the OS sets strange default
parameters for serial devices.
<device> specifies the serial port to communicate with the Arduino.
The name of the serial-device depends on your distribution, under
linux the cdc_acm kernel module is responsible, and usually a
/dev/ttyACM0 device will be created. If your distribution does not have a
cdc_acm module, you can force usbserial to handle the Arduino by the
following command: modprobe usbserial vendor=0x03eb product=0x204b
In this case the device is most probably /dev/ttyUSB0.
You can also specify a baudrate if the device name contains the @
character, e.g.: /dev/ttyACM0@38400
If the baudrate is "directio" (e.g.: /dev/ttyACM0@directio), then the
perl module Device::SerialPort is not needed, and fhem opens the device
with simple file io. This might work if the operating system uses sane
defaults for the serial parameters, e.g. some Linux distributions and
OSX.
The Arduino has to run either 'StandardFirmata' or 'ConfigurableFirmata'.
StandardFirmata supports Digital and Analog-I/O, Servo and I2C. In addition
to that ConfigurableFirmata supports 1-Wire, Stepper-motors and allows to
connect via ethernet in client mode.
You can find StandardFirmata in the Arduino-IDE under 'Examples->Firmata->StandardFirmata
<port> specifies the port the FRM device listens on. If global is
specified the socket is bound to all local ip-addresses, otherwise to localhost
only.
The Arduino must ConfigurableFirmata. The connection is initiated by the arduino
in client-mode. Therefor the ip-address and port of the fhem-server has to be
configured an the arduino, so it knows where to connect to.
As of now only a single Arduino per FRM-device configured is supported. Multiple
Arduinos may connect to different FRM-devices configured for different ports.
ConfigurableFirmata has to be installed manualy. See
ConfigurableFirmata on GitHub or FHEM-Wiki
If the device is called none, then no device will be opened, so you
can experiment without hardware attached.
Set
set <name> init
reinitializes the FRM-Client-devices configured for this Arduino
set <name> reset
does a complete reset of FRM by disconnecting from, reconnecting to and reinitializing the Arduino and FRM internals and all attached FRM-client-devices
Attributes
i2c-config
Configure the arduino for ic2 communication. This will enable i2c on the
i2c_pins received by the capability-query issued during initialization of FRM.
As of Firmata 2.3 you can set a delay-time (in microseconds) that will be inserted into i2c
protocol when switching from write to read.
See: Firmata Protocol details about I2C
represents a pin of an Arduino running Firmata
configured for analog input.
The value read is stored in reading 'state'. Range is from 0 to 1023 (10 Bit)
Requires a defined FRM-device to work.
Define
define <name> FRM_AD <pin>
Defines the FRM_AD device. <pin> is the arduino-pin to use.
Set
N/A
Get
reading
returns the voltage-level read on the arduino-pin. Values range from 0 to 1023.
alarm-upper-threshold
returns the current state of 'alarm-upper-threshold'. Values are 'on' and 'off' (Defaults to 'off')
'alarm-upper-threshold' turns 'on' whenever the 'reading' is higher than the attribute 'upper-threshold'
it turns 'off' again as soon 'reading' falls below 'alarm-upper-threshold'
alarm-lower-threshold
returns the current state of 'alarm-lower-threshold'. Values are 'on' and 'off' (Defaults to 'off')
'alarm-lower-threshold' turns 'on' whenever the 'reading' is lower than the attribute 'lower-threshold'
it turns 'off' again as soon 'reading rises above 'alarm-lower-threshold'
state
returns the 'state' reading
Attributes
upper-threshold
sets the 'upper-threshold'. Whenever the 'reading' exceeds this value 'alarm-upper-threshold' is set to 'on'
As soon 'reading' falls below the 'upper-threshold' 'alarm-upper-threshold' turns 'off' again
Defaults to 1024.
lower-threshold
sets the 'lower-threshold'. Whenever the 'reading' falls below this value 'alarm-lower-threshold' is set to 'on'
As soon 'reading' rises above the 'lower-threshold' 'alarm-lower-threshold' turns 'off' again
Defaults to -1.
IODev
Specify which FRM to use. (Optional, only required if there is more
than one FRM-device defined.)
represents an integrated curcuit connected to the i2c-pins of an Arduino
running Firmata
Requires a defined FRM-device to work.
this FRM-device has to be configures for i2c by setting attr 'i2c-config' on the FRM-device
it reads out the ic-internal storage in intervals of 'sampling-interval' as set on the FRM-device
Define
define <name> FRM_I2C <i2c-address> <register> <bytes-to-read>
Specifies the FRM_I2C device.
i2c-address is the (device-specific) address of the ic on the i2c-bus
register is the (device-internal) address to start reading bytes from.
bytes-to-read is the number of bytes read from the ic
Set
N/A
Get
N/A
Attributes
IODev
Specify which FRM to use. (Optional, only required if there is more
than one FRM-device defined.)
represents a pin of an Arduino running Firmata
configured for digital input.
The current state of the arduino-pin is stored in reading 'state'. Values are 'on' and 'off'.
Requires a defined FRM-device to work.
Define
define <name> FRM_IN <pin>
Defines the FRM_IN device. <pin>> is the arduino-pin to use.
Set
alarm on|off
set the alarm to on or off. Used to clear the alarm.
The alarm is set to 'on' whenever the count reaches the threshold and doesn't clear itself.
Get
reading
returns the logical state of the arduino-pin. Values are 'on' and 'off'.
count
returns the current count. Contains the number of toggles of the arduino-pin.
Depending on the attribute 'count-mode' every rising or falling edge (or both) is counted.
alarm
returns the current state of 'alarm'. Values are 'on' and 'off' (Defaults to 'off')
'alarm' doesn't clear itself, has to be set to 'off' eplicitly.
state
returns the 'state' reading
Attributes
activeLow <yes|no>
count-mode none|rising|falling|both
Determines whether 'rising' (transitions from 'off' to 'on') of falling (transitions from 'on' to 'off')
edges (or 'both') are counted. Defaults to 'none'
count-threshold <number>
sets the theshold-value for the counter. Whenever 'count' reaches the 'count-threshold' 'alarm' is
set to 'on'. Use 'set alarm off' to clear the alarm.
reset-on-threshold-reached yes|no
if set to 'yes' reset the counter to 0 when the threshold is reached (defaults to 'no').
internal-pullup on|off
allows to switch the internal pullup resistor of arduino to be en-/disabled. Defaults to off.
IODev
Specify which FRM to use. (Optional, only required if there is more
than one FRM-device defined.)
represents a pin of an Arduino running Firmata
configured for analog output.
The value set will be output by the specified pin as a pulse-width-modulated signal.
Requires a defined FRM-device to work.
Define
define <name> FRM_PWM <pin>
Defines the FRM_PWM device. <pin>> is the arduino-pin to use.
allows to drive LED-controllers and other multichannel-devices that use PWM as input by an Arduino running Firmata
The value set will be output by the specified pins as pulse-width-modulated signals.
Requires a defined FRM-device to work.
Define
define <name> FRM_RGB <pin> <pin> <pin> [pin...]
Defines the FRM_RGB device. <pin>> are the arduino-pin to use.
For rgb-controlled devices first pin drives red, second pin green and third pin blue.
Set
set <name> on
sets the pulse-width of all configured pins to 100%
set <name> off
sets the pulse-width of all configured pins to 0%
set <name> toggle
toggles in between the last dimmed value, 0% and 100%. If no dimmed value was set before defaults to pulsewidth 50% on all channels
set <name> rgb <value>
sets the pulse-width of all channels at once. Also sets the value toggle can switch to
Value is encoded as hex-string, 2-digigs per channel (e.g. FFFFFF for reguler rgb)
set <name> pct <value>
dims all channels at once while leving the ratio in between the channels unaltered.
Range is 0-100 ('pct' stands for 'percent')
set <name> dimUp
dims up by 10%
set <name> dimDown
dims down by 10%
Get
get <name> rgb
returns the values set for all channels. Format is hex, 2 nybbles per channel.
get <name> RGB
returns the values set for all channels in normalized format. Format is hex, 2 nybbles per channel.
Values are scaled such that the channel with the highest value is set to FF. The real values are calculated
by multipying each byte with the value of 'pct'.
get <name> pct
returns the value of the channel with the highest value scaled to the range of 0-100 (percent).
Attributes
restoreOnStartup <on|off>
restoreOnReconnect <on|off>
IODev
Specify which FRM to use. (Optional, only required if there is more
than one FRM-device defined.)
represents a rotary-encoder attached to two pins of an Arduino running Firmata
Requires a defined FRM-device to work.
Define
define <name> FRM_ROTENC <pinA> <pinB> [id]
Defines the FRM_ROTENC device. <pinA>> and <pinA>> are the arduino-pins to use.
[id] is the instance-id of the encoder. Must be a unique number per FRM-device (rages from 0-4 depending on Firmata being used, optional if a single encoder is attached to the arduino).
Set
reset
resets to value of 'position' to 0
offset <value>
set offset value of 'position'
Get
position
returns the position of the rotary-encoder attached to pinA and pinB of the arduino
the 'position' is the sum of 'value' and 'offset'
offset
returns the offset value
on shutdown of fhem the latest position-value is saved as new offset.
value
returns the raw position value as it's reported by the rotary-encoder attached to pinA and pinB of the arduino
this value is reset to 0 whenever Arduino restarts or Firmata is reinitialized
Attributes
IODev
Specify which FRM to use. (Optional, only required if there is more
than one FRM-device defined.)
represents a pin of an Arduino running Firmata
configured to drive a pwm-controlled servo-motor.
The value set will be drive the shaft of the servo to the specified angle. see Servo.write for values and range
Requires a defined FRM-device to work.
Define
define <name> FRM_SERVO <pin>
Defines the FRM_SERVO device. <pin>> is the arduino-pin to use.
Set
set <name> angle <value> sets the angle of the servo-motors shaft to the value specified (in degrees).
Get
N/A
Attributes
IODev
Specify which FRM to use. (Optional, only required if there is more
than one FRM-device defined.)
min-pulse
sets the minimum puls-width to use. Defaults to 544. For most servos this translates into a rotation of 180° counterclockwise.
max-pulse
sets the maximum puls-width to use. Defaults to 2400. For most servos this translates into a rotation of 180° clockwise
[DRIVER|TWO_WIRE|FOUR_WIRE] defines the control-sequence being used to drive the motor.
DRIVER: motor is attached via a smart circuit that is controlled via two lines: 1 line defines the direction to turn, the other triggers one step per impluse.
FOUR_WIRE: motor is attached via four wires each driving one coil individually.
TWO_WIRE: motor is attached via two wires. This mode makes use of the fact that at any time two of the four motor
coils are the inverse of the other two so by using an inverting circuit to drive the motor the number of control connections can be reduced from 4 to 2.
The sequence of control signals for 4 control wires is as follows:
The sequence of controls signals for 2 control wires is as follows:
(columns C1 and C2 from above):
Step C0 C1
1 0 1
2 1 1
3 1 0
4 0 0
If your stepper-motor does not move or does move but only in a single direction you will have to rearrage the pin-numbers to match the control sequence.
that can be archived either by rearranging the physical connections, or by mapping the connection to the pin-definitions in FRM_STEPPERS define:
e.g. the widely used cheap 28byj-48 you can get for few EUR on eBay including a simple ULN2003 driver interface may be defined by define stepper FRM_STEPPER FOUR_WIRE 7 5 6 8 64 0
when being connected to the arduio with: motor pin1 <-> arduino pin5
motor pin2 <-> arduino pin6
motor pin3 <-> arduino pin7
motor pin4 <-> arduino pin8
motor pin5 <-> ground
Set
set <name> reset
resets the reading 'position' to 0 without moving the motor
set <name> position <position> [speed] [acceleration] [deceleration]
moves the motor to the absolute position specified. positive or negative integer
speed (10 * revolutions per minute, optional), defaults to 30, higher numbers are faster) At 2048 steps per revolution (28byj-48) a speed of 30 results in 3 rev/min
acceleration and deceleration are optional.
set <name> step <stepstomove> [speed] [accel] [decel]
moves the motor the number of steps specified. positive or negative integer
speed, accelleration and deceleration are optional.
Get
N/A
Attributes
restoreOnStartup <on|off>
restoreOnReconnect <on|off>
IODev
Specify which FRM to use. (Optional, only required if there is more
than one FRM-device defined.)
This module provides a generic way to modify the contents of a file with Readings of other devices or the result of Perl expressions.
The typical use case is a custom designed SVG graphics template file which contains place holders that will be replaced with actual values.
The resulting SVG file can then optionally be converted to a PNG file which can be used as an online screensaver for Kindle devices for example.
The module reads the given InputFile every Interval seconds, replaces strings with the results of expressions as defined in attributes and writes the result to the OutputFile
Specify pairs of attr FxxRegex and attr FxxReading or attr FxxExpr to define which strings / placeholders in the InputFile should be replaced with which redings / expressions
If you want to convert a resulting SVG file to a PNG e.g. for use as online screen saver on a Kindle device,
you have to specify the external conversion command with the attribute PostCommand, for Example:
If you want to convert the replacement text from Readings to UTF8, e.g. to make special characters / umlauts display correctly, specify
attr fr ReplacementEncode UTF-8
Set-Commands
ReplaceNow
starts a replace without waiting for the interval
Get-Commands
none
Readings
LastUpdate
Date / Time of the last update of the output file / image. This reading is formatted with strftime and the default format string is "%d.%m.%Y %T". This can be changed with the attribute LUTimeFormat.
Attributes
Rep[0-9]+Regex
defines the regex to be used for finding the right string to be replaced with the corresponding Reading / Expr result
Rep[0-9]+Reading
defines a device and reading to be used as replacement value. It is specified as devicename:readingname:default_value.
The default_value is optional and defaults to 0. If the reading doesn't exist, default_value is used.
Rep[0-9]+MaxAge
this can optionally be used together with RepReading to define a maximum age of the reading. It is specified as seconds:replacement. If the corresponding reading has not been updated for the specified number of seconds, then the replacement is used instead of the reading to do the replacement and further RepExpr or RepFormat attributes will be ignored for this value
If you specify the replacement as {expr} then it is evaluated as a perl expression instead of a string.
Rep[0-9]+MinValue
this can optionally be used together with RepReading to define a minimum value of the reading. It is specified as min:replacement. If the corresponding reading is too small, then the replacement string is used instead of the reading to do the replacement and further RepExpr or RepFormat attributes will be ignored for this value
If you specify the replacement as {expr} then it is evaluated as a perl expression instead of a string.
Rep[0-9]+MaxValue
this can optionally be used together with RepReading to define a maximum value of the reading. It is specified as max:replacement. If the corresponding reading is too big, then the replacement string is used instead of the reading to do the replacement and further RepExpr or RepFormat attributes will be ignored for this value
If you specify the replacement as {expr} then it is evaluated as a perl expression instead of a string.
Rep[0-9]+Expr
defines an optional expression that can be used to compute the replacement value. If RepExpr is used together with RepReading then the expression is evaluated after getting the reading and the value of the reading can be used in the expression as $replacement.
If only RepExpr is specified then readings can be retrieved with the perl function ReadingsVal() inside the expression.
If neither RepExpr nor RepReading is specified then the match for the correspondig regex will be replaced with an empty string.
Rep[0-9]+Format
defines an optional format string to be used in a sprintf statement to format the replacement before it is applied.
Can be used with RepReading or RepExpr or both.
LUTimeFormat
defines a time format string (see Posix strftime format) to be used when creating the reading LastUpdate.
PostCommand
Execute an external command after writing the output file, e.g. to convert a resulting SVG file to a PNG file.
For an eInk Kindle you need a PNG in 8 bit greyscale format. A simple example to call the convert utility from ImageMagick would be attr fr PostCommand convert /opt/fhem/www/images/status.svg
-type GrayScale -depth 8 /opt/fhem/www/images/status.png 2>/dev/null &
a more advanced example that starts inkscape before Imagemagick to make sure that embedded Icons in a SVG file are converted
correctly could be attr fr PostCommand bash -c 'inkscape /opt/fhem/www/images/status.svg -e=tmp.png;; convert tmp.png -type GrayScale -depth 8 /opt/fhem/www/images/status.png' >/dev/null 2>&1 &
or even attr fr PostCommand bash -c 'inkscape /opt/fhem/www/images/status.svg -e=tmp.png -b=rgb\(255,255,255\) --export-height=1024 --export-width=758;; convert tmp.png -type GrayScale -depth 8 /opt/fhem/www/images/status.png' >/dev/null 2>&1 &
Inkscape might be needed because ImageMagick seems to have problems convertig SVG files with embedded icons. However a PNG file created by Inkscape is not in 8 bit greyscale so Imagemagick can be run after Inkscape to convert to 8 bit greyscale
ReplacementEncode
defines an encoding to apply to the replacement string, e.g. UTF-8
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.
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
address 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 address must be FF if
defined as hex value or 4444 if defined as ELV4 value.
dim06% dim12% dim18% dim25% dim31% dim37% dim43% dim50%
dim56% dim62% dim68% dim75% dim81% dim87% dim93% dim100%
dimdown
dimup
dimupdown
off
off-for-timer
on # dimmer: set to value before switching it off
on-for-timer # see the note
on-old-for-timer # set to previous (before switching it on)
ramp-on-time # time to reach the desired dim value on dimmers
ramp-off-time # time to reach the off state on dimmers
reset
sendstate
timer
toggle # between off and previous dim val
set lamp on set lamp1,lamp2,lamp3 on set lamp1-lamp3 on set lamp on-for-timer 12
Notes:
Use reset with care: the device forgets even the housecode.
As the FS20 protocol needs about 0.22 seconds to transmit a
sequence, a pause of 0.22 seconds is inserted after each command.
The FS20ST switches on for dim*%, dimup. It does not respond to
sendstate.
If the timer is set (i.e. it is not 0) then on, dim*,
and *-for-timer will take it into account (at least by the FS20ST).
The time argument ranges from 0.25sec to 4 hours and 16
minutes. As the time is encoded in one byte there are only 112
distinct values, the resolution gets coarse with larger values. The
program will report the used timeout if the specified one cannot be
set exactly. The resolution is 0.25 sec from 0 to 4 sec, 0.5 sec
from 4 to 8 sec, 1 sec from 8 to 16 sec and so on. If you need better
precision for large values, use at which has a 1
sec resolution.
Get
N/A
Attributes
IODev
Set the IO or physical device which should be used for sending signals
for this "logical" device. An example for the physical device is an FHZ
or a CUL. Note: Upon startup FHEM assigns each logical device
(FS20/HMS/KS300/etc) the last physical device which can receive data
for this type of device. The attribute IODev needs to be used only if
you attached more than one physical device capable of receiving signals
for this logical device.
eventMap
Replace event names and set arguments. The value of this attribute
consists of a list of space separated values, each value is a colon
separated pair. The first part specifies the "old" value, the second
the new/desired value. If the first character is slash(/) or komma(,)
then split not by space but by this character, enabling to embed spaces.
Examples:
attr store eventMap on:open off:closed
attr store eventMap /on-for-timer 10:open/off:closed/
set store open
dummy
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.
follow-on-for-timer
schedule a "setstate off;trigger off" for the time specified as argument to
the on-for-timer command. Or the same with on, if the command is
off-for-timer.
follow-on-timer
Like with follow-on-for-timer schedule a "setstate off;trigger off", but
this time for the time specified as argument in seconds to this attribute.
This is used to follow the pre-programmed timer, which was set previously
with the timer command or manually by pressing the button on the device,
see your manual for details.
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:
ignore
Ignore this device, e.g. if it belongs to your neighbour. The device
won't trigger any FileLogs/notifys, issued commands will silently
ignored (no RF signal will be sent out, just like for the dummy attribute). The device won't appear in the
list command (only if it is explicitely asked for it), nor will it
appear in commands which use some wildcard/attribute as name specifiers
(see devspec). You still get them with the
"ignored=1" special devspec.
The regexp will be checked against the device name
devicename:event or timestamp:devicename:event combination.
The regexp must match the complete string, not just a part of it.
<filename> may contain %-wildcards of the
POSIX strftime function of the underlying OS (see your strftime manual).
Common used wildcards are:
%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)
%W week number of year with Monday as first day of week (00..53)
FHEM also replaces %L by the value of the global logdir attribute.
Before using %V for ISO 8601 week numbers check if it is
correctly supported by your system (%V may not be replaced, replaced by an
empty string or by an incorrect ISO-8601 week number, especially
at the beginning of the year)
If you use %V you will also have to use %G
instead of %Y for the year!
If readonly is specified, then the file is used only for visualisation, and
it is not opened for writing.
Examples:
define lamplog FileLog %L/lamp.log lamp define wzlog FileLog ./log/wz-%Y-%U.log
wz:(measured-temp|actuator).*
With ISO 8601 week numbers, if supported: define wzlog FileLog ./log/wz-%G-%V.log
wz:(measured-temp|actuator).*
Set
reopen
Reopen a FileLog after making some manual changes to the
logfile.
addRegexpPart <device> <regexp>
add a regexp part, which is constructed as device:regexp. The parts
are separated by |. Note: as the regexp parts are resorted, manually
constructed regexps may become invalid.
removeRegexpPart <re>
remove a regexp part. Note: as the regexp parts are resorted, manually
constructed regexps may become invalid.
The inconsistency in addRegexpPart/removeRegexPart arguments originates
from the reusage of javascript functions.
absorb secondFileLog
merge the current and secondFileLog into one file, add the regexp of the
secondFileLog to the current one, and delete secondFileLog.
This command is needed to create combined plots (weblinks). Notes:
secondFileLog will be deleted (i.e. the FHEM definition).
only the current files will be merged.
weblinks using secondFilelog will become broken, they have to be
adopted to the new logfile or deleted.
Get
get <name> <infile> <outfile> <from>
<to> <column_spec>
Read data from the logfile, used by frontends to plot data without direct
access to the file.
<infile>
Name of the logfile to open. Special case: "-" is the currently active
logfile, "CURRENT" opens the file corresponding to the "from"
parameter.
<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 number.
<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 is set, then nrarchive old
logfiles are kept along the current one while older ones are moved to
archivedir (or deleted if archivedir is not set).
Note: setting these attributes for the global instance will effect the
FHEM logfile only.
archiveCompress
If nrarchive, archivedir and archiveCompress is set, then the files
in the archivedir will be compressed.
createGluedFile
If set (to 1), and the SVG-Plot requests a time-range wich is stored
in two files, a temporary file with the content of both files will be
created, in order to satisfy the request.
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 fslog FileLog log/fs20dev-%Y-%U.log fs20dev
fht
Plots the measured-temp/desired-temp/actuator lines. The
corresponding filelog definitions (for the FHT device named
fht1) looks like: define fhtlog1 FileLog log/fht1-%Y-%U.log fht1:.*(temp|actuator).*
temp4rain10
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 ks300log FileLog log/fht1-%Y-%U.log ks300:.*H:.*
hum6wind8
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.
reformatFn
used to convert "foreign" logfiles for the SVG Module, contains the name(!)
of a function, which will be called with a "raw" line from the original
file, and has to return a line in "FileLog" format.
E.g. to visualize the NTP loopstats, set reformatFn to ntpLoopstats, and
copy the following into your 99_myUtils.pm:
sub
ntpLoopstats($)
{
my ($d) = @_;
return $d if($d !~ m/^(\d{5}) (\d+)\.(\d{3}) (.*)$/);
my ($r, $t) = ($4, FmtDateTime(($1-40587)*86400+$2));
$t =~ s/ /_/;
return "$t ntpLoopStats $r";
}
GDS
Prerequesits
Module uses following additional Perl modules:
Net::FTP, XML::Simple
If not already installed in your environment,
please install them using appropriate commands from your environment.
Define
define <name> GDS <username> <password> [<host>]
This module provides connection to GDS service
generated by DWD
Optional paramater host is used to overwrite default host "ftp-outgoing2.dwd.de".
Set-Commands
set <name> clear alerts|conditions|forecasts|all
alerts: Delete all a_* readings
all: Delete all a_*, c_*, g_* and fc_* readings
set <name> conditions <stationName>
Retrieve current conditions at selected station. Data will be updated periodically.
set <name> forecasts <region>/<stationName>
Retrieve forecasts for today and the following 3 days for selected station.
Data will be updated periodically.
set <name> help
Show a help text with available commands
set <name> update
Update conditions and forecasts readings at selected station and restart update-timer
condition readings generated by SET use prefix "c_"
forecast readings generated by SET use prefix "fcd_" and a postfix of "hh"
with d=relative day (0=today) and hh=last hour of forecast (exclusive)
readings generated by SET will be updated automatically every 20 minutes
Get-Commands
get <name> alerts <region>
Retrieve alert message for selected region from previously read alert file (see rereadcfg)
get <name> conditions <stationName>
Retrieve current conditions at selected station
get <name> forecasts <region>
Retrieve forecasts for today and the following 3 days for selected region as text
get <name> conditionsmap <region>
Retrieve map (imagefile) showing current conditions at selected station
get <name> forecastsmap <stationName>
Retrieve map (imagefile) showing forecasts for selected region
get <name> headlines
Returns a string, containing all alert headlines separated by |
get <name> help
Show a help text with available commands
get <name> list capstations|data|stations
capstations: Retrieve list showing all defined warning regions.
You can find your WARNCELLID with this list.
data: List current conditions for all available stations in one single table
stations: List all available stations that provide conditions data
get <name> radarmap <region>
Retrieve map (imagefile) containig radar view from selected region
get <name> rereadcfg
Reread all required data from DWD Server manually: station list and CAP data
get <name> warnings <region>
Retrieve current warnings report for selected region
report type VHDL30 = regular report, issued daily
report type VHDL31 = regular report, issued before weekend or national holiday
report type VHDL32 = preliminary report, issued on special conditions
report type VHDL33 = cancel report, issued if necessary to cancel VHDL32
get <name> warningssmap <region>
Retrieve map (imagefile) containig current warnings for selected region marked with symbols
All downloaded mapfiles can be found inside "GDS Files" area in left navigation bar.
disable - if set, gds will not try to connect to internet
gdsAll - defines filter for "all data" from alert message
gdsDebug - defines filter for debug informations
gdsSetCond - defines conditions area to be used after system restart
gdsSetForecast - defines forecasts region/station to be used after system restart
gdsLong - show long text fields "description" and "instruction" from alert message in readings
gdsPolygon - show polygon data from alert message in a reading
gdsHideFiles - if set to 1, the "GDS Files" menu in the left navigation bar will not be shown
gdsPassiveFtp - set to 1 to use passive FTP transfer
gdsFwName - define firewall hostname in format <hostname>:<port>
gdsFwType - define firewall type in a value 0..7 please refer to
cpan documentation
for further informations regarding firewall settings.
Generated Readings/Events:
_<readingName> - debug informations
a_X_<readingName> - weather data from CAP alert messages. Readings will NOT be updated automatically
a_ readings contain a set of alert inforamtions, X represents a numeric set identifier starting with 0
that will be increased for every valid alert message in selected area
a_count - number of currently valid alert messages, can be used for own loop iterations on alert messages
a_valid - returns 1 if at least one of decoded alert messages is valid
c_<readingName> - weather data from SET weather conditions.
Readings will be updated every 20 minutes.
fc?_<readingName>?? - weather data from SET weather forecasts,
prefix by relative day and postfixed by last hour. Readings will be updated every 20 minutes.
0_weather06 and ?_weather12 (with ? greater 0) is the weather in the morning
0_weather12 is the weather at noon
0_weather18 and ?_weather24 (with ? greater 0) is the weather in the afternoon
0_weather24 is the weather at midnight
0_windGust06 and ?_windGust12 (with ? greater 0) is the wind in the morning
0_windGust12 is the wind at noon
0_windGust18 and ?_windGust24 (with ? greater 0) is the wind in the afternoon
0_windGust24 is the wind at midnight
?_tMinAir is minimum temperature in the morning
0_tAvgAir12 is the average temperature at noon
?_tMaxAir is the maximum temperature in the afternoon
0_tAvgAir24 is the average temperature at midnight
g_<readingName> - weather data from GET weather conditions.
Readings will NOT be updated automatically
Author's notes
Module uses following additional Perl modules:
Net::FTP, XML::Simple
If not already installed in your environment, please install them using appropriate commands from your environment.
Have fun!
GEOFANCY
Provides webhook receiver for geofencing, e.g. via the following apps:
Note: GEOFANCY is an extension to FHEMWEB. You need to install FHEMWEB to use GEOFANCY.
Define
define <name> GEOFANCY <infix>
Defines the webhook server. <infix> is the portion behind the FHEMWEB base URL (usually http://hostname:8083/fhem)
Example:
define geofancy GEOFANCY geo
The webhook will be reachable at http://hostname:8083/fhem/geo in that case.
Set
clear readings can be used to cleanup auto-created readings from deprecated devices.
Attributes
devAlias: can be used to rename device names in the format DEVICEUUID:Aliasname. Separate using blank to rename multiple devices.
Usage information
Likely your FHEM installation is not reachable directly from the internet (good idea!).
It is recommended to have a reverse proxy like nginx or Apache in front of FHEM where you can make sure access is only possible to specific subdirectories like /fhem/geo.
You might also want to think about protecting the access by using HTTP Basic Authentication and encryption via SSL.
Also the definition of a dedicated FHEMWEB instance for that purpose might help to restrict FHEM's functionality (note that the 'hidden' attributes of FHEMWEB currently do NOT protect from just guessing/knowing the correct URL!)
To make that reverse proxy available from the internet, just forward the appropriate port via your internet router.
The actual solution on how you can securely make your Geofancy webhook available to the internet is not part of this documentation and depends on your own skills.
Integration with Home Automation
You might want to have a look to the module family of ROOMMATE, GUEST and RESIDENTS for an easy processing of GEOFANCY events.
Configure WLAN settings:
bring device in AP mode (press button for more than 3s, repeat this step until the LED is permanently on)
Now connect with your computer to G-Home network.
Browse to 10.10.100.254 (username:password = admin:admin)
In STA Setting insert your WLAN settings
Configure Network Parameters setting:
Other Setting -> Protocol to TCP-Client
Other Setting -> Port ID (remember value for FHEM settings)
Other Setting -> Server Address (IP of your FHEM Server)
Optional:
Block all outgoing connections for G-Homa in your router.
Define
define <name> GHoma <port>
Specifies the GHoma server device.
New adapters will be added automaticaly after first connection.
You can also manyally add an adapter: define <name> GHoma <Id>
where Id is the last 6 numbers of the plug's MAC address
Example: MAC= AC:CF:23:A5:E2:3B -> Id= A5E23B
define <rg_GuestName> GUEST [<device name of resident group>]
Provides a special dummy device to represent a guest of your home.
Based on the current state and other readings, you may trigger other actions within FHEM.
Used by superior module RESIDENTS but may also be used stand-alone.
Example:
# Standalone
define rg_Guest GUEST
# Typical group member
define rg_Guest GUEST rgr_Residents # to be member of resident group rgr_Residents
# Member of multiple groups
define rg_Guest GUEST rgr_Residents,rgr_Guests # to be member of resident group rgr_Residents and rgr_Guests
Please note the RESIDENTS group device needs to be existing before a GUEST device can become a member of it.
Set
set <rg_GuestName> <command> [<parameter>]
Currently, the following commands are defined.
location - sets reading 'location'; see attribute rg_locations to adjust list shown in FHEMWEB
mood - sets reading 'mood'; see attribute rg_moods to adjust list shown in FHEMWEB
state home,gotosleep,asleep,awoken,absent,none switch between states; see attribute rg_states to adjust list shown in FHEMWEB
create wakeuptimer add several pre-configurations provided by RESIDENTS Toolkit. See separate section in RESIDENTS module commandref for details.
Note: If you would like to restrict access to admin set-commands (-> create) you may set your FHEMWEB instance's attribute allowedCommands like 'set,set-user'.
The string 'set-user' will ensure only non-admin set-commands can be executed when accessing FHEM using this FHEMWEB instance.
Possible states and their meaning
This module differs between 6 states:
home - individual is present at home and awake
gotosleep - individual is on it's way to bed
asleep - individual is currently sleeping
awoken - individual just woke up from sleep
absent - individual is not present at home but will be back shortly
none - guest device is disabled
Presence correlation to location
Under specific circumstances, changing state will automatically change reading 'location' as well.
Whenever presence state changes from 'absent' to 'present', the location is set to 'home'. If attribute rg_locationHome was defined, first location from it will be used as home location.
Whenever presence state changes from 'present' to 'absent', the location is set to 'underway'. If attribute rg_locationUnderway was defined, first location from it will be used as underway location.
Auto Gone
Whenever an individual is set to 'absent', a trigger is started to automatically change state to 'gone' after a specific timeframe.
Default value is 16 hours.
This behaviour can be customized by attribute rg_autoGoneAfter.
Synchronizing presence with other ROOMMATE or GUEST devices
If you always leave or arrive at your house together with other roommates or guests, you may enable a synchronization of your presence state for certain individuals.
By setting attribute rg_passPresenceTo, those individuals will follow your presence state changes to 'home', 'absent' or 'gone' as you do them with your own device.
Please note that individuals with current state 'none' or 'gone' (in case of roommates) will not be touched.
Location correlation to state
Under specific circumstances, changing location will have an effect on the actual state as well.
Whenever location is set to 'home', the state is set to 'home' if prior presence state was 'absent'. If attribute rg_locationHome was defined, all of those locations will trigger state change to 'home' as well.
Whenever location is set to 'underway', the state is set to 'absent' if prior presence state was 'present'. If attribute rg_locationUnderway was defined, all of those locations will trigger state change to 'absent' as well. Those locations won't appear in reading 'lastLocation'.
Whenever location is set to 'wayhome', the reading 'wayhome' is set to '1' if current presence state is 'absent'. If attribute rg_locationWayhome was defined, LEAVING one of those locations will set reading 'wayhome' to '1' as well. So you actually have implicit and explicit options to trigger wayhome.
Arriving at home will reset the value of 'wayhome' to '0'.
If you are using the GEOFANCY module, you can easily have your location updated with GEOFANCY events by defining a simple NOTIFY-trigger like this:
define n_rg_Guest.location notify geofancy:currLoc_Guest.* set rg_Guest:FILTER=location!=$EVTPART1 location $EVTPART1
By defining geofencing zones called 'home' and 'wayhome' in the iOS app, you automatically get all the features of automatic state changes described above.
Attributes
rg_autoGoneAfter - hours after which state should be auto-set to 'gone' when current state is 'absent'; defaults to 16 hours
rg_locationHome - locations matching these will be treated as being at home; first entry reflects default value to be used with state correlation; separate entries by space; defaults to 'home'
rg_locationUnderway - locations matching these will be treated as being underway; first entry reflects default value to be used with state correlation; separate entries by comma or space; defaults to "underway"
rg_locationWayhome - leaving a location matching these will set reading wayhome to 1; separate entries by space; defaults to "wayhome"
rg_locations - list of locations to be shown in FHEMWEB; separate entries by comma only and do NOT use spaces
rg_moodDefault - the mood that should be set after arriving at home or changing state from awoken to home
rg_moodSleepy - the mood that should be set if state was changed to gotosleep or awoken
rg_moods - list of moods to be shown in FHEMWEB; separate entries by comma only and do NOT use spaces
rg_noDuration - may be used to disable duration timer calculation (see readings durTimer*)
rg_passPresenceTo - synchronize presence state with other GUEST or GUEST devices; separte devices by space
rg_realname - whenever GUEST wants to use the realname it uses the value of attribute alias or group; defaults to group
rg_showAllStates - states 'asleep' and 'awoken' are hidden by default to allow simple gotosleep process via devStateIcon; defaults to 0
rg_states - list of states to be shown in FHEMWEB; separate entries by comma only and do NOT use spaces; unsupported states will lead to errors though
rg_wakeupDevice - reference to enslaved DUMMY devices used as a wake-up timer (part of RESIDENTS Toolkit's wakeuptimer)
Generated Readings/Events:
durTimerAbsence - timer to show the duration of absence from home in human readable format (hours:minutes:seconds)
durTimerAbsence_cr - timer to show the duration of absence from home in computer readable format (minutes)
durTimerPresence - timer to show the duration of presence at home in human readable format (hours:minutes:seconds)
durTimerPresence_cr - timer to show the duration of presence at home in computer readable format (minutes)
durTimerSleep - timer to show the duration of sleep in human readable format (hours:minutes:seconds)
durTimerSleep_cr - timer to show the duration of sleep in computer readable format (minutes)
lastArrival - timestamp of last arrival at home
lastAwake - timestamp of last sleep cycle end
lastDeparture - timestamp of last departure from home
lastDurAbsence - duration of last absence from home in human readable format (hours:minutes:seconds)
lastDurAbsence_cr - duration of last absence from home in computer readable format (minutes)
lastDurPresence - duration of last presence at home in human readable format (hours:minutes:seconds)
lastDurPresence_cr - duration of last presence at home in computer readable format (minutes)
lastDurSleep - duration of last sleep in human readable format (hours:minutes:seconds)
lastDurSleep_cr - duration of last sleep in computer readable format (minutes)
lastLocation - the prior location
lastMood - the prior mood
lastSleep - timestamp of last sleep cycle begin
lastState - the prior state
lastWakeup - time of last wake-up timer run
lastWakeupDev - device name of last wake-up timer
location - the current location
mood - the current mood
nextWakeup - time of next wake-up program run
nextWakeupDev - device name for next wake-up program run
presence - reflects the home presence state, depending on value of reading 'state' (can be 'present' or 'absent')
state - reflects the current state
wakeup - becomes '1' while a wake-up program of this resident is being executed
wayhome - depending on current location, it can become '1' if individual is on his/her way back home
The following readings will be set to '-' if state was changed to 'none':
lastArrival, lastDurAbsence, lastLocation, lastMood, location, mood
HCS
Defines a virtual device for monitoring thermostats (FHT, HM-CC-TC, MAX) to control a central
heating unit.
Define
define <name> HCS <device>
<device> the name of a predefined device to switch.
The HCS (heating control system) device monitors the state of all detected thermostats
in a free definable interval (by default: 10 min).
Regulation for heating requirement or suppression of the request can be controlled by
valve position or measured temperature (default) using also free definable thresholds.
In doing so, the HCS device also includes the hysteresis between two states.
Example for monitoring measured temperature:
Threshold temperature for heating requirement: 0.5 (default)
Threshold temperature for idle: 0.5 (default)
Heating is required when the measured temperature of a thermostat is lower than
0.5° Celsius as the desired temperature. HCS then activates the defined device
until the measured temperature of the thermostat is 0.5° Celsius higher as the
desired temperature (threshold for idle). In this example, both tresholds are equal.
Example for monitoring valve position:
Threshold valve position for heating requirement: 40% (default)
Threshold valve position for idle: 35% (default)
Heating is required when the "open" position of a valve is more than 40%. HCS then
activates the defined device until the "open" position of the valve has lowered to
35% or less (threshold for idle).
The HCS device supports an optional eco mode. The threshold oriented regulation by
measured temperature or valve position can be overridden by setting economic thresholds.
Example:
Threshold temperature economic mode on: 15° Celsius
Threshold temperature economic mode off: 25° Celsius
HCS activates the defined device until the measured temperature of one ore more
thermostats is lower or equal than 15° Celsius. If a measured temperature of one
or more thermostats is higher or equal than 25° Celsius, HCS switch of the defined
device (if none of the measured temperatures of all thermostats is lower or equal as
15° Celsius).
In addition, the HCS device supports an optional temp-sensor. The threshold and economic
oriented regulation can be overriden by the reading of the temp-sensor (overdrive mode).
Example:
Threshold temperature reading for heating requirement: 10° Celsius
Threshold temperature reading for idle: 18° Celsius
Is a measured temperature ore valve position reaching or exceeding the threshold for
heating requirement, but the temperature reading is more than 18° Celcius, the
selected device will stay deactivated. The measured temperature or valve-position
oriented regulation has been overridden by the temperature reading in this example.
The HCS device automatically detects devices which are ignored. Furthermore, certain
devices can also be excluded of the monitoring manually.
To reduce the transmission load, use the attribute event-on-change-reading, e.g.
attr <name> event-on-change-reading state,devicestate,eco,overdrive
To avoid frequent switching "on" and "off" of the device, a timeout (in minutes) can be set
using the attribute idleperiod.
Get
values
returns the actual values of each device
Set
eco <on>|<off>
enable (on) or disable (off) the economic mode.
interval <value> value modifies the interval of reading the actual valve positions.
The unit is minutes.
mode <thermostat>|<valve>
changes the operational mode: thermostat controls the heating demand by defined temperature
thresholds. valve controls the heating demand by defined valve position thresholds.
on
restarts the monitoring after shutdown by off switch.
HCS device starts up automatically upon FHEM start or after new device implementation!
off
shutdown of monitoring, can be restarted by using the on command.
Attributes
deviceCmdOn (mandatory)
command to activate the device, e.g. on.
Default value: on
deviceCmdOff (mandatory)
command to deactivate the device, e.g. off.
Default value: off
ecoTemperatureOn (Required by eco mode)
defines threshold for measured temperature upon which device is allways switched on
ecoTemperatureOff (Required by eco mode)
defines threshold for measured temperature upon which device is switched off
exclude (optional)
space or comma separated list of devices (FHT or HM-CC-TC) for excluding from
monitoring
idleperiod (mandatory)
locks the device to be switched for the specified period. The unit is minutes.
Default value: 10
mode (mandatory)
defines the operational mode: thermostat controls the heating demand by defined temperature
thresholds. valve controls the heating demand by defined valve position thresholds.
Default value: thermostat
sensor (optional)
device name of the temp-sensor
sensorThresholdOn (Required by sensor)
threshold for temperature reading activating the defined device
Must be set if sensor has been defined
sensorThresholdOff (Required by sensor)
threshold for temperature reading deactivating the defined device.
Must be set if sensor has been defined
sensorReading (Required by sensor)
name which is used for saving the "reading" of the defined temp-sensor.
thermostatThresholdOn (Required by operational mode thermostat)
defines delta threshold between desired and measured temperature upon which device
is switched on (heating required).
Default value: 0.5
thermostatThresholdOff (Required by operational mode thermostat)
defines delta threshold between desired and measured temperature upon which
device is switched off (idle).
Default value: 0.5
valveThresholdOn (Required by operational mode valve)
defines threshold of valve-position upon which device is switched on (heating
required).
Default value: 40
valveThresholdOff (Required by operational mode valve)
defines threshold of valve-position upon which device is switched off (idle).
Default value: 35
verbose
verbose 4 (or lower) shows a complete statistic of scanned devices (FHT or HM-CC-TC).
verbose 3 shows a short summary of scanned devices.
verbose 2 suppressed the above messages.
HEATRONIC
The HEATRONIC module interprets messages received from the HT-Bus of a Junkers Boiler. Possible Adapters are described in
http://www.mikrocontroller.net/topic/317004 (only in german).
ch_Tflow_desired
required flow temperature (in domestic hot water mode value of max vessel temperature)
ch_Tflow_measured
current measured flow temperature
ch_Treturn
current measured return temperature
ch_Tmixer
current measured mixer temperature
ch_mode
current operation mode (0=off, 1=heating, 2=domestic hot water)
ch_burner_fan
status of burner fan (0=off, 1=running)
ch_burner_operation
burner status (0=off, 1=on)
ch_pump_heating
status of the heating pump(0=off, 1=running)
ch_pump_cylinder
status of cylinder loading pump (0=off, 1=running)
ch_pump_circulation
status of circulation pump (0=off, 1=running)
ch_burner_power
burner power in percent
ch_pump_heating_power
power of heating power in percent
ch_Toutside
outside temperature
ch_runtime_total
runtime of burner in minutes (heating and domestic hot water)
ch_runtime_ch
runtime of burner in minutes (heating only)
ch_runtime_dhw
runtime of burner in minutes (domestic hot water only)
ch_starts_tot
count of burner operations (heating and domestic hot water)
ch_starts_ch
count of burner operations (heating only)
ch_starts_dhw
count of burner operations (domestic hot water only)
ch_time
system time of boiler
hc1_Tdesired .. hc4_Tdesired
required room temperature for heating circuit 1-4
hc1_Tmeasured .. hc4_Tmeasured
current measured room temperature for heating circuit 1-4
hc1_Tmode .. hc4_Tmode
operating mode for heating circuit 1-4
dhw_Tdesired
required domestic hot water temperature
dhw_Tmeasured
current measured domestic hot water temperature
dhw_Tcylinder
current measured domestic hot water temperature at the top of the cylinder
sol_Tcollector
temperature of collector groupp 1
sol_Tcylinder_bottom
temperature at the bottom of solar cylinder
sol_yield_last_hour
yield of collector in the last hour
sol_yield_2
This value is unkown at the moment. The name can be changed later.
sol_pump
status of solar circuit pump (0=off, 1=running)
sol_runtime
runtime of solar pump in minutes
HMLAN
The HMLAN is the fhem module for the eQ-3 HomeMatic LAN Configurator.
A description on how to use hmCfgUsb can be found follwing the link.
The fhem module will emulate a CUL device, so the CUL_HM module can be used to define HomeMatic devices.
In order to use it with fhem you must disable the encryption first with the "HomeMatic Lan Interface Configurator"
(which is part of the supplied Windows software), by selecting the device, "Change IP Settings", and deselect "AES Encrypt Lan Communication".
This device can be used in parallel with a CCU and (readonly) with fhem. To do this:
start the fhem/contrib/tcptee.pl program
redirect the CCU to the local host
disable the LAN-Encryption on the CCU for the Lan configurator
set the dummy attribute for the HMLAN device in fhem
reassignIDs
Syncs the IDs between HMLAN and teh FHEM list.
Usually this is done automatically and only is recomended if there is a difference in counts.
logIDs
enables selective logging of HMLAN messages. A list of HMIds or names can be
entered, comma separated, which shall be logged.
The attribute only allows device-IDs, not channel IDs.
Channel-IDs will be modified to device-IDs automatically.
all will log raw messages for all HMIds sys will log system related messages like keep-alive
in order to enable all messages set "all,sys"
loadLevel
loadlevel will be mapped to reading vaues.
0:low,30:mid,40:batchLevel,90:high,99:suspended
the batchLevel value will be set to 40 if not entered. This is the level at which
background message generation e.g. for autoReadReg will be stopped
hmKey5
AES keys for the HMLAN adapter.
The key is converted to a hash. If a hash is given directly it is not converted but taken directly.
Therefore the original key cannot be converted back
respTime
Define max response time of the HMLAN adapter in seconds. Default is 1 sec.
Longer times may be used as workaround in slow/instable systems or LAN configurations.
wdTimer
Time in sec to trigger HMLAN. Values between 5 and 25 are allowed, 25 is default.
It is not recommended to change this timer. If problems are detected with
HLMLAN disconnection it is advisable to resolve the root-cause of the problem and not symptoms.
hmLanQlen
defines queuelength of HMLAN interface. This is therefore the number of
simultanously send messages. increasing values may cause higher transmission speed.
It may also cause retransmissions up to data loss.
Effects can be observed by watching protocol events
1 - is a conservatibe value, and is default
5 - is critical length, likely cause message loss
assignedIDsCnt
number of IDs that are assigned to HMLAN by FHEM.
If the number reported by HMLAN differ it will be reported as 'reported'.
It is recommended to resync HMLAN using the command 'assignIDs'.
msgKeepAlive
performance of keep-alive messages. dlyMax: maximum delay of sheduled message-time to actual message send. bufferMin: minimal buffer left to before HMLAN would likely disconnect
due to missing keepAlive message. bufferMin will be reset to 30sec if
attribut wdTimer is changed.
if dlyMax is high (several seconds) or bufferMin goes to "0" (normal is 4) the system
suffers on internal delays. Reasons for the delay might be explored. As a quick solution
wdTimer could be decreased to trigger HMLAN faster.
msgLoadCurrent
Current transmit load of HMLAN. When capacity reaches 100% HMLAN stops sending and waits for
reduction. See also:
loadLevel
msgLoadHistory
Historical transmition load of HMLAN.
msgParseDly
calculates the delay of messages in ms from send in HMLAN until processing in FHEM.
It therefore gives an indication about FHEM system performance.
prot_keepAlive HMLAN disconnect likely do to slow keep-alive sending
prot_ok recent HMLAN ok condition
prot_timeout recent HMLAN timeout
prot_Warning-HighLoad high load condition entered - HMLAN has about 10% performance left
prot_ERROR-Overload overload condition - HMLAN will receive bu tno longer transmitt messages
prot_Overload-released overload condition released - normal operation possible
HMS
Define
define <name> HMS <housecode>
<housecode> is a four digit hex number,
corresponding to the address of the HMS device.
Examples:
define temp HMS 1234
Notes:
Currently supported devices are the HMS100-T HMS100-TF HMS100-WD
HMS100-MG HMS100-TFK HMS100-CO HMS100-FIT RM100-2 RM100-3
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
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.
HMinfo is a module to support getting an overview of
eQ-3 HomeMatic devices as defines in CUL_HM.
Status information and counter
HMinfo gives an overview on the CUL_HM installed base including current conditions.
Readings and counter will not be updated automatically due to performance issues.
Command update must be used to refresh the values.
set hm update
Webview of HMinfo providee details, basically counter about how
many CUL_HM entities experience exceptional conditions. It contains
Action Detector status
CUL_HM related IO devices and condition
Device protocol events which are related to communication errors
count of certain readings (e.g. batterie) and conditions - attribut controlled
count of error condition in readings (e.g. overheat, motorErr) - attribut controlled
It also allows some HM wide commands such
as store all collected register settings.
Commands are executed on all HM entities.
If applicable and evident execution is restricted to related entities.
e.g. rssi is executed on devices only since channels do not support rssi values.
set <name> <cmd> <filter> [<param>]
whereby filter has two segments, typefilter and name filter
[-dcasev] [-f <filter>]
filter for types
d - device :include devices
c - channels :include channels
v - virtual :supress fhem virtual
p - physical :supress physical
a - aktor :supress actor
s - sensor :supress sensor
e - empty :include results even if requested fields are empty
and/or filter for names:
-f <filter> :regexp to filter entity names
Example:
set hm param -d -f dim state # display param 'state' for all devices whos name contains dim
set hm param -c -f ^dimUG$ peerList # display param 'peerList' for all channels whos name is dimUG
set hm param -dcv expert # get attribut expert for all channels,devices or virtuals
regCheck[filter]
performs a consistency check on register readings for completeness
peerCheck[filter]
performs a consistency check on peers. If a peer is set in a channel
it will check wether the peer also exist on the opposit side.
peerXref[filter]
provides a cross-reference on peerings, a kind of who-with-who summary over HM
configCheck[filter]
performs a consistency check of HM settings. It includes regCheck and peerCheck
templateList [<name>]
list defined templates. If no name is given all templates will be listed
templateUsg <template>
templare usage
template filters the output
msgStat[filter]
statistic about message transferes over a week
protoEvents [filter] important view about pending commands and failed executions for all devices in a single table.
Consider to clear this statistic use clear Protocol.
rssi [filter]
statistic over rssi data for HM entities.
templateChk[filter] <template> <peer:[long|short]> [<param1> ...]
verifies if the register-readings comply to the template
Parameter are identical to templateSet
The procedure will check if the register values match the ones provided by the template
If no peer is necessary use none to skip this entry
Example to verify settings
set hm templateChk -f RolloNord BlStopUpLg none 1 2 # RolloNord, no peer, parameter 1 and 2 given
set hm templateChk -f RolloNord BlStopUpLg peerName:long # RolloNord peerName, long only
set hm templateChk -f RolloNord BlStopUpLg peerName # RolloNord peerName, long and short
set hm templateChk -f RolloNord BlStopUpLg peerName:all # RolloNord peerName, long and short
set hm templateChk -f RolloNord BlStopUpLg all:long # RolloNord any peer, long only
set hm templateChk -f RolloNord BlStopUpLg all # RolloNord any peer,long and short
set hm templateChk -f Rollo.* BlStopUpLg all # each Rollo* any peer,long and short
set hm templateChk BlStopUpLg # each entities
set hm templateChk # all assigned templates
set hm templateChk sortTemplate # all assigned templates sortiert nach Template
set hm templateChk sortPeer # all assigned templates sortiert nach Peer
archConfig[filter] [<file>]
performs saveConfig for entities that appeare to have achanged configuration.
It is more conservative that saveConfig since incomplete sets are not stored.
Option -a force an archieve for all devices that have a complete set of data
loadConfig[filter] [<file>]
loads register and peers from a file saved by saveConfig.
It should be used carefully since it will add data to FHEM which cannot be verified. No readings will be replaced, only
missing readings will be added. The command is mainly meant to be fill in readings and register that are
hard to get. Those from devices which only react to config may not easily be read.
Therefore it is strictly up to the user to fill valid data. User should consider using autoReadReg for devices
that can be read.
The command will update FHEM readings and attributes. It will not reprogramm any device.
purgeConfig[filter] [<file>]
purge (reduce) the saved config file. Due to the cumulative storage of the register setting
purge will use the latest stored readings and remove older one.
See CUL_HM saveConfig.
verifyConfig[filter] [<file>]
Compare date in config file to the currentactive data and report differences.
Possibly usable with a known-good configuration that was saved before.
It may make sense to purge the config file before.
See CUL_HM purgeConfig.
tempList[filter] [save|restore|verify|status|genPlot] [<file>]
this function supports handling of tempList for thermstates.
It allows templists to be saved in a separate file, verify settings against the file
and write the templist of the file to the devices.
save saves tempList readings of the system to the file.
Note that templist as available in FHEM is put to the file. It is up to the user to make
sure the data is actual
Storage is not cumulative - former content of the file will be removed
restore available templist as defined in the file are written directly
to the device
verify file data is compared to readings as present in FHEM. It does not
verify data in the device - user needs to ensure actuallity of present readings
status gives an overview of templates being used by any CUL_HM thermostat. It alls showes
templates being defined in the relevant files.
genPlot generates a set of records to display templates graphicaly.
Out of the given template-file it generates a .log extended file which contains log-formated template data. timestamps are
set to begin Year 2000.
A prepared .gplot file will be added to gplot directory.
Logfile-entity _Log will be added if not already present. It is necessary for plotting.
SVG-entity _SVG will be generated if not already present. It will display the graph.
file name of the file to be used. Default: tempList.cfg
filename is the name of the file to be used. Default ist tempList.cfg
entities comma separated list of entities which refers to the temp lists following.
The actual entity holding the templist must be given - which is channel 04 for RTs or channel 02 for TCs
tempList... time and temp couples as used in the set tempList commands
cpRegs <src:peer> <dst:peer>
allows to copy register, setting and behavior of a channel to
another or for peers from the same or different channels. Copy therefore is allowed
intra/inter device and intra/inter channel. src:peer is the source entity. Peer needs to be given if a peer behabior beeds to be copied dst:peer is the destination entity.
Example
set hm cpRegs blindR blindL # will copy all general register (list 1)for this channel from the blindR to the blindL entity.
This includes items like drive times. It does not include peers related register (list 3/4)
set hm cpRegs blindR:Btn1 blindL:Btn2 # copy behavior of Btn1/blindR relation to Btn2/blindL
set hm cpRegs blindR:Btn1 blindR:Btn2 # copy behavior of Btn1/blindR relation to Btn2/blindR, i.e. inside the same Actor
Restrictions:
cpRegs will not add any peers or read from the devices. It is up to the user to read register in advance
cpRegs is only allowed between identical models
cpRegs expets that all readings are up-to-date. It is up to the user to ensure data consistency.
templateDef <name> <param> <desc> <reg1:val1> [<reg2:val2>] ...
define a template. param gives the names of parameter necesary to execute the template. It is template dependant
and may be onTime or brightnesslevel. A list of parameter needs to be separated with colon
param1:param2:param3
if del is given as parameter the template is removed desc shall give a description of the template reg:val is the registername to be written and the value it needs to be set to.
In case the register is from link set and can destinguist between long and short it is necessary to leave the
leading sh or lg off.
if parameter are used it is necessary to enter p. as value with p0 first, p1 second parameter
Example
set hm templateDef SwOnCond level:cond "my description" CtValLo:p0 CtDlyOn:p1 CtOn:geLo
set hm templateDef SwOnCond del # delete a template
set hm templateDef SwOnCond fromMaster <masterChannel> <peer:[long|short]># define a template with register as of the example
set hm templateDef SwOnCond fromMaster myChannel peerChannel:long #
templateSet <entity> <template> <peer:[long|short]> [<param1> ...]
sets a bunch of register accroding to a given template. Parameter may be added depending on
the template setup.
templateSet will collect and accumulate all changes. Finally the results are written streamlined. entity: peer is the source entity. Peer needs to be given if a peer behabior beeds to be copied template: one of the programmed template peer: [long|short]:if necessary a peer needs to be given. If no peer is used enter '0'.
with a peer it should be given whether it is for long or short keypress param: number and meaning of parameter depends on the given template
Example could be (templates not provided, just theoretical)
set hm templateSet Licht1 staircase FB1:short 20
set hm templateSet Licht1 staircase FB1:long 100
Restrictions:
User must ensure to read configuration prior to execution.
templateSet may not setup a complete register block but only a part if it. This is up to template design.
templateDel <entity> <template> <peer:[long|short]> ]
remove a template installed by templateSet
templateExe <template>
executes the register write once again if necessary (e.g. a device had a reset)
sumStatus
Warnings: list of readings that shall be screend and counted based on current presence.
I.e. counter is the number of entities with this reading and the same value.
Readings to be searched are separated by comma.
Example:
attr hm sumStatus battery,sabotageError
will cause a reading like
W_sum_batterie ok:5 low:3
W_sum_sabotageError on:1
Note: counter with '0' value will not be reported. HMinfo will find all present values autonomously
Setting is meant to give user a fast overview of parameter that are expected to be system critical
sumERROR
Similar to sumStatus but with a focus on error conditions in the system.
Here user can add readingvalues that are not displayed. I.e. the value is the
good-condition that will not be counted.
This way user must not know all error values but it is sufficient to supress known non-ciritical ones.
Example:
autoUpdate
retriggers the command update periodically.
Example:
attr hm autoUpdate 00:10
will trigger the update every 10 min
autoArchive
if set fhem will update the configFile each time the new data is available.
The update will happen with autoUpdate. It will not
work it autoUpdate is not used.
see also archConfig
hmAutoReadScan
defines the time in seconds CUL_HM tries to schedule the next autoRead
from the queue. Despite this timer FHEM will take care that only one device from the queue will be
handled at one point in time. With this timer user can stretch timing even further - to up to 300sec
min delay between execution.
Setting to 1 still obeys the "only one at a time" prinzip.
Note that compressing will increase message load while stretch will extent waiting time.
hmIoMaxDly
max time in seconds CUL_HM stacks messages if the IO device is not ready to send.
If the IO device will not reappear in time all command will be deleted and IOErr will be reported.
Note: commands will be executed after the IO device reappears - which could lead to unexpected
activity long after command issue.
default is 60sec. max value is 3600sec
configDir
default directory where to store and load configuration files from.
This path is used as long as the path is not given in a filename of
a given command.
It is used by commands like tempList or saveConfig
I_autoReadPend: Info:list of entities which are queued to retrieve config and status.
This is typically scheduled thru autoReadReg
ERR___rssiCrit: Error:list of devices with RSSI reading n min level
W_unConfRegs: Warning:list of entities with unconfirmed register changes. Execute getConfig to clear this.
I_rssiMinLevel: Info:counts of rssi min readings per device, clustered in blocks
ERR__protocol: Error:count of non-recoverable protocol events per device.
Those events are NACK, IOerr, ResendFail, CmdDel, CmdPend.
Counted are the number of device with those events, not the number of events!
ERR__protoNames: Error:name-list of devices with non-recoverable protocol events
I_HM_IOdevices: Info:list of IO devices used by CUL_HM entities
I_actTotal: Info:action detector state, count of devices with ceratin states
ERRactNames: Error:names of devices that are not alive according to ActionDetector
C_sumDefined: Count:defined entities in CUL_HM. Entites might be count as
device AND channel if channel funtion is covered by the device itself. Similar to virtual
ERR_<reading>: Error:count of readings as defined in attribut
sumERROR
that do not match the good-content.
ERR_names: Error:name-list of entities that are counted in any ERR_<reading>
W_sum_<reading>: count of readings as defined in attribut
sumStatus.
Provides webhook receiver for weather station HP1000 of Fine Offset Electronics.
There needs to be a dedicated FHEMWEB instance with attribute webname set to "weatherstation".
No other name will work as it's hardcoded in the HP1000 device itself!
As the URI has a fixed coding as well there can only be one single HP1000 station per FHEM installation.
Example:
# unprotected instance where ID and PASSWORD will be ignored
define WeatherStation HP1000
# protected instance: Weather Station needs to be configured
# to send this ID and PASSWORD for data to be accepted
define WeatherStation HP1000 MyHouse SecretPassword
IMPORTANT: In your HP1000 device, make sure you use a DNS name as most revisions cannot handle IP addresses directly.
HTTPMOD
This module provides a generic way to retrieve information from devices with an HTTP Interface and store them in Readings.
It queries a given URL with Headers and data defined by attributes.
From the HTTP Response it extracts Readings named in attributes using Regexes also defined by attributes.
In an advanced configuration the module can also send information to devices. To do this a generic set option can be configured using attributes.
Prerequisites
This Module uses the non blocking HTTP function HttpUtils_NonblockingGet provided by FHEM's HttpUtils in a new Version published in December 2013.
If not already installed in your environment, please update FHEM or install it manually using appropriate commands from your environment.
Define
define <name> HTTPMOD <URL> <Interval>
The module connects to the given URL every Interval seconds, sends optional headers and data and then parses the response
Specify optional headers as attr requestHeader1 to attr requestHeaderX,
optional POST data as attr requestData and then
pairs of attr readingXName and attr readingXRegex to define which readings you want to extract from the HTTP
response and how to extract them. (The old syntax attr readingsNameX and attr readingsRegexX is still supported
but the new one with attr readingXName and attr readingXRegex should be preferred.
If you need to do some calculation on a raw value before it is used as a reading, you can define the attribute readingXExpr
which can use the raw value from the variable $val
Example:
attr PM reading03Expr $val * 10
Advanced configuration to define a set or get and send data to a device
When a set option is defined by attributes, the module will use the value given to the set command and translate it into an HTTP-Request that sends the value to the device.
Extension to the above example for a PoolManager 5:
This example defines a set option with the name HeizungSoll.
By issuing set PM HeizungSoll 10 in FHEM, the value 10 will be sent in the defined HTTP
Post to URL http://MyPoolManager/cgi-bin/webgui.fcgi in the Post Data as {"set" :{"34.3118.value" :"10" }}
The optional attributes set01Min and set01Max define input validations that will be checked in the set function.
the optional attribute set01Hint will define a selection list for the Fhemweb GUI.
When a get option is defined by attributes, the module allows querying additional values from the device that require
individual HTTP-Requests or special parameters to be sent
This example defines a get option with the name MyGetValue.
By issuing get PM MyGetValue in FHEM, the defined HTTP request is sent to the device.
The HTTP response is then parsed using the same readingXXName and readingXXRegex attributes as above so
additional pairs will probably be needed there for additional values.
If the new get parameter should also be queried regularly, you can define the following optional attributes:
attr PM get01Poll 1
attr PM get01PollDelay 300
The first attribute includes this reading in the automatic update cycle and the second defines an
alternative lower update frequency. When the interval defined initially is over and the normal readings
are read from the device, the update function will check for additional get parameters that should be included
in the update cycle.
If a PollDelay is specified for a get parameter, the update function also checks if the time passed since it has last read this value
is more than the given PollDelay. If not, this reading is skipped and it will be rechecked in the next cycle when
interval is over again. So the effective PollDelay will always be a multiple of the interval specified in the initial define.
Advanced configuration to create a valid session id that might be necessary in set options
when sending data to an HTTP-Device in a set, HTTPMOD will replace any $sid in the URL, Headers and Post data with the internal $hash->{sid}. To authenticate towards the device and give this internal a value, you can use an optional multi step login procedure defined by the following attributes:
sid[0-9]*URL
sid[0-9]*IDRegex
sid[0-9]*Data.*
sid[0-9]*Header.*
Each step can have a URL, Headers, Post Data pieces and a Regex to extract a resulting Session ID into $hash->{sid}.
HTTPMOD will create a sorted list of steps (the numbers between sid and URL / Data / Header) and the loop through these steps and send the corresponding requests to the device. For each step a $sid in a Header or Post Data will be replaced with the current content of $hash->{sid}.
Using this feature, HTTPMOD can perform a forms based authentication and send user name, password or other necessary data to the device and save the session id for further requests.
To determine when this login procedure is necessary, HTTPMOD will first try to do a set without
doing the login procedure. If the Attribute reAuthRegex is defined, it will then compare the HTTP Response to the set request with the regular expression from reAuthRegex. If it matches, then a
login is performed. The reAuthRegex is meant to match the error page a device returns if authentication or reauthentication is required e.g. because a session timeout has expired.
If for one step not all of the URL, Data or Header Attributes are set, then HTTPMOD tries to use a
sidURL, sidData.* or sidHeader.* Attribue (without the step number after sid). This way parts that are the same for all steps don't need to be defined redundantly.
Define an optional additional HTTP Header to set in the HTTP request
requestData
optional POST Data to be sent in the request. If not defined, it will be a GET request as defined in HttpUtils used by this module
reading[0-9]+Name or readingsName.*
the name of a reading to extract with the corresponding readingRegex
reading[0-9]+Regex ro readingsRegex.*
defines the regex to be used for extracting the reading. The value to extract should be in a sub expression e.g. ([\d\.]+) in the above example
reading[0-9]*Expr or readingsExpr.*
defines an expression that is used in an eval to compute the readings value.
The raw value will be in the variable $val.
If specified as readingExpr then the attribute value is a default for all other readings that don't specify
an explicit reading[0-9]*Expr.
reading[0-9]*Map
Map that defines a mapping from raw to visible values like "0:mittig, 1:oberhalb, 2:unterhalb".
If specified as readingMap then the attribute value is a default for all other readings that don't specify
an explicit reading[0-9]*Map.
reading[0-9]*Format
Defines a format string that will be used in sprintf to format a reading value.
If specified as readingFormat then the attribute value is a default for all other readings that don't specify
an explicit reading[0-9]*Format.
reading[0-9]*Decode
defines an encoding to be used in a call to the perl function decode to convert the raw data string read from the device to a reading. This can be used if the device delivers strings in an encoding like cp850 instead of utf8.
reading[0-9]*Encode
defines an encoding to be used in a call to the perl function encode to convert the raw data string read from the device to a reading. This can be used if the device delivers strings in an encoding like cp850 and after decoding it you want to reencode it to e.g. utf8.
noShutdown
pass the noshutdown flag to HTTPUtils for webservers that need it (some embedded webservers only deliver empty pages otherwise)
disable
stop doing automatic HTTP requests while this attribute is set to 1
timeout
time in seconds to wait for an answer. Default value is 2
enableControlSet
enables the built in set commands interval, stop, start, reread.
enableXPath
enables the use of "xpath:" instead of a regular expression to parse the HTTP response
enableXPath-Strict
enables the use of "xpath-strict:" instead of a regular expression to parse the HTTP response
advanced attributes
reAuthRegex
regular Expression to match an error page indicating that a session has expired and a new authentication for read access needs to be done. This attribute only makes sense if you need a forms based authentication for reading data and if you specify a multi step login procedure based on the sid.. attributes.
sid[0-9]*URL
different URLs or one common URL to be used for each step of an optional login procedure.
sid[0-9]*IDRegex
different Regexes per login procedure step or one common Regex for all steps to extract the session ID from the HTTP response
sid[0-9]*Data.*
data part for each step to be sent as POST data to the corresponding URL
sid[0-9]*Header.*
HTTP Headers to be sent to the URL for the corresponding step
sid[0-9]*IgnoreRedirects
tell HttpUtils to not follow redirects for this authentication request
set[0-9]+Name
Name of a set option
set[0-9]*URL
URL to be requested for the set option
set[0-9]*Data
optional Data to be sent to the device as POST data when the set is executed. if this atribute is not specified, an HTTP GET method
will be used instead of an HTTP POST
set[0-9]*Header
optional HTTP Headers to be sent to the device when the set is executed
set[0-9]+Min
Minimum value for input validation.
set[0-9]+Max
Maximum value for input validation.
set[0-9]+Expr
Perl Expression to compute the raw value to be sent to the device from the input value passed to the set.
set[0-9]+Map
Map that defines a mapping from raw to visible values like "0:mittig, 1:oberhalb, 2:unterhalb". This attribute atomatically creates a hint for FhemWEB so the user can choose one of the visible values.
set[0-9]+Hint
Explicit hint for fhemWEB that will be returned when set ? is seen.
set[0-9]*ReAuthRegex
Regex that will detect when a session has expired an a new login needs to be performed.
set[0-9]*NoArg
Defines that this set option doesn't require arguments. It allows sets like "on" or "off" without further values.
set[0-9]*TextArg
Defines that this set option doesn't require any validation / conversion.
The raw value is passed on as text to the device.
get[0-9]+Name
Name of a get option and Reading to be retrieved / extracted
get[0-9]*URL
URL to be requested for the get option. If this option is missing, the URL specified during define will be used.
get[0-9]*Data
optional data to be sent to the device as POST data when the get is executed. if this attribute is not specified, an HTTP GET method
will be used instead of an HTTP POST
get[0-9]*Header
optional HTTP Headers to be sent to the device when the get is executed
get[0-9]*URLExpr
optional Perl expression that allows modification of the URL at runtime. The origial value is available as $old.
get[0-9]*DatExpr
optional Perl expression that allows modification of the Post data at runtime. The origial value is available as $old.
get[0-9]*HdrExpr
optional Perl expression that allows modification of the Headers at runtime. The origial value is available as $old.
get[0-9]+Poll
if set to 1 the get is executed automatically during the normal update cycle (after the interval provided in the define command has elapsed)
get[0-9]+PollDelay
if the value should not be read in each iteration (after the interval given to the define command), then a
minimum delay can be specified with this attribute. This has only an effect if the above Poll attribute has
also been set. Every time the update function is called, it checks if since this get has been read the last time, the defined delay has elapsed. If not, then it is skipped this time.
PollDelay can be specified as seconds or as x[0-9]+ which means a multiple of the interval in the define command.
get[0-9]*Regex
If this attribute is specified, the Regex defined here is used to extract the value from the HTTP Response
and assign it to a Reading with the name defined in the get[0-9]+Name attribute.
if this attribute is not specified for an individual Reading but as getRegex, then it applies to all get options
where no specific Regex is defined.
If neither a generic getRegex attribute nor a specific get[0-9]+Regex attribute is specified, then HTTPMOD
tries all Regex / Reading pairs defined in Reading[0-9]+Name and Reading[0-9]+Regex attributes and assigns the
Readings that match.
get[0-9]*Expr
this attribute behaves just like Reading[0-9]*Expr but is applied to a get value.
get[0-9]*Map
this attribute behaves just like Reading[0-9]*Map but is applied to a get value.
get[0-9]*Format
this attribute behaves just like Reading[0-9]*Format but is applied to a get value.
get[0-9]*Decode
defines an encoding to be used in a call to the perl function decode to convert the raw data string read from the device to a reading. This can be used if the device delivers strings in an encoding like cp850 instead of utf8.
get[0-9]*Encode
defines an encoding to be used in a call to the perl function encode to convert the raw data string read from the device to a reading. This can be used if the device delivers strings in an encoding like cp850 and after decoding it you want to reencode it to e.g. utf8.
get[0-9]*CheckAllReadings
this attribute modifies the behavior of HTTPMOD when the HTTP Response of a get command is parsed.
If this attribute is set to 1, then additionally to any matching of get specific regexes (get[0-9]*Regex),
also all the Regex / Reading pairs defined in Reading[0-9]+Name and Reading[0-9]+Regex attributes are checked and if they match, the coresponding Readings are assigned as well.
get[0-9]*URLExpr
Defines a Perl expression to specify the HTTP Headers for this request. This overwrites any other header specification and should be used carefully only if needed e.g. to pass additional variable data to a web service. The original Header is availabe as $old.
get[0-9]*DatExpr
Defines a Perl expression to specify the HTTP Post data for this request. This overwrites any other post data specification and should be used carefully only if needed e.g. to pass additional variable data to a web service.
The original Data is availabe as $old.
get[0-9]*HdrExpr
Defines a Perl expression to specify the URL for this request. This overwrites any other URL specification and should be used carefully only if needed e.g. to pass additional variable data to a web service.
The original URL is availabe as $old.
showMatched
if set to 1 then HTTPMOD will create a reading that contains the names of all readings that could be matched in the last request.
queueDelay
HTTP Requests will be sent from a queue in order to avoid blocking when several Requests have to be sent in sequence. This attribute defines the delay between calls to the function that handles the send queue. It defaults to one second.
queueMax
Defines the maximum size of the send queue. If it is reached then further HTTP Requests will be dropped and not be added to the queue
minSendDelay
Defines the minimum time between two HTTP Requests.
Author's notes
If you don't know which URLs, headers or POST data your web GUI uses, you might try a local proxy like BurpSuite to track requests and responses
HTTPSRV
Provides a mini HTTP server plugin for FHEMWEB. It serves files from a given directory.
It optionally accepts a query string to set readings of this device if an attribute allows the given reading
HTTPSRV is an extension to FHEMWEB. You must install FHEMWEB to use HTTPSRV.
Define
define <name> <infix> <directory> <friendlyname>
Defines the HTTP server. <infix> is the portion behind the FHEMWEB base URL (usually
http://hostname:8083/fhem), <directory> is the absolute path the
files are served from, and <friendlyname> is the name displayed in the side menu of FHEMWEB.
Example:
define myJSFrontend HTTPSRV jsf /usr/share/jsfrontend My little frontend
or
define kindleweb HTTPSRV kindle /opt/fhem/kindle Kindle Web
attr kindleweb readings KindleBatt
Set
n/a
Attributes
directoryindex: if the request is sent with no filename, i.e. the infix (with or without trailing slash) only, the file given in this attribute is loaded. Defaults to index.html.
readings: a comma separated list of reading names. If the request ends with a querystring like ?Batt=43 and an attribute is set like attr kindleweb readings Batt, then a reading with the Name of this Attribute (here Batt) is created with the value from the request.
Usage information
The above example on http://hostname:8083/fhem will return the file
/usr/share/jsfrontend/foo.html for http://hostname:8083/fhem/jsf/foo.html.
If no filename is given, the filename prescribed by the directoryindex attribute is returned.
Notice: All links are relative to http://hostname:8083/fhem.
HUEBridge
Module to access the bridge of the phillips hue lighting system.
The actual hue bulbs, living colors or living whites devices are defined as HUEDevice devices.
All newly found devices and groups are autocreated at startup and added to the room HUEDevice.
Notes:
This module needs JSON.
Please install with 'cpan install JSON' or your method of choice.
autocreate only works for the first bridge. devices on other bridges have to be manualy defined.
Define
define <name> HUEBridge [<host>] [<interval>]
Defines a HUEBridge device with address <host>.
If [<host>] is not given the module will try to autodetect the bridge with the hue portal services.
The bridge status will be updated every <interval> seconds. The default and minimum is 60.
After a new bridge is created the pair button on the bridge has to be pressed.
Examples:
define bridge HUEBridge 10.0.1.1
Get
devices
list the devices known to the bridge.
groups
list the groups known to the bridge.
scenes
list the scenes known to the bridge.
sensors
list the sensors known to the bridge.
whitelist
list the whitlist of the bridge.
Set
autocreate
Create fhem devices for all bridge devices.
autodetect
Initiate the detection of new ZigBee devices. After aproximately one minute any newly detected
devices can be listed with get devices and the corresponding fhem devices
can be created by set autocreate.
delete <name>|<id>
Deletes the given device in the bridge and deletes the associated fhem device.
creategroup <name> <lights>
Create a group out of <lights> in the bridge.
The lights are given as a comma sparated list of fhem device names or bridge light numbers.
deletegroup <name>|<id>
Deletes the given group in the bridge and deletes the associated fhem device.
savescene <id> <name> <lights>
Create a scene from the current state of <lights> in the bridge.
The lights are given as a comma sparated list of fhem device names or bridge light numbers.
scene <id>
Recalls the scene with the given id.
modifyscene <id> <light> <light-args>
Modifys the given scene in the bridge.
deletwhitelist <key>
Deletes the given key from the whitelist in the bridge.
touchlink
perform touchlink action
statusRequest
Update bridge status.
swupdate
Update bridge firmware. This command is only available if a new firmware is
available (indicated by updatestate with a value of 2. The version and release date is shown in the reading swupdate.
A notify of the form define HUEUpdate notify bridge:swupdate.* {...}
can be used to be informed about available firmware updates.
This can be a hue bulb, a living colors light or a living whites bulb or dimmer plug.
The device status will be updated every <interval> seconds. 0 means no updates.
The default and minimum is 60 if the IODev has not set pollDevices to 1.
The default ist 0 if the IODev has set pollDevices to 1.
Groups are updated only on definition and statusRequest
bri
the brightness reported from the device. the value can be betwen 1 and 254
colormode
the current colormode
ct
the colortemperature in mireds and kelvin
hue
the current hue
level
the current brightness in percent
onoff
the current on/off state as 0 or 1
sat
the current saturation
xy
the current xy color coordinates
state
the current state
Notes:
groups have no readings.
not all readings show the actual device state. all readings not related to the current colormode have to be ignored.
the actual state of a device controlled by a living colors or living whites remote can be different and will
be updated after some time.
Set
on [<ramp-time>]
off [<ramp-time>]
toggle [<ramp-time>]
statusRequest
Request device status update.
pct <value> [<ramp-time>]
dim to <value>
Note: the FS20 compatible dimXX% commands are also accepted.
color <value>
set colortemperature to <value> kelvin.
bri <value> [<ramp-time>]
set brighness to <value>; range is 0-254.
dimUp [delta]
dimDown [delta]
ct <value> [<ramp-time>]
set colortemperature to <value> in mireds (range is 154-500) or kelvin (rankge is 2000-6493).
hue <value> [<ramp-time>]
set hue to <value>; range is 0-65535.
sat <value> [<ramp-time>]
set saturation to <value>; range is 0-254.
xy <x>,<y> [<ramp-time>]
set the xy color coordinates to <x>,<y>
alert [none|select|lselect]
effect [none|colorloop]
transitiontime <time>
set the transitiontime to <time> 1/10s
rgb <rrggbb>
set the color to (the nearest equivalent of) <rrggbb>
delayedUpdate
immediateUpdate
savescene <id>
scene
lights <lights>
Only valid for groups. Changes the list of lights in this group.
The lights are given as a comma sparated list of fhem device names or bridge light numbers.
rename <new name>
Renames the device in the bridge and changes the fhem alias.
multiple paramters can be set at once separated by :
Examples: set LC on : transitiontime 100 set bulb on : bri 100 : color 4000
Get
rgb
RGB
devStateIcon
returns html code that can be used to create an icon that represents the device color in the room overview.
Attributes
color-icon
1 -> use lamp color as icon color and 100% shape as icon shape
2 -> use lamp color scaled to full brightness as icon color and dim state as icon shape
subType
extcolordimmer -> device has rgb and color temperatur control
colordimmer -> device has rgb controll
ctdimmer -> device has color temperature control
dimmer -> device has brightnes controll
switch -> device has on/off controll
transitiontime
default transitiontime for all set commands if not specified directly in the set.
delayedUpdate
1 -> the update of the device status after a set command will be delayed for 1 second. usefull if multiple devices will be switched.
devStateIcon
will be initialized to {(HUEDevice_devStateIcon($name),"toggle")} to show device color as default in room overview.
webCmd
will be initialized to a device specific value according to subType.
HXB
Define
define <name> HXB
Defines a Hexabus. You need one Hexabus to receive multicast messages from Hexabus devices.
Have a look at the Hexabus wiki for more information on Hexabus.
You need the perl modules IO::Socket::Multicast6 and Digest::CRC. Under Debian and its derivatives they are installed with apt-get install libio-socket-multicast6-perl libdigest-crc-perl.
HXBDevice
Define
define <name> HXB <IPv6Address>
Defines a Hexabus device at the IPv6 address <IPv6Address>. You need one Hexabus
to receive multicast messages from Hexabus devices.
Have a look at the Hexabus wiki for more information on Hexabus.
to set a weekly profile for <device>, eg. a heating sink.
You can define different switchingtimes for every day.
The new temperature is sent to the <device> automatically with
set <device> (desired-temp|desiredTemperature) <temp>
Because of the fhem-type of structures, a structures of heating sinks is sent "desired-temp":
Use an explicit command if you have structures of MAX heating thermostats.
If you have defined a <condition> and this condition is false if the switchingtime has reached, no command will executed.
A other case is to define an own perl command with <command>.
The following parameter are defined:
device
The device to switch at the given time.
language
Specifies the language used for definition and profiles.
de,en,fr are possible. The parameter is optional.
weekdays
Specifies the days for all timer in the Heating_Control.
The parameter is optional. For details see the weekdays part in profile.
profile
Define the weekly profile. All timings are separated by space. A switchingtime is defined
by the following example:
[<weekdays>|]<time>|<parameter>
weekdays: optional, if not set every day of the week is used.
Otherwise you can define a day with its number or its shortname.
0,su sunday
1,mo monday
2,tu tuesday
3,we wednesday
4 ...
7,$we weekend ($we)
8,!$we weekday (!$we)
It is possible to define $we or !$we in daylist to easily allow weekend an holiday. $we !$we are coded as 7 8, when using a numeric daylist.
time:define the time to switch, format: HH:MM:[SS](HH in 24 hour format) or a Perlfunction like {sunrise_abs()}. Within the {} you can use the variable $date(epoch) to get the exact switchingtimes of the week. Example: {sunrise_abs_dat($date)}
parameter:the temperature to be set, using a float with mask 99.9 or a sybolic value like eco or comfort - whatever your thermostat understands.
The symbolic value can be added an additional parameter: dayTemp:16 night-temp:15. See examples
command
If no condition is set, all the rest is interpreted as a command. Perl-code is setting up
by the well-known Block with {}.
Note: if a command is defined only this command is executed. In case of executing
a "set desired-temp" command, you must define the hole commandpart explicitly by yourself.
in the command section you can access the event:
The variable $EVENT will contain the complete event, e.g.
measured-temp: 21.7 (Celsius)
$EVTPART0,$EVTPART1,$EVTPART2,etc contain the space separated event
parts (e.g. $EVTPART0="measured-temp:", $EVTPART1="21.7",
$EVTPART2="(Celsius)". This data is available as a local
variable in perl, as environment variable for shell scripts, and will
be textually replaced for FHEM commands.
$NAME contains the device to send the event, e.g.
myFht
Note: the following is deprecated and will be removed in a future
release. The described replacement is attempted if none of the above
variables ($NAME/$EVENT/etc) found in the command.
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. The space separated event "parts"
are available as %EVTPART0, %EVTPART1, etc. A single %
looses its special meaning if any of these parameters appears in the
definition.
The following parameter are replaced:
@ => the device to switch
% => the new temperature
condition
if a condition is defined you must declare this with () and a valid perl-code.
The returnvalue must be boolean.
The parameter @ and % will be interpreted.
Example:
define HCB Heating_Control Bad_Heizung 12345|05:20|21 12345|05:25|comfort 17:20|21 17:25|eco
Mo-Fr are setting the temperature at 05:20 to 21°C, and at 05:25 to comfort.
Every day will be set the temperature at 17:20 to 21°C and 17:25 to eco.
define HCW Heating_Control WZ_Heizung 07:00|16 Mo,Tu,Th-Fr|16:00|18.5 20:00|12
{fhem("set dummy on"); fhem("set @ desired-temp %");}
At the given times and weekdays only(!) the command will be executed.
define HCW Heating_Control WZ_Heizung Sa-Su,We|08:00|21 (ReadingsVal("WeAreThere", "state", "no") eq "yes")
The temperature is only set if the dummy variable WeAreThere is "yes".
define HCW Heating_Control WZ_Heizung en Su-Fr|{sunrise_abs()}|21 Mo-Fr|{sunset_abs()}|16
The device is switched at sunrise/sunset. Language: english.
define HCW Heating_Control WZ_Heizung en Mo-Fr|{myFunction}|night-temp:18 Mo-Fr|{myFunction()}|dayTemp:16
The is switched at time myFunction(). It is sent the Command "night-temp 18" and "dayTemp 16".
If you want to have set all Heating_Controls their current value (after a temperature lowering phase holidays)
you can call the function Heating_Control_SetTemp(<"HC-device">) or Heating_Control_SetAllTemps().
This call can be automatically coupled to a dummy by a notify: define HeizStatus2 notify Heating:. * {Heating_Control_SetAllTemps()}
Some definitions without comment:
define hc WeekdayTimer WDdevice de 7|23:35|veryHigh 34|23:30|low 23:30|high 23:15|off 8|23:45|down
define hc WeekdayTimer WDdevice de fr,$we|23:35|veryHigh 34|23:30|low 23:30|high 23:15|off 12|23:45|down
define hc WeekdayTimer WDdevice de 20:35|veryHigh 34|14:30|low 21:30|high 21:15|off 12|23:00|down
define hw WeekdayTimer WDdevice de mo-so, $we|{sunrise_abs_dat($date)}|on mo-so, $we|{sunset_abs_dat($date)}|off
define ht WeekdayTimer WDdevice de mo-so,!$we|{sunrise_abs_dat($date)}|on mo-so,!$we|{sunset_abs_dat($date)}|off
define hh WeekdayTimer WDdevice de {sunrise_abs_dat($date)}|on {sunset_abs_dat($date)}|off
define hx WeekdayTimer WDdevice de 22:35|hi 23:00|on
The daylist can be given globaly for the whole WeekdayTimer:
define WD_Wohnen_an WeekdayTimer WDdevice de !$we 09:00|an 19:00|aus (bedingung("@", "%")
define WD_Wohnen_an WeekdayTimer WDdevice de $we 09:00|an 19:00|aus (bedingung("@", "%")
define WD_Wohnen_an WeekdayTimer WDdevice de 78 09:00|an 19:00|aus (bedingung("@", "%")
define WD_Wohnen_an WeekdayTimer WDdevice de 57 09:00|an 19:00|aus (bedingung("@", "%")
define WD_Wohnen_an WeekdayTimer WDdevice de fr,$we 09:00|an 19:00|aus (bedingung("@", "%")
Set
N/A
Get
N/A
Attributes
delayedExecutionCond
defines a delay Function. When returning true, the switching of the device is delayed until the function retruns a false value. The behavior is just like a windowsensor.
Example:
attr hc delayedExecutionCond isDelayed("%HEATING_CONTROL","%WEEKDAYTIMER","%TIME","%NAME","%EVENT")
the parameters %HEATING_CONTROL(timer name) %TIME %NAME(device name) %EVENT are replaced at runtime by the correct value.
switchInThePast
defines that the depending device will be switched in the past in definition and startup phase when the device is not recognized as a heating.
Heatings are always switched in the past.
windowSensor Defines a list of window sensors. When one of its window state readings is open the aktual switch is delayed.
Hideki
The Hideki module is a module for decoding weather sensors, which use the hideki protocol. Known brands are Bresser, Cresta, TFA and Hama.
Supported Brands
Hama
Bresser
TFA Dostman
Arduinos with remote Sensor lib from Randy Simons
Cresta
Hideki
all other devices, which use the Hideki protocol
Please note, currently temp/hum devices are implemented. Please report data for other sensortypes.
Define
define <name> Hideki <code>
<code> is the address of the sensor device and
is build by the sensor type and the channelnumber (1 to 5) or if the attribute longid is specfied an autogenerated address build when inserting
the battery (this adress will change every time changing the battery).
If autocreate is enabled, the device will be defined via autocreate. This is also the preferred mode of defining such a device.
Hourcounter can detect both the activiy-time and the inactivity-time of a property.
The "pattern_for_ON" identifies the events, that signal the activity of the desired property.
The "pattern_for_OFF" identifies the events, that signal the inactivity of the desired property.
If "pattern_for_OFF" is not defined, any matching event of "patter_for_ON" will be counted.
Otherwise only the rising edges of "pattern_for_ON" will be counted.
This means a "pattern_for_OFF"-event must be detected before a "pattern_for_ON"-event is accepted.
"pattern_for_ON" and "pattern_for_OFF" must be formed using the following structure:
device:[regexp]
The forming-rules are the same as for the notify-command.
clears the readings countsPerDay, countsOverall,pauseTimeIncrement, pauseTimePerDay, pauseTimeOverall,
pulseTimeIncrement, pulseTimePerDay, pulseTimeOverall by setting to 0.
The reading clearDate is set to the current Date/Time.
set <name> countsOverall <value>
Sets the reading countsOverall to the given value.This is the total-counter.
set <name> countsPerDay <value>
Sets the reading countsPerDay to the given value. This reading will automatically be set to 0, after change
of day.
set <name> pauseTimeIncrement <value>
Sets the reading pauseTimeIncrement to the given value.
This reading in seconds is automatically set after a rising edge.
set <name> pauseTimeEdge <value>
Sets the reading pauseTimeEdge to the given value.
This reading in seconds is automatically set after a rising edge.
set <name> pauseTimeOverall <value>
Sets the reading pauseTimeOverall to the given value.
This reading in seconds is automatically adjusted after a change of pauseTimeIncrement.
set <name> pauseTimePerDay <value>
Sets the reading pauseTimePerDay to the given value.
This reading in seconds is automatically adjusted after a change of pauseTimeIncrement and set to 0 after
change of day.
set <name> pulseTimeIncrement <value>
Sets the reading pulseTimeIncrement to the given value.
This reading in seconds is automatically set after a falling edge of the property.
set <name> pulseTimeEdge <value>
Sets the reading pulseTimeEdge to the given value.
This reading in seconds is automatically set after a rising edge.
set <name> pulseTimeOverall <value>
Sets the reading pulseTimeOverall to the given value.
This reading in seconds is automatically adjusted after a change of pulseTimeIncrement.
set <name> pulseTimePerDay <value>
Sets the reading pulseTimePerDay to the given value.
This reading in seconds is automatically adjusted after a change of pulseTimeIncrement and set to 0 after
change of day.
set <name> forceHourChange
This modifies the reading tickHour, which is automatically modified after change of hour.
set <name> forceDayChange
This modifies the reading tickDay, which is automatically modified after change of day.
set <name> forceWeekChange
This modifies the reading tickWeek, which is automatically modified after change of week.
set <name> forceMonthChange
This modifies the reading tickMonth, which is automatically modified after change of month.
set <name> forceYearChange
This modifies the reading tickYear, which is automatically modified after change of year.
set <name> app.* <value>
Any reading with the leading term "app", can be modified.
This can be useful for user-readings.
Get-Commands
get <name> version
Get the current version of the module.
Attributes
interval
the update interval for pulse/pause-time in minutes [default 60]
The file 99_UtilsHourCounter.pm is a reference implementation for user defined extensions.
It shows how to create sum values for hours,days, weeks, months and years.
This file is located in the sub-folder contrib. For further information take a look to FHEM Wiki.
I2C_BMP180
With this module you can read values from the digital pressure sensors BMP180 and BMP085
via the i2c bus on Raspberry Pi.
There are two possibilities connecting to I2C bus:
via RPII2C module
The I2C messages are send through an I2C interface module like RPII2C, FRM
or NetzerI2C so this device must be defined first. attribute IODev must be set
via HiPi library
Add these two lines to your /etc/modules file to load the I2C relevant kernel modules
automaticly during booting your Raspberry Pi.
To change the permissions of the I2C device create file:
/etc/udev/rules.d/98_i2c.rules
with this content:
SUBSYSTEM=="i2c-dev", MODE="0666"
Reboot
To use the sensor on the second I2C bus at P5 connector
(only for version 2 of Raspberry Pi) you must add the bold
line of following code to your FHEM start script:
case "$1" in
'start')
sudo hipi-i2c e 0 1
...
Define
define BMP180 I2C_BMP180 [<I2C device>]
<I2C device> must not be used if you connect via RPII2C module. For HiPi it's mandatory.
Reads the current temperature and pressure values from sensor.
Normaly this execute automaticly at each poll intervall. You can execute
this manually if you want query the current values.
Get
N/A
Attributes
oversampling_settings
Controls the oversampling setting of the pressure measurement in the sensor.
Default: 3, valid values: 0, 1, 2, 3
poll_interval
Set the polling interval in minutes to query the sensor for new measured
values.
Default: 5, valid values: 1, 2, 5, 10, 20, 30
roundTemperatureDecimal
Round temperature values to given decimal places.
Default: 1, valid values: 0, 1, 2
roundPressureDecimal
Round temperature values to given decimal places.
Default: 1, valid values: 0, 1, 2
altitude
if set, this altitude is used for calculating the pressure related to sea level (nautic null) NN
Note: this is a global attributes, e.g
attr global altitude 220
I2C_DS1307
reads a DS1307 real-time clock chip via I2C.
Requires a defined I2C-device to work. Define
define <name> I2C_DS1307 <i2c-address>
Specifies the I2C_DS1307 device.
i2c-address is the (device-specific) address of the ic on the i2c-bus
Set
set <name> datetime; set DS1307 time. Format is JJJJ-MM-DD HH:MM:SSdisplayed>
set <name> now
Get
N/A
Attributes
poll_interval <seconds>
IODev
Specify which I2C to use. (Optional, only required if there is more
than one I2C-device defined.)
Provides an interface to an I2C EEPROM.
The I2C messages are send through an I2C interface module like RPII2C, FRM
or NetzerI2C so this device must be defined first. attribute IODev must be set Define
define <name> I2C_EEPROM <I2C Address>
where <I2C Address> is without direction bit
Set
set <name> <byte address> <value>
where <byte address> is a number (0..device specific) and <value> is a number (0..255)
both numbers can be written in decimal or hexadecimal notation.
Example:
set eeprom1 0x02 0xAA set eeprom1 2 170
Get
get <name>
refreshes all readings
get <name> <byte address> [Bit<bitnumber(0..7)>]
returnes actual reading of stated <byte address> or a single bit of <byte address>
Values are readout from readings, NOT from device!
Attributes
poll_interval
Set the polling interval in minutes to query the EEPROM content
Default: -, valid values: decimal number
EEPROM_size
Sets the storage size of the EEPROM
Default: 128, valid values: 128 (128bit), 2k (2048bit)
drives LiquidCrystal Displays (LCD) that are connected to Firmata (via I2C).
Supported are Displays that use a PCF8574T as I2C Bridge (as found on eBay when searching for
'LCD' and 'I2C'). Tested is the 1602 type (16 characters, 2 Lines), the 2004 type (and other cheap chinise-made
I2C-LCDs for Arduino) ship with the same library, so they should work as well.
See http://arduino.cc/en/Tutorial/LiquidCrystal for details about
how to hook up the LCD to the arduino.
Requires a defined I2C-device to work.
this I2C-device has to be configures for i2c by setting attr 'i2c-config' on the I2C-device Define
define <name> I2C_LCD <size-x> <size-y> <i2c-address>
Specifies the I2C_LCD device.
size-x is the number of characters per line
size-y is the numbers of rows.
i2c-address is the (device-specific) address of the ic on the i2c-bus
Set
set <name> text <text to be displayed>
set <name> home
set <name> clear
set <name> display on|off
set <name> cursor <...>
set <name> scroll left|right
set <name> backlight on|off
set <name> reset
set <name> writeXY x-pos,y-pos,len[,l] <text to be displayed>
Get
N/A
Attributes
backLight <on|off>
autoClear <on|off>
autoBreak <on|off>
restoreOnStartup <on|off>
restoreOnReconnect <on|off>
replaceRegex ä=ae,cd+=ef,g=\x{DF}
specify find=replace regex pattern eg for non-printable characters. \x{DF} will become char 223, which is º on my lcd.
customChar<0-7>
up to 8 5x8px custom chars, see http://www.quinapalus.com/hd44780udg.html for a generator, use \x{00} to \x{07} to display
IODev
Specify which I2C to use. (Optional, only required if there is more
than one I2C-device defined.)
Provides an interface to the MCP23008 16 channel port extender IC. On Raspberry Pi the Interrupt Pin's can be connected to an GPIO and RPI_GPIO can be used to get the port values if an interrupt occurs.
The I2C messages are send through an I2C interface module like RPII2C, FRM
or NetzerI2C so this device must be defined first. attribute IODev must be set Define
define <name> I2C_MCP23008 <I2C Address>
where <I2C Address> is without direction bit
Set
set <name> <port[,port[...]]> <value>
where <port> is one of PortA0 to PortA7 and <value> is one of:
off
on
Example:
set mod1 PortA4 on set mod1 PortA4,PortA6 off set mod1 PortA4,A6 on
Get
get <name>
refreshes all readings
Attributes
poll_interval
Set the polling interval in minutes to query the GPIO's level
Default: -, valid values: decimal number
OutputPorts
Comma separated list of ports that are used as Output
Ports not in this list can't be written
Default: no, valid values: A0-A7
OnStartup
Comma separated list of output ports and their desired state after start
Without this atribut all output ports will set to last state
Default: -, valid values: <port>=on|off|last where <port> = A0-A7
Pullup
Comma separated list of input ports which switch on their internal 100k pullup
Default: -, valid values: A0-A7
Interrupt
Comma separated list of input ports which will trigger the IntA/B pin
Default: -, valid values: A0-A7
invert_input
Comma separated list of input ports which use inverted logic
Default: -, valid values: A0-A7
InterruptOut
Configuration options for INT output pin
Values:
Provides an interface to the MCP23017 16 channel port extender IC. On Raspberry Pi the Interrupt Pin's can be connected to an GPIO and RPI_GPIO can be used to get the port values if an interrupt occurs.
The I2C messages are send through an I2C interface module like RPII2C, FRM
or NetzerI2C so this device must be defined first. attribute IODev must be set Define
define <name> I2C_MCP23017 <I2C Address>
where <I2C Address> is without direction bit
Set
set <name> <port[,port[...]]> <value>
where <port> is one of PortA0 to PortA7 / PortB0 to PortB7 and <value> is one of:
off
on
Example:
set mod1 PortA4 on set mod1 PortA4,PortB6 off set mod1 PortA4,B6 on
Get
get <name>
refreshes all readings
Attributes
poll_interval
Set the polling interval in minutes to query the GPIO's level
Default: -, valid values: decimal number
OutputPorts
Comma separated list of ports that are used as Output
Ports not in this list can't be written
Default: no, valid values: A0-A7, B0-B7
OnStartup
Comma separated list of output ports and their desired state after start
Without this atribut all output ports will set to last state
Default: -, valid values: <port>=on|off|last where <port> = A0-A7, B0-B7
Pullup
Comma separated list of input ports which switch on their internal 100k pullup
Default: -, valid values: A0-A7, B0-B7
Interrupt
Comma separated list of input ports which will trigger the IntA/B pin
Default: -, valid values: A0-A7, B0-B7
invert_input
Comma separated list of input ports which use inverted logic
Default: -, valid values: A0-A7, B0-B7
InterruptOut
Configuration options for INTA/INTB output pins
Values:
separate_active-low (INTA/INTB outputs are separate for both ports and active low)
separate_active-high (INTA/INTB outputs are separate for both ports and active high)
separate_open-drain (INTA/INTB outputs are separate for both ports and open drain)
connected_active-low (INTA/INTB outputs are internally connected and active low)
connected_active-high (INTA/INTB outputs are internally connected and active high)
connected_open-drain (INTA/INTB outputs are internally connected and open drain)
Provides an interface to the MCP3422/3/4 A/D converter.
The I2C messages are send through an I2C interface module like RPII2C, FRM
or NetzerI2C so this device must be defined first. attribute IODev must be set Define
define <name> I2C_MCP342x [[<I2C Address>] <n channels>]
where <I2C Address> is without direction bit and <n channels> is the number of A/D channels
Get
get <name> [[[<channel>] <resolution> ] <gain>]
Returns the level on specific <channel>. <resolution> and <gain> will override attibutes for actual operation.
Without attributes only the readings will be refreshed.
Attributes
poll_interval
Set the polling interval in minutes to query data from sensor
Default: 5, valid values: 1,2,5,10,20,30
Following attributes are separate for all channels.
ch1resolution
resolution settings
the bigger the resolution the longer the conversion time.
Default: 12, valid values: 12,14,16,18
ch1gain
gain setting
Important: the gain setting will reduce the measurement range an may produce an overflow. In this case "overflow" will be added to reading
Default: 1, valid values: 1,2,4,8
ch1factor
correction factor (will be mutiplied to channel value)
Default: 1, valid values: number
ch1roundDecimal
Number of decimal places for value
Default: 3, valid values: 0,1,2,3
Provides an interface to the PCA9532 I2C 16 channel PWM IC.
The PCA9532 has 2 independent PWM stages and every channel can be attached to on of these stages or directly turned on or off.
The I2C messages are send through an I2C interface module like RPII2C, FRM
or NetzerI2C so this device must be defined first. attribute IODev must be set Define
define <name> I2C_PCA9532 <I2C Address>
where <I2C Address> is an 2 digit hexadecimal value
Set
set <name> <port> <value>
if <port> is one of Port0 to Port15, then <value> will be one of:
off
on
PWM0 (output is switched with PWM0 frequency and duty cycle)
PWM1 (output is switched with PWM1 frequency and duty cycle)
if <port> is PWM0 or PWM1, then <value> is an value between 0 and 255 and stands for the duty cycle of the PWM stage.
Examples:
set mod1 Port4 PWM1 set mod1 PWM1 128
Get
get <name>
refreshes all readings
Attributes
poll_interval
Set the polling interval in minutes to query the GPIO's level
Default: -, valid values: decimal number
OutputPorts
Comma separated list of Portnumers that are used as Outputs
Only ports in this list can be written
Default: no, valid values: 0 1 2 .. 15
OnStartup
Comma separated list of output ports/PWM registers and their desired state after start
Without this atribut all output ports will set to last state
Default: -, valid values: <port>=on|off|PWM0|PWM1|last or PWM0|PWM1=0..255|last where <port> = 0 - 15
T0/T1
Sets PWM0/PWM1 to another Frequency. The Formula is: Fx = 152/(Tx + 1) The corresponding frequency value is shown under internals.
Default: 0 (152Hz), valid values: 0-255
Provides an interface to the PCA9532 8 channel port extender IC. On Raspberry Pi the Interrupt Pin can be connected to an GPIO and RPI_GPIO can be used to get the port values if an interrupt occurs.
The I2C messages are send through an I2C interface module like RPII2C, FRM
or NetzerI2C so this device must be defined first. attribute IODev must be set Define
define <name> I2C_PCF8574 <I2C Address>
where <I2C Address> is without direction bit
Set
set <name> <port[,port[...]]> <value>
<port> is one of Port0 to Port7 and <value> is one of:
off
on
Example:
set mod1 Port4 on set mod1 Port4,Port6 off set mod1 Port4,6 on
Get
get <name>
refreshes all readings
Attributes
poll_interval
Set the polling interval in minutes to query the GPIO's level
Default: -, valid values: decimal number
InputPorts
Space separated list of Portnumers that are used as Inputs
Ports in this list can't be written
Default: no, valid values: 0 1 2 .. 7
OnStartup
Comma separated list of output ports and their desired state after start
Without this atribut all output ports will set to last state
Default: -, valid values: <port>=on|off|last where <port> = 0 - 7
Provides an interface to the SHT21 I2C Humidity sensor from Sensirion.
The I2C messages are send through an I2C interface module like RPII2C, FRM
or NetzerI2C so this device must be defined first. attribute IODev must be set Define
define <name> I2C_SHT21 [<I2C Address>]
where <I2C Address> is an 2 digit hexadecimal value
Set
set <name> readValues
Reads the current temperature and humidity values from sensor.
Attributes
poll_interval
Set the polling interval in minutes to query data from sensor
Default: 5, valid values: 1,2,5,10,20,30
roundHumidityDecimal
Number of decimal places for humidity value
Default: 1, valid values: 0 1 2
roundTemperatureDecimal
Number of decimal places for temperature value
Default: 1, valid values: 0,1,2
With this module you can read values from the ambient light sensor TSL2561
via the i2c bus on Raspberry Pi.
The luminosity value returned is a good human eye reponse approximation of an
illumination measurement in the range of 0.1 to 40000+ lux (but not a replacement for a
precision measurement, relation between measured value and true value may vary by 40%).
There are two possibilities connecting to I2C bus:
via IODev module
The I2C messages are send through an I2C interface module like RPII2C, FRM
or NetzerI2C so this device must be defined first. attribute IODev must be set
via HiPi library
Add these two lines to your /etc/modules file to load the I2C relevant kernel modules
automaticly during booting your Raspberry Pi.
To change the permissions of the I2C device create file:
/etc/udev/rules.d/98_i2c.rules
with this content:
SUBSYSTEM=="i2c-dev", MODE="0666"
Reboot
To use the sensor on the second I2C bus at P5 connector
(only for version 2 of Raspberry Pi) you must add the bold
line of following code to your FHEM start script:
<I2C device> mandatory for HiPi, must be omitted if you connect via IODev
<I2C address> may be 0x29, 0x39 or 0x49 (and 'AUTO' when using IODev to search for device at startup and after an I2C error)
Force immediate illumination measurement and restart a new poll_interval.
Note that the new readings are not yet available after set returns because the
measurement is performed asynchronously. Depending on the attributes integration time,
autoGain and autoIntegrationTime this may require more than one second to complete.
Readings
luminosity
Good human eye reponse approximation of an illumination measurement in the range of 0.1 to 40000+ lux.
Rounded to 3 significant digits or one fractional digit.
broadband
Broadband spectrum sensor sample.
Enable attribute normalizeRawValues for continuous readings independed of actual gain and integration time settings.
ir
Infrared spectrum sensor sample.
Enable attribute normalizeRawValues for continuous readings independed of actual gain and integration time settings.
gain
sensor gain used for current luminosity measurement (1 or 16)
integrationTime
integration time in seconds used for current luminosity measurement
IODev
Set the name of an IODev module. If undefined the perl modules HiPi::Device::I2C are required.
Default: undefined
poll_interval
Set the polling interval in minutes to query the sensor for new measured values.
Default: 5, valid values: 1, 2, 5, 10, 20, 30
gain
Set gain factor. Attribute will be ignored if autoGain is enabled.
Default: 1, valid values: 1, 16
integrationTime
Set time in ms the sensor takes to measure the light. Attribute will be ignored if autoIntegrationTime is enabled.
Default: 13, valid values: 13, 101, 402
See this tutorial
for more details.
autoGain
Enable auto gain. If set to 1, the gain parameter is adjusted automatically depending on light conditions.
Default: 1, valid values: 0, 1
autoIntegrationTime
Enable auto integration time. If set to 1, the integration time parameter is adjusted automatically depending on light conditions.
Default: 0, valid values: 0, 1
normalizeRawValues
Scale the sensor raw values broadband and ir depending on actual gain and integrationTime to the equivalent of the settings for maximum sensitivity (gain=16 and integrationTime=403ms). This feature may be useful when autoGain or autoIntegrationTime is enabled to provide continuous values instead of jumping values when gain or integration time changes.
Default: 0, valid values: 0, 1
floatArithmetics
Enable float arithmetics.
If set to 0, the luminosity is calculated using int arithmetics (for very low powered platforms).
If set to 1, the luminosity is calculated using float arithmetics, yielding some additional precision.
Default: 1, valid values: 0, 1
<format> and [<regular expression>] are filter options und are optional.
possible <format>:
'd' for decimal number
If only the state of a device is to be used, then only the device can be specified:
[<device>] corresponsed to [<device>:&STATE]
Examples:
IF in combination with at-module, Reading specified in the condition:
define check at +00:10 IF ([outdoor:humidity] > 70) (set switch1 off) ELSE (set switch1 on)
IF state query of the device "outdoor" in the condition:
define check at +00:10 IF ([outdoor] eq "open") (set switch1 on)
corresponds with details of the internal:
define check at +00:10 IF ([outdoor:&STATE] eq "open") (set switch1 on)
If the reading "state" to be queried, then the name of reading is specified without &:
define check at +00:10 IF ([outdoor:state] eq "open") (set switch1 on)
Nested IF commands (It can be entered in the DEF input on multiple lines with indentation for better representation):
define test notify lamp
IF ([lampe] eq "on") (
IF ([outdoor:humidity] < 70) (set lamp off)
ELSE (set lamp on)
) ELSE (set switch on)
Filter by numbers in Reading "temperature":
define settemp at 22:00 IF ([tempsens:temperature:d] >= 10) (set heating on)
Filter by "on" and "off" in the status of the device "move":
define activity notify move IF ([move:&STATE:[(on|off)]] eq "on" and $we) (set lamp off)
Example of the use of Readings in the then-case:
define temp at 18:00 IF ([outdoor:temperature] > 10) (set lampe [dummy])
If an expression is to be evaluated first in a FHEM command, then it must be enclosed in brackets.
For example, if at 18:00 clock the outside temperature is higher than 10 degrees, the desired temperature is increased by 1 degree:
define temp at 18:00 IF ([outdoor:temperature] > 10) (set thermostat desired-temp {([thermostat:desired-temp:d]+1)})
Multiple commands are separated by a comma instead of a semicolon, thus eliminating the doubling, quadrupling, etc. of the semicolon:
define check at +00:10 IF ([outdoor:humidity] > 10) (set switch1 off,set switch2 on) ELSE (set switch1 on,set switch2 off)
If a comma in FHEM expression occurs, this must be additionally bracketed so that the comma is not recognized as a delimiter:
define check at +00:10 IF ([outdoor:humidity] > 10) ((set switch1,switch2 off))
IF in combination with a define at multiple set commands:
define check at *10:00 IF ([indoor] eq "on") (define a_test at +00:10 set lampe1 on;;set lampe2 off;;set temp desired 20)
The comma can be combined as a separator between the FHEM commands with double semicolon, eg:
define check at *10:00 IF ([indoor] eq "on") (set lamp1 on,define a_test at +00:10 set lampe2 on;;set lampe3 off;;set temp desired 20)
Time-dependent switch: In the period 20:00 to 22:00 clock the light should go off when it was on and I leave the room:
define n_lamp_off notify sensor IF ($hms gt "20:00" and $hms lt "22:00" and [sensor] eq "absent") (set lamp:FILTER=STATE!=off off)
Combination of Perl and FHEM commands ($NAME and $EVENT can also be used):
define mail notify door:open IF ([alarm] eq "on")({system("wmail $NAME:$EVENT")},set alarm_signal on)
IPCAM
Define
define <name> IPCAM <ip[:port]>
Defines a network camera device to trigger snapshots on events.
Network cameras (IP cameras) usually have a build-in function to create
snapshot images. This module enables the event- or time-controlled
recording of these images.
In addition, this module allows the recording of many image formats like
JPEG, PNG, GIF, TIFF, BMP, ICO, PPM, XPM, XBM and SVG. The only requirement
is that the recorded image must be accessible via a URL.
So it is also possible to record images of e.g. a public Weather Camera
from the internet or any picture of a website.
Furthermore, it is possible to control the camera via PTZ-mode or custom commands.
Examples:
A local ip-cam takes 5 snapshots with 10 seconds delay per call:
define schloss IPCAM www2.braunschweig.de attr schloss path webcam/schloss.jpg attr schloss storage /srv/share/surveillance/snapshots
An at-Job takes every hour a snapshot:
define snapshot_schloss at +*00:01:00 get schloss image
Move the camera up:
set ipcam tilt up
Move the camera to a the predefined position 4:
set ipcam pos 4
Set
set <name> <value> <argument>
where value is one of:
cmd 1 .. 15
Sets the camera to a custom defined command. The command must be defined as an
attribute first.
You can define up to 15 custom commands. The given number always relates to an
equivalent attribute cmd<number>.
pan <direction> [steps]
Move the camera to the given <direction>, where <direction>
could be left or right.
The command always relates to an equivalent attribute cmdPan<direction>.
Furthermore, a step size can be specified, which relates to the equivalent attribute
cmdStep.
pos 1 .. 15|home
Sets the camera to a custom defined position in PTZ mode. The position must be
defined as an attribute first.
You can define up to 15 custom positions and a predefined home position. The given
number always relates to an equivalent attribute cmdPos<number>.
tilt <direction> [steps]
Move the camera to the given <direction>, where <direction>
could be up or down.
The command always relates to an equivalent attribute cmdPan<direction>.
Furthermore, a step size can be specified, which relates to the equivalent attribute
cmdStep.
raw <argument>
Sets the camera to a custom defined argument.
Get
get <name> <value>
where value is one of:
image
Get one or more images of the defined IP-Cam. The number of images
and the time interval between images can be specified using the
attributes snapshots and delay.
last
Show the name of the last snapshot.
snapshots
Show the total number of a image sequence.
Attributes
basicauth
If your camera supports authentication like http://username:password@domain.com/, you
can store your creditials within the basicauth attribute.
If you prefer to store the credentials in a file (take a look at the attribute credentials)
you have to set the placeholder {USERNAME} and {PASSWORD} in the basicauth string.
These placeholders will be replaced with the values from the credentials file.
Example: attr ipcam3 basicauth {USERNAME}:{PASSWORD}
cmd01, cmd02, cmd03, .. cmd13, cdm14, cdm15
It is possible to define up to 15 custom commands.
Examples: attr ipcam cmd01 led_mode=0 attr ipcam cmd02 resolution=8
cmdPanLeft, cmdPanRight, cmdTiltUp, cmdTiltDown, cmdStep
Depending of the camera model, are different commands necessary.
Examples: attr ipcam cmdTiltUp command=0 attr ipcam cmdTiltDown command=2 attr ipcam cmdPanLeft command=4 attr ipcam cmdPanRight command=6 attr ipcam cmdStep onstep
cmdPos01, cmdPos02, cmdPos03, .. cmdPos13, cmdPos14, cmdPos15, cmdPosHome
It is possible to define up to 15 predefined position in PTZ-mode.
Examples: attr ipcam cmdPosHome command=25 attr ipcam cmdPos01 command=31 attr ipcam cmdPos02 command=33
credentials
Defines the location of the credentials file.
If you prefer to store your cam credentials in a file instead be a part of the
URI (see attributes path and query), set the full path
with filename on this attribute.
Example: attr ipcam3 credentials /etc/fhem/ipcam.conf
Replace <name_cam1> respectively <name_cam2>
with the names of your defined ip-cams and <your_username> respectively
<your_password> with your credentials (all without the brackets
< and >!).
delay
Defines the time interval between snapshots in seconds.
If more then one snapshot is taken, then it makes sense to define a short delay
between the snapshots. On the one hand, the camera is not addressed in short intervals
and the second may be better represented movements between images.
Example: attr ipcam3 delay 10
path
Defines the path and query component of the complete URI to get a snapshot of the
camera. Is the full URI of your ip-cam for example http://CAMERA_IP/snapshot.cgi?user=admin&pwd=password,
then only the path and query part is specified here (without the leading slash (/).
Example: attr ipcam3 path snapshot.cgi?user=admin&pwd=password
If you prefer to store the credentials in a file (take a look at the attribute credentials)
you have to set the placeholder {USERNAME} and {PASSWORD} in the path string. These placeholders
will be replaced with the values from the credentials file.
Example: attr ipcam3 path snapshot.cgi?user={USERNAME}&pwd={PASSWORD}
pathCmd
Defines a path for the custom commands, if it is necessary.
Example: attr ipcam3 pathCmd set_misc.cgi
pathPanTilt
Defines a path for the PTZ-mode commands pan, tilt and pos,
if it is necessary.
Example: attr ipcam3 pathPanTilt decoder_control.cgi?user={USERNAME}&pwd={PASSWORD}
snapshots
Defines the total number of snapshots to be taken with the get <name> image command.
If this attribute is not defined, then the default value is 1.
The snapshots are stored in the given path of the attribute storage and are
numbered sequentially (starts with 1) like snapshot_01, snapshot_02, etc.
Furthermore, an additional file last will be saved, which is identical with
the last snapshot-image. The module checks the imagetype and stores all these files with
the devicename and a correct extension, e.g. <devicename>_snapshot_01.jpg.
If you like a timestamp instead a sequentially number, take a look at the attribute timestamp.
All files are overwritten on every get <name> image command (except: snapshots
with a timestamp. So, keep an eye on your diskspace if you use a timestamp extension!).
Example: attr ipcam3 snapshots 5
storage
Defines the location for the file storage of the snapshots.
Default: $modpath/www/snapshots
Example: attr ipcam3 storage /srv/share/surveillance/snapshots
timestamp
If this attribute is unset or set to 0, snapshots are stored with a sequentially number
like <devicename>_snapshot_01.jpg, <devicename>_snapshot_02.jpg, etc.
If you like filenames with a timestamp postfix, e.g. <devicename>_20121023_002602.jpg,
set this attribute to 1.
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
N/A
Get
get <name> status
Gets actual data from device for sensors with data
The InterTechno 433MHZ protocol is used by a wide range of devices, which are either of
the sender/sensor or the receiver/actuator category.
Right now, we are able to SEND and RECEIVE InterTechno commands.
Supported are devices like switches, dimmers, etc. through an CUL device, this must be defined first.
This module supports Intertechno protocol version 1 and version 3.
Newly found devices are added into the category "IT" by autocreate.
Hint: IT protocol 1 devices are created on pressing the on-button.
Define
define <name> IT <housecode> <on-code> <off-code>
[<dimup-code>] [<dimdown-code>] or define <name> IT <ITRotarySwitches|FLS100RotarySwitches> or define <name> IT <address 26 Bit> <group bit> <unit Code>
The value of housecode is a 10-digit InterTechno Code, consisting of 0/1/F as it is
defined as a tri-state protocol. These digits depend on the device you are using.
Bit 11 and 12 are used for switching/dimming. As different manufacturers are using
different bit-codes you can specifiy here the 2-digit code for off/on/dimup/dimdown
in the same form: 0/1/F.
The value of ITRotarySwitches consists of the value of the alpha switch A-P and
the numeric switch 1-16 as set on the intertechno device. E.g. A1 or G12.
The value of FLS100RotarySwitches consist of the value of the I,II,II,IV switch
and the numeric 1,2,3,4 swicht. E.g. I2 or IV4.
The value of ITRotarySwitches and FLS100RotarySwitches are internaly translated
into a houscode value.
<housecode> is a 10 digit tri-state number (0/1/F) depending on
your device setting (see list below).
<on-code> is a 2 digit tri-state number for switching your device on;
It is appended to the housecode to build the 12-digits IT-Message.
<off-code> is a 2 digit tri-state number for switching your device off;
It is appended to the housecode to build the 12-digits IT-Message.
The optional <dimup-code> is a 2 digit tri-state number for dimming your device up;
It is appended to the housecode to build the 12-digits IT-Message.
The optional <dimdown-code> is a 2 digit tri-state number for dimming your device down;
It is appended to the housecode to build the 12-digits IT-Message.
Examples:
define lamp IT 01FF010101 11 00 01 10 define roll1 IT 111111111F 11 00 01 10 define otherlamp IT 000000000F 11 10 00 00 define otherroll1 IT FFFFFFF00F 11 10 define itswitch1 IT A1 define lamp IT J10 define flsswitch1 IT IV1 define lamp IT II2
For Intertechno protocol 3 the <housecode> is a 26-digits number.
Additionaly there are a 4-digits unit code and a 1-digit group code used.
<address> is a 26 digit number (0/1)
<group> is a 1 digit number (0/1)
<unit> is a 4 digit number (0/1)
Examples:
define myITSwitch IT 00111100110101010110011111 0 0000
Set
set <name> <value> [<time>]
where value is one of:
dimdown
dimup
off
on
on-till # Special, see the note
dim06% dim12% dim18% dim25% dim31% dim37% dim43% dim50%
dim56% dim62% dim68% dim75% dim81% dim87% dim93% dim100%
set lamp on set lamp1,lamp2,lamp3 on set lamp1-lamp3 on set lamp off
Notes:
on-till requires an absolute time in the "at" format (HH:MM:SS, HH:MM
or { <perl code> }, where the perl-code returns a time specification).
If the current time is greater than the specified time, the
command is ignored, else an "on" command is generated, and for the
given "till-time" an off command is scheduleld via the at command.
Get
N/A
Attributes
IODev
Set the IO device which will be used to send signals
for this device. An example for the physical device is a CUL.
Note: On startup, fhem DOES NOT assign an InterTechno device to an
IODevice! The attribute IODev needs to be used ALWAYS!
eventMap
Replace event names and set arguments. The value of this attribute
consists of a list of space separated values. Each value is a colon
separated pair. The first part specifies the "old" value, the second
the new/desired value. If the first character is slash(/) or comma(,)
the values are not separated by space but by this character to
enable spaces in values.
Examples:
attr store eventMap on:open off:closed
attr store eventMap /on-for-timer 10:open/off:closed/
set store open
dummy
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.
model
The model attribute denotes the type of the device.
This attribute will (currently) not be used by 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 switch, "dim..%" to dimmers etc.).
The spelling of the model should match the modelname used in the
documentation that comes which the device. The name should consist of
lower-case characters without spaces. Valid characters are
a-z 0-9 and - (dash),
other characters should not be used. Here is a list of "official"
devices: Sender/Sensor: itremote Dimmer: itdimmer Receiver/Actor: itswitch
ignore
Ignore this device, e.g. if it belongs to your neighbour. The device
won't trigger any FileLogs/notifys, issued commands will be silently
ignored (no RF signal will be sent out, just like for the dummy attribute). The device won't appear in the
list command (only if it is explicitely asked for it), nor will it
be affected by commands which use wildcards or attributes as name specifiers
(see devspec). You still get them with the
"ignored=1" special devspec.
Generated events:
From an IT device you can receive the following events.
Layout will be reread automatically if edited via fhem's "Edit files" function.
Autoread can be disabled via attribute.
set <name> ovEnable <xconditionName>
set an override "1" to named xcondition
set <name> ovDisable <xconditionName>
set an override "0" to named xcondition
set <name> ovClear <xconditionName>|all;
delete an existing overrides to named xcondition. "all" will clear all overrides.
Get-Commands
get <name> counter
return value from internal counter
get <name> layout
return complete layout definition
get <name> overrides
return list of defined overrides
Attributes
autoreread - disables automatic layout reread after edit if set to 1
refresh - time (in seconds) after which the HTML page will be reloaded automatically.
Any values below 60 seconds will not become valid.
showTime - disables generation timestamp in state if set to 0
size - The dimensions of the picture in the format
<width>x<height>
useViewPort - add viewport meta tag to fit mobile displays
title - webpage title to be shown in Browser
bgcenter - background images will not be centered if attribute set to 0. Default: show centered
bgcolor - defines the background color, use html-hexcodes to specify color, eg 00FF00 for green background. Default color is black. You can use bgcolor=none to disable use of any background color
bgdir - directory containing background images
bgopacity - set opacity for background image, values 0...1.0
tmin - background picture will be shown at least tmin seconds,
no matter how frequently the RSS feed consumer accesses the page.
Important: bgcolor and bgdir will be evaluated by { <perl special> } use quotes for absolute values!
Generated Readings/Events:
state - show time and date of last layout evaluation
Layout definition
All parameters in curly brackets can be evaluated by { <perl special> }
area <id> <x1> <y1> <x2> <y2> <{link}>
create a responsive area which will call a link when clicked.
id = element id
x1,y1 = upper left corner
x2,y2 = lower right corner
link = url to be called
boxcolor <{rgba}>
define an rgb color code to be used for filling button and textbox
create a responsive colored button which will call a link when clicked.
id = element id
x1,y1 = upper left corner
x2,y2 = lower right corner
r1,r2 = radius for rounded corners
link = url to be called
text = text that will be written onto the button
button will be filled with color defined by "boxcolor"
text color will be read from "rgb" value
buttonpanel
needed once in your layout file if you intend to use buttons in the same layout.
circle <id> <x> <y> <r> [<fill>] [<stroke-width>] [<link>]
create a circle
id = element id
x,y = center coordinates of circle
r = radius
fill = circle will be filled with "rgb" color if set to 1. Default = 0
stroke-width = defines stroke width to draw around the circle. Default = 0
link = URL to be linked to item
counter <id> <x> <y>
print internal counter
id = element id
x,y = position
date <id> <x> <y>
print date
id = element id
x,y = position
embed <id> <x> <y> <width> <height> <{object}>
embed any object
id = element id
x,y = position
width,height = containers's dimension
object = object to embed
id = element id
x,y = center coordinates of ellipse
r1,r2 = radius
fill = ellipse will be filled with "rgb" color if set to 1. Default = 0
stroke-width = defines stroke width to draw around the ellipse. Default = 0
link = URL to be linked to item
font <font-family>
define font family used for text elements (text, date, time, seconds ...)
Example: font arial
group <id> open <x> <y>
group - close (id will not be evaluated, just give any value)
group items
open|close = define start and end of group
x,y = upper left corner as reference for all grouped items, will be inherited to all elements.
Examples:
group - open 150 150
rect ...
img ...
group - close
id = element id
x,y = upper left corner
scale = scale to be used for resizing; may be factor or defined by width or height
link = URL to be linked to item, use "" if not needed
sourceType = file |Â url | data
dataSource = where to read data from, depends on sourceType
line <id> <x1> <y1> <x2> <y2> [<stroke>]
draw a line
id = element id
x1,y1 = coordinates (start)
x2,y2 = coordinates (end)
stroke = stroke width for line; if omitted, default = 0
moveby <x> <y>
move most recently x- and y-coordinates by given steps
moveto <x> <y>
move x- and y-coordinates to the given positon
padding <width>
border width (in pixel) to be used in textboxes
plot <id> <x> <y> <scale> <inline> <{plotName}>
embed an SVG plot into InfoPanel
id = element id
x,y = upper left corner
scale = scale to be used for resizing; may be factor or defined by width or height
inline = embed plot as data (inline=1) or as link (inline=0)
plotName = name of desired SVG device from your fhem installation
pop
fetch last parameter set from stack and set it actice
pt <[+-]font-size>
define font size used for text elements (text, date, time, seconds ...)
can be given as absolute or relative value.
id = element id
x1,y1 = upper left corner
x2,y2 = lower right corner
r1,r2 = radius for rounded corners
fill = rectangle will be filled with "rgb" color if set to 1. Default = 0
stroke-width = defines stroke width to draw around the rectangle. Default = 0
link = URL to be linked to item
rgb <{rgb[a]}>
define rgba value (hex digits!) used for text, lines, circles, ellipses
r = red value g = green value b = blue value a = alpha value used for opacity; optional
seconds <id> <x> <y> [<format>]
print seconds
id = element id
x,y = position
format = seconds will be preceeded by ':' if set to 'colon'; optional
text <id> <x> <y> <{text}>
print text
id = element id
x,y = position
text = text content to be printed
id = element id
x,y = upper left corner
boxWidth,boxHeight = dimensions of textbox
link = url to be used when clicked; use "" if not needed
text = text to be printed in textbox
Important: textboxes are not responsive via area tag. Use optional link parameter in textbox tag
textboxalign <align>
define horizontal alignment for text inside textboxes
valid values: left center right justify
textdesign <align>
define comma-separated list for text design and decoration
id = element id
x,y = position
width = width
items = number of items to be displayed simultanously
speed = scroll speed
data = list of text items, separated by \n
time <id> <x> <y>
print time
id = element id
x,y = position
tvalign <align>
define vertical alignment for text output
valid values: auto baseline middle center hanging
Author's notes
Have fun!
Itach_IR
Defines a device representing a physical Itach IR. Serves as communication layer for Itach_IRDevice.
For more information, check the Wiki page. Define
timeout
Can be used to change the timeout-value for tcp-communication. Default is 2.0.
Itach_IRDevice
Itach IR is a physical device that serves to emit Infrared (IR) commands, hence it is a general IR remote control that can be controlled via WLAN (WF2IR) or LAN (IP2IR).
Using the iLearn-Software that ships with every Itach IR, record the IR-squences per original remotecontrol-button and store all these IR-codes as an IR-config-file.
This IR-config-file can then be used directly with this module. All commands stored in the IR-config-file will be available immediately for use.
For more information, check the Wiki page. Define
define <name> Itach_IRDevice <IR-config-file>
Store the IR-config-file in the same directory where fhem.cfg resides. Hint: define an Itach_IR device first!
Example: define IR_mac Itach_IRDevice IR-codes-mac.txt define IR_amp Itach_IRDevice IR-codes-media-amplifier.txt
Set set <name> <command> [<parameter>]
The list of available commands depends on the content of the IR-config-file.
There are only two module specific commands:
set <name> rereadIRfile
For performance reasons, the IR-config-File is read into memory upon definition of the device. If you change the configuration within that file, use this set-command to read its content into fhem once again.
set <name> seqsingle <parameter>
Will send the digits of a sequence one after the other. Useful when you have a sequence of digits to be sent, e.g. 123. Each digit must be a valid command in your IR-config-file.
Get
get <name> validcommands
Lists the valid commands for this device according to your IR-config-file.
IODev
Needs to be stated if more than one ItachIR-device is part of your fhem-configuration.
ITACH_RELAY
Note: this module needs the Net::Telnet module.
Define
define <name> ITACH_RELAY <ip-address> <port>
Defines an Global Cache iTach Relay device (Box with 3 relays) via its ip address.
Examples:
define motor1 ITACH_RELAY 192.168.8.200 1
Set
set <name> <value>
where value is one of:
off
on
toggle
Examples:
set motor1 on
Notes:
Toggle is special implemented. List name returns "on" or "off" even after a toggle command
JSONMETER
This module reads data from a measurement unit (so called smart meters for electricity, gas or heat)
that provides OBIS compliant data in JSON format on a webserver or on the FHEM file system.
It assumes normally, that the structur of the JSON data do not change.
<deviceType>
Mandatory. Used to define the path and port to extract the json file.
The attribute 'pathString' can be used to add login information to the URL path of predefined devices.
ITF - FROETEC Simplex ME one tariff electrical meter (N-ENERGY) (ITF Fröschl)
EFR - EFR Smart Grid Hub for electrical meter (EON, N-ENERGY and EnBW)
use the 'pathstring' attribute to specifiy your login information
attr pathString ?LogName=user&LogPSWD=password
LS110 - YouLess LS110 network sensor (counter) for electro mechanical electricity meter
url - use the URL defined via the attributes 'pathString' and 'port'
file - use the file defined via the attribute 'pathString' (positioned in the FHEM file system)
[<ip address>]
IP address of the phyisical device. (not needed for 'url' and 'file')
[poll-interval]
Optional. Default is 300 seconds. Smallest possible value is 10. With 0 it will only update on "manual" request.
Set
activeTariff < 0 - 9 >
Allows the separate measurement of the consumption (doStatistics = 1) within different tariffs for all gages that miss this built-in capability (e.g. LS110). Also the possible gain of a change to a time-dependent tariff can be evaluated with this.
This value must be set at the correct point of time in accordance to the existing or planned tariff by the FHEM command "at".
0 = without separate tariffs
INTERVAL <polling interval>
Polling interval in seconds
resetStatistics <statReadings>
Deletes the selected statistic values: all, statElectricityConsumed..., statElectricityConsumedTariff..., statElectricityPower...
restartJsonAnalysis
Restarts the analysis of the json file for known readings (compliant to the OBIS standard).
This analysis happens normally only once if readings have been found.
statusRequest
Update device information
Get
jsonFile
extracts and shows the json data
jsonAnalysis
extracts the json data and shows the result of the analysis
Attributes
alwaysAnalyse < 0 | 1 >
Repeats by each update the json analysis - use if structure of json data changes
Normally the once analysed structure is saved to reduce CPU load.
doStatistics < 0 | 1 >
Builds daily, monthly and yearly statistics for certain readings (average/min/max or cumulated values).
Logging and visualisation of the statistics should be done with readings of type 'statReadingNameLast'.
pathString <string>
if deviceType = 'file': specifies the local file name and path
if deviceType = 'url': specifies the url path
other deviceType: can be used to add login information to the url path of predefined devices
port <number>
Specifies the IP port for the deviceType 'url' (default is 80)
timeOut <seconds>
Specifies the timeout for the reading of the raw data. (default is 10)
The run time of the reading process can be measured via "get jsonFile".
This Module allows FHEM to connect to the Jabber Network, send and receiving messages from and to a Jabber server.
Jabber is another description for (XMPP) - a communications protocol for message-oriented middleware based
on XML and - depending on the server - encrypt the communications channels.
For the user it is similar to other instant messaging Platforms like Facebook Chat, ICQ or Google's Hangouts
but free, Open Source and by default encrypted between the Jabber servers.
You need an account on a Jabber Server, you can find free services and more information on jabber.org
Discuss the module in the specific thread here.
This Module requires the following perl Modules to be installed (using SSL):
Net::Jabber
Net::XMPP
Authen::SASL
XML::Stream
Net::SSLeay
Since version 1.5 it allows FHEM also to join MUC (Multi-User-Channels) and the use of OTR for end to end encryption
If you want to use OTR you must compile and install Crypt::OTR from CPAN on your own.
set <name> msg <username> <msg>
sends a message to the specified username
Examples:
set JabberClient1 msg myname@jabber.org It is working!
set <name> msgmuc <channel> <msg>
sends a message to the specified MUC group channel
Examples:
set JabberClient1 msgmuc roomname@jabber.org Woot!
set <name> msgotr <username> <msg>
sends an Off-the-Record encrypted message to the specified username, if no OTR session is currently established it is being tried to esablish an OTR session with the specified user.
If the user does not have OTR support the message is discarded.
Examples:
set JabberClient1 msgotr myname@jabber.org Meet me at 7pm at the place today :*
set <name> subscribe <username>
asks the username for authorization (not needed normally)
Example:
set JabberClient1 subscribe myname@jabber.org
Get
N/A
Attributes
OnlineStatus available|unavailable
Sets the online status of the client, available (online in Clients) or unavailable (offline in Clients)
It is possible, on some servers, that FHEM can even recieve messages if the status is unavailable
Default: available
ResourceName <name>
In XMPP/Jabber you can have multiple clients connected with the same username.
The resource name finally makes the Jabber-ID unique to each client.
Here you can define the resource name.
Default: FHEM
PollTimer <seconds>
This is the interval in seconds at which the jabber server get polled.
Every interval the client checks if there are messages waiting and checks the connection to the server.
Don't set it over 10 seconds, as the client could get disconnected.
Default: 2
RecvWhitelist <Regex>
Only if the Regex match, the client accepts and interpret the message. Everything else will be discarded.
MucJoin channel1@server.com/mynick[:password]
Allows you to join one or more MUC's (Multi-User-Channel) with a specific Nick and a optional Password
Default: empty (no messages accepted)
Examples:
Join a channel: channel1@server.com/mynick
Join more channels: channel1@server.com/mynick,channel2@server.com/myothernick
Join a channel with a password set: channel1@server.com/mynick:password
MucRecvWhitelist <Regex>
Same as RecvWhitelist but for MUC: Only if the Regex match, the client accepts and interpret the message. Everything else will be discarded.
Default: empty (no messages accepted)
Examples:
All joined channels allowed: .*
Specific channel allowed only: mychannel@jabber.org
Specific Nick in channel allowed only: mychannel@jabber.org/NickOfFriend
OTREnable 1|0
Enabled the use of Crypt::OTR for end to end encryption between a device and FHEM
You must have Crypt::OTR installed and a private key is being generated the first time you enable this option
Key generation can take more than 2 hours on a quiet system but will not block FHEM instead it will inform you if it has been finished
Key generation is a one-time-task
Default: empty (OTR disabled)
OTRSharedSecret aSecretKeyiOnlyKnow@@*
Optional shared secret to allow the other end to start a trust verification against FHEM with this shared key.
If the user starts a trust verification process the fingerprint of the FHEM private key will be saved at the user's device and the connection is trusted.
This will allow to inform the user if the private key has changed (ex. in Man-in-the-Middle attacks)
Default: empty, please define a shared secret on your own.
Generated Readings/Events:
Private Messages
Message - Complete message including JID and text
LastMessage - Only text portion of the Message
LastSenderJID - Only JID portion of the Message
Encrypted Private Messages (if OTREnable=1)
OTRMessage - Complete decrypted message including JID and text
OTRLastMessage - Only text portion of the Message
OTRLastSenderJID - Only JID portion of the Message
MUC Room Messages (if MUCJoin is set)
MucMessage - Complete message including room's JID and text
MucLastMessage - Only text portion of the Message
MucLastSenderJID - Only JID portion of the Message
Author's Notes:
You can react and reply on incoming private messages with a notify like this:
define Jabber_Notify notify JabberClient1:Message.* {
my $lastsender=ReadingsVal("JabberClient1","LastSenderJID","0");
my $lastmsg=ReadingsVal("JabberClient1","LastMessage","0");
my $temperature=ReadingsVal("BU_Temperatur","temperature","0");
fhem("set JabberClient1 msg ". $lastsender . " Temp: ".$temperature);
}
You can react and reply on MUC messages with a notify like this, be aware that the nickname in $lastsender is stripped off in the msgmuc function
define Jabber_Notify notify JabberClient1:MucMessage.* {
my $lastsender=ReadingsVal("JabberClient1","LastSenderJID","0");
my $lastmsg=ReadingsVal("JabberClient1","LastMessage","0");
my $temperature=ReadingsVal("BU_Temperatur","temperature","0");
fhem("set JabberClient1 msgmuc ". $lastsender . " Temp: ".$temperature);
}
You can react and reply on OTR private messages with a notify like this:
define Jabber_Notify notify JabberClient1:OTRMessage.* {
my $lastsender=ReadingsVal("JabberClient1","LastSenderJID","0");
my $lastmsg=ReadingsVal("JabberClient1","LastMessage","0");
my $temperature=ReadingsVal("BU_Temperatur","temperature","0");
fhem("set JabberClient1 msgotr ". $lastsender . " Temp: ".$temperature);
}
JawboneUp
This module supports the Jawbone Up[24] fitness tracker. The module collects calories, steps and distance walked (and a few other metrics) on a given day.
All communication with the Jawbone services is handled as background-tasks, in order not to interfere with other FHEM services.
Installation
Among the perl modules required for this module are: LWP::UserAgent, IO::Socket::SSL, WWW::Jawbone::Up.
At least WWW:Jawbone::Up doesn't seem to have a debian equivalent, so you'll need CPAN to install the modules.
Example: cpan -i WWW::Jawbone::Up should install the required perl modules for the Jawbone up.
Unfortunately the WWW::Jawbone::Up module relies on quite a number of dependencies, so in case of error, check the CPAN output for missing modules.
Some dependent modules might fail during self-test, in that case try a forced install: cpan -i -f module-name
Error handling
If there are more than three consecutive API errors, the module disables itself. A "get update" re-enables the module.
API errors can be caused by wrong credentials or missing internet-connectivity or by a failure of the Jawbone server.
sleep_asleep
(Actual sleep during sleep period, time in seconds)
awakenings
(Awakenings)
light
(Light sleep during sleep period, time in seconds)
time_to_sleep
(Time to fall asleep in seconds)
bedtime
(Time in bed)
deep
(Deep sleep in seconds)
awake
(Time awake in seconds)
sleep_mode
(0: sleep mode inactive, 1: sleep mode active) Note: this is not real-time since updates depend on the module's poll-intervall
stopwatch_mode
(0: not in stopwatch mode, 1: stopwatch mode active) Note: not suitable for real-time measurements for the reasons above.
Get
update
trigger an update
Attributes
interval
the interval in seconds for updates. the default ist 3600 (=1h), minimum is 300 (=5min). It is not recommended to go below 900sec.
disable
1 -> disconnect and stop polling
JeeLink
The JeeLink is a family of RF devices sold by jeelabs.com.
It is possible to attach more than one device in order to get better
reception, fhem will filter out duplicate messages.
This module provides the IODevice for:
PCA301 modules that implement the PCA301 protocol.
LaCrosse modules that implement the IT+ protocol (Sensors like TX29DTH, TX35, ...).
LevelSender for measuring tank levels
EMT7110 energy meter
Other Sensors like WT440XH (their protocol gets transformed to IT+)
Note: this module may require the Device::SerialPort or Win32::SerialPort module if you attach the device via USB
and the OS sets strange default parameters for serial devices.
Define
define <name> JeeLink <device>
USB-connected devices:
<device> specifies the serial port to communicate with the JeeLink.
The name of the serial-device depends on your distribution, under
linux the cdc_acm kernel module is responsible, and usually a
/dev/ttyACM0 device will be created. If your distribution does not have a
cdc_acm module, you can force usbserial to handle the JeeLink by the
following command:
modprobe usbserial vendor=0x0403
product=0x6001
In this case the device is most probably
/dev/ttyUSB0.
You can also specify a baudrate if the device name contains the @
character, e.g.: /dev/ttyACM0@57600
If the baudrate is "directio" (e.g.: /dev/ttyACM0@directio), then the
perl module Device::SerialPort is not needed, and fhem opens the device
with simple file io. This might work if the operating system uses sane
defaults for the serial parameters, e.g. some Linux distributions and
OSX.
Set
raw <data>
send <data> to the JeeLink. Depending on the sketch running on the JeeLink, different commands are available. Most of the sketches support the v command to get the version info and the ? command to get the list of available commands.
reset
force a device reset closing and reopening the device.
LaCrossePairForSec <sec> [ignore_battery]
enable autocreate of new LaCrosse sensors for <sec> seconds. If ignore_battery is not given only sensors
sending the 'new battery' flag will be created.
flash [firmwareName]
The JeeLink needs the right firmware to be able to receive and deliver the sensor data to fhem. In addition to the way using the
arduino IDE to flash the firmware into the JeeLink this provides a way to flash it directly from FHEM.
The firmwareName argument is optional. If not given, set flash checks the firmware type that is currently installed on the JeeLink and
updates it with the same type.
There are some requirements:
avrdude must be installed on the host
On a linux systems like Cubietruck or Raspberry Pi this can be done with: sudo apt-get install avrdude
the flashCommand attribute must be set.
This attribute defines the command, that gets sent to avrdude to flash the JeeLink.
The default is: avrdude -p atmega328P -c arduino -P [PORT] -D -U flash:w:[HEXFILE] 2>[LOGFILE]
It contains some place-holders that automatically get filled with the according values:
[PORT]
is the port the JeeLink is connectd to (e.g. /dev/ttyUSB0)
[HEXFILE]
is the .hex file that shall get flashed. There are three options (applied in this order):
- passed in set flash
- taken from the hexFile attribute
- the default value defined in the module
[LOGFILE]
The logfile that collects information about the flash process. It gets displayed in FHEM after finishing the flash process
led <on|off>
Is used to disable the blue activity LED
beep
...
setReceiverMode
...
Get
Attributes
Clients
The received data gets distributed to a client (e.g. LaCrosse, EMT7110, ...) that handles the data.
This attribute tells, which are the clients, that handle the data. If you add a new module to FHEM, that shall handle
data distributed by the JeeLink module, you must add it to the Clients attribute.
MatchList
can be set to a perl expression that returns a hash that is used as the MatchList attr myJeeLink MatchList {'5:AliRF' => '^\\S+\\s+5 '}
initCommands
Space separated list of commands to send for device initialization.
This can be used e.g. to bring the LaCrosse Sketch into the data rate toggle mode. In this case initCommands would be: 30t
flashCommand
See "Set flash"
timeout
format: <timeout, checkInterval>
Checks every 'checkInterval' seconds if the last data reception is longer than 'timout' seconds ago.
If this is the case, a reset is done for the IO-Device.
JsonList
Note: this command is deprecated, use jsonlist2 instead.
jsonlist [<devspec>|<typespec>|ROOMS]
Returns an JSON tree of all definitions, all notify settings and all at
entries if no parameter is given. Can also be called via HTTP by
http://fhemhost:8083/fhem?cmd=jsonlist&XHR=1
This is a command, to be issued on the command line (FHEMWEB or telnet
interface). Can also be called via HTTP by
http://fhemhost:8083/fhem?cmd=jsonlist2&XHR=1
Returns an JSON tree of the internal values, readings and attributes of the
requested definitions.
If value is specified, then output only the corresponding internal (like DEF,
TYPE, etc), reading (actuator, measured-temp) or attribute for all devices
from the devspec.
Note: the old command jsonlist (without the 2 as suffix) is deprecated
and will be removed in the future
KM271
KM271 is the name of the communication device for the Buderus Logamatic 2105
or 2107 heating controller. It is connected via a serial line to the fhem
computer. The fhem module sets the communication device into log-mode, which
then will generate an event on change of the inner parameters. There are
about 20.000 events a day, the FHEM module ignores about 90% of them, if the
all_km271_events attribute is not set.
Note: this module requires the Device::SerialPort or Win32::SerialPort module.
Define
define <name> KM271 <serial-device-name>
Example:
define KM271 KM271 /dev tyS0@2400
Set
set KM271 <param> [<value> [<values>]]
where param is one of:
hk1_tagsoll <temp>
sets the by day temperature for heating circuit 1
0.5 celsius resolution - temperature between 10 and 30 celsius
hk2_tagsoll <temp>
sets the by day temperature for heating circuit 2
(see above)
hk1_nachtsoll <temp>
sets the by night temperature for heating circuit 1
(see above)
hk2_nachtsoll <temp>
sets the by night temperature for heating circuit 2
(see above)
hk1_betriebsart [automatik|nacht|tag]
sets the working mode for heating circuit 1
automatik: the timer program is active and the summer configuration is in effect
nacht: manual by night working mode, no timer program is in effect
tag: manual by day working mode, no timer program is in effect
hk2_betriebsart [automatik|nacht|tag]
sets the working mode for heating circuit 2
(see above)
ww_soll <temp>
sets the hot water temperature
1.0 celsius resolution - temperature between 30 and 60 celsius
ww_betriebsart [automatik|nacht|tag]
sets the working mode for hot water
automatik: hot water production according to the working modes of both heating circuits
nacht: no hot water at all
tag: manual permanent hot water
ww_on-till [localtime]
start hot water production till the given time is reached
localtime must have the format HH:MM[:SS]
ww_betriebsart is set according to the attribut ww_timermode. For switching-off hot water a single one-time at command is automatically generated which will set ww_betriebsart back to nacht
ww_zirkulation [count]
count pumping phases for hot water circulation per hour
count must be between 0 and 7 with special meaning for
0: no circulation at all
7: circulation is always on
hk1_programm [eigen|familie|frueh|spaet|vormittag|nachmittag|mittag|single|senior]
sets the timer program for heating circuit 1
eigen: the custom program defined by the user (see below) is used
all others: predefined programs from Buderus for various situations (see Buderus manual for details)
hk2_programm [eigen|familie|frueh|spaet|vormittag|nachmittag|mittag|single|senior]
sets the timer program for heating circuit 2
(see above)
hk1_timer [<position> delete|<position> <on-day> <on-time> <off-day> <off-time>]
sets (or deactivates) a by day working mode time interval for the custom program of heating circuit 1
position: addresses a slot of the custom timer program and must be between 1 and 21
The slot will be set to the interval specified by the following on- and off-timepoints or is deactivated when the next argument is delete.
on-day: first part of the on-timepoint
valid arguments are [mo|di|mi|do|fr|sa|so]
on-time: second part of the on-timepoint
valid arguments have the format HH:MM (supported resolution: 10 min)
off-day: first part of the off-timepoint
(see above)
off-time: second part of the off-timepoint
valid arguments have the format HH:MM (supported resolution: 10 min)
As the on-timepoint is reached, the heating circuit is switched to by day working mode and when the off-timepoint is attained, the circuit falls back to by night working mode.
A program can be build up by chaining up to 21 of these intervals. They are ordered by the position argument. There's no behind the scene magic that will automatically consolidate the list.
The consistency of the program is in the responsibility of the user.
Example:
set KM271 hk1_timer 1 mo 06:30 mo 08:20
This will toogle the by day working mode every Monday at 6:30 and will fall back to by night working mode at 8:20 the same day.
hk2_timer [<position> delete|<position> <on-day> <on-time> <off-day> <off-time>]
sets (or deactivates) a by day working mode time interval for the custom program of heating circuit 2
(see above)
logmode set to logmode / request all readings again
Get
get KM271 <param>
where param is one of:
l_fehler
gets the latest active error (code and message)
l_fehlerzeitpunkt
gets the timestamp, when the latest active error occured (format of Perl-function 'time')
l_fehleraktualisierung
gets the timestamp, of the latest update of an error status (format of Perl-function 'time')
all_km271_events
If this attribute is set to 1, do not ignore following events:
HK1_Vorlaufisttemperatur, HK1_Mischerstellung, HK2_Vorlaufisttemperatur, HK2_Mischerstellung,
Kessel_Vorlaufisttemperatur, Kessel_Integral, Kessel_Integral1
These events account for ca. 92% of all events.
All UNKNOWN events are ignored too, most of them were only seen
directly after setting the device into logmode.
ww_timermode [automatik|tag]
Defines the working mode for the ww_on-till command (default is tag).
ww_on-till will set the ww_betriebsart of the heater according to this attribute.
readingsFilter
Regular expression for selection of desired readings.
Only readings which will match the regular expression will be used. All other readings are
suppressed in the device and even in the logfile.
Generated events:
Abgastemperatur
Aussentemperatur
Aussentemperatur_gedaempft
Brenner_Ansteuerung
Brenner_Ausschalttemperatur
Brenner_Einschalttemperatur
Brenner_Laufzeit1_Minuten2
Brenner_Laufzeit1_Minuten1
Brenner_Laufzeit1_Minuten
Brenner_Laufzeit2_Minuten2
Brenner_Laufzeit2_Minuten1
Brenner_Laufzeit2_Minuten
Brenner_Mod_Stellglied
ERR_Fehlerspeicher1
ERR_Fehlerspeicher2
ERR_Fehlerspeicher3
ERR_Fehlerspeicher4
ERR_Alarmstatus
HK1_Ausschaltoptimierung
HK1_Betriebswerte1
HK1_Betriebswerte2
HK1_Einschaltoptimierung
HK1_Heizkennlinie_+10_Grad
HK1_Heizkennlinie_-10_Grad
HK1_Heizkennlinie_0_Grad
HK1_Mischerstellung
HK1_Pumpe
HK1_Raumisttemperatur
HK1_Raumsolltemperatur
HK1_Vorlaufisttemperatur
HK1_Vorlaufsolltemperatur
HK2_Ausschaltoptimierung
HK2_Betriebswerte1
HK2_Betriebswerte2
HK2_Einschaltoptimierung
HK2_Heizkennlinie_+10_Grad
HK2_Heizkennlinie_-10_Grad
HK2_Heizkennlinie_0_Grad
HK2_Mischerstellung
HK2_Pumpe
HK2_Raumisttemperatur
HK2_Raumsolltemperatur
HK2_Vorlaufisttemperatur
HK2_Vorlaufsolltemperatur
Kessel_Betrieb
Kessel_Fehler
Kessel_Integral
Kessel_Integral1
Kessel_Vorlaufisttemperatur
Kessel_Vorlaufsolltemperatur
Modulkennung
NoData
Versionsnummer_NK
Versionsnummer_VK
WW_Betriebswerte1
WW_Betriebswerte2
WW_Einschaltoptimierung
WW_Isttemperatur
WW_Pumpentyp
WW_Solltemperatur
As I cannot explain all the values, I logged data for a period and plotted
each received value in the following logs:
All of these events are reported directly after initialization (or after
requesting logmode), along with some 60 configuration records (6byte long
each). Most parameters from these records are reverse engeneered, they
all start with CFG_ for configuration and PRG_ for timer program information.
Kopp Free Control protocol
Please take into account: this protocol is under construction. Commands may change till first official "10_KOPP_FC.pm" version is released
The Kopp Free Control protocol is used by Kopp receivers/actuators and senders.
As we right now are only able to send Kopp commands but can't receive them, this module currently only
supports devices like dimmers, switches and in futue also blinds through a CUL or compatible device (e.g. CCD...).
This devices must be defined before using this protocol (e.g. "define CUL_0 CUL /dev/ttyAMA0@38400 1234" ).
name is the identifier (name) you plan to assign to your specific device (actor) as done for any other FHEM device
<Keycode>
Keycode is a 2 digit hex code (1Byte) which reflects the transmitters key
<Transmittercode1>
Transmittercode1 is a 4 digit hex code. This code is specific for the transmitter itself.
<Transmittercode2>
Transmittercode2 is a 2 digit hex code and also specific for the transmitter, but I didn't see any difference while modifying this code.
(seems this code don't matter the receiver).
Both codes (Transmittercode1/2) are also used to pair the transmitter with the receivers
(remote switch, dimmer, blind..)
Pairing is done by setting the receiver in programming mode by pressing the program button at the receiver
(small buttom, typically inside a hole).
Once the receiver is in programming mode send a command from within FHEM to complete the pairing.
For more details take a look to the data sheet of the corresponding receiver type.
You are now able to control teh receiver from FHEM, the receiver thinks it is just another remote control.
Examples:
set DimmerDevice toggle # will switch dimmer device (e.g. lamp) on/off
set DimmerDevice dimm # will start dimming process
set DimmerDevice stopp # will stop dimming process
The module reads the current values from web page of a Kostal Piko inverter.
It can also be used, to capture the values of global radiation, UV-index and sunshine duration
from a special web-site (proplanta) regardless of the existence of the inverter.
Parameters:
<ip-address> - the ip address of the inverter
<user> - the login-user for the inverter's web page
<password> - the login-password for the inverter's web page
Fhem can receive the KS300 or KS555 radio messages through the FHZ, WS300 or CUL, so
one of them must be defined first. This module services messages received
by the FHZ or CUL.
<housecode> is a four digit hex number, it must be
specified foir historic reasons, and it is ignored.
The ml/raincounter defaults to 255 ml, and it must be specified if you wish
to set the wind factor, which defaults to 1.0.
Examples:
rainadjustment
If this attribute is set, fhem automatically considers rain counter
resets after a battery change and random counter switches as
experienced by some users. Default is 0 (off).
LGTV
Define
define <name> LGTV
This module is expected to work with xxLG7000 as it's
IODev. With LGTV and a compatible hardware module (currently, there's only
xxLG7000), you are able to power your TV set on and off, query it's power state,
select the input (AV, RGB, Composites, analogue TV, DVB-T, HDMI) or mute/unmute
the volume.
Defining a LGTV device will schedule an internal task, which periodically reads
the status of the TV set (power state; if power is on, query the selected input)
and triggers notify/filelog commands.
Currently, the following commands are defined; not all may be available on a
given TV set. An error messages should be recorded if e. g. the input in question
is not usable.
power on
power off
input AV1
input AV2
input AV3
input AV3
input Component
input RGB
input HDMI1
input HDMI2
input HDMI3
input HDMI4
input DVBT
input PAL
audio mute
audio normal
Get
get <name> <what>
Currently, the following commands are defined; not all may be available on a
given TV set. An error messages should be recorded if e. g. the input in question
is not usable.
The commands listed above are send 1:1 to the underlying IODev (e. g. xxLG7000); that IODev
is responsible for translation into whatever means to invoke the function on the TV.
It is my hope that other's will adopt this idea and write compatible low level drivers for other
TV sets, to make this module (even ;)) more useful.
LIGHTIFY
Module to integrate a OSRAM LIGHTIFY gateway into FHEM;.
The actual LIGHTIFY lights are defined as HUEDevice devices.
All newly found devices and groups are autocreated at startup and added to the room LIGHTIFY.
Notes:
Autocreate only works for the first gateway. Devices on other gateways have to be manualy defined.
Define
define <name> LIGHTIFY <host>
Defines a LIGHTIFY gateway device with address <host>.
Examples:
define gateway LIGHTIFY 10.0.1.1
Get
Set
reconnect
Closes and reopens the connection to the gateway.
Defines an Lindy 4:2 HDMI Switch serial connected to a transparent ethernet to serial adapter via the ip address of the adapter. Lindy partnumber: 38054
First digit is the output port, second digit is the input port.
Example:
set livingroom.hdmi 12
LIRC
Generate FHEM-events when an LIRC device receives infrared signals.
Note: this module needs the Lirc::Client perl module.
Define
define <name> LIRC <lircrc_file>
Example:
define Lirc LIRC /etc/lirc/lircrc
Note: In the lirc configuration file you have to define each possible event.
If you have this configuration
begin
prog = fhem
button = pwr
config = IrPower
end
and you press the pwr button the IrPower toggle event occures at fhem.
define IrPower01 notify Lirc:IrPower set lamp toggle
turns the lamp on and off.
If you want a faster reaction to keypresses you have to change the
defaultvalue of readytimeout from 5 seconds to e.g. 1 second in fhem.pl
Set
N/A
Get
N/A
Attributes
LUXTRONIK2
Luxtronik 2.0 is a heating controller used in Alpha Innotec, Siemens Novelan (WPR NET) and Wolf Heiztechnik (BWL/BWS) heat pumps.
It has a built-in ethernet port, so it can be directly integrated into a local area network (LAN).
The modul is reported to work with firmware: V1.51, V1.54C, V1.60, V1.64, V1.69, V1.70, V1.73.
More Info on the particular page of FHEM-Wiki (in German).
Define
define <name> LUXTRONIK2 <IP-address> [poll-interval]
If the pool interval is omitted, it is set to 300 (seconds). Smallest possible value is 30.
Example: define Heizung LUXTRONIK2 192.168.0.12 600
Set
A firmware check assures before each set operation that a heat pump with untested firmware is not damaged accidently.
activeTariff < 0 - 9 >
Allows the separate measurement of the consumption (doStatistics = 1) within different tariffs.
This value must be set at the correct point of time in accordance to the existing or planned tariff by the FHEM command "at".
0 = without separate tariffs
INTERVAL <polling interval>
Polling interval in seconds
hotWaterTemperatureTarget <temperature>
Target temperature of domestic hot water boiler in °C
hotWaterCircPumpDeaerate <on | off>
Switches the external circulation pump for the hot water on or off. The circulation prevents a cool down of the hot water in the pipes but increases the heat consumption drastically.
NOTE! It uses the deaerate function of the controller. So, the pump alternates always 5 minutes on and 5 minutes off.
opModeHotWater <Mode>
Operating Mode of domestic hot water boiler (Auto | Party | Off)
resetStatistics <statReadings>
Deletes the selected statistic values all, statBoilerGradientCoolDownMin, statAmbientTemp..., statElectricity..., statHours..., statHeatQ...
returnTemperatureSetBack <Temperatur>
Decreasing or increasing of the returnTemperatureTarget by -5°C till + 5°C
statusRequest
Update device information
synchClockHeatPump
Synchronizes controller clock with FHEM time. !! This change is lost in case of controller power off!!
Get
No get implemented yet ...
Attributes
allowSetParameter < 0 | 1 >
The parameters of the heat pump controller can only be changed if this attribut is set to 1.
autoSynchClock <delay>
Corrects the clock of the heatpump automatically if a certain delay (10 s - 600 s) against the FHEM time is exeeded. Does a firmware check before.
(A 'delayDeviceTimeCalc' <= 2 s can be caused by the internal calculation interval of the heat pump controller.)
compressor2ElectricalPowerWatt
Electrical power of the 2nd compressor to calculated the COP and estimate electrical consumption (calculations not implemented yet)
doStatistics < 0 | 1 >
Calculates statistic values: statBoilerGradientHeatUp, statBoilerGradientCoolDown, statBoilerGradientCoolDownMin (boiler heat loss)
Builds daily, monthly and yearly statistics for certain readings (average/min/max or cumulated values).
Logging and visualisation of the statistic should be done with readings of type 'statReadingNameLast'.
heatPumpElectricalPowerWatt
Electrical power of the heat pump by a flow temperature of 35°C to calculated coefficency factor and estimate electrical consumption
heatPumpElectricalPowerFactor
Change of electrical power consumption per 1 K flow temperature differenz to 35°C (e.g. 2% per 1 K = 0,02)
heatRodElectricalPowerWatt
Electrical power of the heat rods (2nd heat source) to estimate electrical consumption
ignoreFirmwareCheck < 0 | 1 >
A firmware check assures before each set operation that a heatpump controller with untested firmware is not damaged accidently.
If this attribute is set to 1, the firmware check is ignored and new firmware can be tested for compatibility.
statusHTML
If set, a HTML-formatted reading named "floorplanHTML" is created. It can be used with the FLOORPLAN module.
Currently, if the value of this attribute is not NULL, the corresponding reading consists of the current status of the heat pump and the temperature of the water.
FHEM module for LaCrosse Temperature and Humidity sensors and weather stations like WS 1600 (TX22 sensor).
It can be integrated in to FHEM via a JeeLink as the IODevice.
The JeeNode sketch required for this module can be found in .../contrib/36_LaCrosse-pcaSerial.zip.
Define
define <name> LaCrosse <addr> [corr1...corr2]
addr is a 2 digit hex number to identify the LaCrosse device.
corr1..corr2 are up to 2 numerical correction factors (corr1 for the temperature and corr2 for the humidity), which will be added to the respective value to calibrate the device.
Note: devices are autocreated only if LaCrossePairForSec is active for the JeeLink IODevice device.
Set
replaceBatteryForSec <sec> [ignore_battery]
sets the device for <sec> seconds into replace battery mode. the first unknown address that is
received will replace the current device address. this can be partly automated with a readings group configured
to show the battery state of all LaCrosse devices and a link/command to set replaceBatteryForSec on klick.
Get
Readings
battery[]
ok or low
temperature (°C)
Notice: see the filterThreshold attribute.
humidity (%rH)
Wind speed (m/s), gust (m/s) and direction (degree)
Rain (mm)
Attributes
doAverage
use an average of the last 4 values for temperature and humidity readings
doDewpoint
calculate dewpoint
filterThreshold
if the difference between the current and previous temperature is greater than filterThreshold degrees
the readings for this channel are not updated. the default is 10.
resolution
the resolution in 1/10 degree for the temperature reading
ignore
1 -> ignore this device.
Logging and autocreate
If autocreate is not active (not defined or disabled) and LaCrosse is not contained in the ignoreTypes attribute of autocreate then
the Unknown device xx, please define it messages will be logged with loglevel 3. In all other cases they will be logged with loglevel 4.
The autocreateThreshold attribute of the autocreate module (see autocreate) is respected. The default is 2:120, means, that
autocreate will create a device for a sensor only, if the sensor was received at least two times within two minutes.
Level
FHEM module for Level.
It can be integrated in to FHEM via a JeeLink as the IODevice.
The JeeNode sketch required for this module can be found in .../contrib/36_LaCrosse-LaCrosseITPlusReader.zip. It must be at least version 10.0c
For more information see: http://forum.fhem.de/index.php/topic,23217.msg165163.html#msg165163
Define
define <name> Level <addr>
addr is a 1 digit hex number (0 .. F) to identify the Level device.
Readings
liters
Calculated liters based on distanceToBottom, distance and litersPerCm
temperature
Measured temperature
voltage
Measured battery voltage
distance
Measured distance from the sensor to the fluid
level
Calculated level based on the distanceToBottom attribute
Attributes
distanceToBottom
Distance from the ultra sonic sensor to the bottom of the tank
litersPerCm
Liters for each cm level
LightScene
Allows to store the state of a group of lights and other devices and recall it later.
Multiple states for one group can be stored.
The device detail view will show an html overview of the current state of all included devices and all
configured scenes with the device states for each. The column heading with the device names is clickable
to go to detail view of this device. The first row that displays the current device state is clickable
and should react like a click on the device icon in a room overview would. this can be used to interactively
configure a new scene and save it with the command menu of the detail view. The first column of the table with
the scene names ic clickable to activate the scene.
A weblink with a scene overview that can be included in any room or a floorplan can be created with:
save <scene_name>
save current state for alle devices in this LightScene to <scene_name>
scene <scene_name>
shows scene <scene_name> - all devices are switched to the previously saved state
set <scene_name> <device> [<cmd>]
set the saved state of <device> in <scene_name> to <cmd>
setcmd <scene_name> <device> [<cmd>]
set command to be executed for <device> in <scene_name> to <cmd>.
<cmd> can be any commandline that fhem understands including multiple commands separated by ;;
set kino_group setcmd allOff LampeDecke sleep 30 ;; set LampeDecke off
set light_group setcmd test Lampe1 sleep 10 ;; set Lampe1 on ;; sleep 5 ;; set Lampe1 off
remove <scene_name>
remove <scene_name> from list of saved scenes
rename <scene_old_name> <scene_new_name>
rename <scene_old_name> to <scene_new_name>
Get
scenes
scene <scene_name>
Attributes
async_delay
If this attribute is defined, unfiltered set commands will not be
executed in the clients immediately. Instead, they are added to a queue
to be executed later. The set command returns immediately, whereas the
clients will be set timer-driven, one at a time. The delay between two
timercalls is given by the value of async_delay (in seconds) and may be
0 for fastest possible execution.
lightSceneParamsToSave
this attribute can be set on the devices to be included in a scene. it is set to a comma separated list of readings
that will be saved. multiple readings separated by : are collated in to a single set command (this has to be supported
by the device). each reading can have a perl expression appended with '@' that will be used to alter the $value used for
the set command. this can for example be used to strip a trailing % from a dimmer state. this perl expression must not contain
spaces,colons or commas.
in addition to reading names the list can also contain expressions of the form abc -> xyz
or get cba -> set uvw to map reading abc to set xyz or get cba to set uvw. the list can be given as a
string or as a perl expression enclosed in {} that returns this string. attr myReceiver lightSceneParamsToSave volume,channel attr myHueDevice lightSceneParamsToSave {(Value($DEVICE) eq "off")?"state":"bri : xy"}
lightSceneRestoreOnlyIfChanged
this attribute can be set on the lightscene and/or on the individual devices included in a scene.
the device settings have precedence over the scene setting.
1 -> for each device do nothing if current device state is the same as the saved state
0 -> always set the state even if the current state is the same as the saved state. this is the default
followDevices
the LightScene tries to follow the switching state of the devices set its state to the name of the scene that matches.
1 -> if no match is found state will be unchanged and a nomatch event will be triggered.
2 -> if no match is found state will be set to unknown. depending on the scene and devices state can toggle multiple
times. use a watchdog if you want to handle this.
switchingOrder
space separated list of <scene>:<deviceList> items that will give a per scene order
in which the devices should be switched.
the devices from <deviceList> will come before all other devices of this LightScene;
if the first character of the <deviceList> ist a ! the devices from the list will come after
all other devices from this lightScene.
<scene> and each element of <deviceList> are treated as a regex.
Example: To switch a master power outlet before every other device at power on and after every device on power off: define media LightScene TV,DVD,Amplifier,masterPower
attr media switchingOrder .*On:masterPower,.* allOff:!.*,masterPower
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 65,535 to 0 and then stops.
See M232Counter for how we care about this.
Define at most one M232Counter for a M232 device. Defining a M232Counter
will schedule an internal task, which periodically reads the status of the
counter, and triggers notify/filelog commands. unit is the unit
name, factor is used to calculate the reading of the counter
from the number of ticks. deltaunit is the unit name of the counter
differential per second, deltafactor is used to calculate the
counter differential per second from the number of ticks per second.
Default values:
unit: ticks
factor: 1.0
deltaunit: ticks per second
deltafactor: 1.0
Note: the parameters in square brackets are optional. If you wish to
specify an optional parameter, all preceding parameters must be specified
as well.
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).
To avoid issues with the tick count reaching the end point, the device's
internal counter is automatically reset to 0 when the tick count is 64,000
or above and the reading basis is adjusted accordingly.
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 <name> interval <interval>
Sets the status polling interval in seconds to the given value. The default
is 60 seconds.
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).
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
Devices from the eQ-3 MAX! group.
When heating thermostats show a temperature of zero degrees, they didn't yet send any data to the cube. You can
force the device to send data to the cube by physically setting a temperature directly at the device (not through fhem).
Define
define <name> MAX <type> <addr>
Define an MAX device of type <type> and rf address <addr>.
The <type> is one of HeatingThermostat, HeatingThermostatPlus, WallMountedThermostat, ShutterContact, PushButton.
The <addr> is a 6 digit hex number.
You should never need to specify this by yourself, the autocreate module will do it for you.
It's advisable to set event-on-change-reading, like
attr MAX_123456 event-on-change-reading .*
because the polling mechanism will otherwise create events every 10 seconds.
Example:
define switch1 MAX PushButton ffc545
Set
desiredTemperature auto [<temperature>]
For devices of type HeatingThermostat only. If <temperature> is omitted,
the current temperature according to the week profile is used. If <temperature> is provided,
it is used until the next switch point of the week porfile. It maybe one of
degree celcius between 4.5 and 30.5 in 0.5 degree steps
"on" or "off" set the thermostat to full or no heating, respectively
"eco" or "comfort" using the eco/comfort temperature set on the device (just as the right-most physical button on the device itself does)
desiredTemperature [manual] <value> [until <date>]
For devices of type HeatingThermostat only. <value> maybe one of
degree celcius between 4.5 and 30.5 in 0.5 degree steps
"on" or "off" set the thermostat to full or no heating, respectively
"eco" or "comfort" using the eco/comfort temperature set on the device (just as the right-most physical button on the device itself does)
The optional "until" clause, with <data> in format "dd.mm.yyyy HH:MM" (minutes may only be "30" or "00"!),
sets the temperature until that date/time. Make sure that the cube/device has a correct system time.
If the keepAuto attribute is 1 and the device is currently in auto mode, 'desiredTemperature <value>'
behaves as 'desiredTemperature auto <value>'. If the 'manual' keyword is used, the keepAuto attribute is ignored
and the device goes into manual mode.
desiredTemperature boost
For devices of type HeatingThermostat only.
Activates the boost mode, where for boostDuration minutes the valve is opened up boostValveposition percent.
groupid <id>
For devices of type HeatingThermostat only.
Writes the given group id the device's memory. To sync all devices in one room, set them to the same groupid greater than zero.
ecoTemperature <value>
For devices of type HeatingThermostat only. Writes the given eco temperature to the device's memory. It can be activated by pressing the rightmost physical button on the device.
comfortTemperature <value>
For devices of type HeatingThermostat only. Writes the given comfort temperature to the device's memory. It can be activated by pressing the rightmost physical button on the device.
measurementOffset <value>
For devices of type HeatingThermostat only. Writes the given temperature offset to the device's memory. If the internal temperature sensor is not well calibrated, it may produce a systematic error. Using measurementOffset, this error can be compensated. The reading temperature is equal to the measured temperature at sensor + measurementOffset. Usually, the internally measured temperature is a bit higher than the overall room temperature (due to closeness to the heater), so one uses a small negative offset. Must be between -3.5 and 3.5 degree celsius.
minimumTemperature <value>
For devices of type HeatingThermostat only. Writes the given minimum temperature to the device's memory. It confines the temperature that can be manually set on the device.
maximumTemperature <value>
For devices of type HeatingThermostat only. Writes the given maximum temperature to the device's memory. It confines the temperature that can be manually set on the device.
windowOpenTemperature <value>
For devices of type HeatingThermostat only. Writes the given window open temperature to the device's memory. That is the temperature the heater will temporarily set if an open window is detected. Setting it to 4.5 degree or "off" will turn off reacting on open windows.
windowOpenDuration <value>
For devices of type HeatingThermostat only. Writes the given window open duration to the device's memory. That is the duration the heater will temporarily set the window open temperature if an open window is detected by a rapid temperature decrease. (Not used if open window is detected by ShutterControl. Must be between 0 and 60 minutes in multiples of 5.
decalcification <value>
For devices of type HeatingThermostat only. Writes the given decalcification time to the device's memory. Value must be of format "Sat 12:00" with minutes being "00". Once per week during that time, the HeatingThermostat will open the valves shortly for decalcification.
boostDuration <value>
For devices of type HeatingThermostat only. Writes the given boost duration to the device's memory. Value must be one of 5, 10, 15, 20, 25, 30, 60. It is the duration of the boost function in minutes.
boostValveposition <value>
For devices of type HeatingThermostat only. Writes the given boost valveposition to the device's memory. It is the valve position in percent during the boost function.
maxValveSetting <value>
For devices of type HeatingThermostat only. Writes the given maximum valveposition to the device's memory. The heating thermostat will not open the valve more than this value (in percent).
valveOffset <value>
For devices of type HeatingThermostat only. Writes the given valve offset to the device's memory. The heating thermostat will add this to all computed valvepositions during control.
factoryReset
Resets the device to factory values. It has to be paired again afterwards.
ATTENTION: When using this on a ShutterContact using the MAXLAN backend, the ShutterContact has to be triggered once manually to complete
the factoryReset.
associate <value>
Associated one device to another. <value> can be the name of MAX device or its 6-digit hex address.
Associating a ShutterContact to a {Heating,WallMounted}Thermostat makes it send message to that device to automatically lower temperature to windowOpenTemperature while the shutter is opened. The thermostat must be associated to the ShutterContact, too, to accept those messages.
!Attention: After sending this associate command to the ShutterContact, you have to press the button on the ShutterContact to wake it up and accept the command. See the log for a message regarding this!
Associating HeatingThermostat and WallMountedThermostat makes them sync their desiredTemperature and uses the measured temperature of the
WallMountedThermostat for control.
deassociate <value>
Removes the association set by associate.
weekProfile [<day> <temp1>,<until1>,<temp2>,<until2>] [<day> <temp1>,<until1>,<temp2>,<until2>] ...
Allows setting the week profile. For devices of type HeatingThermostat or WallMountedThermostat only. Example: set MAX_12345 weekProfile Fri 24.5,6:00,12,15:00,5 Sat 7,4:30,19,12:55,6
sets the profile Friday: 24.5 °C for 0:00 - 6:00, 12 °C for 6:00 - 15:00, 5 °C for 15:00 - 0:00
Saturday: 7 °C for 0:00 - 4:30, 19 °C for 4:30 - 12:55, 6 °C for 12:55 - 0:00
while keeping the old profile for all other days.
keepAuto Default: 0. If set to 1, it will stay in the auto mode when you set a desiredTemperature while the auto (=weekly program) mode is active.
Generated events:
desiredTemperature Only for HeatingThermostat and WallMountedThermostat
valveposition Only for HeatingThermostat
battery
temperature The measured temperature (= measured temperature at sensor + measurementOffset), only for HeatingThermostat and WallMountedThermostat
MAXLAN
The MAXLAN is the fhem module for the eQ-3 MAX! Cube LAN Gateway.
The fhem module makes the MAX! "bus" accessible to fhem, automatically detecting paired MAX! devices. It also represents properties of the MAX! Cube. The other devices are handled by the MAX module, which uses this module as its backend.
port is 62910 by default. (If your Cube listens on port 80, you have to update the firmware with
the official MAX! software).
If the ip-address is called none, then no device will be opened, so you
can experiment without hardware attached.
The optional parameter <pollintervall> defines the time in seconds between each polling of data from the cube.
You may provide the option ondemand forcing the MAXLAN module to tear-down the connection as often as possible
thus making the cube usable by other applications or the web portal.
Set
pairmode [<n>,cancel]
Sets the cube into pairing mode for <n> seconds (default is 60s ) where it can be paired with other devices (Thermostats, Buttons, etc.). You also have to set the other device into pairing mode manually. (For Thermostats, this is pressing the "Boost" button for 3 seconds, for example).
Setting pairmode to "cancel" puts the cube out of pairing mode.
raw <data>
Sends the raw <data> to the cube.
clock
Sets the internal clock in the cube to the current system time of fhem's machine (uses timezone attribute if set). You can add attr ml set-clock-on-init
to your fhem.cfg to do this automatically on startup.
factorReset
Reset the cube to factory defaults.
reconnect
FHEM will terminate the current connection to the cube and then reconnect. This allows
re-reading the configuration data from the cube, as it is only send after establishing a new connection.
Get
N/A
Attributes
set-clock-on-init
(Default: 1). Automatically call "set clock" after connecting to the cube.
timezone
(Default: CET-CEST). Set MAX Cube timezone (requires "set clock" to take effect). NB.Cube time and cubeTimeDifference will not change until Cube next connects.
GMT-BST - (UTC +0, UTC+1)
CET-CEST - (UTC +1, UTC+2)
EET-EEST - (UTC +2, UTC+3)
FET-FEST - (UTC +3)
MSK-MSD - (UTC +4)
The following are settings with no DST (daylight saving time)
GMT - (UTC +0)
CET - (UTC +1)
EET - (UTC +2)
MPD
FHEM module to control a MPD like the MPC (MPC = Music Player Command, the command line interface to the Music Player Daemon )
To install a MPD on a Raspberry Pi you will find a lot of documentation at the web e.g. http://www.forum-raspberrypi.de/Thread-tutorial-music-player-daemon-mpd-und-mpc-auf-dem-raspberry-pi in german
FHEM Forum : Modul für MPD ( in german )
Define
define <name> MPD <IP MPD Server | default localhost> <Port MPD Server | default 6600>
Example:
define myMPD MPD 192.168.0.99 7000
if FHEM and MPD a running on the same device :
define myMPD MPD
Set
set <name> <what>
Currently, the following commands are defined.
play => like MPC play , start playing song in playlist
clear => like MPC clear , delete MPD playlist
stop => like MPC stop, stops playing
pause => like MPC pause
previous => like MPC previous, play previous song in playlist
next => like MPC next, play next song in playlist
random => like MPC random, toggel on/off
repaet => like MPC repeat, toggel on/off
toggle => toggles from play to stop or from stop/pause to play
updateDb => like MPC update
volume (%) => like MPC volume %, 0 - 100
volumeUp => inc volume ( + attr volumeStep size )
volumeDown => dec volume ( - attr volumeStep size )
playlist (playlist name) => set playlist on MPD Server
playfile (file) => create playlist + add file to playlist + start playing
IdleNow => send Idle command to MPD and wait for events to return
interval => set polling interval of MPD server, overwrites attr interval temp , use 0 to disable polling
reset => reset MPD Modul
mpdCMD => same as GET mpdCMD
Get
get <name> <what>
Currently, the following commands are defined.
music => list all MPD music files in MPD databse
playlists => list all MPD playlist in MPD databse
playlistsinfo => show current playlist informations
webrc => HTML output for a simple Remote Control on FHEM webpage e.g :.
statusRequest => get MPD status
mpdCMD (cmd) => send a command to MPD Server ( MPD Command Ref )
currentsong => get infos from current song in playlist
outputs => get name,id,status about all MPD output devices in /etc/mpd.conf
Attributes
interval = polling interval at MPD server, use 0 to disable polling (default 30)
password (not ready yet) if password on MPD server is set
loadMusic 0|1 = load titles from MPD database at startup
loadPlaylists 0|1 = load playlist names from MPD database at startup
volumeStep 1|2|5|10 = Step size for Volume +/- (default 5)
useIdle 0|1 = send Idle command to MPD and wait for MPD events needs MPD Version 0.16.0 or greater
titleSplit 1|0 = split title to artist and title if no artist is given in songinfo (e.g. radio-stream)
A single MQTT device can serve multiple MQTT_DEVICE and MQTT_BRIDGE clients.
Each MQTT_DEVICE acts as a bridge in between an fhem-device and mqtt.
Note: this module is based on Net::MQTT which needs to be installed from CPAN first.
Define
define <name> MQTT <ip:port>
Specifies the MQTT device.
Set
set <name> connect
(re-)connects the MQTT-device to the mqtt-broker
set <name> disconnect
disconnects the MQTT-device from the mqtt-broker
Attributes
keep-alive
sets the keep-alive time (in seconds).
MQTT_BRIDGE
acts as a bridge in between an fhem-device and mqtt-topics.
requires a MQTT-device as IODev
Note: this module is based on Net::MQTT which needs to be installed from CPAN first.
Define
define <name> MQTT_BRIDGE <fhem-device-name>
Specifies the MQTT device.
<fhem-device-name> is the fhem-device this MQTT_BRIDGE is linked to.
Get
get <name> readings
retrieves all existing readings from fhem-device and configures (default-)topics for them.
attribute 'publish-topic-base' is prepended if set.
Attributes
attr <name> subscribeSet <topic>
configures a topic that will issue a 'set <message> whenever a message is received
attr <name> subscribeSet_<reading> <topic>
configures a topic that will issue a 'set <reading> <message> whenever a message is received
attr <name> publishState <topic>
configures a topic such that a message is sent to topic whenever the device state changes.
attr <name> publishReading_<reading> <topic>
configures a topic such that a message is sent to topic whenever the device readings value changes.
attr <name> publish-topic-base <topic>
this is used as base path when issueing 'get <device> readings' to construct topics to publish to based on the devices existing readings
MQTT_DEVICE
acts as a fhem-device that is mapped to mqtt-topics.
requires a MQTT-device as IODev
Note: this module is based on Net::MQTT which needs to be installed from CPAN first.
Define
define <name> MQTT_DEVICE
Specifies the MQTT device.
Set
set <name> <command>
sets reading 'state' and publishes the command to topic configured via attr publishSet
set <name> <h;reading> <value>
sets reading <h;reading> and publishes the command to topic configured via attr publishSet_<h;reading>
Attributes
attr <name> publishSet [<commands>] <topic>
configures set commands that may be used to both set reading 'state' and publish to configured topic
attr <name> publishSet_<reading> [<values>] <topic>
configures reading that may be used to both set 'reading' (to optionally configured values) and publish to configured topic
attr <name> autoSubscribeReadings <topic>
specify a mqtt-topic pattern with wildcard (e.c. 'myhouse/kitchen/+') and MQTT_DEVICE automagically creates readings based on the wildcard-match
e.g a message received with topic 'myhouse/kitchen/temperature' would create and update a reading 'temperature'
attr <name> subscribeReading_<reading> <topic>
mapps a reading to a specific topic. The reading is updated whenever a message to the configured topic arrives
The MSGFile device is used to write arbitrary data to a file on disk
or other media accessable through the filesystem. In order to write to a file,
the access rights of the FHEM process to the specified file and path are relevant.
To set the rights for a directory, please use OS related commands.
Define
define <name> MSGFile <filename>
Specifies the MSGFile device. At definition the message counter is set to 0.
A filename must be specified at definition.
Examples:
define myFile MSGFile
Set
set <name> add|clear|list|write [text]
Set is used to manipulate the message buffer of the device. The message
buffer is an array of lines of data, stored serial based on the incoming
time into the buffer. Lines of data inside the buffer could not be deleted
anymore, except of flashing the whole buffer.
add to add lines of data to the message buffer. All data behind
"add" will be interpreted as text message. To add a carriage return to the data,
please use the CR attribute.
clear to flash the message buffer and set the line counter to 0.
All the lines of data are deleted and the buffer is flushed.
list to list the message buffer.
write to write the message buffer to the associated file.
Examples:
set myFile add Dies ist Textzeile 1 set myFile add Dies ist Textzeile 2 set myFile clear
Full working example to write two lines of data to a file: define myFile MSGFile /tmp/fhemtest.txt attr myFile filemode append set myFile add Textzeile 1 set myFile add Textzeile 2 set myFile write set myFile clear
Attributes
filename
sets the filename, must be a fully qualified filename.
FHEM must have the rights to write this file to the directory
filemode
sets the filemode, valid are "new" or "append"
new creates a new, empty file and writes the data to this file. Existing files are cleared, the data is lost!
append uses, if available, an existing file and writes the
buffer data to the end of the file. If the file do not exist, it will
be created
CR
set the option to write a carriage return at the end of the line.
CR could be set to 0 or 1, 1 enables this feature
The MSGMail device is used to send mail messages to a recipient by connecting
to a SMTP server. Currently MSGMail supports only servers, that allow SSL secured connections
like Googlemail, GMX, Yahoo or 1und1.
MSGMail requires the perl pacakge MAIL::Lite.
For SSL support, Net::SMTP version 3.06 is required. On systems with an older version of Net::SMTP,
MSGMail requires the package Net::SMTP::SSL.
Specifies the MSGMail device. At definition the message counter is set to 0.
From, To, SMTPHost and the authfile (see attributes below) need to be defined
at definition time.
set <name> add|clear|list|send [text]
Set is used to manipulate the message buffer of the device. The message
buffer is an array of lines of data, stored serial based on the incoming
time into the buffer. Lines of data inside the buffer could not be deleted
anymore, except of flashing the whole buffer.
add to add lines of data to the message buffer. All data behind
"add" will be interpreted as text message. To add a carriage return to the data,
please use the CR attribute.
clear to flush the message buffer and set the line counter to 0.
All the lines of data are deleted and the buffer is flushed.
list to list the message buffer.
send to send the message buffer.
Examples:
set myMail add Dies ist Textzeile 1 set myMail add Dies ist Textzeile 2 set myMail clear
Full working example to send two lines of data to a recipent: define myMail MSGMail donald.duck@entenhausen.com dagobert.duck@duck-banking.com smtp.entenhausen.net /etc/fhem/msgmailauth attr myMail smtpport 9999 attr myMail subject i need more money attr myMail CR 0 set myMail add Please send me set myMail add 1.000.000 Taler set myMail send set myMail clear
Attributes
Almost all of these attributes are not optional, most of them could set at definition.
smtphost
sets the name of the smtphost, for example for GMX
you could use mail.gmx.net or for Googlemail the smtphost is
smtp.googlemail.com
smtpport (optional)
sets the port of the smtphost, for example for GMX
or for Googlemail the smtport is 465, which is also
the default and do not need to be set
subject (optional)
sets the subject of this email. Per default the subject is set to "FHEM"
authfile
sets the authfile for the SSL connection to the SMTP host
the authfile is a simple textfile with the userid in line 1 and
the password in line 2.
Example: 123user45 strenggeheim
It is a good behaviour to protect this data and put the file, for
example into the /etc directory and set the rights to 440
(chmod 440 /etc/msgmailauthfile), so that not everyone could see the contents
of the file. FHEM must have access to this file to read the userid and password.
mailtype plain|html
Use this attribute to select the contenttype to text/plain or text/html.
If text/html is selected, valid html code must be provided as content. No checks are applied!
Per default this attribute is 'plain'
CR
set the option to write a carriage return at the end of the line.
CR could be set to 0 or 1, 1 enables this feature.
Per default this attribute is enabled
set <name> connect
(re-)connects the MYSENSORS-device to the MYSENSORS-gateway
set <name> disconnect
disconnects the MYSENSORS-device from the MYSENSORS-gateway
set <name> inclusion-mode on|off
turns the gateways inclusion-mode on or off
Attributes
att <name> autocreate
enables auto-creation of MYSENSOR_DEVICE-devices on receival of presentation-messages
att <name> requestAck
request acknowledge from nodes.
if set the Readings of nodes are updated not before requested acknowledge is received
if not set the Readings of nodes are updated immediatly (not awaiting the acknowledge).
May also be configured for individual nodes if not set for gateway.
att <name> first-sensorid <<number <h; 255>>
configures the lowest node-id assigned to a mysensor-node on request (defaults to 20)
MYSENSORS_DEVICE
represents a mysensors sensor attached to a mysensor-node
define <name> MYSENSORS_DEVICE <Sensor-type> <node-id>
Specifies the MYSENSOR_DEVICE device.
Set
set <name> clear
clears routing-table of a repeater-node
set <name> time
sets time for nodes (that support it)
set <name> reboot
reboots a node (requires a bootloader that supports it).
Attention: Nodes that run the standard arduino-bootloader will enter a bootloop!
Dis- and reconnect the nodes power to restart in this case.
Attributes
attr <name> config [<M|I>]
configures metric (M) or inch (I). Defaults to 'M'
attr <name> setCommands [<command:reading:value>]*
configures one or more commands that can be executed by set.
e.g.: attr <name> setCommands on:switch_1:on off:switch_1:off
if list of commands contains both 'on' and 'off' set extensions are supported
attr <name> setReading_<reading> [<value>]*
configures a reading that can be modified by set-command
e.g.: attr <name> setReading_switch_1 on,off
attr <name> mapReading_<reading> <childId> <readingtype> [<value>:<mappedvalue>]*
configures the reading-name for a given childId and sensortype
E.g.: attr xxx mapReading_aussentemperatur 123 temperature
att <name> requestAck
request acknowledge from nodes.
if set the Readings of nodes are updated not before requested acknowledge is received
if not set the Readings of nodes are updated immediatly (not awaiting the acknowledge).
May also be configured on the gateway for all nodes at once
attr <name> mapReadingType_<reading> <new reading name> [<value>:<mappedvalue>]*
configures reading type names that should be used instead of technical names
E.g.: attr xxx mapReadingType_LIGHT switch 0:on 1:off
to be used for mysensor Variabletypes that have no predefined defaults (yet)
MilightBridge
This module is the interface to a Milight Bridge which is connected to the network using a Wifi connection. It uses a UDP protocal with no acknowledgement so there is no guarantee that your command was received.
The Milight system is sold under various brands around the world including "LimitlessLED, EasyBulb, AppLamp"
Specifies the MilightBridge device.
<host/ip> is the hostname or IP address of the Bridge.
Readings
state
[Initialized|ok|unreachable]: Shows reachable status of bridge using "ping" check every 10 (checkInterval) seconds.
sendFail
0 if everything is OK. 1 if the send function was unable to send the command - this would indicate a problem with your network and/or host/port parameters.
slot[0|1|2|3|4|5|6|7|8]
The slotX reading will display the name of the MilightDevice that is defined with this Bridge as it's IODev. It will be blank if no device is defined for that slot.
Attributes
sendInterval
Default: 100ms. The bridge has a minimum send delay of 100ms between commands.
checkInterval
Default: 10s. Time after the bridge connection is re-checked.
If this is set to 0 checking is disabled and state = "Initialized".
port
Default: 8899. Older bridges (V2) used port 50000 so change this value if you have an old bridge.
tcpPing
If this attribute is defined, ping will use TCP instead of UDP.
MilightDevice
This module represents a Milight LED Bulb or LED strip controller. It is controlled by a MilightBridge.
The Milight system is sold under various brands around the world including "LimitlessLED, EasyBulb, AppLamp"
Specifies the Milight device.
<devType> One of RGB, RGBW, White depending on your device.
<IODev> The MilightBridge which the device is paired with.
<slot> The slot on the MilightBridge that the device is paired with or 'A' to group all slots.
Readings
state
[on xxx|off|night]: Current state of the device / night mode (xxx = 0-100%).
brightness
[0-100]: Current brightness level in %.
brightness_on
[0-100]: The brightness level before the off command was sent. This allows the light to turn back on to the last brightness level.
rgb
[FFFFFF]: HEX value for RGB.
previousState
[hsv]: hsv value before last change. Can be used with restorePreviousState set command.
savedState
[hsv]: hsv value that was saved using saveState set function
hue
[0-360]: Current hue value.
saturation
[0-100]: Current saturation value.
transitionInProgress
[0|1]: Set to 1 if a transition is currently in progress for this device (eg. fade).
discoMode
[0|1]: 1 if discoMode is enabled, 0 otherwise.
discoSpeed
[0|1]: 1 if discoSpeed is increased, 0 if decreased. Does not mean much for RGBW
lastPreset
[0..X]: Last selected preset.
ct
[1-10]: Current colour temperature (3000=Warm,6500=Cold) for White devices.
Set
on <ramp_time (seconds)>
off <ramp_time (seconds)>
toggle
night
dim <percent(0..100)> [seconds(0..x)] [flags(l=long path|q=don't clear queue)]
Will be replaced by brightness at some point
dimup <percent change(0..100)> [seconds(0..x)]
Special case: If percent change=100, seconds will be adjusted for actual change to go from current brightness.
dimdown <percent change(0..100)> [seconds(0..x)]
Special case: If percent change=100, seconds will be adjusted for actual change to go from current brightness.
pair
May not work properly. Sometimes it is necessary to use a remote to clear pairing first.
unpair
May not work properly. Sometimes it is necessary to use a remote to clear pairing first.
restorePreviousState
Set device to previous hsv state as stored in previousState reading.
saveState
Save current hsv state to savedState reading.
restoreState
Set device to saved hsv state as stored in savedState reading.
preset (0..X|+)
Load preset (+ for next preset).
hsv <h(0..360)>,<s(0..100)>,<v(0..100)> [seconds(0..x)] [flags(l=long path|q=don't clear queue)]
Set hsv value directly
rgb RRGGBB [seconds(0..x)] [flags(l=long path|q=don't clear queue)]
Set rgb value directly or using colorpicker.
hue <(0..360)> [seconds(0..x)] [flags(l=long path|q=don't clear queue)]
Set hue value.
saturation <s(0..100)> [seconds(0..x)] [flags(q=don't clear queue)]
Set saturation value directly
discoModeUp
Next disco Mode setting (for RGB and RGBW).
discoModeDown
Previous disco Mode setting (for RGB).
discoSpeedUp
Increase speed of disco mode (for RGB and RGBW).
discoSpeedDown
Decrease speed of disco mode (for RGB and RGBW).
ct <3000-6500>
Colour temperature 3000=Warm White,6500=Cold White (10 steps) (for White devices only).
dimStep
Allows you to modify the default dimStep if required.
defaultRampOn
Set the default ramp time if not specified for on command.
defaultRampOff
Set the default ramp time if not specified for off command.
presets
List of hsv presets separated by spaces (eg 0,0,100 9,0,50).
colorCast
Color shift values for red,yellow,green,cyan,blue,magenta (-29..29) for HSV color correction (eg 0,5,10,-5,0,0)
gamma
Set gamma correction value for device (eg 0.8)
dimOffWhite
Use a different switching logic for White bulbs to better handle packet loss.
updateGroupDevices
Update the state of single devices switched with slot 'A'.
defaultBrightness
Set the default brightness if not known. (Default: 36)
Modbus
Modbus defines a physical modbus interface and functions to be called from other logical modules / devices.
This low level module takes care of the communication with modbus devices and provides Get, Set and cyclic polling
of Readings as well as formatting and input validation functions.
The logical device modules for individual machines only need to define the supported modbus function codes and objects of the machine with the modbus interface in data structures. These data structures are then used by this low level module to implement Set, Get and automatic updateing of readings in a given interval.
This version of the Modbus module supports Modbus RTU over serial / RS485 lines as well as Modbus TCP and Modbus RTU over TCP.
It defines read / write functions for Modbus holding registers, input registers, coils and discrete inputs.
Prerequisites
This module requires the Device::SerialPort or Win32::SerialPort module.
Define
define <name> Modbus <device>
A define of a physical device based on this module is only necessary if a shared physical device like a RS485 USB adapter is used. In the case of Modbus TCP this module will be used as a library for other modules that define all the data objects and no define of the base module is needed.
Example:
define ModBusLine Modbus /dev/ttyUSB1@9600
In this example the module opens the given serial interface and other logical modules can access several Modbus devices connected to this bus concurrently.
If your device needs special communications parameters like even parity you can add the number of data bits, the parity and the number of stopbits separated by commas after the baudrate e.g.:
define ModBusLine Modbus /dev/ttyUSB2@38400,8,E,2
Set-Commands
this low level device module doesn't provide set commands for itself but implements set
for logical device modules that make use of this module. See ModbusAttr for example.
Get-Commands
this low level device module doesn't provide get commands for itself but implements get
for logical device modules that make use of this module.
modify the delay used when sending requests to the device from the internal queue, defaults to 1 second
queueMax
max length of the send queue, defaults to 100
profileInterval
if set to something non zero it is the time period in seconds for which the module will create bus usage statistics.
Pleas note that this number should be at least twice as big as the interval used for requesting values in logical devices that use this physical device
The bus usage statistics create the following readings:
Profiler_Delay_sum
seconds used as delays to implement the defined sendDelay and commDelay
Profiler_Fhem_sum
seconds spend processing in the module
Profiler_Idle_sum
idle time
Profiler_Read_sum
seconds spent reading and validating the data read
Profiler_Send_sum
seconds spent preparing and sending data
Profiler_Wait_sum
seconds waiting for a response to a request
Statistics_Requests
number of requests sent
Statistics_Timeouts
timeouts encountered
ModbusAttr
ModbusAttr uses the low level Modbus module 98_Modbus.pm to provide a generic Modbus module for devices that can be defined by attributes similar to the way HTTPMOD works for devices with a web interface.
Prerequisites
This module requires the basic Modbus module which itsef DevIO which again requires Device::SerialPort or Win32::SerialPort module.
The module connects to the Modbus device with Modbus Id <Id> through an already defined modbus device
or directly through Modbus TCP or Modbus RTU over TCP and actively requests data from that device every <Interval> seconds
Examples:
define WP ModbusAttr 1 60
to go through a serial interface managed by an already defined basic modbus device.
or
define WP ModbusAttr 5 60 192.168.1.122:504 TCP
to talk Modbus TCP
or
define WP ModbusAttr 3 60 192.168.1.122:8000 RTU
to talk Modbus RTU over TCP
Configuration of the module
The data objects (holding registers, input registers, coils or discrete inputs) of the device to be queried are defined using attributes. The attributes assign objects with their address to readings inside fhem and control
how these readings are calculated from the raw values and how they are formatted.
Objects can also be written to the device and attributes define how this is done.
Attributes to define data objects start with obj- followed by a code that identifies the type and address
of the data object.
Modbus devices offer the following types of data objects: holding registers (16 bit objects that can be read and written), input registers (16 bit objects that can only be read), coils (single bit objects that can be read and written) or discrete inputs (single bit objects that can only be read).
The module uses the first character of these data object types to define attributes. Thus h770 refers to a holding register with the decimal address 770 and c120 refers to a coil with address 120. The address has to be specified as pure decimal number without any leading zeros or spaces.
attr PWP obj-h258-reading Temp_Wasser_Aus defines a reading with the name Temp_Wasser_Aus that is read from the Modbus holding register at address 258.
With the attribute ending on -expr you can define a perl expression to do some conversion or calculation on the raw value read from the device. In the above example the raw value has to be devided by 10 to get the real value.
An object attribute ending on -set creates a fhem set option. In the above example the reading Temp_Soll can be changed to 12 degrees by the user with the fhem command set PWP Temp_Soll 12
The object attributes ending on -min and -max define min and max values for input validation and the attribute ending on -hint will tell fhem to create a selection list so the user can graphically select the defined values.
To define general properties of the device you can specify attributes starting with dev-. E.g. with dev-timing-timeout you can specify the timeout when waiting for a response from the device. With dev-h- you can specify several default values or general settings for all holding registers like the function code to be used when reading or writing holding registers. These attributes are optional and the module will use defaults that work in most cases. dev-h-combine 5 for example allows the module to combine read requests to objects having an address that differs 5 or less into one read request. Without setting this attribute the module will start individual read requests for each object. Typically the documentation for the modbus interface of a given device states the maximum number of objects that can be read in one function code 3 request.
Set-Commands
are created based on the attributes defining the data objects.
Every object for which an attribute like obj-xy-set is set to 1 will create a valid set option.
Get-Commands
All readings are also available as Get commands. Internally a Get command triggers the corresponding
request to the device and then interprets the data and returns the right field value. To avoid huge option lists in FHEMWEB, the objects visible as Get in FHEMWEB can be defined by setting an attribute obj-xy-showget to 1.
the following list of attributes can be applied to any data object by specifying the objects type and address in the variable part.
For many attributes you can also specify default values per object type (see dev- attributes later) or you can specify an object attribute without type and address (e.g. obj-len) which then applies as default for all objects:
obj-[cdih][1-9][0-9]*-reading
define the name of a reading that corresponds to the modbus data object of type c,d,i or h and a decimal address (e.g. obj-h225-reading).
obj-[cdih][1-9][0-9]*-name
defines an optional internal name of this data object (this has no meaning for fhem and serves mainly documentation purposes.
obj-[cdih][1-9][0-9]*-set
if set to 1 then this data object can be changed (works only for holding registers and coils since discrete inputs and input registers can not be modified by definition.
obj-[cdih][1-9][0-9]*-min
defines a lower limit to the value that can be written to this data object. This ist just used for input validation.
obj-[cdih][1-9][0-9]*-max
defines an upper limit to the value that can be written to this data object. This ist just used for input validation.
obj-[cdih][1-9][0-9]*-hint
this is used for set options and tells fhemweb what selection to display for the set option (list or slider etc.)
obj-[cdih][1-9][0-9]*-expr
defines a perl expression that converts the raw value read from the device.
obj-[cdih][1-9][0-9]*-map
defines a map to convert values read from the device to more convenient values when the raw value is read from the device or back when the value to write has to be converted from the user value to a raw value that can be written. Example: 0:mittig, 1:oberhalb, 2:unterhalb
obj-[cdih][1-9][0-9]*-setexpr
defines a perl expression that converts the user specified value in a set to a raw value that can be sent to the device. This is typically the inversion of -expr above.
obj-[cdih][1-9][0-9]*-format
defines a format string to format the value read e.g. %.1f
obj-[cdih][1-9][0-9]*-len
defines the length of the data object in registers. It defaults to 1. Some devices store 32 bit floating point values in two registers. In this case you can set this attribute to two.
obj-[cdih][1-9][0-9]*-unpack
defines the unpack code to convert the raw data string read from the device to a reading. For an unsigned integer in big endian format this would be "n", for a signed 16 bit integer in big endian format this would be "s>" and for a 32 bit big endian float value this would be "f>". (see the perl documentation of the pack function).
obj-[cdih][1-9][0-9]*-revRegs
this is only applicable to objects that span several input registers or holding registers.
when they are read then the order of the registers will be reversed before
further interpretation / unpacking of the raw register string
obj-[cdih][1-9][0-9]*-bswapRegs
this is applicable to objects that span several input or holding registers.
after the registers have been read, all 16-bit values are treated big-endian and are reversed to little-endian by swapping the two 8 bit bytes. This functionality is most likely used for reading (ASCII) strings from the device that are stored as big-endian 16-bit values.
example: original reading is "324d3130203a57577361657320722020". After applying bswapRegs, the value will be "4d3230313a2057576173736572202020"
which will result in the ASCII string "M201: WWasser ". Should be used with "(a*)" as -unpack value.
obj-[cdih][1-9][0-9]*-decode
defines an encoding to be used in a call to the perl function decode to convert the raw data string read from the device to a reading. This can be used if the device delivers strings in an encoding like cp850 instead of utf8.
obj-[cdih][1-9][0-9]*-encode
defines an encoding to be used in a call to the perl function encode to convert the raw data string read from the device to a reading. This can be used if the device delivers strings in an encoding like cp850 and after decoding it you want to reencode it to e.g. utf8.
obj-[cdih][1-9][0-9]*-showget
every reading can also be requested by a get command. However these get commands are not automatically offered in fhemweb. By specifying this attribute, the get will be visible in fhemweb.
obj-[cdih][1-9][0-9]*-poll
if set to 1 then this obeject is included in the cyclic update request as specified in the define command. If not set, then the object can manually be requested with a get command, but it is not automatically updated each interval. Note that this setting can also be specified as default for all objects with the dev- atributes described later.
obj-[cdih][1-9][0-9]*-polldelay
this attribute allows to poll objects at a lower rate than the interval specified in the define command. you can either specify a time in seconds or number prefixed by "x" which means a multiple of the interval of the define command.
if you specify a normal numer then it is interpreted as minimal time between the last read and another automatic read. Please note that this does not create an individual interval timer. Instead the normal interval timer defined by the interval of the define command will check if this reading is due or not yet. So the effective interval will always be a multiple of the interval of the define.
dev-([cdih]-)*read
specifies the function code to use for reading this type of object. The default is 3 for holding registers, 1 for coils, 2 for discrete inputs and 4 for input registers.
dev-([cdih]-)*write
specifies the function code to use for writing this type of object. The default is 6 for holding registers and 5 for coils. Discrete inputs and input registers can not be written by definition.
dev-([cdih]-)*combine
defines how many adjacent objects can be read in one request. If not specified, the default is 1
dev-([cdih]-)*defLen
defines the default length for this object type. If not specified, the default is 1
dev-([cdih]-)*defFormat
defines a default format string to use for this object type in a sprintf function on the values read from the device.
dev-([cdih]-)*defExpr
defines a default Perl expression to use for this object type to convert raw values read.
dev-([cdih]-)*defUnpack
defines the default unpack code for this object type.
dev-([cdih]-)*defRevRegs
defines that the order of registers for objects that span several registers will be reversed before
further interpretation / unpacking of the raw register string
dev-([cdih]-)*defBswapRegs
per device default for swapping the bytes in Registers (see obj-bswapRegs above)
dev-([cdih]-)*defDecode
defines a default for decoding the strings read from a different character set e.g. cp850
dev-([cdih]-)*defEncode
defines a default for encoding the strings read (or after decoding from a different character set) e.g. utf8
dev-([cdih]-)*defPoll
if set to 1 then all objects of this type will be included in the cyclic update by default.
dev-([cdih]-)*defShowGet
if set to 1 then all objects of this type will have a visible get by default.
dev-timing-timeout
timeout for the device (defaults to 2 seconds)
dev-timing-sendDelay
delay to enforce between sending two requests to the device. Default ist 0.1 seconds.
dev-timing-commDelay
delay between the last read and a next request. Default ist 0.1 seconds.
ModbusSET
ModbusSET uses the low level Modbus module to provide a way to communicate with Silent 10 heat pumps from SET.
It probably works with other heat pumps from SET as well and since the control device used in these heat pumps
is an iChill IC121 from Dixell, it could even work for other heat pumps with this controller as well or with few
changes. It defines the modbus holding registers for the temperature sensors and reads them in a defined interval.
Prerequisites
This module requires the basic Modbus module which itsef requires Device::SerialPort or Win32::SerialPort module.
Define
define <name> ModbusSET <Id> <Interval>
The module connects to the heat pump with Modbus Id <Id> through an already defined modbus device and actively requests data from the heat pump every <Interval> seconds
Example:
define WP ModbusSET 1 60
Configuration of the module
apart from the modbus id and the interval which both are specified in the define command there is nothing that needs to be defined.
However there are some attributes that can optionally be used to modify the behavior of the module.
The attributes that control which messages are sent / which data is requested every <Interval> seconds are:
if the attribute is set to 1, the corresponding data is requested every <Interval> seconds. If it is set to 0, then the data is not requested.
by default the temperatures are requested if no attributes are set.
if some readings should be polled, but less frequently than the normal interval, you can specify a pollDelay-
Attribute for the reading.
The pollDelay attribute allows to poll objects at a lower rate than the interval specified in the define command. you can either specify a time in seconds or number prefixed by "x" which means a multiple of the interval of the define command.
if you specify a normal numer then it is interpreted as minimal time between the last read and another automatic read. Please note that this does not create an individual interval timer. Instead the normal interval timer defined by the interval of the define command will check if this reading is due or not yet. So the effective interval will always be a multiple of the interval of the define.
Hysterese (defines the hysterese in Kelvin)
Hyst_Mode (defines the interpretation of hysterese for the heating and can be set to mittig, oberhalb or unterhalb)
Temp_Wasser_Aus_Off (offset of sensor in Kelvin - used to kalibrate)
Temp_Wasser_Ein_Off (offset of sensor in Kelvin - used to kalibrate)
Temp_Luft_Off (offset of sensor in Kelvin - used to kalibrate)
Temp_Verdampfer_Off (offset of sensor in Kelvin - used to kalibrate)
Temp_Soll (target temperature of the heating pump)
Get-Commands
All readings are also available as Get commands. Internally a Get command triggers the corresponding
request to the device and then interprets the data and returns the right field value. To avoid huge option lists in FHEMWEB, only the most important Get options
are visible in FHEMWEB. However this can easily be changed since all the readings and protocol messages are internally defined in the modue in a data structure
and to make a Reading visible as Get option only a little option (e.g. showget => 1 has to be added to this data structure
include a read request for the corresponding registers when sending requests every interval seconds
pollDelay-*
set a delay for polling individual Readings. In case some readings should be polled less frequently than the
normal delay specified during define. Specifying a pollDelay will not create an individual timer for
polling this reading but check if the delay is over when the normal update interval is handled.
You can either specify a time in seconds or number prefixed by "x" which means a multiple of the interval of the define command.
If you specify a normal numer then it is interpreted as minimal time between the last read and another automatic read. Please note that this does not create an individual interval timer. Instead the normal interval timer defined by the interval of the define command will check if this reading is due or not yet. So the effective interval will always be a multiple of the interval of the define.
dev-timing-timeout
set the timeout for reads, defaults to 2 seconds
dev-timing-minSendDelay
minimal delay between two requests sent to this device
dev-timing-minCommDelay
minimal delay between requests or receptions to/from this device
NUT
The Network UPS Tools (www.networkupstools.org) provide support for Uninterruptable Power Supplies and the like.
This module gives access to a running nut server. You can read data (status, runtime, input voltage, sometimes even temperature and so on). In the future it will
also be possible to control the UPS (start test, switch off).
Which values you can use as readings is set with asReadings. Which values are available with this UPS, you can check with
list theUPS. Only ups.status is always read and used as the status of the device.
Define
define <name> NUT <ups> [<host>[:<port>]]
<ups> is the name of a ups defined in the nut server.
[<host>[:<port>]] is the host of the nut server. If omitted, localhost:3493 is used.
pollState
Polling interval in seconds for the state of the ups. Default: 10
pollVal
Polling interval in seconds of the other Readings. This should be a multiple of pollState. Default: 60
asReadings
Values of the UPS which are used as Readings (ups.status is read anyway)
Example: attr theUPS asReadings battery.charge,battery.runtime,input.voltage,ups.load,ups.power,ups.realpower
Note: this module needs the HTTP::Request and LWP::UserAgent perl modules.
Please also note: the PDU must use firmware 3.1 or later and set to unencrypted mode.
Defines a switching device, where sockets can be switched
separately (just use 0-4 as socket number)
all together (use 1234 as socket number)
in arbitrary groups (e.g 13 switches socket 1 and 3, 42
switches socket 2 and 4, etc...), invalid numbers are
ignored
User name and password are optional. When no user name or
password is passed, the module looks for a configfile at
'/var/log/fhem/netio.conf'. If no config file is found, it
uses 'admin/admin' as user/pass, since this is the default
configuration for the device.
Alternatively you can pass a path to a configfile instead of
the user/pass combo. (e.g. /var/tmp/tmp.conf)
Configfile-Format:
The Netzer realizes an Ethernet interface on a PIC-based platform. As a gateway module it enables communication between standard TCP/IP sockets and serial busses like I2C, SPI and UART.
Also up to 13 GPIO pins can be accessed. This Modul provides access to these GPIO pins on a Netzer running IO_base in Version 1.5.
There are two pins usable as ADC channel, two as PMW outputs, three as counter and three can generate an interrupt.
The GPIO pins are configured a input per default. Before a port can be used as output it must be configured via the embedded webpage.
If one of the input ports is configured to send interrupt events on GPIO Server, on every event all port values will be updated.
All ports can be read and controlled individually by the function readingsProxy.
Define
define <name> Netzer <host:port>
Set
set <name> <port[_counter]> <value>
Where <value> is a character between a and m according to the port. If Port attr is cnt an aditional value <port_counter> can be set.
Only ports with corresponding attr Port_[a-m] set to PWM or out can be used.
If Port attr is:
PWM <value> can be a number between 0 and 1023
out <value> can be a number between 0 and 1
cnt <port_counter> <value> can be a number between 0 and 32767
Get
get <name> [<port[_counter]>]
If no <port> is set, all readings will be updated.
<port> is a character between a and m according to the port. If Port attr is cnt an aditional reading <port_counter> can be read.
Attributes
poll_interval
Set the polling interval in minutes to query the sensor for new measured values.
Default: 5, valid values: decimal number
Port_<port>
Configuration for Netzer port.
<port> is a character between a and m.
in: Port is defined as input. Same behavior as no attribute. Set is not avaliable for this port.
Can be used for all ports
out: Port is defined as output. Set is avaliable for this port with <value> between 0 and 1.
Can be used for all ports
cnt: Port is defined as input. Set is not avaliable for this port.
An second reading: Port_<port>_counter is avaiable.
It can be updated with get an changed with set.
Port_<port>_counter <value> = 0-32767 or overflow if outside this range.
Can be used for ports a,b,c
ADC: Port is defined as analog input. Get <value> is 0-1023 according the voltage on port. Set is not avaliable for this port.
Can be used for ports e,f
PWM: Port is defined as PWM output. Set and get <value> is 0-1023 according the duty cycle on the port.
Can be used for ports d,j
NetzerI2C
Provides access to Netzer's I2C interfaces for some logical modules and also directly.
define <name> NetzerI2C <Device-Address:Port>
where <Device-Address:Port> Device Address/ IP-Address and Serial Server TCP Port of the Netzer
Set
Write one byte (or more bytes sequentially) directly to an I2C device (for devices that have only one register to write): set <name> writeByte <I2C Address> <value>
Write one byte (or more bytes sequentially) to the specified register of an I2C device: set <name> writeByteReg <I2C Address> <Register Address> <value>
Write n-bytes to an register range, beginning at the specified register: set <name> writeBlock <I2C Address> <Register Address> <value>
Examples:
Write 0xAA to device with I2C address 0x60 set test1 writeByte 60 AA
Write 0xAA to register 0x01 of device with I2C address 0x6E set test1 writeByteReg 6E 01 AA
Write 0xAA to register 0x01 of device with I2C address 0x6E, after it write 0x55 to register 0x02 set test1 writeByteReg 6E 01 AA 55
Write 0xA4 to register 0x03, 0x00 to register 0x04 and 0xDA to register 0x05 of device with I2C address 0x60 as block operation set test1 writeBlock 60 03 A4 00 DA
Get
get <name> read <I2C Address> [<Register Address> [<number of registers>]]
gets value of I2C device's registers
Examples:
Reads byte from device with I2C address 0x60 get test1 writeByte 60
Reads register 0x01 of device with I2C address 0x6E. get test1 read 6E 01 AA 55
Reads register 0x03 to 0x06 of device with I2C address 0x60. get test1 read 60 03 4
This module controls ONKYO A/V receivers via network connection.
Defining an ONKYO device will schedule an internal task (interval can be set with optional parameter <poll-interval> in seconds, if not set, the value is 75 seconds), which periodically reads the status of the device and triggers notify/filelog commands.
Example:
define avr ONKYO_AVR 192.168.0.10
# With explicit protocol version 2013 and later
define avr ONKYO_AVR 192.168.0.10 2013
# With protocol version prior 2013
define avr ONKYO_AVR 192.168.0.10 pre2013
# With zone2
define avr ONKYO_AVR 192.168.0.10 pre2013 zone2
# With custom interval of 60 seconds
define avr ONKYO_AVR 192.168.0.10 pre2013 main 60
# With zone2 and custom interval of 60 seconds
define avr ONKYO_AVR 192.168.0.10 pre2013 zone2 60
Set
set <name> <command> [<parameter>]
Currently, the following commands are defined (may vary depending on zone).
on - powers on the device
off - turns the device in standby mode
sleep 1..90,off - sets auto-turnoff after X minutes
toggle - switch between on and off
volume 0...100 - set the volume level in percentage
volumeUp - increases the volume level
volumeDown - decreases the volume level
mute on,off - controls volume mute
input - switches between inputs
statusRequest - requests the current status of the device
remoteControl - sends remote control commands; see remoteControl help
Note: If you would like to restrict access to admin set-commands (-> statusRequest, remoteControl) you may set your FHEMWEB instance's attribute allowedCommands like 'set,set-user'.
The string 'set-user' will ensure only non-admin set-commands can be executed when accessing FHEM using this FHEMWEB instance.
Get
get <name> <what>
Currently, the following commands are defined (may vary depending on zone):
power
input
volume
mute
sleep
Generated Readings/Events (may vary depending on zone):
input - Shows currently used input; part of FHEM-4-AV-Devices compatibility
mute - Reports the mute status of the device (can be "on" or "off")
power - Reports the power status of the device (can be "on" or "off")
presence - Reports the presence status of the receiver (can be "absent" or "present"). In case of an absent device, control is not possible.
sleep - Reports current sleep state (can be "off" or shows timer in minutes)
state - Reports current power state and an absence of the device (can be "on", "off" or "absent")
volume - Reports current volume level of the receiver in percentage values (between 0 and 100 %)
OPENWEATHER
The module extracts weather data via the openweather API of www.wetter.com.
It requires a registration on this website to obtain the necessary parameters.
It uses the perl moduls HTTP::Request, LWP::UserAgent, HTML::Parse and Digest::MD5.
To obtain the below parameter you have to create a new project on www.wetter.com.
<project>
Name of the 'openweather' project (create with a user account on wetter.com).
<cityCode>
Code of the location for which the forecast is requested.
The code is part of the URL of the weather forecast page. For example DE0009042 in:
http://www.wetter.com/wetter_aktuell/aktuelles_wetter/deutschland/rostock/DE0009042.html
<apiKey>
Secret key that is provided when the user creates a 'openweather' project on wetter.com.
[language]
Optional. Default language of weather description is German. Change with en to English or es to Spanish.
The function OPENWEATHER_Html creates a HTML code for a vertically arranged weather forecast.
Example:
define MyForecast weblink htmlCode { OPENWEATHER_Html("MyWeather") }
Set
set <name> update
The weather data are immediately polled from the website.
Get
get <name> apiResponse
Shows the response of the web site.
Attributes
disable <0 | 1>
Automatic update is stopped if set to 1.
INTERVAL <seconds>
Polling interval for weather data in seconds (default and smallest value is 3600 = 1 hour). 0 will stop automatic updates.
Note! The forecast values (in brackets) have first to be selected on the project setup page on wetter.com.
fc0|1|2_... - forecast values for today|tommorrow|in 2 days
fc0_...06|11|17|23 - forecast values for today at 06|11|17|23 o'clock
fc1_tempMin|Max - minimal|maximal temperature for tommorrow in °C (tn,tx)
fc0_tempMin06 - minimal temperatur today at 06:00 o'clock in °C
fc0_chOfRain - chance of rain today in % (pc)
fc0_valHours06 - validity period in hours of the forecast values starting at 06:00 o'clock (p)
fc0_weather - weather situation today in German (w_txt)
fc0_weatherCode - code of weather situation today (w)
fc0_wday - German abbreviation of week day of today (d)
fc0_wind - wind speed today in km/h (ws)
fc0_windDir - wind direction today in ° (degree) (wd)
fc0_windDirTxt - wind direction today in text form (wd_txt
etc.
OREGON
The OREGON module interprets Oregon sensor messages received by a RFXCOM receiver. You need to define a RFXCOM receiver first.
See RFXCOM.
Define
define <name> OREGON <deviceid>
<deviceid> is the device identifier of the Oregon sensor. It consists of the sensors name and a one byte hex string (00-ff) that identifies the sensor. The define statement with the deviceid is generated automatically by autocreate. The following sensor names are used:
BTHR918, BTHR918N, PCR800 RGR918, RTGR328N, THN132N, THGR228N, THGR328N, THGR918, THR128, THWR288A, THGR810, UV138, UVN800, WGR918, WGR800, WTGR800_A, WTGR800_T.
The one byte hex string is generated by the Oregon sensor when is it powered on. The value seems to be randomly generated. This has the advantage that you may use more than one Oregon sensor of the same type even if it has no switch to set a sensor id. For exampple the author uses three BTHR918 sensors at the same time. All have different deviceids. The drawback is that the deviceid changes after changing batteries.
FHEM module to commmunicate with 1-Wire A/D converters
This 1-Wire module works with the OWX interface module or with the OWServer interface module
(prerequisite: Add this module's name to the list of clients in OWServer).
Please define an OWX device or OWServer device first.
attr <name> stateAL1 <string> character string for denoting low alarm condition, default is down triangle,
e.g. the code ▾ leading to the sign ▾
attr <name> stateAH1 <string> character string for denoting high alarm condition, default is upward
triangle, e.g. the code ▴ leading to the sign ▴
For each of the following attributes, the channel identification A,B,C,D may be used.
attr <name> <channel>Function
<string> arbitrary functional expression involving the values VA,VB,VC,VD. VA is replaced by
the measured voltage in channel A, etc. This attribute allows linearization of measurement
curves as well as the mixing of various channels. Replacement for Offset/Factor !
FHEM module to commmunicate with 1-Wire Counter/RAM DS2423 or its emulation DS2423emu
This 1-Wire module works with the OWX interface module or with the OWServer interface module
(prerequisite: Add this module's name to the list of clients in OWServer).
Please define an OWX device or OWServer device first.
Defines a 1-wire device. The 1-wire device is identified by its <address>. It is
served by the most recently defined OWServer.
If <interval> is given, the OWServer is polled every <interval> seconds for
a subset of readings.
OWDevice is a generic device. Its characteristics are retrieved at the time of the device's
definition. The available readings that you can get or set as well as those that are
regularly retrieved by polling can be seen when issuing the
list <name> command.
The following devices are currently supported:
DS2401 - Silicon Serial Number
DS1990A - Serial Number iButton
DS2405 - Addressable Switch
DS18S20 - High-Precision 1-Wire Digital Thermometer
DS1920 - iButton version of the thermometer
DS2406, DS2407 - Dual Addressable Switch with 1kbit Memory
DS2436 - Battery ID/Monitor Chip
DS2423 - 4kbit 1-Wire RAM with Counter
DS2450 - Quad A/D Converter
DS1822 - Econo 1-Wire Digital Thermometer
DS2415 - 1-Wire Time Chip
DS1904 - RTC iButton
DS2438 - Smart Battery Monitor
DS2417 - 1-Wire Time Chip with Interrupt
DS18B20 - Programmable Resolution 1-Wire Digital Thermometer
DS2408 - 1-Wire 8 Channel Addressable Switch
DS2413 - Dual Channel Addressable Switch
DS1825 - Programmable Resolution 1-Wire Digital Thermometer with ID
EDS0066 - Multisensor for temperature and pressure
LCD - LCD controller by Louis Swart
Adding more devices is simple. Look at the code (subroutine OWDevice_GetDetails).
This module is completely unrelated to the 1-wire modules with names all in uppercase.
Note:The state reading never triggers events to avoid confusion.
Example:
define myOWServer localhost:4304
get myOWServer devices
10.487653020800 DS18S20
define myT1 10.487653020800
list myT1 10.487653020800
Internals:
...
Readings:
2012-12-22 20:30:07 temperature 23.1875
Fhem:
...
getters:
address
family
id
power
type
temperature
templow
temphigh
polls:
temperature
setters:
alias
templow
temphigh
...
Set
set <name> interval <value>
value modifies the interval for polling data. The unit is in seconds.
set <name> <reading> <value>
Sets <reading> to <value> for the 1-wire device <name>. The permitted values are defined by the underlying
1-wire device type.
Example:
set myT1 templow 5
Get
get <name> <reading> <value>
Gets <reading> for the 1-wire device <name>. The permitted values are defined by the underlying
1-wire device type.
Example:
get myT1 temperature
Attributes
IODev:
Set the OWServer device which should be used for sending and receiving data
for this OWDevice. Note: Upon startup fhem assigns each OWDevice
to the last previously defined OWServer. Thus it is best if you define OWServer
and OWDevices in blocks: first define the first OWServer and the OWDevices that
belong to it, then continue with the next OWServer and the attached OWDevices, and so on.
trimvalues: removes leading and trailing whitespace from readings. Default is 1 (on).
polls: a comma-separated list of readings to poll. This supersedes the list of default readings to poll.
interfaces: supersedes the interfaces exposed by that device.
model: preset with device type, e.g. DS18S20.
resolution: resolution of temperature reading in bits, can be 9, 10, 11 or 12.
Lower resolutions allow for faster retrieval of values from the bus.
Particularly reasonable for large 1-wire installations to reduce busy times for FHEM.
OWFS is a suite of programs that designed to make the 1-wire bus and its
devices easily accessible. The underlying priciple is to create a virtual
filesystem, with the unique ID being the directory, and the individual
properties of the device are represented as simple files that can be read
and written.
Define a 1-wire device to communicate with an OWFS-Server.
<owserver-ip:port>
IP-address:port from OW-Server.
<model>
Define the type of the input device.
Currently supportet: DS1420, DS9097 (for passive Adapter)
<id>
Corresponding to the id of the input device. Only for active Adapter.
Note:
If the owserver-ip:port is called none, then
no device will be opened, so you can experiment without hardware attached.
Example:
#define an active Adapter:
define DS9490R OWFS 127.0.0.1:4304 DS1420 93302D000000
#define a passive Adapter:
define DS9097 OWFS 127.0.0.1:4304 DS9097
Set
N/A
Get
get <name> <value>
where value is one of (not supported by passive Devices e.g. DS9097):
address (read-only)
The entire 64-bit unique ID. address starts with the family code.
Given as upper case hexidecimal digits (0-9A-F).
crc8 (read-only)
The 8-bit error correction portion. Uses cyclic redundancy check. Computed
from the preceeding 56 bits of the unique ID number.
Given as upper case hexidecimal digits (0-9A-F).
family (read-only)
The 8-bit family code. Unique to each type of device.
Given as upper case hexidecimal digits (0-9A-F).
id (read-only)
The 48-bit middle portion of the unique ID number. Does not include the
family code or CRC.
Given as upper case hexidecimal digits (0-9A-F).
locator (read-only)
Uses an extension of the 1-wire design from iButtonLink company that
associated 1-wire physical connections with a unique 1-wire code. If
the connection is behind a Link Locator the locator will show a unique
8-byte number (16 character hexidecimal) starting with family code FE.
If no Link Locator is between the device and the master, the locator
field will be all FF.
present (read-only)
Is the device currently present on the 1-wire bus?
type (read-only)
Part name assigned by Dallas Semi. E.g. DS2401 Alternative packaging
(iButton vs chip) will not be distiguished.
Examples:
get DS9490R type DS9490R type => DS1420
get DS9490R address DS9490R address => 8193302D0000002B
FHEM module to commmunicate with 1-Wire multi-sensors, currently the DS2438 smart battery
monitor
This 1-Wire module works with the OWX interface module or with the OWServer interface module
(prerequisite: Add this module's name to the list of clients in OWServer).
Please define an OWX device or OWServer device first.
[<model>] Defines the sensor model (and thus 1-Wire family
id), currently the following values are permitted:
model DS2438 with family id 26 (default if the model parameter is omitted).
Measured is a temperature value, an external voltage and the current supply
voltage
<fam> 2-character unique family id, see above
<id> 12-character unique ROM id of the converter device without family id and CRC
code
<interval> Measurement interval in seconds. The default is 300 seconds.
FHEM module to commmunicate with 1-Wire Programmable Switches
This 1-Wire module works with the OWX interface module or with the OWServer interface module
(prerequisite: Add this module's name to the list of clients in OWServer).
Please define an OWX device or OWServer device first.
set <name> output <channel-name> on | off | on-for-timer <time> | off-for-timer <time> Set
value for channel (A,B,... or defined channel name). 1 = off, 0 = on in normal
usage. See also the note above.
on-for-timer/off-for-timer will set the desired value only for the given time,
either given as hh:mm:ss or as integers seconds
and then will return to the opposite value.
set <name> gpio <value> Set values for
channels (For 2 channels: 3 = A and B off, 1 = B on 2 = A on 0 = both on)
get <name> input <channel-name> state for
channel (A,B, ... or defined channel name) This value reflects the measured value,
not necessarily the one set as output state, because the output transistors are open
collector switches. A measured state of 1 = OFF therefore corresponds to an output
state of 1 = OFF, but a measured state of 0 = ON can also be due to an external
shortening of the output.
Defines a logical OWServer device. OWServer is the server component of the
1-Wire Filesystem. It serves as abstraction layer
for any 1-wire devices on a host. <protocol> has
format <hostname>:<port>. For details see
owserver documentation.
You need OWNet.pm from owfs.org, which is normally deployed with FHEM. As at 2012-12-23 the OWNet module
on CPAN has an issue which renders it useless for remote connections.
The actual 1-wire devices are defined as OWDevice devices.
If autocreate is enabled, all the devices found are created at
start of FHEM automatically.
This module is completely unrelated to the 1-wire modules with names all in uppercase.
Notice: if you get no devices add both localhost and the FQDN of your owserver as server directives
to the owserver configuration file
on the remote host.
devices
Lists the addresses and types of all 1-wire devices provided by the owserver. Also shows
the corresponding OWDevice if one is defined for the respective 1-wire devices.
nonblocking
Get all readings (OWServer / OWDevice) via a child process. This ensures, that FHEM
is not blocked during communicating with the owserver.
Example: attr <name> nonblocking 1
FHEM module to commmunicate with 1-Wire bus digital thermometer devices
This 1-Wire module works with the OWX interface module or with the OWServer interface module
(prerequisite: Add this module's name to the list of clients in OWServer).
Please define an OWX device or OWServer device first.
[<model>] Defines the thermometer model (and thus 1-Wire family
id) currently the following values are permitted:
model DS1820 with family id 10 (default if the model parameter is omitted)
model DS1822 with family id 22
model DS18B20 with family id 28
<fam> 2-character unique family id, see above
<id> 12-character unique ROM id of the thermometer device without family id and CRC
code
<interval> Temperature measurement interval in seconds. The default is 300 seconds.
Set
set <name> interval <int> Temperature
readout interval in seconds. The default is 300 seconds. Attention:This is the
readout interval. Whether an actual temperature measurement is performed, is determined by the
tempConv attribute
set <name> tempHigh <float> The high alarm temperature (on the temperature scale chosen by the attribute
value)
set <name> tempLow <float> The low alarm temperature (on the temperature scale chosen by the attribute
value)
Get
get <name> id Returns the full 1-Wire device id OW_FAMILY.ROM_ID.CRC
get <name> present Returns 1 if this 1-Wire device is present, otherwise 0.
attr <name> stateAL <string> character string for denoting low alarm condition, default is down triangle,
e.g. the code ▾ leading to the sign ▾
attr <name> stateAH <string> character string for denoting high alarm condition, default is upward
triangle, e.g. the code ▴ leading to the sign ▴
attr <name> tempConv onkick|onread determines, whether a temperature measurement will happen when "kicked"
through the OWX backend module (all temperature sensors at the same time), or on
reading the sensor (1 second waiting time, default).
attr <name> interval <int> Temperature
readout interval in seconds. The default is 300 seconds. Attention:This is the
readout interval. Whether an actual temperature measurement is performed, is determined by the
tempConv attribute
define <name> OWX <serial-device> or define <name> OWX <cuno/coc-device> or define <name> OWX <arduino-pin>
Define a 1-Wire interface to communicate with a 1-Wire bus.
<serial-device> The serial device (e.g. USB port) to which the
1-Wire bus is attached.
<cuno-device> The previously defined CUNO to which the 1-Wire bus
is attached.
<arduino-pin> The pin of the previous defined FRM
to which the 1-Wire bus is attached. If there is more than one FRM device defined
use IODev attribute to select which FRM device to use.
sets the time period in seconds for "kicking" the 1-Wire bus (default
is 300 seconds). This means:
With 1-Wire bus interfaces that do not supply power to the 1-Wire bus (attr
buspower parasitic), the 1-Wire bus is reset at these intervals.
With 1-Wire bus interfaces that supply power to the 1-Wire bus (attr
buspower = real), all temperature measurement devices on the bus receive the
command to start a temperature conversion (saves a lot of time when reading)
With 1-Wire bus interfaces that contain a busmaster chip, the response to a
reset pulse contains information about alarms.
instructs the module to start an alarm search in case a reset pulse
discovers any 1-Wire device which has the alarm flag set.
Get
get <name> alarms
performs an "alarm search" for devices on the 1-Wire bus and, if found,
generates an event in the log (not with CUNO).
get <name> devices
redicovers all devices on the 1-Wire bus. If a device found has a
previous definition, this is automatically used. If a device is found but has no
definition, it is autocreated. If a defined device is not on the 1-Wire bus, it is
autodeleted.
define <name> OWX_ASYNC <serial-device> or define <name> OWX_ASYNC <cuno/coc-device> or define <name> OWX_ASYNC <arduino-pin>
Define a 1-Wire interface to communicate with a 1-Wire bus.
<serial-device> The serial device (e.g. USB port) to which the
1-Wire bus is attached.
<cuno-device> The previously defined CUNO to which the 1-Wire bus
is attached.
<arduino-pin> The pin of the previous defined FRM
to which the 1-Wire bus is attached. If there is more than one FRM device defined
use IODev attribute to select which FRM device to use.
instructs the module to start an alarm search in case a reset pulse
discovers any 1-Wire device which has the alarm flag set.
Get
get <name> alarms
performs an "alarm search" for devices on the 1-Wire bus and, if found,
generates an event in the log (not with CUNO).
get <name> devices
redicovers all devices on the 1-Wire bus. If a device found has a
previous definition, this is automatically used. If a device is found but has no
definition, it is autocreated. If a defined device is not on the 1-Wire bus, it is
autodeleted.
Attributes
attr <name> dokick 0|1 1 if the interface regularly kicks thermometers on the bus to do a temperature conversion,
and to perform an alarm check, 0 if not
attr <name> buspower real|parasitic parasitic if there are any devices on the bus that steal power from the data line.
Ensures that never more than a single device on the bus is talked to (throughput is throttled noticable!)
Automatically disables attribute 'dokick'.
attr <name> IODev <FRM-device> assignes a specific FRM-device to OWX_ASYNC when working through an Arduino.
Required only if there is more than one FRM defined.
attr <name> maxtimeouts <number> maximum number of timeouts (in a row) before OWX_ASYNC disconnects itself from the
busmaster and tries to establish a new connection
consumptionTotal
will be created as a default user reading to have a continous consumption value that is not influenced
by the regualar reset or overflow of the normal consumption reading
Attributes
forceOn
try to switch on the device whenever an off status is received.
offLevel
a power level less or equal offLevel is considered to be off.
readonly
if set to a value != 0 all switching commands (on, off, toggle, ...) will be disabled.
This module controls a Philips Audio Player e.g. MCi, Streamium or Fidelio and (potentially) any other device including a navigation server.
To check, open the following URL in the browser: http://[ip # of your device]:8889/index
Currently implemented features:
Power on/off
Internet Radio Preset Selection
Input selection
Volume +/-
Mute on/off
...
Defining a PHILIPS_AUDIO device will schedule an internal task (interval can be set
with optional parameters <off_status_interval> and <on_status_interval> in seconds.
<off_status_interval> is a parameter used in case the device is powered off or not available.
<on_status_interval> is a parameter used in case the device is powered on.
If both parameters are unset, a default value 30 (seconds) for both is used.
If <off_status_interval> is set only the same value is used for both parameters.
Due to a relatively low-performance of the devices the minimum interval is set to 3 seconds.
The internal task periodically reads the status of the Network Player (power state, volume and mute status etc.) and triggers notify/filelog commands.
Example:
Add the following code into the fhem.cfg configuration file and restart fhem:
It's a good idea to insert a 'sleep' instruction between each fhem commands due to internal processing time of the player. Be patient when executing the commands...
Now the function can be called by typing the following line in the FHEM command line or by the notify-definitions:
{startMyFavouriteRadioStation()}
Get
get <name> <reading>
Currently, the 'get' command returns reading values only. For a specific list of possible values, see section "Generated Readings".
Optional attribute to disable the internal cyclic status update of the receiver. Manual status updates via statusRequest command is still possible.
Possible values: 0 → perform cyclic status update, 1 → don't perform cyclic status updates.
Readings
albumArt - Link to current album art or radio station.
elapseTime - Elapse time of the played audio.
mute - Reports the mute status (on|off).
playing - Reports the current playier status (yes|no).
power - Reports the current power status (on|absent).
presence - Reports the current presence (present|absent).
state - Reports the current state status (on|absent).
subtitle - Reports the current subtitle of played audio.
title - Reports the current title of played audio.
totalTime - Reports the total time of the played audio.
volume - Reports current relative volume (0..100).
volumeStraight - Reports current absolute volume (0..64).
Implementer's note
Trivial: In order to use that module the network player must be connected to the Ethernet.
There's no possibility to read back the current power on/standby status from the device. This fuctionality is missing in the server application.
This module controls Philips TV devices and their Ambilight.
Defining a PHTV device will schedule an internal task (interval can be set
with optional parameter <poll-interval> in seconds, if not set, the value is 45
seconds), which periodically reads the status of the device and triggers notify/filelog commands.
Example:
define PhilipsTV PHTV 192.168.0.10
# With custom interval of 20 seconds
define PhilipsTV PHTV 192.168.0.10 20
Set
set <name> <command> [<parameter>]
Currently, the following commands are defined.
on - powers on the device and send a WoL magic package if needed
off - turns the device in standby mode
toggle - switch between on and off
channel channel,0...999,sRef - zap to specific channel or service reference
channelUp - zap to next channel
channelDown - zap to previous channel
volume 0...100 - set the volume level in percentage
volumeStraight 1...60 - set the volume level in device specific range
volumeUp - increases the volume level
volumeDown - decreases the volume level
mute on,off,toggle - controls volume mute
input ... - switches between inputs
statusRequest - requests the current status of the device
remoteControl UP,DOWN,... - sends remote control commands; see remoteControl help
ambiHue on,off - activates/disables Ambilight+Hue function
ambiMode internal,manual,expert - set source register for Ambilight
ambiPreset - set Ambilight to predefined state
rgb HEX,LED address - set an RGB value for Ambilight
hue 0-65534 - set the color hue value Ambilight
sat 0-255 - set the saturation value for Ambilight
bri 0-255 - set the brightness value for Ambilight
play - starts/resumes playback
pause - starts/resumes playback
stop - stops current playback
record - starts recording of current channel
Note: If you would like to restrict access to admin set-commands (-> statusRequest) you may set your FHEMWEB instance's attribute allowedCommands like 'set,set-user'.
The string 'set-user' will ensure only non-admin set-commands can be executed when accessing FHEM using this FHEMWEB instance.
Advanced Ambilight Control
If you would like to specificly control color for individual sides or even individual LEDs, you may use special addressing to be used with set command 'rgb':
LED addressing format: <Layer><Side><LED number>
Examples:
# set LED 0 on left side within layer 1 to color RED
set PhilipsTV rgb L1L0:FF0000
# set LED 0, 2 and 4 on left side within layer 1 to color RED
set PhilipsTV rgb L1L0:FF0000 L1L2:FF0000 L1L4:FF0000
# set complete right side within layer 1 to color GREEN
set PhilipsTV rgb L1R:00FF00
# set complete layer 1 to color BLUE
set PhilipsTV rgb L1:0000FF
Advanced Ambilight+HUE Control
Linking to your HUE devices within attributes ambiHueLeft, ambiHueTop, ambiHueRight and ambiHueBottom uses some defaults to calculate the actual color.
More than one HUE device may be added using blank.
The following settings can be fine tuned for each HUE device:
LED(s) to be used as color source
either 1 single LED or a few in a raw like 2-4. Defaults to use the middle LED and it's left and right partners. Counter starts at 1. See readings ambiLED* for how many LED's your TV has.
saturation in percent of the original value (1-99, default=100)
brightness in percent of the original value (1-99, default=100)
Use the following addressing format for fine tuning: devicename:<LEDs$gt;:<saturation$gt;:<brightness$gt;
Examples:
# to push color from top to 2 HUE devices
attr PhilipsTV ambiHueTop HUEDevice0 HUEDevice1
# to use only LED 4 from the top as source
attr PhilipsTV ambiHueTop HUEDevice0:4
# to use a combination of LED's 1+2 as source
attr PhilipsTV ambiHueTop HUEDevice0:1-2
# to use LED's 1+2 and only 90% of their saturation
attr PhilipsTV ambiHueTop HUEDevice0:1-2:90
# to use LED's 1+2 and only 50% of their brightness
attr PhilipsTV ambiHueTop HUEDevice0:1-2::50
# to use LED's 1+2, 90% saturation and 50% brightness
attr PhilipsTV ambiHueTop HUEDevice0:1-2:90:50
# to use default LED settings but only adjust their brightness to 50%
attr PhilipsTV ambiHueTop HUEDevice0:::50
Get
get <name> <what>
Currently, the following commands are defined:
channel
mute
power
input
volume
rgb
Attributes
ambiHueLeft - HUE devices that should get the color from left Ambilight.
ambiHueTop - HUE devices that should get the color from top Ambilight.
ambiHueRight - HUE devices that should get the color from right Ambilight.
ambiHueBottom - HUE devices that should get the color from bottom Ambilight.
ambiHueLatency - Controls the update interval for HUE devices in milliseconds; defaults to 200 ms.
disable - Disable polling (true/false)
drippyFactor - Adds some delay in seconds after low-performance devices came up to allow more time to become responsive (default=0)
inputs - Presents the inputs read from device. Inputs can be renamed by adding ,NewName right after the original name.
jsversion - JointSpace protocol version; e.g. pre2014 devices use 1, 2014 devices use 5 and 2015 devices use 6. defaults to 1
sequentialQuery - avoid parallel queries for low-performance devices
timeout - Set different polling timeout in seconds (default=7)
Generated Readings/Events:
ambiHue - Ambilight+Hue status
ambiLEDBottom - Number of LEDs of bottom Ambilight
ambiLEDLayers - Number of physical LED layers
ambiLEDLeft - Number of LEDs of left Ambilight
ambiLEDRight - Number of LEDs of right Ambilight
ambiLEDTop - Number of LEDs of top Ambilight
ambiMode - current Ambilight color source
channel - Shows the service name of current channel; part of FHEM-4-AV-Devices compatibility
country - Set country
currentMedia - The preset number of this channel; part of FHEM-4-AV-Devices compatibility
frequency - Shows current channels frequency
input - Shows currently used input; part of FHEM-4-AV-Devices compatibility
language - Set menu language
model - Device model
mute - Reports the mute status of the device (can be "on" or "off")
onid - The ON ID
power - Reports the power status of the device (can be "on" or "off")
presence - Reports the presence status of the receiver (can be "absent" or "present"). In case of an absent device, control is basically limited to turn it on again. This will only work if the device supports Wake-On-LAN packages, otherwise command "on" will have no effect.
receiveMode - Receiving mode (analog or DVB)
rgb - Current Ambilight color if ambiMode is not set to internal and all LEDs have the same color
rgb_X - Current Ambilight color of a specific LED if ambiMode is not set to internal
serialnumber - Device serial number
servicename - Name for current channel
sid - The S-ID
state - Reports current power state and an absence of the device (can be "on", "off" or "absent")
systemname - Device system name
tsid - The TS ID
volume - Reports current volume level of the receiver in percentage values (between 0 and 100 %)
volumeStraight - Reports current volume level of the receiver in device specific range
The PIFACE module managed the Raspberry Pi extension board PiFace Digital.
PIFACE controls the input ports 0..7 and output ports 0..7.
The relays 0 and 1 have corresponding output port 0 and 1.
The switches 0..3 have corresponding input ports 0..3 and must be read with attr portMode<0..7> = up
The status of the ports can be displayed periodically. The update of the states via interrupt is not supported.
The module can be periodically monitored by a watchdog function.
The ports can be read and controlled individually by the function readingsProxy.
PIFACE is tested with the Raspbian OS.
Preparatory Work
The use of PIFACE module requires some preparatory work.
Module needs tools from Wiring Pi. Install it with git clone git://git.drogon.net/wiringPi
cd wiringPi
./build
PiFace Digital need the SPI pins on the Raspberry Pi to be enabled in order to function.
Start sudo raspi-config, select Option 8 Advanced Options
and set the A5 SPI option to "Yes".
The function of the PiFace Digital can be tested at OS command line. For example: gpio -p readall gpio -p read 200 gpio -p write 201 0 or gpio -p write 201 1
The watchdog function monitors the input port 7 and the output port 7.
If the watchdog is enabled, this ports can not be used for other tasks.
In order to monitor the input port 7, it must be connected to the ground!
The OS command "shutdown" must be enable for fhem if an OS restart is to
be executed in case of malfunction. For example, with chmod +s /sbin/shutdown
or sudo chmod +s /sbin/shutdown.
Define
define <name> PIFACE
Set
set <name> <port> <value>
set single port n to 1 (on) or 0 (off)
Examples:
set <name> 3 1 => set port 3 on
set <name> 5 0 => set port 5 off
set all ports in one command by bitmask
Example:
set <name> all 255 => set all ports on
set <name> all 0 => set all ports off
set <name> all 170 => bitmask(170) = 10101010 => set ports 1 3 5 7 on, ports 0 2 4 6 off
port 76543210
bit 10101010
Get
get <name> <port>
get state of single port
Example:
get <name> 3 => get state of port 3
get state of input ports and update changed readings
Example:
get <name> in => get state of all input ports
get state of out ports and update changed readings
Example:
get <name> out => get state of all output ports
get state of input and out ports and update all readings
Example:
get <name> all => get state of all ports
Attributes
defaultState last|off|0|1,
[defaultState] = off is default.
Restoration of the status of the output port after a Fhem reboot.
disable 0|1
If applied set commands will not be executed.
disabledForIntervals HH:MM-HH:MM HH:MM-HH-MM...
Space separated list of HH:MM tupels. If the current time is between
the two time specifications, set commands will not be executed. Instead of
HH:MM you can also specify HH or HH:MM:SS. To specify an interval
spawning midnight, you have to specify two intervals, e.g.:
23:00-24:00 00:00-01:00
pollInterval off|1,2,...,9,10,
[pollInterval] = off is default.
Define the polling interval of the input ports in seconds.
portMode<0..7> tri|up,
[portMode<0..7>] = tri is default.
This enables (up) or disables (tri) the internal pull-up resistor on the given input port.
You need to enable the pull-up if you want to read any of the on-board switches on the PiFace board.
watchdog off|on|silent,
[watchdog] = off is default.
The function of the PiFace extension can be monitored periodically.
The watchdog module checks the function of ports in7 and out7.
If the watchdog function is to be used, ports in7 and out7 are reserved for this purpose.
The port 7 must be connected to ground.
If [watchdog] = on, the result of which is periodically logged and written to the reading watchdog.
If [watchdog] = silent, FHEM is restarted after the first error detected.
If the error could not be eliminated, then the Raspberry operating system is restarted.
If the error is not corrected as well, the monitoring function is disabled and the error is logged.
watchdogInterval 10..65535,
[watchdogInterval] = 60 is default.
Interval between two monitoring tests in seconds.
Generated Readings/Events:
<out0..out7>: 0|1
state of output port 0..7
<in0..in7>: 0|1
state of input port 0..7
watchdog: off|ok|error|restart|start
state of the watchdog function
state: active|error
PIONEERAVR
This module allows to remotely control a Pioneer AV receiver (only the Main zone, other zones are controlled by the module PIONEERAVRZONE)
equipped with an Ethernet interface or a RS232 port.
It enables Fhem to
Note: this module requires the Device::SerialPort or Win32::SerialPort module
if the module is connected via serial Port or USB.
This module tries to
keep the data connection between Fhem and the Pioneer AV receiver open. If the connection is lost, this module tries to reconnect once
forwards data to the module PIONEERAVRZONE to control the ZONEs of a Pioneer AV receiver
As long as Fhem is connected to the Pioneer AV receiver no other device (e.g. a smart phone) can connect to the Pioneer AV receiver on the same port.
Some Pioneer AV receivers offer more than one port though. From Pioneer recommend port numbers:00023,49152-65535, Invalid port numbers:00000,08102
Define
define <name> PIONEERAVR telnet <IPAddress:Port>
or
define <name> PIONEERAVR serial <SerialDevice>[<@BaudRate>]
Defines a Pioneer AV receiver device (communication interface and main zone control). The keywords telnet or
serial are fixed. Default port on Pioneer AV receivers is 23 (according to the above mentioned Pioneer documetation) or 8102 (according to posts in the Fhem forum)
Note: PIONEERAVRZONE devices to control zone2, zone3 and/or HD-zone are autocreated on reception of the first message for those zones.
Examples:
define VSX923 PIONEERAVR telnet 192.168.0.91:23 define VSX923 PIONEERAVR serial /dev/ttyS0 define VSX923 PIONEERAVR serial /dev/ttyUSB0@9600
Set
set <name> <what> [<value>]
where <what> is one of
bass <-6 ... 6> - Bass from -6dB to + 6dB (is only available if tone = on and the ListeningMode supports it)
channel <1 ... 9> - To change the tuner preset. Only available for input = 2 (Tuner)
channelDown - Changes to the next lower tuner preset. Only available for input = 2 (Tuner)
channelStraight -
To change the tuner preset with values as they are shown in the display of the Pioneer AV receiver eg. "A1". Only available for input = 2 (Tuner)
channelUp - Changes to the next higher tuner preset. Only available for input = 2 (Tuner)
down - "arrow key down". Available for the same inputs as "play"
enter - "Enter key". Available for the same inputs as "play"
eq - Turns the equalizer on or off
fwd - Fast forward. Available for the same inputs as "play"
hdmiOut <1+2|1|2|off> - Switches the HDMI output 1 and/or 2 of the Pioneer AV Receivers on or off.
input The list of possible (i.e. not deactivated)
inputs is read in during Fhem start and with get statusRequest. Renamed inputs are shown with their new (renamed) name
inputDown - Select the next lower input for the Main Zone
inputUp - Select the next higher input for the Main Zone
left - "Arrow key left". Available for the same inputs as "play"
listeningMode - Sets a ListeningMode e.g. autoSourround, direct, action,...
mcaccMemory <1...6> - Sets one of the 6 predefined MCACC settings for the Main Zone
menu - "Menu-key" of the remote control. Available for the same inputs as "play"
mute - Mute the Main Zone of the Pioneer AV Receiver. "mute = on" means: Zero volume
networkStandby - Turns Network standby on or off. To turn on a Pioneer AV Receiver with this module from standby, Network Standby must be "on"
next - Available for the same inputs as "play"
off - Switch the Main Zone to standby
on - Switch the Main Zone on from standby. This can only work if "Network Standby" is "on" in the Pioneer AV Receiver. Refer to "networkStandby" above.
pause - Pause replay. Available for the same inputs as "play"
play - Starts replay for the following inputs:
usbDac
ipodUsb
xmRadio
homeMediaGallery
sirius
adapterPort
internetRadio
pandora
mediaServer
favorites
mhl
prev - Changes to the previous title. Available for the same inputs as "play".
raw - Sends the command <PioneerCommand> unchanged to the Pioneer AV receiver. A list of all available commands is available in the Pioneer documentation mentioned above
remoteControl - where is one of:
cursorDown
cursorRight
cursorLeft
cursorEnter
cursorReturn
homeMenu
statusDisplay
audioParameter
hdmiOutputParameter
videoParameter
homeMenu
Simulates the keys of the remote control. Warning: The cursorXX keys cannot change the inputs -> set up ... can be used for this
reopen - Tries to reconnect Fhem to the Pioneer AV Receiver
repeat - Repeat for the following inputs: AdapterPort, Ipod, Favorites, InternetRadio, MediaServer. Cycles between
no repeat
repeat current title
repeat all titles
return - "Return key". Available for the same inputs as "play"
rev - "rev key". Available for the same inputs as "play"
right - "Arrow key right". Available for the same inputs as "play"
selectLine01 - selectLine08 - Available for the same inputs as "play". If there is an OSD you can select the lines directly
shuffle - Random replay. For the same inputs available as "repeat". Toggles between random on and off
signalSelect - Signal select function
speakers - Turns speaker A and or B on or off.
standingWave - Turns Standing Wave on or off for the Main Zone
statusRequest - Asks the Pioneer AV Receiver for information to update the modules readings
stop - Stops replay. Available for the same inputs as "play"
toggle - Toggle the Main Zone to/from Standby
tone - Turns tone on or in bypass
treble <-6 ... 6> - Treble from -6dB to + 6dB (works only if tone = on and the ListeningMode permits it)
up - "Arrow key up". Available for the same inputs as "play"
volume <0 ... 100> - Volume of the Main Zone in % of the maximum volume
volumeDown - Reduce the volume of the Main Zone by 0.5dB
volumeUp - Increase the volume of the Main Zone by 0.5dB
volumeStraight<-80.5 ... 12> - Set the volume of the Main Zone with values from -80 ... 12 (As it is displayed on the Pioneer AV receiver
Closes and reopens the device. Could be handy if the connection between Fhem and the Pioneer AV receiver is lost and cannot be
reestablished automatically.
Get
loadInputNames - reads the names of the inputs from the Pioneer AV receiver and checks if those inputs are enabled
audioInfo - get the current audio parameters from the Pioneer AV receiver (e.g. audioInputSignal, audioInputFormatXX, audioOutputFrequency)
display - updates the reading 'display' and 'displayPrevious' with what is shown on the display of the Pioneer AV receiver
bass - updates the reading 'bass'
channel -
currentListIpod - updates the readings currentAlbum, currentArtist, etc.
currentListNetwork -
display -
input -
listeningMode -
listeningModePlaying -
macAddress -
avrModel - get the model of the Pioneer AV receiver, eg. VSX923
mute -
networkPorts - get the open tcp/ip ports of the Pioneer AV Receiver
networkSettings - get the IP network settings (ip, netmask, gateway,dhcp, dns1, dns2, proxy) of the Pioneer AV Receiver
networkStandby -
power - get the Power state of the Pioneer AV receiver
signalSelect -
softwareVersion - get the software version of the software currently running in the Pioneer AV receiver
speakers -
speakerSystem -
tone -
tunerFrequency - get the current frequency the tuner is set to
tunerChannelNames -
treble -
volume -
Attributes
checkConnection <enable|disable> - Enables/disables the check if the data connection to the Pioneer AV receiver is open.(Default: enable)
logTraffic <loglevel> - Enables logging of sent and received datagrams with the given loglevel.
Control characters in the logged datagrams are escaped, i.e. a double backslash is shown for a single backslash,
\n is shown for a line feed character,...
verbose - 0: log es less as possible, 5: log as much as possible
volumeLimit <0 ... 100> - limits the volume to the given value
volumeLimitStraight <-80 ... 12> - limits the volume to the given value
PIONEERAVRZONE
Define
define <name> PIONEERAVRZONE <zone>
Defines a Zone (zone2, zone3 or hdZone) of a PioneerAVR device.
Note: devices to control zone2, zone3 and/or HD-zone are autocreated on reception of the first message for those zones.
Normally, the PIONEERAVRZONE device is attached to the latest previously defined PIONEERAVR device
for I/O. Use the IODev attribute of the PIONEERAVRZONE device to attach to any
PIONEERAVR device, e.g. attr myPioneerAvrZone2 IODev myPioneerAvr.
The POKEYS module is used to control the LAN POKEYS device (POKEYS56e) which supports
up to 56 digital input, analog inputs, counter inputs and digital outputs.
Each port/pin has to be configured before it can be used.
Define
define <name> POKEYS <ip-address> <pin> <io-state> [<time in ms>]
<ip-address> the IP address where the POKEYS device can be accessed <pin> the pin number which should be configured <io-state> the new io state of the pin Obsolete(=undef) DigIn DigOut AdcIn DigInCtRise DigInCtFall ExtDigOut GetBasic <time in ms> optional else 1000ms: cyclic update time for Input pin
Example:
define PoInfo POKEYS 192.168.178.34 0 GetBasic
# creates a virtual pin for getting infos about the device with the get command define Pin44in POKEYS 192.168.178.34 44 DigIn 200
# creates a digitial input port on pin 44 define Pin25out POKEYS 192.168.178.34 25 DigOut
# creates a digial output port on pin 25
Set
set <name> <state> [<time in ms>]
<state> can be OFF ON OFF_PULSE ON_PULSE <time in ms> optional else 1000ms hold time for the ON_PULSE OFF_PULSE state
Example:
set Pin25out ON
# sets Pin25out to ON (0V)
Get
get <name> <type>
only supported for pins of type GetBasic <type> can be Version DevName Serial User CPUload
Example:
get PoInfo Version
# gets the version of the POKEYS device
Attributes
todo
PRESENCE
The PRESENCE module provides several possibilities to check the presence of mobile phones or similar mobile devices such as tablets.
This module provides several operational modes to serve your needs. These are:
lan-ping - A presence check of a device via network ping in your LAN/WLAN
fritzbox - A presence check by requesting the device state from the FritzBox internals (only available when running FHEM on a FritzBox!)
local-bluetooth - A presence check by searching directly for a given bluetooth device nearby
function - A presence check by using your own perl function which returns a presence state
shellscript - A presence check by using an self-written script or binary which returns a presence state
lan-bluetooth - A presence check of a bluetooth device via LAN network by connecting to a presenced or collectord instance
Each mode can be optionally configured with a specific check interval and a present check interval.
check-interval - The interval in seconds between each presence check. Default value: 30 seconds
present-check-interval - The interval in seconds between each presence check in case the device is present. Otherwise the normal check-interval will be used.
Checks for a network device by requesting the internal state on a FritzBox via ctlmgr_ctl. The device-name must be the same as shown in the network overview of the FritzBox or can be substituted by the MAC address with the format XX:XX:XX:XX:XX:XX
This check is only applicable when FHEM is running on a FritzBox! The detection of absence can take about 10-15 minutes!
Checks for a bluetooth device and reports its presence state. For this mode the shell command "hcitool" is required (provided with a bluez installation under Debian via APT), as well
as a functional bluetooth device directly attached to your machine.
Checks for a presence state via perl-code. You can use a self-written perl function to obtain the presence state of a specific device (e.g. via SNMP check).
The function must return 0 (absent) or 1 (present). An example can be found in the FHEM-Wiki.
Example
define iPhone PRESENCE function {snmpCheck("10.0.1.1","0x44d77429f35c")}
Checks for a presence state via shell script. You can use a self-written script or binary in any language to obtain the presence state of a specific device (e.g. via SNMP check).
The shell must return 0 (absent) or 1 (present) on console (STDOUT). Any other values will be treated as an error
Checks for a bluetooth device with the help of presenced or collectord. They can be installed where-ever you like, just must be accessible via network.
The given device will be checked for presence status.
The presence is a perl network daemon, which provides presence checks of multiple bluetooth devices over network.
It listens on TCP port 5111 for incoming connections from a FHEM PRESENCE instance or a running collectord.
Usage:
presenced -d [-p <port>] [-P <filename>]
presenced [-h | --help]
Options:
-p, --port
TCP Port which should be used (Default: 5111)
-P, --pid-file
PID file for storing the local process id (Default: /var/run/presenced.pid)
-d, --daemon
detach from terminal and run as background daemon
-v, --verbose
Print detailed log output
-h, --help
Print detailed help screen
It uses the hcitool command (provided by a bluez installation)
to make a paging request to the given bluetooth address (like 01:B4:5E:AD:F6:D3). The devices must not be visible, but
still activated to receive bluetooth requests.
If a device is present, this is send to FHEM, as well as the device name as reading.
The collectord is a perl network daemon, which handles connections to several presenced installations to search for multiple bluetooth devices over network.
It listens on TCP port 5222 for incoming connections from a FHEM presence instance.
Usage:
collectord -c <configfile> [-d] [-p <port>] [-P <pidfile>]
collectord [-h | --help]
Options:
-c, --configfile <configfile>
The config file which contains the room and timeout definitions
-p, --port
TCP Port which should be used (Default: 5222)
-P, --pid-file
PID file for storing the local process id (Default: /var/run/collectord.pid)
-d, --daemon
detach from terminal and run as background daemon
-v, --verbose
Print detailed log output
-l, --logfile <logfile>
log to the given logfile
-h, --help
Print detailed help screen
Before the collectord can be used, it needs a config file, where all different rooms, which have a presenced detector, will be listed. This config file looks like:
# room definition
# ===============
#
[room-name] # name of the room
address=192.168.0.10 # ip-address or hostname
port=5111 # tcp port which should be used (5111 is default)
presence_timeout=120 # timeout in seconds for each check when devices are present
absence_timeout=20 # timeout in seconds for each check when devices are absent
[living room]
address=192.168.0.11
port=5111
presence_timeout=180
absence_timeout=20
If a device is present in any of the configured rooms, this is send to FHEM, as well as the device name as reading and the room which has detected the device.
(Only in Mode "ping" on Linux based OS applicable)
Changes the count of the used ping packets to recognize a present state. Depending on your network performance sometimes a packet can be lost or blocked.
(only for mode "fritzbox")
When this attribute is enabled, the network speed is checked in addition to the device state.
This only makes sense for wireless devices connected directly to the FritzBox.
Possible values: 0 => do not check speed, 1 => check speed when device is active
Default value is 0 (no speed check)
Define a FHEM command, which powers on or off the device.
When executing the powerCmd (set command: power) following placeholders will be replaced by there corresponding values:
%NAME - name of the PRESENCE definition
%ADDRESS - the address of the PRESENCE definition as given in the define statement
%ARGUMENT - the argument given to the power set command (e.g. "on" or "off)
Example FHEM commands:
set PowerSwitch_1 on
set PowerSwitch_1 %ARGUMENT
"/opt/power_on.sh %ADDRESS"
{powerOn("%ADDRESS", "username", "password")}
Generated Events:
General Events:
state: (absent|present|disabled|error|timeout) - The state of the device or "disabled" when the disable attribute is enabled
presence: (absent|present) - The state of the device
powerCmd: (executed|failed) - power command was executed or has failed
Bluetooth specific events:
device_name: $name - The name of the Bluetooth device in case it's present
presenced/collectord specific events:
command_accepted: $command_accepted (yes|no) - Was the last command acknowleged and accepted by the presenced or collectord?
room: $room - If the module is connected with a collector daemon this event shows the room, where the device is located (as defined in the collectord config file)
PROPLANTA
The module extracts weather data from www.proplanta.de.
The website provides a forecast for 12 days, for the first 7 days in a 3-hours-interval.
This modul causes a high CPU load. It is recommended to reduce the number of captured forecast days.
It uses the perl moduls HTTP::Request, LWP::UserAgent and HTML::Parse.
Define
define <name> PROPLANTA [City] [CountryCode]
Example:
define wetter PROPLANTA Bern ch define wetter PROPLANTA Wittingen+(Niedersachsen)
[City]
Optional. The city must be selectable on www.proplanta.de.
Please pay attention to the Capital letters in the city names.
Spaces within the name are replaced by a + (plus).
[CountryCode]
Optional. Possible values: de (default), at, ch, fr, it
The function PROPLANTA_Html creates a HTML code for a 3 day weather forecast.
Example:
define HTMLForecast weblink htmlCode { PROPLANTA_Html("ProPlanta_Wetter") }
Set
set <name> update
The weather data are immediately polled from the website.
Attributes
forecastDays <4-14>
Number of days for which the forecast data shall be fetched. Default is 14 days (incl. today).
INTERVAL <seconds>
Poll interval for weather data in seconds (default 3600 = 1 hour)
URL <internet address>
URL to extract information from. Overwrites the values in the 'define' term.
The PachLog-Module Logs SensorData like (temperature and humidity) to www.pachube.com.
Note: this module needs the HTTP::Request and LWP::UserAgent perl modules.
Define
define <name> PachLog <Pachube-API-Key>
<Pachube-API-Key>:
The Pachube-API-Key however is what you need in your code to authenticate your application's access the Pachube service.
Don't share this with anyone: it's just like any other password. www.pachube.com
Set
Add a new Device for Logging to www.pachube.com
set <NAME> ADD <FHEM-DEVICENAME> FEED-NR:ID:READING:ID:READING
Example: KS300-Weather-Data
READINGS: temperature humidity wind rain
1. Generate Input-Feed on www.pachube.com => Yout get your FEED-NR: 1234
2. Add Datastreams to the Feed:
ID
0
temperature
ID
1
humidity
ID
2
wind
ID
3
rain
3. Add the KS300 to your PachLog-Device
set <NAME> ADD <My-KS300> 1234:0temperature:1:humidity:2:wind:3:rain
disable
Disables PachLog.
Nor more Logging to www.pachube.com
Plugwise
This module is for the Plugwise-System.
Note: this module requires the Device::SerialPort or Win32::SerialPort module
if the devices is connected via USB or a serial port.
Also needed: digest:CRC
You can install these modules using CPAN.
Define
define <name> Plugwise <device>
<device> specifies the serial port to communicate with the Plugwise-Stick.
Normally on Linux the device will be named /dev/ttyUSBx, where x is a number.
For example /dev/ttyUSB0. Please note that the Plugwise-Stick normally operates at 115200 baud. You may specify the baudrate used after the @ char.
Initiates a scan for new devices and defines them.
syncTime
Syncs all reachable devices to the system-time.
reOpen
Closes and reopens the serial-Port. (useful in case of to many Errors)
Attributes
circlecount
Max. Number of Circles to be found by the Scan-Command
interval
standard polling-interval for new Circles
autosync
Sends every n seconds a SyncTime to each device
WattFormat
A string representing the format of the power-readings.
If not defined, it defaults to %0.f
showCom
Writes the complete communication matching a RegEx into the reading "communication"
(can be viewed in EventMonitor or used with a FileLog)
PushNotifier
PushNotifier is a service to receive instant push notifications on your
phone or tablet from a variety of sources.
You need an account to use this module.
For further information about the service see FhemWiki PushNotifier.
You have to create an account to get the apiToken.
And you have to create an application to get the appToken.
Example:
define PushNotifier1 PushNotifier 01234 appname user password 012
Set
set <PushNotifier_device> message
Examples:
set PushNotifier1 message This is a text.
Linebreak:
set PushNotifier1 message This is a text._New Line.
Generated events:
N/A
Pushalot
Pushalot is a service to receive instant push notifications on your
Windows Phone device from a variety of sources.
You need an account to use this module.
For further information about the service see pushalot.com.
The token that identifies a pushalot-account. You need to create if no account yet.
<source>
The source defines what will be shown in the 'from'-field of the message (the sender).
Example:
define PushNotification Pushalot 123234 FHEM
Set
set <Pushalot_device> "<message>" ["<title>"] ["<image>"] ["<link>"] ["<link_title>"] ["<important>"] ["<silent>"]
<message>
The message body that should appear in the message.
<title>
The title of the message.
<image>
An optional image URL that is shown in the message.
<link>
An optional link that should be appended to the message body.
<link_title>
An optional link title. If no title is set, the URL is shown as title in the message.
<important>
True|False: True if the message should be marked as 'important', otherwise False (Default)
<silent>
True|False: True if the message should be delivered silently (no notify sound is played), otherwise False (Default)
Examples:
set PushNotification message "This is my message." set PushNotification message "This is my message." "With Title" set PushNotification message "This is my message." "With Title" "http://www.xyz.com/image.png" set PushNotification message "This is my message." "With Title" "http://www.xyz.com/image.png" "http://www.xyz.com" set PushNotification message "This is my message." "With Title" "http://www.xyz.com/image.png" "http://www.xyz.com" "Link Title" set PushNotification message "This is my message." "With Title" "http://www.xyz.com/image.png" "http://www.xyz.com" "Link Title" True set PushNotification message "This is my message." "With Title" "http://www.xyz.com/image.png" "http://www.xyz.com" "Link Title" True False
Get
N/A
Attributes
N/A
Generated events:
N/A
Pushbullet
Pushbullet is a service to send instant push notifications to different devices. There are
apps for iPhone, Android, Windows (Beta), Mac OS X and plugins for Chrome Firefox and Safari.
For further information about the service see pushbullet.com.
Register on pushbullet.com to get your accessToken.
Set
clear
clear device readings
contactAdd name | email
adds a contact. Spaces in name are allowed
deviceDelete deviceName
deletes a device
deviceRename deviceName | newDeviceName
renames a device
link [| title | device]
sends a link with optional title and device. If no device is given, push goes to all your devices.
list item1[, item2, item3, ... | title | device]
sends a list with one or more items, optional title and device. If no device is given, push goes to all your devices.
message [| title | device]
sends a push notification with optional title and device. If no device is given, push goes to all your devices.
Examples:
set Pushbullet message This is a message.
sends a push notification with message "This is a message" without a title to all your devices.
set Pushbullet message This is a message | A title
sends a push notification with message "This is a message" and title "A title" to all your devices.
set Pushbullet message This is a message | A title | iPhone
sends a push notification with message "This is a message" and title "A title" to Device iPhone.
set Pushbullet message This is a message | A title | Max Mustermann
sends a push notification with message "This is a message" and title "A title" to your contact Max Mustermann.
Note:
Spaces before and after | are not needed.
Get
devices
reads your device list (devices + contacts) and set device readings
Attributes
defaultDevice
default device for pushmessages
defaultTitle
default title for pushmessages. If it is undefined the defaultTitle will be FHEM
Pushover
Pushover is a service to receive instant push notifications on your
phone or tablet from a variety of sources.
You need an account to use this module.
For further information about the service see pushover.net.
Installation of Perl module IO::Socket::SSL is mandatory to use this module (i.e. via 'cpan -i IO::Socket::SSL').
It is recommended to install Perl-JSON to make use of advanced functions like supplementary URLs.
You have to create an account to get the user key.
And you have to create an application to get the API token.
Attribute infix is optional to define FHEMWEB uri name for Pushover API callback function.
Callback URL may be set using attribute callbackUrl (see below).
Note: A uri name can only be used once within each FHEM instance!
set Pushover1 msg 'This is a text.' set Pushover1 msg 'Title' 'This is a text.' set Pushover1 msg 'Title' 'This is a text.' '' 0 '' set Pushover1 msg 'Emergency' 'Security issue in living room.' '' 2 'siren' 30 3600 set Pushover1 msg 'Hint' 'This is a reminder to do something' '' 0 '' 0 3600 'Click here for action' 'set device something' set Pushover1 msg 'Emergency' 'Security issue in living room.' '' 2 'siren' 30 3600 'Click here for action' 'set device something'
Notes:
For the first and the second example the corresponding default attributes for the missing arguments must be defined for the device (see attributes section)
If device is empty, the message will be sent to all devices.
If device has a User or Group Key, the message will be sent to this recipient instead. Should you wish to address a specific device here, add it at the end separated by colon.
If sound is empty, the default setting in the app will be used.
If priority is higher or equal 2, retry and expire must be defined.
For further documentation of these parameters have a look at the Pushover API.
Get
N/A
Attributes
callbackUrl
Set the callback URL to be used to acknowledge messages with emergency priority or supplementary URLs.
timestamp
Send the unix timestamp with each message.
title
Will be used as title if title is not specified as an argument.
device
Will be used for the device name if device is not specified as an argument. If left blank, the message will be sent to all devices.
priority
Will be used as priority value if priority is not specified as an argument. Valid values are -1 = silent / 0 = normal priority / 1 = high priority
sound
Will be used as the default sound if sound argument is missing. If left blank the adjusted sound of the app will be used.
Generated events:
N/A
RESIDENTS
Define
define <rgr_ResidentsName> RESIDENTS
Provides a special dummy device to represent a group of individuals living at your home.
It locically combines individual states of ROOMMATE and GUEST devices and allows state changes for all members.
Based on the current state and other readings, you may trigger other actions within FHEM.
Example:
# Standalone
define rgr_Residents RESIDENTS
Set
set <rgr_ResidentsName> <command> [<parameter>]
Currently, the following commands are defined.
addGuest - creates a new GUEST device and adds it to the current RESIDENTS group. Just enter the dummy name and there you go.
addRoommate - creates a new ROOMMATE device and adds it to the current RESIDENTS group. Just enter the first name and there you go.
removeGuest - shows all GUEST members and allows to delete their dummy devices easily.
removeRoommate - shows all ROOMMATE members and allows to delete their dummy devices easily.
state home,gotosleep,asleep,awoken,absent,gone switch between states for all group members at once; see attribute rgr_states to adjust list shown in FHEMWEB
create wakeuptimer add several pre-configurations provided by RESIDENTS Toolkit. See separate section for details.
Note: If you would like to restrict access to admin set-commands (-> addGuest, addRoommate, removeGuest, create) you may set your FHEMWEB instance's attribute allowedCommands like 'set,set-user'.
The string 'set-user' will ensure only non-admin set-commands can be executed when accessing FHEM using this FHEMWEB instance.
Possible states and their meaning
This module differs between 7 states:
home - residents are present at home and at least one of them is not asleep
gotosleep - present residents are on their way to bed (if they are not asleep already)
asleep - all present residents are currently sleeping
awoken - at least one resident just woke up from sleep
absent - no resident is currently at home but at least one will be back shortly
gone - all residents left home for longer period
none - no active member
Note: State 'none' cannot explicitly be set. Setting state to 'gone' will be handled as 'none' for GUEST member devices.
Attributes
rgr_showAllStates - states 'asleep' and 'awoken' are hidden by default to allow simple gotosleep process via devStateIcon; defaults to 0
rgr_states - list of states to be shown in FHEMWEB; separate entries by comma only and do NOT use spaces; unsupported states will lead to errors though
rgr_wakeupDevice - reference to enslaved DUMMY devices used as a wake-up timer (part of RESIDENTS Toolkit's wakeuptimer)
Generated Readings/Events:
lastActivity - the last state change of one of the group members
lastActivityBy - the realname of the last group member with changed state
lastArrival - timestamp of last arrival at home
lastAwake - timestamp of last sleep cycle end
lastDeparture - timestamp of last departure from home
lastDurAbsence - duration of last absence from home in human readable format (hours:minutes:seconds)
lastDurAbsence_cr - duration of last absence from home in computer readable format (minutes)
lastDurPresence - duration of last presence at home in human readable format (hours:minutes:seconds)
lastDurPresence_cr - duration of last presence at home in computer readable format (minutes)
lastDurSleep - duration of last sleep in human readable format (hours:minutes:seconds)
lastDurSleep_cr - duration of last sleep in computer readable format (minutes)
lastSleep - timestamp of last sleep cycle begin
lastState - the prior state
lastWakeup - time of last wake-up timer run
lastWakeupDev - device name of last wake-up timer
nextWakeup - time of next wake-up program run
nextWakeupDev - device name for next wake-up program run
presence - reflects the home presence state, depending on value of reading 'state' (can be 'present' or 'absent')
residentsAbsent - number of residents with state 'absent'
residentsAbsentDevs - device name of residents with state 'absent'
residentsAbsentNames - device alias of residents with state 'absent'
residentsAsleep - number of residents with state 'asleep'
residentsAsleepDevs - device name of residents with state 'asleep'
residentsAsleepNames - device alias of residents with state 'asleep'
residentsAwoken - number of residents with state 'awoken'
residentsAwokenDevs - device name of residents with state 'awoken'
residentsAwokenNames - device alias of residents with state 'awoken'
residentsGone - number of residents with state 'gone'
residentsGoneDevs - device name of residents with state 'gone'
residentsGoneNames - device alias of residents with state 'gone'
residentsGotosleep - number of residents with state 'gotosleep'
residentsGotosleepDevs - device name of residents with state 'gotosleep'
residentsGotosleepNames - device alias of residents with state 'gotosleep'
residentsHome - number of residents with state 'home'
residentsHomeDevs - device name of residents with state 'home'
residentsHomeNames - device alias of residents with state 'home'
residentsTotal - total number of all active residents despite their current state
residentsTotalAbsent - number of all residents who are currently underway
residentsTotalAbsentDevs - device name of all residents who are currently underway
residentsTotalAbsentNames - device alias of all residents who are currently underway
residentsTotalGuests - number of active guests who are currently treated as part of the residents scope
residentsTotalGuestsAbsent - number of all active guests who are currently underway
residentsTotalGuestsAbsentDevs - device name of all active guests who are currently underway
residentsTotalGuestsAbsentNames - device alias of all active guests who are currently underway
residentsTotalGuestsPresent - number of all active guests who are currently at home
residentsTotalGuestsPresentDevs - device name of all active guests who are currently at home
residentsTotalGuestsPresentNames - device alias of all active guests who are currently at home
residentsTotalOwners - number of residents treated as being a permanent resident
residentsTotalOwnersAbsent - number of all owners who are currently underway
residentsTotalOwnersAbsentDevs - device name of all owners who are currently underway
residentsTotalOwnersAbsentNames - device alias of all owners who are currently underway
residentsTotalOwnersPresent - number of all owners who are currently at home
residentsTotalOwnersPresentDevs - device name of all owners who are currently at home
residentsTotalOwnersPresentNames - device alias of all owners who are currently at home
residentsTotalPresent - number of all residents who are currently at home
residentsTotalPresentDevs - device name of all residents who are currently at home
residentsTotalPresentNames - device alias of all residents who are currently at home
residentsTotalWakeup - number of all residents which currently have a wake-up program being executed
residentsTotalWakeupDevs - device name of all residents which currently have a wake-up program being executed
residentsTotalWakeupNames - device alias of all residents which currently have a wake-up program being executed
residentsTotalWayhome - number of all active residents who are currently on their way back home
residentsTotalWayhomeDevs - device name of all active residents who are currently on their way back home
residentsTotalWayhomeNames - device alias of all active residents who are currently on their way back home
state - reflects the current state
wakeup - becomes '1' while a wake-up program of this resident group is being executed
RESIDENTS Toolkit
Using set-command create you may add pre-configured configurations to your RESIDENTS, ROOMMATE or GUEST devices for your convenience.
The following commands are currently available:
wakeuptimer - adds a wake-up timer dummy device with enhanced functions to start with wake-up automations
A notify device is created to be used as a Macro to carry out your actual automations. The macro is triggered by a normal at device you may customize as well. However, a special RESIDENTS Toolkit function is handling the wake-up trigger event for you.
The wake-up behaviour may be influenced by the following device attributes:
wakeupAtdevice - backlink the at device (mandatory)
wakeupDays - only trigger macro at these days. Mon=1,Tue=2,Wed=3,Thu=4,Fri=5,Sat=6,Sun=0 (optional)
wakeupDefaultTime - after triggering macro reset the wake-up time to this default value (optional)
wakeupEnforced - Enforce wake-up (optional; 0=no, 1=yes, 2=if wake-up time is not wakeupDefaultTime)
wakeupHolidays - May trigger macro on holidays or non-holidays (optional; andHoliday=on holidays also considering wakeupDays, orHoliday=on holidays independently of wakeupDays, andNoHoliday=on non-holidays also considering wakeupDays, orNoHoliday=on non-holidays independently of wakeupDays)
wakeupMacro - name of the notify macro device (mandatory)
wakeupOffset - value in minutes to trigger your macro earlier than the user requested to be woken up, e.g. if you have a complex wake-up program over 30 minutes (defaults to 0)
wakeupResetSwitcher - DUMMY device to quickly turn on/off reset function (optional, device will be auto-created)
wakeupResetdays - if wakeupDefaultTime is set you may restrict timer reset to specific days only. Mon=1,Tue=2,Wed=3,Thu=4,Fri=5,Sat=6,Sun=0 (optional)
wakeupUserdevice - backlink to RESIDENTS, ROOMMATE or GUEST device to check it's status (mandatory)
wakeupWaitPeriod - waiting period threshold in minutes until wake-up program may be triggered again, e.g. if you manually set an earlier wake-up time than normal while using wakeupDefaultTime. Does not apply in case wake-up time was changed during this period; defaults to 360 minutes / 6h (optional)
RFXCOM
This module is for the old RFXCOM USB or LAN based 433 Mhz RF receivers and transmitters (order order code 80002 and others). It does not support the new RFXtrx433 transmitter because it uses a different protocol. See RFXTRX for support of the RFXtrx433 transmitter.
These receivers supports many protocols like Oregon Scientific weather sensors, RFXMeter devices, X10 security and lighting devices and others.
Currently the following parser modules are implemented:
41_OREGON.pm (see device OREGON): Process messages Oregon Scientific weather sensors.
See http://www.rfxcom.com/oregon.htm of
Oregon Scientific weather sensors that could be received by the RFXCOM receivers.
Until now the following Oregon Scientific weather sensors have been tested successfully: BTHR918, BTHR918N, PCR800, RGR918, THGR228N, THGR810, THR128, THWR288A, WTGR800, WGR918. It will probably work with many other Oregon sensors supported by RFXCOM receivers. Please give feedback if you use other sensors.
43_RFXX10REC.pm (see device RFXX10REC): Process X10 security and X10 lighting devices.
Note: this module requires the Device::SerialPort or Win32::SerialPort module
if the devices is connected via USB or a serial port.
Define
define <name> RFXCOM <device> [noinit]
USB-connected (80002):
<device> specifies the USB port to communicate with the RFXCOM receiver.
Normally on Linux the device will be named /dev/ttyUSBx, where x is a number.
For example /dev/ttyUSB0.
Example: define RFXCOMUSB RFXCOM /dev/ttyUSB0
Network-connected devices:
<device> specifies the host:port of the device. E.g.
192.168.1.5:10001
noninit is optional and issues that the RFXCOM device should not be
initialized. This is useful if you share a RFXCOM device. It is also useful
for testing to simulate a RFXCOM receiver via netcat or via FHEM2FHEM.
longids
Comma separated list of device-types for RFXCOM that should be handled using long IDs. This additional ID is a one byte hex string and is generated by the Oregon sensor when is it powered on. The value seems to be randomly generated. This has the advantage that you may use more than one Oregon sensor of the same type even if it has no switch to set a sensor id. For example the author uses two BTHR918N sensors at the same time. All have different deviceids. The drawback is that the deviceid changes after changing batteries. All devices listed as longids will get an additional one byte hex string appended to the device name.
Default is to use long IDs for all devices.
Examples:
# Do not use any long IDs for any devices:
attr RFXCOMUSB longids 0
# Use any long IDs for all devices (this is default):
attr RFXCOMUSB longids 1
# Use longids for BTHR918N devices.
# Will generate devices names like BTHR918N_f3.
attr RFXCOMUSB longids BTHR918N
# Use longids for TX3_T and TX3_H devices.
# Will generate devices names like TX3_T_07, TX3_T_01 ,TX3_H_07.
attr RFXCOMUSB longids TX3_T,TX3_H
RFXMETER
The RFXMETER module interprets RFXCOM RFXMeter messages received by a RFXCOM receiver. You need to define an RFXCOM receiver first.
See the RFXCOM.
<deviceid> is the device identifier of the RFXMeter sensor and is a one byte hexstring (00-ff).
<scalefactor> is an optional scaling factor. It is multiplied to the value that is received from the RFXmeter sensor.
<unitname> is an optional string that describes the value units. It is added to the Reading generated to describe the values.
The RFXX10REC module interprets X10 security and X10 lighting messages received by a RFXCOM RF receiver. Reported also to work with KlikAanKlikUit. You need to define an RFXCOM receiver first.
See RFXCOM.
specifies the type of the X10 device:
X10 security devices:
ds10a (X10 security ds10a Door/Window Sensor or compatible devices. This device type reports the status of the switch [Open/Closed], status of the delay switch [min|max]], and battery status [ok|low].)
ms10a (X10 security ms10a motion sensor. This device type reports the status of motion sensor [normal|alert] and battery status [ok|low].))
sd90 (Marmitek sd90 smoke detector. This device type reports the status of the smoke detector [normal|alert] and battery status [ok|low].)
kr18 (X10 security remote control. Report the Reading "Security" with values [Arm|Disarm], "ButtonA" and "ButtonB" with values [on|off] )
X10 lighting devices:
ms14a (X10 motion sensor. Reports [normal|alert] on the first deviceid (motion sensor) and [on|off] for the second deviceid (light sensor))
x10 (All other x10 devices. Report [on|off] on both deviceids.)
<deviceid>
specifies the first device id of the device. X10 security have a a 16-Bit device id which has to be written as a hex-string (example "5a54").
A X10 lighting device has a house code A..P followed by a unitcode 1..16 (example "B1").
<devicelog>
is the name of the Reading used to report. Suggested: "Window" or "Door" for ds10a, "motion" for motion sensors, "Smoke" for sd90.
<deviceid2>
is optional and specifies the second device id of the device if it exists. For example sd90 smoke sensors can be configured to report two device ids. ms14a motion sensors report motion status on the first deviceid and the status of the light sensor on the second deviceid.
<devicelog2>
is optional for the name used for the Reading of <deviceid2>.
define <rr_FirstName> ROOMMATE [<device name of resident group>]
Provides a special dummy device to represent a resident of your home.
Based on the current state and other readings, you may trigger other actions within FHEM.
Used by superior module RESIDENTS but may also be used stand-alone.
Example:
# Standalone
define rr_Manfred ROOMMATE
# Typical group member
define rr_Manfred ROOMMATE rgr_Residents # to be member of resident group rgr_Residents
# Member of multiple groups
define rr_Manfred ROOMMATE rgr_Residents,rgr_Parents # to be member of resident group rgr_Residents and rgr_Parents
Please note the RESIDENTS group device needs to be existing before a ROOMMATE device can become a member of it.
Set
set <rr_FirstName> <command> [<parameter>]
Currently, the following commands are defined.
location - sets reading 'location'; see attribute rr_locations to adjust list shown in FHEMWEB
mood - sets reading 'mood'; see attribute rr_moods to adjust list shown in FHEMWEB
state home,gotosleep,asleep,awoken,absent,gone switch between states; see attribute rr_states to adjust list shown in FHEMWEB
create wakeuptimer add several pre-configurations provided by RESIDENTS Toolkit. See separate section in RESIDENTS module commandref for details.
Note: If you would like to restrict access to admin set-commands (-> create) you may set your FHEMWEB instance's attribute allowedCommands like 'set,set-user'.
The string 'set-user' will ensure only non-admin set-commands can be executed when accessing FHEM using this FHEMWEB instance.
Possible states and their meaning
This module differs between 6 states:
home - individual is present at home and awake
gotosleep - individual is on it's way to bed
asleep - individual is currently sleeping
awoken - individual just woke up from sleep
absent - individual is not present at home but will be back shortly
gone - individual is away from home for longer period
Presence correlation to location
Under specific circumstances, changing state will automatically change reading 'location' as well.
Whenever presence state changes from 'absent' to 'present', the location is set to 'home'. If attribute rr_locationHome was defined, first location from it will be used as home location.
Whenever presence state changes from 'present' to 'absent', the location is set to 'underway'. If attribute rr_locationUnderway was defined, first location from it will be used as underway location.
Auto Gone
Whenever an individual is set to 'absent', a trigger is started to automatically change state to 'gone' after a specific timeframe.
Default value is 36 hours.
This behaviour can be customized by attribute rr_autoGoneAfter.
Synchronizing presence with other ROOMMATE or GUEST devices
If you always leave or arrive at your house together with other roommates or guests, you may enable a synchronization of your presence state for certain individuals.
By setting attribute rr_passPresenceTo, those individuals will follow your presence state changes to 'home', 'absent' or 'gone' as you do them with your own device.
Please note that individuals with current state 'gone' or 'none' (in case of guests) will not be touched.
Location correlation to state
Under specific circumstances, changing location will have an effect on the actual state as well.
Whenever location is set to 'home', the state is set to 'home' if prior presence state was 'absent'. If attribute rr_locationHome was defined, all of those locations will trigger state change to 'home' as well.
Whenever location is set to 'underway', the state is set to 'absent' if prior presence state was 'present'. If attribute rr_locationUnderway was defined, all of those locations will trigger state change to 'absent' as well. Those locations won't appear in reading 'lastLocation'.
Whenever location is set to 'wayhome', the reading 'wayhome' is set to '1' if current presence state is 'absent'. If attribute rr_locationWayhome was defined, LEAVING one of those locations will set reading 'wayhome' to '1' as well. So you actually have implicit and explicit options to trigger wayhome.
Arriving at home will reset the value of 'wayhome' to '0'.
If you are using the GEOFANCY module, you can easily have your location updated with GEOFANCY events by defining a simple NOTIFY-trigger like this:
define n_rr_Manfred.location notify geofancy:currLoc_Manfred.* set rr_Manfred:FILTER=location!=$EVTPART1 location $EVTPART1
By defining geofencing zones called 'home' and 'wayhome' in the iOS app, you automatically get all the features of automatic state changes described above.
Attributes
rr_autoGoneAfter - hours after which state should be auto-set to 'gone' when current state is 'absent'; defaults to 36 hours
rr_locationHome - locations matching these will be treated as being at home; first entry reflects default value to be used with state correlation; separate entries by space; defaults to 'home'
rr_locationUnderway - locations matching these will be treated as being underway; first entry reflects default value to be used with state correlation; separate entries by comma or space; defaults to "underway"
rr_locationWayhome - leaving a location matching these will set reading wayhome to 1; separate entries by space; defaults to "wayhome"
rr_locations - list of locations to be shown in FHEMWEB; separate entries by comma only and do NOT use spaces
rr_moodDefault - the mood that should be set after arriving at home or changing state from awoken to home
rr_moodSleepy - the mood that should be set if state was changed to gotosleep or awoken
rr_moods - list of moods to be shown in FHEMWEB; separate entries by comma only and do NOT use spaces
rr_noDuration - may be used to disable duration timer calculation (see readings durTimer*)
rr_passPresenceTo - synchronize presence state with other ROOMMATE or GUEST devices; separte devices by space
rr_realname - whenever ROOMMATE wants to use the realname it uses the value of attribute alias or group; defaults to group
rr_showAllStates - states 'asleep' and 'awoken' are hidden by default to allow simple gotosleep process via devStateIcon; defaults to 0
rr_states - list of states to be shown in FHEMWEB; separate entries by comma only and do NOT use spaces; unsupported states will lead to errors though
rr_wakeupDevice - reference to enslaved DUMMY devices used as a wake-up timer (part of RESIDENTS Toolkit's wakeuptimer)
Generated Readings/Events:
durTimerAbsence - timer to show the duration of absence from home in human readable format (hours:minutes:seconds)
durTimerAbsence_cr - timer to show the duration of absence from home in computer readable format (minutes)
durTimerPresence - timer to show the duration of presence at home in human readable format (hours:minutes:seconds)
durTimerPresence_cr - timer to show the duration of presence at home in computer readable format (minutes)
durTimerSleep - timer to show the duration of sleep in human readable format (hours:minutes:seconds)
durTimerSleep_cr - timer to show the duration of sleep in computer readable format (minutes)
lastArrival - timestamp of last arrival at home
lastAwake - timestamp of last sleep cycle end
lastDeparture - timestamp of last departure from home
lastDurAbsence - duration of last absence from home in human readable format (hours:minutes:seconds)
lastDurAbsence_cr - duration of last absence from home in computer readable format (minutes)
lastDurPresence - duration of last presence at home in human readable format (hours:minutes:seconds)
lastDurPresence_cr - duration of last presence at home in computer readable format (minutes)
lastDurSleep - duration of last sleep in human readable format (hours:minutes:seconds)
lastDurSleep_cr - duration of last sleep in computer readable format (minutes)
lastLocation - the prior location
lastMood - the prior mood
lastSleep - timestamp of last sleep cycle begin
lastState - the prior state
lastWakeup - time of last wake-up timer run
lastWakeupDev - device name of last wake-up timer
location - the current location
mood - the current mood
nextWakeup - time of next wake-up program run
nextWakeupDev - device name for next wake-up program run
presence - reflects the home presence state, depending on value of reading 'state' (can be 'present' or 'absent')
state - reflects the current state
wakeup - becomes '1' while a wake-up program of this resident is being executed
wayhome - depending on current location, it can become '1' if individual is on his/her way back home
Provides access to Raspberry Pi's I2C interfaces for some logical modules and also directly.
This modul will basically work on every linux system that provides /dev/i2c-x.
preliminary:
load I2C kernel modules (choose one of the following options):
open /etc/modules
sudo nano /etc/modules
add these lines
i2c-dev
i2c-bcm2708
Since Kernel 3.18.x on raspberry pi and maybe on other boards too, device tree support was implemented and enabled by default.
To enable I2C support just add
device_tree_param=i2c0=on,i2c1=on
to /boot/config.txt
You can also enable just one of the I2C. In this case remove the unwantet one from the line.
On Raspbian images since 2015 just start sudo raspi-config and enable I2C there. Parameters will be added automaticly to /boot/config.txt
reboot
Choose only one of the three follwing methodes do grant access to /dev/i2c-* for FHEM user:
Add following lines into /etc/init.d/fhem before perl fhem.pl line in start or into /etc/rc.local:
sudo chown fhem /dev/i2c-*
sudo chgrp dialout /dev/i2c-*
sudo chmod +t /dev/i2c-*
sudo chmod 660 /dev/i2c-*
Alternatively for Raspberry Pi you can install the gpio utility from WiringPi library change access rights of I2C-Interface
WiringPi installation is described here: RPI_GPIO.
gpio utility will be automaticly used, if installed.
Important: to use I2C-0 at P5 connector you must use attribute swap_i2c0.
Optional: access via IOCTL will be used (RECOMMENDED) if Device::SMBus is not present.
To access the I2C-Bus via the Device::SMBus module, following steps are necessary:
For Raspbian users only
If you are using I2C-0 at P5 connector on Raspberry Pi model B with newer raspbian versions, including support for Raspberry Pi model B+, you must add following line to /boot/cmdline.txt:
bcm2708.vc_i2c_override=1
Define
define <name> RPII2C <I2C Bus Number>
where <I2C Bus Number> is the number of the I2C bus that should be used (0 or 1)
Set
Write one byte (or more bytes sequentially) directly to an I2C device (for devices that have only one register to write): set <name> writeByte <I2C Address> <value>
Write n-bytes to an register range (as an series of single register write operations), beginning at the specified register: set <name> writeByteReg <I2C Address> <Register Address> <value> [<value> [..]]
Write n-bytes directly to an I2C device (as an block write operation): set <name> writeBlock <I2C Address> <Register Address> <value> [<value> [..]]
Write n-bytes to an register range (as an block write operation), beginning at the specified register: set <name> writeBlockReg <I2C Address> <Register Address> <value> [<value> [..]]
Examples:
Write 0xAA to device with I2C address 0x60 set test1 writeByte 60 AA
Write 0xAA to register 0x01 of device with I2C address 0x6E set test1 writeByteReg 6E 01 AA
Write 0xAA to register 0x01 of device with I2C address 0x6E, after it write 0x55 to 0x02 as two separate commands set test1 writeByteReg 6E 01 AA 55
Write 0xA4 to register 0x03, 0x00 to register 0x04 and 0xDA to register 0x05 of device with I2C address 0x60 as an block command set test1 writeBlock 60 03 A4 00 DA
Get
Gets value of I2C device's registers: get <name> read <I2C Address> [<Register Address> [<number of registers>]]
Gets value of I2C device in blockwise mode: get <name> readblock <I2C Address> [<number of registers>]
Gets value of I2C device's registers in blockwise mode: get <name> readblockreg <I2C Address> <Register Address> [<number of registers>]
Examples:
Reads byte from device with I2C address 0x60 get test1 read 60
Reads register 0x01 of device with I2C address 0x6E. get test1 read 6E 01 AA 55
Reads register 0x03 to 0x06 of device with I2C address 0x60. get test1 read 60 03 4
Attributes
swap_i2c0
Swap Raspberry Pi's I2C-0 from J5 to P5 rev. B
This attribute is for Raspberry Pi only and needs gpio utility from WiringPi library.
Default: none, valid values: on, off
useHWLib
Change hardware access method.
Attribute exists only if both access methods are usable
Default: IOCTL, valid values: IOCTL, SMBus
Raspberry Pi offers direct access to several GPIO via header P1 (and P5 on V2). The Pinout is shown in table under define.
With this module you are able to access these GPIO's directly as output or input. For input you can use either polling or interrupt mode
In addition to the Raspberry Pi, also BBB, Cubie, Banana Pi and almost every linux system which provides gpio access in userspace is supported. Warning: Never apply any external voltage to an output configured pin! GPIO's internal logic operate with 3,3V. Don't exceed this Voltage!
preliminary:
GPIO Pins accessed by sysfs. The files are located in folder /system/class/gpio and belong to the gpio group (on actual Raspbian distributions since jan 2014).
After execution of following commands, GPIO's are usable whithin PRI_GPIO:
sudo adduser fhem gpio
sudo reboot
If attribute pud_resistor shall be used and on older Raspbian distributions, aditionally gpio utility from WiringPi
library must be installed to set the internal pullup/down resistor or export and change access rights of GPIO's (for the second case active_low does not work).
Installation WiringPi:
On Linux systeme where /system/class/gpio can only accessed as root, GPIO's must exported and their access rights changed before FHEM starts.
This can be done in /etc/rc.local (Examole for GPIO22 and 23):
readval refreshes the reading Pinlevel and, if attr toggletostate not set, the state value
Examples:
set Pin12 off set Pin11,Pin12 on
Get
get <name>
returns "high" or "low" regarding the actual status of the pin and writes this value to reading Pinlevel
Attributes
direction
Sets the GPIO direction to input or output.
Default: input, valid values: input, output
active_low
Inverts logical value
Default: off, valid values: on, off
interrupt can only be used with GPIO configured as input
enables edge detection for GPIO pin
on each interrupt event readings Pinlevel and state will be updated
Default: none, valid values: none, falling, rising, both
For "both" the reading Longpress will be added and set to on as long as kes hold down longer than 1s
For "falling" and "rising" the reading Toggle will be added an will be toggled at every interrupt and the reading Counter that increments at every interrupt
poll_interval
Set the polling interval in minutes to query the GPIO's level
Default: -, valid values: decimal number
toggletostate works with interrupt set to falling or rising only
if yes, state will be toggled at each interrupt event
Default: no, valid values: yes, no
pud_resistor
Sets the internal pullup/pulldown resistor Works only with installed gpio urility from WiringPi Library.
Default: -, valid values: off, up, down
debounce_in_ms
readout of pin value x ms after an interrupt occured. Can be used for switch debouncing
Default: 0, valid values: decimal number
restoreOnStartup
Restore Readings and sets after reboot
Default: last, valid values: last, on, off, no
longpressinterval works with interrupt set to both only
time in seconds, a port need to be high to set reading longpress to on
Default: 1, valid values: 0.1 - 10
Provides a freely configurable RSS feed and HTML page.
The media RSS feed delivers status pictures either in JPEG or PNG format.
This media RSS feed can be used to feed a status display to a
network-enabled photo frame.
In addition, a periodically refreshing HTML page is generated that shows the picture
with an optional HTML image map.
You need to have the perl module GD installed. This module is most likely not
available for small systems like Fritz!Box.
RSS is an extension to FHEMWEB. You must install FHEMWEB to use RSS.
A note on colors: Colors are specified as 6- or 8-digit hex numbers,
every 2 digits determining the red, green and blue color components as in HTML
color codes. The optional 7th and 8th digit code the alpha channel (transparency from
00 to 7F). Examples: FF0000 for red, C0C0C0 for light
gray, 1C1C1C40 for semi-transparent gray.
Define
define <name> RSS jpg|png <hostname> <filename>
Defines the RSS feed. jpg and png are fixed literals to select output format.
<hostname> is the hostname of the fhem server as
seen from the consumer of the RSS feed. <filename> is the
name of the file that contains the layout definition.
Rereads the layout definition from the file. Useful to enable
changes in the layout on-the-fly.
Attributes
autoreread If set to 1, layout is automatically reread when layout file has been changed
by FHEMWEB file editor.
size The dimensions of the picture in the format
<width>x<height>.
bg The directory that contains the background pictures (must be in JPEG, GIF or PNG format, file
format is guessed from file name extension).
bgcolor <color> Sets the background color.
tmin The background picture is shown at least tmin seconds,
no matter how frequently the RSS feed consumer accesses the page.
refresh <interval> Time in seconds after which the HTML page is automatically reloaded. Defaults to 60.
Set <interval> to 0 to disable reloading.
viewport Adds a viewport directive to the HTML header.
Example: attr FrameRSS viewport width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0
This scales the image to fit to the browser's viewport and inhibits zooming in or out on tablets.
noscrollSuppresses scrollbars in browsers, if set to 1.
areas HTML code that goes into the image map.
Example: attr FrameRSS areas <area shape="rect" coords="0,0,200,200" href="http://fhem.de"/><area shape="rect" coords="600,400,799,599" href="http://has:8083/fhem" target="_top"/>
Usage information
If a least one RSS feed is defined, the menu entry RSS appears in the FHEMWEB
side menu. If you click it you get a list of all defined RSS feeds. The URL of any such is
RSS feed is http://hostname:port/fhem/rss/name.rss with hostname and
name from the RSS feed's definition and the port
(usually 8083) and literal /fhem from the underlying FHEMWEB
definition.
The media RSS feed points to a dynamically generated picture. The URL of the picture
belonging to the RSS can be found by replacing the extension ".rss" in feed's URL by ".jpg" or ".png"
depending on defined output format,
To render the picture the current, or, if tmin seconds have elapsed, the next
JPEG picture from the directory bg is chosen and scaled to the dimensions given
in size. The background is black if no usable JPEG picture can be found. Next the
script in the layout definition is used to superimpose items on
the background.
You can directly access the URL of the picture in your browser. Reload the page to see
how it works.
The media RSS feed advertises to refresh after 1 minute (ttl). Some photo frames ignore it and
use their preset refresh rate. Go for a photo frame with an adjustable refresh rate (e.g
every 5 seconds) if you have the choice!
The layout definition is a script for placing items on the background. It is read top-down.
It consists of layout control commands and items placement commands. Layout control
commands define the appearance of subsequent items. Item placement commands actually
render items.
Everything after a # is treated as a comment and ignored. You can fold long lines by
putting a \ at the end.
General notes
Use double quotes to quote literal text if perl specials are allowed.
Text alignment requires the Perl module GD::Text::Align to be installed. Text wrapping (in text boxes) require GD::Text::Wrap to be installed. Debian-based systems can install both with apt-get install libgd-text-perl.
Notes on coordinates
(0,0) is the upper left corner.
Coordinates equal or greater than 1 are considered to be absolute pixels, coordinates between 0 and 1 are considered to
be relative to the total width or height of the picture.
Literal x and y evaluate to the most recently used x- and y-coordinate. See also moveto and moveby below.
Layout control commands
moveto <x> <y> Moves most recently used x- and y-coordinate to the given absolute or relative position.
moveby <x> <y> Moves most recently used x- and y-coordinate by the given absolute or relative amounts.
font "<font>" Sets the font. <font> is the name of a TrueType font (e.g.
Arial) or the full path to a TrueType font
(e.g. /usr/share/fonts/truetype/arial.ttf),
whatever works on your system.
rgb "<color>" Sets the color. You can use
{ <perl special> } for <color>.
pt <pt> Sets the font size in points. A + or - sign in front of the the number given
for <pt> signifies a change of the font size relative to the current size. Otherwise the absolute
size is set. You can use
{ <perl special> } for <pt>.
thalign|ihalign|halign "left"|"center"|"right" Sets the horizontal alignment of text, image or both. Defaults to left-aligned. You can use
{ <perl special> } instead of the literal alignment control word.
tvalign|ivalign|valign "top"|"center"|"base"|"bottom" Sets the vertical alignment of text, image or both. Defaults to base-aligned for text and
top-aligned for image. You can use
{ <perl special> } instead of the literal alignment control word.
linespace <space> Sets the line spacing in pixels for text boxes (see textbox item below).
condition <condition> Subsequent layout control and item placement commands except for another condition command are ignored if and only if <condition> evaluates to false.
push The current parameter set (position, color, font name and size, text alignment and line spacing) is
put (saved) on top of a stack.
pop The most recently saved (pushed) current parameter set is pulled from the top of the stack and restored.
Item placement commands
text <x> <y> <text> Renders the text <text> at the
position (<x>, <y>) using the current font, font size and color.
You can use
{ <perl special> } for <text> to fully
access device readings and do some programming on the fly. See below for examples.
textbox <x> <y> <boxwidth> <text> Same as before but text is rendered
in a box of horizontal width <boxwidth>.
textboxf <x> <y> <boxwidth> <bgcolor> <text> Same as before but
the textbox will be filled with the given background color <bgcolor> before drawing the text.
<bgcolor> can be used with { <perl special> } to evalute RGB value.
time <x> <y> Renders the current time in HH:MM format.
seconds <x> <y> <format> Renders the curent seconds. Maybe useful for a RSS Clock.
date <x> <y> Renders the current date in DD.MM.YYYY format.
line <x1> <y1> <x2> <y2> [<thickness>] Draws a line from position (<x1>, <y1>) to position (<x2>, <y2>) with optional thickness (default=1).
rect <x1> <y1> <x2> <y2> [<filled>] Draws a rectangle with corners at positions (<x1>, <y1>) and (<x2>, <y2>), which is filled if the <filled> parameter is set and not zero.
img <x> <y> <['w' or 'h']s> <imgtype> <srctype> <arg> Renders a picture at the
position (<x>, <y>). The <imgtype> is one of gif, jpeg, png.
The picture is scaled by the factor <s> (a decimal value). If 'w' or 'h' is in front of scale-value the value is used to set width or height to the value in pixel. If <srctype> is file, the picture
is loaded from the filename <arg>, if <srctype> is url or urlq, the picture
is loaded from the URL <arg> (with or without logging the URL), if <srctype> is data, the picture
is piped in from data <arg>. You can use
{ <perl special> } for <arg>. See below for example. Warning: do not load the image from URL that is served by fhem as it leads to a deadlock.
embed <x> <y> <z> <position> <id> <element>
For HTML output: embeds a div element into the HTML page at (<x>,<y>) with z-order <z> and positioning <position> (use absolute). <id> is the id attribute of the
div element and <element> is its content. Note: There are several issues with different browsers when using this.
Example
This is how a layout definition might look like:
font /usr/share/fonts/truetype/arial.ttf # must be a TrueType font
rgb "c0c0c0" # HTML color notation, RGB
pt 48 # font size in points
time 0.10 0.90
pt 24
text 0.10 0.95 { ReadingsVal("MyWeather","temperature","?"). "C" }
moveby 0 -25
text x y "Another text"
img 20 530 0.5 png file { "/usr/share/fhem/www/images/weather/" . ReadingsVal("MyWeather","icon","") . ".png" }
embed 0 0 2 absolute plot1 { plotFromUrl('mySVG') }
embed 10 200 2 absolute iframe1 "<iframe width=\"420\" height=\"315\" src=\"//www.youtube.com/embed/9HShl_ufOFI\" frameborder=\"0\" allowfullscreen></iframe>"
Special uses
You can display SVG plots with the aid of the helper function plotAsPng(<name>[,<zoom>[,<offset>]]) (in 98_SVG.pm). Examples:
img 20 30 0.6 png data { plotAsPng("mySVGPlot") }
img 20 30 0.6 png data { plotAsPng("mySVGPlot","qday",-1) }
This requires the perl module Image::LibRSVG and librsvg. Debian-based systems can install these with apt-get install libimage-librsvg-perl.
For HTML output, you can use plotFromURL(<name>[,<zoom>[,<offset>]]) instead.
Defines a device, that imitates the random switch functionality of a timer clock, like a FS20 ZSU.
The idea to create it, came from the problem, that is was always a little bit tricky to install a timer clock before
holiday: finding the manual, testing it the days before and three different timer clocks with three different manuals - a horror.
By using it in conjunction with a dummy and a disableCond, I'm able to switch the always defined timer on every weekend easily from all over the world.
Descrition
a RandomTimer device starts at timespec_start switching device. Every (timeToSwitch
seconds +-10%) it trys to switch device on/off. The switching period stops when the
next time to switch is greater than timespec_stop.
Parameter
timespec_start
The parameter timespec_start defines the start time of the timer with format: HH:MM:SS.
It can be a Perlfunction as known from the at timespec .
device
The parameter device defines the fhem device that should be switched.
timespec_stop
The parameter timespec_stop defines the stop time of the timer with format: HH:MM:SS.
It can be a Perlfunction as known from the timespec at .
timeToSwitch
The parameter timeToSwitch defines the time in seconds between two on/off switches.
Examples
define ZufallsTimerTisch RandomTimer *{sunset_abs()} StehlampeTisch +03:00:00 500
defines a timer that starts at sunset an ends 3 hous later. The timer trys to switch every 500 seconds(+-10%).
define ZufallsTimerTisch RandomTimer *{sunset_abs()} StehlampeTisch *{sunset_abs(3*3600)} 480
defines a timer that starts at sunset and stops after sunset + 3 hours. The timer trys to switch every 480 seconds(+-10%).
define ZufallsTimerTisch RandomTimer *{sunset_abs()} StehlampeTisch 22:30:00 300
defines a timer that starts at sunset an ends at 22:30. The timer trys to switch every 300 seconds(+-10%).
disableCond
The default behavior of a RandomTimer is, that it works.
To set the Randomtimer out of work, you can specify in the disableCond attibute a condition in perlcode that must evaluate to true.
The Condition must be put into round brackets. The best way is to define
a function in 99_utils.
Examples
attr ZufallsTimerZ disableCond (!isVerreist())
attr ZufallsTimerZ disableCond (Value("presenceDummy") ne "present"))
keepDeviceAlive
The default behavior of a RandomTimer is, that it shuts down the device after stoptime is reached.
The keepDeviceAlive attribute changes the behavior. If set, the device status is not changed when the stoptime is reached.
Example
attr ZufallsTimerZ keepDeviceAlive
onCmd, offCmd
Setting the on-/offCmd changes the command sent to the device. Standard is: "set <device> on".
The device can be specified by a @.
Examples
attr Timer oncmd {fhem("set @ on-for-timer 14")}
attr Timer offCmd {fhem("set @ off 16")}
attr Timer oncmd set @ on-for-timer 12
attr Timer offCmd set @ off 12
switchmode
Setting the switchmode you can influence the behavior of switching on/off.
The parameter has the Format 999/999 and the default ist 800/200. The values are in "per mill".
The first parameter sets the value of the probability that the device will be switched on when the device is off.
The second parameter sets the value of the probability that the device will be switched off when the device is off.
Examples
attr ZufallsTimerZ switchmode 400/400
Revolt NC-5462
Provides voltage, current, frequency, power, pf, energy readings for Revolt NC-5462 devices via CUL.
Define
define <name> Revolt <id>
<id> is a 4 digit hex number to identify the NC-5462 device.
Note: devices are autocreated on reception of the first message.
Readings
energy [kWh]
power [W]
voltage [V]
current [A]
frequency [Hz]
Pf
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.
The SD_WS07 module interprets temperature sensor messages received by a Device like CUL, CUN, SIGNALduino etc.
Known models:
Eurochon EAS800z
Technoline WS6750/TX70DTH
New received device are add in fhem with autocreate.
Define
The received devices created automatically.
The ID of the defice is the cannel or, if the longid attribute is specified, it is a combination of channel and some random generated bits at powering the sensor and the channel.
If you want to use more sensors, than channels available, you can use the longid option to differentiate them.
Generated readings: Some devices may not support all readings, so they will not be presented
SHC is the basestation module that supports a family of RF devices available
at www.smarthomatic.org.
This module provides the IODevice for the SHCdev
modules that implement the SHCdev protocol.
Note: this module may require the Device::SerialPort or Win32::SerialPort
module if you attach the device via USB and the OS sets strange default
parameters for serial devices.
Define
define <name> SHC <device>
<device> specifies the serial port to communicate with the SHC.
The name of the serial-device depends on your distribution, under
linux usually a /dev/ttyUSB0 device will be created.
You can also specify a baudrate if the device name contains the @
character, e.g.: /dev/ttyUSB0@57600. Please note that the default
baudrate for the SHC base station is 19200 baud.
Example:
define shc_base SHC /dev/ttyUSB0
Set
raw <data>
not supported yet
Get
N/A
Attributes
N/A
SHCdev
SHC is the device module that supports several device types available
at www.smarthomatic.org.
These device are connected to the FHEM server through the SHC base station (SHC).
Currently supported are:
EnvSensor
PowerSwitch
Dimmer
RGBDimmer
SoilMoistureMeter
Define
define <name> SHCdev <SenderID> [<AesKey>]
<SenderID>
is a number ranging from 0 .. 4095 to identify the SHCdev device.
<AesKey>
is a optional number ranging from 0 .. 15 to select an encryption key.
It is required for the basestation to communicate with remote devides
The default value is 0.
Note: devices are autocreated on reception of the first message.
Set
on
Supported by Dimmer and PowerSwitch (on always refers to pin1).
off
Supported by Dimmer and PowerSwitch (off always refers to pin1).
pct <0..100>
Sets the brightness in percent. Supported by Dimmer.
ani <AnimationMode> <TimeoutSec> <StartBrightness> <EndBrightness>
Description and details available at www.smarthomatic.org
Supported by Dimmer.
statusRequest
Supported by Dimmer and PowerSwitch.
Color <ColorNumber>
A detailed description is available at www.smarthomatic.org
The color palette can be found here
Supported by RGBDimmer.
ColorAnimation <Repeat> <AutoReverse> <Time0> <ColorNumber0> <Time1> <ColorNumber1> ... up to 10 time/color pairs
A detailed description is available at www.smarthomatic.org
The color palette can be found here
Supported by RGBDimmer.
DigitalPin <Pos> <On>
A detailed description is available at www.smarthomatic.org
Supported by PowerSwitch.
DigitalPinTimeout <Pos> <On> <Timeout>
A detailed description is available at www.smarthomatic.org
Supported by PowerSwitch.
DigitalPort <On>
<On>
is a bit array (0 or 1) describing the port state. If less than eight bits were provided zero is assumed.
Example: set SHC_device DigitalPort 10110000 will set pin0, pin2 and pin3 to 1.
A detailed description is available at www.smarthomatic.org
Supported by PowerSwitch.
DigitalPortTimeout <On> <Timeout0> .. <Timeout7>
<On>
is a bit array (0 or 1) describing the port state. If less than eight bits were provided zero is assumed.
Example: set SHC_device DigitalPort 10110000 will set pin0, pin2 and pin3 to 1.
<Timeout0> .. <Timeout7>
are the timeouts for each pin. If no timeout is provided zero is assumed.
A detailed description is available at www.smarthomatic.org
Supported by PowerSwitch.
din <pin>
Returns the state of the specified digital input pin for pin = 1..8. Or the state of all pins for pin = all.
Supported by EnvSensor.
ain <pin>
Returns the state of the specified analog input pin for pin = 1..5. Or the state of all pins for pin = all.
If the voltage of the pin is over the specied trigger threshold) it return 1 otherwise 0.
Supported by EnvSensor.
ain <pin>
Returns the state of the specified analog input pin for pin = 1..5. Or the state of all pins for pin = all.
If the voltage of the pin is over the specied trigger threshold) it return 1 otherwise 0.
Supported by EnvSensor.
ain_volt <pin>
Returns the voltage of the specified analog input pin for pin = 1..5 in millivolts, ranging from 0 .. 1100 mV.
Supported by EnvSensor.
Attributes
devtype
The device type determines the command set, default web commands and the
default devStateicon. Currently supported are: EnvSensor, Dimmer, PowerSwitch, RGBDimmer, SoilMoistureMeter.
Note: If the device is not set manually, it will be determined automatically
on reception of a device type specific message. For example: If a
temperature message is received, the device type will be set to EnvSensor.
readonly
if set to a value != 0 all switching commands (on, off, toggle, ...) will be disabled.
forceOn
try to switch on the device whenever an off status is received.
SIGNALduino
The SIGNALduino ia based on an idea from mdorenka published at FHEM Forum.
With the opensource firmware (see this link) it is capable
to receive and send different protocols over different medias. Currently are 433Mhz protocols implemented.
The following devices are currently available:
Wireless switches
IT/Elro and other brands --> uses IT.pm
Temperatur / humidity sensors suppored by 14_CUL_TCM97001:
PEARL NC7159, LogiLink WS0002,GT-WT-02,AURIOL,TCM97001, TCM27 and many more
Oregon Scientific v2 Sensors --> 41_OREGON.pm
Temperatur / humidity sensors suppored by 14_SD_WS07
technoline WS 6750 and TX70DTH
Eurochon EAS 800z
FreeTec NC-7344
It is possible to attach more than one device in order to get better
reception, fhem will filter out duplicate messages.
Note: this module require the Device::SerialPort or Win32::SerialPort
module. It can currently only attatched via USB.
Define define <name> SIGNALduino <device>
USB-connected devices (SIGNALduino):
<device> specifies the serial port to communicate with the SIGNALduino.
The name of the serial-device depends on your distribution, under
linux the cdc_acm kernel module is responsible, and usually a
/dev/ttyACM0 or /dev/ttyUSB0 device will be created. If your distribution does not have a
cdc_acm module, you can force usbserial to handle the SIGNALduino by the
following command:
modprobe usbserial
vendor=0x03eb
product=0x204b
In this case the device is most probably
/dev/ttyUSB0.
You can also specify a baudrate if the device name contains the @
character, e.g.: /dev/ttyACM0@57600
This is also the default baudrate
It is recommended to specify the device via a name which does not change:
e.g. via by-id devicename: /dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0@57600
If the baudrate is "directio" (e.g.: /dev/ttyACM0@directio), then the
perl module Device::SerialPort is not needed, and fhem opens the device
with simple file io. This might work if the operating system uses sane
defaults for the serial parameters, e.g. some Linux distributions and
OSX.
debug
This will bring the module in a very verbose debug output. Usefull to find new signals and verify if the demodulation works correctly.
flashCommand
This is the command, that is executed to performa the firmware flash. Do not edit, if you don't know what you are doing.
The default is: avrdude -p atmega328P -c arduino -P [PORT] -D -U flash:w:[HEXFILE] 2>[LOGFILE]
It contains some place-holders that automatically get filled with the according values:
[PORT]
is the port the Signalduino is connectd to (e.g. /dev/ttyUSB0) and will be used from the defenition
[HEXFILE]
is the .hex file that shall get flashed. There are three options (applied in this order):
- passed in set flash
- taken from the hexFile attribute
- the default value defined in the module
[LOGFILE]
The logfile that collects information about the flash process. It gets displayed in FHEM after finishing the flash process
hardware
When using the flash command, you should specify whar hardware you have connected to the usbport. Doing not, can cause failures of the device.
minsecs
This is a very special attribute. It is provided to other modules. minsecs should act like a threshold. All logic must be done in the logical module.
If specified, then supported modules will discard new messages if minsecs isn't past.
longids
Comma separated list of device-types for SIGNALduino that should be handled using long IDs. This additional ID allows it to differentiate some weather sensors, if they are sending on the same channel. Therfor a random generated id is added. If you choose to use longids, then you'll have to define a different device after battery change.
Default is to not to use long IDs for all devices.
Examples:
# Do not use any long IDs for any devices:
attr sduino longids 0
# Use any long IDs for all devices (this is default):
attr sduino longids 1
# Use longids for BTHR918N devices.
# Will generate devices names like BTHR918N_f3.
attr sduino longids BTHR918N
Get
version
return the SIGNALduino firmware version
raw
Issue a SIGNALduino firmware command, and wait for one line of data returned by
the SIGNALduino. See the SIGNALduino firmware code for details on SIGNALduino
commands. With this line, you can send almost any signal via a transmitter connected
Example for Send raw:
SR;R=5;P0=294;P1=-381;P2=650;P3=-727;P4=-13076;P5=-15842;D=0501230121212301230301230121212121212303012301230304012301212123012303012301212121212123030123012303;
Message is send 5 Types (R=5)
D= specifies the messages, which is generated with Pulses (P0-P5).
cmds
Depending on the firmware installed, SIGNALduinos have a different set of
possible commands. Please refer to the sourcecode of the firmware of your
SIGNALduino to interpret the response of this command. See also the raw-
command.
ITParms
For sending IT Signals for wireless switches, the number of repeats and the base duration can be set.
With the get command, you can verify what is programmed into the uC.
SET
ITClock
Sets the clock which is used to send the signal for IT switches. (Default is 300)
raw
Issue a SIGNALduino firmware command, without waiting data returned by
the SIGNALduino. See the SIGNALduino firmware code for details on SIGNALduino
commands. With this line, you can send almost any signal via a transmitter connected
reset
This will do a reset of the usb port and normaly causes to reset the uC connected.
flash [hexFile]
The SIGNALduino needs the right firmware to be able to receive and deliver the sensor data to fhem. In addition to the way using the
arduino IDE to flash the firmware into the SIGNALduino this provides a way to flash it directly from FHEM.
There are some requirements:
avrdude must be installed on the host
On a Raspberry PI this can be done with: sudo apt-get install avrdude
the hardware attribute must be set if using any other hardware as an Arduino nano
This attribute defines the command, that gets sent to avrdude to flash the uC.
SIGNALduino_un
The SIGNALduino_un module is a testing and debugging module to decode some devices, it will not create any devices, it will catch only all messages from the signalduino which can't be send to another module
Define
define <name> SIGNALduino_un <code> ]
You can define a Device, but currently you can do nothing with it.
Autocreate is also not enabled for this module.
The function of this module is only to output some logging at verbose 4 or higher. May some data is decoded correctly but it's also possible that this does not work.
The Module will try to process all messages, which where not handled by other modules.
When using multiple SIS PMs on one host, sispmctl up to and including V 2.7 has a bug:
plug-2:# sispmctl -v -s -d 1 -g all -d 2 -g all
SiS PM Control for Linux 2.7
(C) 2004, 2005, 2006, 2007, 2008 by Mondrian Nuessle, (C) 2005, 2006 by Andreas Neuper.
This program is free software.
[...]
Gembird #0 is USB device 013.This device is a 4-socket SiS-PM.
[...]
Gembird #1 is USB device 015.This device is a 4-socket SiS-PM.
[...]
Accessing Gembird #1 USB device 015
Status of outlet 1: on
Status of outlet 2: on
Status of outlet 3: on
Status of outlet 4: on
Error performing requested action
Libusb error string: error sending control message: Invalid argument
Terminating
*** glibc detected *** sispmctl: double free or corruption (fasttop): 0x000251e0 ***
[...]
Well, the fix is simple and will be sent upstream, but in case it's not incorporated
at the time you need it, here it is; it's easy to apply even by hand ;-)
Defines a path to the program "sispmctl", which is used to control (locally attached)
"Silver Shield Power Manager" devices. Usually these are connected to the local computer
via USB, more than one "sispm" device per computer is supported. (Please note that, due
to neglections in their USB driver, AVM's Fritz!Box 7170 (and derivates, like Deutsche
Telekom's Speedport W901V) is not able to talk to these devices ... The Fritz!Box
72xx and 73xx should be fine.)
The communication between FHEM and the Power Manager device is done by using the open
source sispmctl program. Thus, for the
time being, THIS functionality is only available running FHEM on Linux (or any other platform
where you can get the sispmctl program compiled and running). On the bright side: by
interfacing via commandline, it is possible to define multiple SISPM devices, e. g. with
a wrapper that does execute sispmctl on a remote (Linux) system. And: sispmctl runs happily
on Marvells SheevaPlug ;) Please note: if you're not running FHEM as root, you most likely
have to make sispmctl setuid root (chmod 4755 /path/to/sispmctl) or fiddle with
udev so that the devices of the Power Manager are owned by the user running FHEM.
After defining a SISPM device, a first test is done, identifying attached PMs. If this
succeeds, an internal task is scheduled to read the status every 30 seconds. (Reason
being that someone else could have switched sockets externally to FHEM.)
To actually control any power sockets, you need to define a SIS_PMS
device ;) If autocreate is enabled, those should be autocreated for your convenience as
soon as the first scan took place (30 seconds after the define).
Implementation of SISPM.pm tries to be nice, that is it reads from the pipe only
non-blocking (== if there is data), so it should be safe even to use it via ssh or
a netcat-pipe over the Internet, but this, as well, has not been tested extensively yet.
This module is responsible for handling the actual sockets (power on,
power off, toggle) on a "Silver Shield Power Manager", see SISPM
for how to define access to one (SIS_PMS stands for "Silver Shield Power Manager Socket").
Define
define <name> SIS_PMS <serial> <socket>
To securely distinguish multiple attached Power Manager devices, the
serial number of those is used. You get these with "sispmctl -s" - or
just let autocreate define the sockets attached for you.
<serial> is the serial number of the Power Manager device, see above.
<socket> is a number between 1 and 4 (for a 4 socket model)
off
on
toggle
on-till # Special, see the note
off-till # Special, see the note
Examples:
set lamp on set lamp1,lamp2,lamp3 on set lamp1-lamp3 on set hql_lamp on-till 18:45
Notes:
As an external program is used, a noticeable delay may occur.
*-till requires an absolute time in the "at" format (HH:MM:SS, HH:MM
or { <perl code> }, where the perl-code returns a time
specification).
If the current time is greater than the specified time, then the
command is ignored, else an "on" or "off" command, respectively, is
generated, and for the given time an "off"/"on" command is
scheduleld via the at command.
dummy
Set the device attribute dummy to define devices which should not
output any 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 actually switch if triggered in the web frontend.
This module is a FHEM frontend to the Linux tool smartctl.
It provides various information on the SMART System of the hard drive.
Define
define <name> SMARTMON <device> [<Interval>]
This statement creates a new SMARTMON instance.
The parameters specify a device to be monitored and the update interval in minutes.
Example: define sm SMARTMON /dev/sda 60
Readings:
overall_health_test
Specifies the general condition of the HDD (PASSED or FAILED).
warnings
Specifies the number of stored alerts.
Furthermore, the available SMART parameters can be displayed as Readings (RAW and / or (partially) interpreted).
Get:
version
Displays the module version.
update
Updates all readings.
list
Displays various information:
devices: List of available devices in the system.
info: Information about the current device.
data: List of SMART parameters for the current device.
health: Information about overall health status for the device.
For the Last 3 commands can also be another Device specified (as an additional parameter).
Attributes:
show_raw
Valid values: 0: no RAW Readings (default), 1: show all, are not included in interpreted Readings, 2: show all.
include
Comma separated list of IDs for desired SMART parameters. If nothing passed, all available values are displayed.
disable
Valid values: 0: Module active (default), 1: module is disabled (no updates).
parameters
Additional values for smartctl.
For more information see cmartctrl documentation.
SML
This module supports "Intelligenter Strom Zhler"(ENBW) and "Sparzhler" (Yellow Strom).
The electricity meter will be polled in a defined interval (1-100) for new values.
Set
set <name> <value> <nummber> where value is one of:
TOTALPOWER
YEARPOWER
MONTHPOWER
DAYPOWER
Interval
Example:
set <name> TOTALPOWER 12345
Get
get <name> <value> where value is one of:
TOTALPOWER
YEARPOWER
MONTHPOWER
DAYPOWER
Interval
Example:
get <name> DAYPOWER
get <name> YEARPOWER
SOMFY - Somfy RTS / Simu Hz protocol
The Somfy RTS (identical to Simu Hz) protocol is used by a wide range of devices,
which are either senders or receivers/actuators.
Right now only SENDING of Somfy commands is implemented in the CULFW, so this module currently only
supports devices like blinds, dimmers, etc. through a CUL device (which must be defined first).
The address is a 6-digit hex code, that uniquely identifies a single remote control channel.
It is used to pair the remote to the blind or dimmer it should control.
Pairing is done by setting the blind in programming mode, either by disconnecting/reconnecting the power,
or by pressing the program button on an already associated remote.
Once the blind is in programming mode, send the "prog" command from within FHEM to complete the pairing.
The blind will move up and down shortly to indicate completion.
You are now able to control this blind from FHEM, the receiver thinks it is just another remote control.
<address> is a 6 digit hex number that uniquely identifies FHEM as a new remote control channel.
You should use a different one for each device definition, and group them using a structure.
The optional <encryption-key> is a 2 digit hex number (first letter should always be A)
that can be set to clone an existing remote control channel.
The optional <rolling-code> is a 4 digit hex number that can be set
to clone an existing remote control channel.
If you set one of them, you need to pick the same address as an existing remote.
Be aware that the receiver might not accept commands from the remote any longer,
if you used FHEM to clone an existing remote.
This is because the code is original remote's codes are out of sync.
on
off
go-my
stop
pos value (0..100) # see note
prog # Special, see note
on-for-timer
off-for-timer
Examples:
set rollo_1 on set rollo_1,rollo_2,rollo_3 on set rollo_1-rollo_3 on set rollo_1 off set rollo_1 pos 50
Notes:
prog is a special command used to pair the receiver to FHEM:
Set the receiver in programming mode (eg. by pressing the program-button on the original remote)
and send the "prog" command from FHEM to finish pairing.
The blind will move up and down shortly to indicate success.
on-for-timer and off-for-timer send a stop command after the specified time,
instead of reversing the blind.
This can be used to go to a specific position by measuring the time it takes to close the blind completely.
pos value
The position is variying between 0 completely open and 100 for covering the full window.
The position must be between 0 and 100 and the appropriate
attributes drive-down-time-to-100, drive-down-time-to-close,
drive-up-time-to-100 and drive-up-time-to-open must be set.
The position reading distinuishes between multiple cases
Without timing values set only generic values are used for status and position:
open, closed, moving
are used
With timing values set but drive-down-time-to-close equal to drive-down-time-to-100 and drive-up-time-to-100 equal 0
the device is considered to only vary between 0 and 100 (100 being completely closed)
With full timing values set the device is considerd a window shutter (Rolladen) with a difference between
covering the full window (position 100) and being completely closed (position 200)
Get
N/A
Attributes
IODev
Set the IO or physical device which should be used for sending signals
for this "logical" device. An example for the physical device is a CUL.
Note: The IODev has to be set, otherwise no commands will be sent!
If you have both a CUL868 and CUL433, use the CUL433 as IODev for increased range.
setList
Space separated list of commands, which will be returned upon "set name ?",
so the FHEMWEB frontend can construct the correct control and command dropdown. Specific controls can be added after a colon for each command
Example: attr shutter setList open close pos:textField
additionalPosReading
Position of the shutter will be stored in the reading pos as numeric value.
Additionally this attribute might specify a name for an additional reading to be updated with the same value than the pos.
eventMap
Replace event names and set arguments. The value of this attribute
consists of a list of space separated values, each value is a colon
separated pair. The first part specifies the "old" value, the second
the new/desired value. If the first character is slash(/) or comma(,)
then split not by space but by this character, enabling to embed spaces.
Examples:
attr store eventMap on:open off:closed
attr store eventMap /on-for-timer 10:open/off:closed/
set store open
dummy
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.
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 switch, "dim..%" to dimmers 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: Receiver/Actor: somfyblinds
ignore
Ignore this device, e.g. if it belongs to your neighbour. The device
won't trigger any FileLogs/notifys, issued commands will silently
ignored (no RF signal will be sent out, just like for the dummy attribute). The device won't appear in the
list command (only if it is explicitely asked for it), nor will it
appear in commands which use some wildcard/attribute as name specifiers
(see devspec). You still get them with the
"ignored=1" special devspec.
drive-down-time-to-100
The time the blind needs to drive down from "open" (pos 0) to pos 100.
In this position, the lower edge touches the window frame, but it is not completely shut.
For a mid-size window this time is about 12 to 15 seconds.
drive-down-time-to-close
The time the blind needs to drive down from "open" (pos 0) to "close", the end position of the blind.
This is about 3 to 5 seonds more than the "drive-down-time-to-100" value.
drive-up-time-to-100
The time the blind needs to drive up from "close" (endposition) to "pos 100".
This usually takes about 3 to 5 seconds.
drive-up-time-to-open
The time the blind needs drive up from "close" (endposition) to "open" (upper endposition).
This value is usually a bit higher than "drive-down-time-to-close", due to the blind's weight.
Generated events:
From a Somfy device you can receive one of the following events.
on
off
stop
go-my
Which event is sent is device dependent and can sometimes be configured on
the device.
SONOS
FHEM-Module to communicate with the Sonos-System via UPnP
The system consists of two different components:
1. A UPnP-Client which runs as a standalone process in the background and takes the communications to the sonos-components.
2. The FHEM-module itself which connects to the UPnP-client to make fhem able to work with sonos.
The client will be started by the module itself if not done in another way.
You can start this client on your own (to let it run instantly and independent from FHEM): perl 00_SONOS.pm 4711: Starts a UPnP-Client in an independant way who listens to connections on port 4711. This process can run a long time, FHEM can connect and disconnect to it.
Define a Sonos interface to communicate with a Sonos-System.
[upnplistener] The name and port of the external upnp-listener. If not given, defaults to localhost:4711. The port has to be a free portnumber on your system. If you don't start a server on your own, the script does itself. If you start it yourself write down the correct informations to connect.
[interval] The interval is for alive-checking of Zoneplayer-device, because no message come if the host disappear :-) If omitted a value of 10 seconds is the default.
[waittime] With this value you can configure the waiting time for the starting of the Subprocess.
[delaytime] With this value you can configure a delay time before starting the network-part.
Groups <GroupDefinition> Sets the current groups on the whole Sonos-System. The format is the same as retreived by getter 'Groups'.
Get
Group-Commands
Groups Retreives the current group-configuration of the Sonos-System. The format is a comma-separated List of Lists with devicenames e.g. [Sonos_Kueche], [Sonos_Wohnzimmer, Sonos_Schlafzimmer]. In this example there are two groups: the first consists of one player and the second consists of two players.
The order in the sublists are important, because the first entry defines the so-called group-coordinator (in this case Sonos_Wohnzimmer), from which the current playlist and the current title playing transferred to the other member(s).
Attributes
'''Attention''' The most of the attributes can only be used after a restart of fhem, because it must be initially transfered to the subprocess.
Common
characterDecoding <codingname> With this attribute you can define a character-decoding-class. E.g. <UTF-8>. Default is <CP-1252>.
disable <value> One of (0,1). With this value you can disable the whole module. Works immediatly. If set to 1 the subprocess will be terminated and no message will be transmitted. If set to 0 the subprocess is again started. It is useful when you install new Sonos-Components and don't want any disgusting devices during the Sonos setup.
ignoredIPs <IP-Address>[,IP-Address] With this attribute you can define IP-addresses, which has to be ignored by the UPnP-System of this module. e.g. "192.168.0.11,192.168.0.37"
pingType <string> One of (none,tcp,udp,icmp,syn). Defines which pingType for alive-Checking has to be used. If set to 'none' no checks will be done.
Bookmark Configuration
bookmarkSaveDir <path> Defines a directory where the saved bookmarks can be placed. If not defined, "." will be used.
generateProxyAlbumArtURLs <int> One of (0, 1). If defined, all Cover-Links (the readings "currentAlbumArtURL" and "nextAlbumArtURL") are generated as links to the internal Sonos-Module-Proxy. It can be useful if you access Fhem over an external proxy and therefore have no access to the local network (the URLs are direct URLs to the Sonosplayer instead).
proxyCacheDir <Path> Defines a directory where the cached Coverfiles can be placed. If not defined "/tmp" will be used.
proxyCacheTime <int> A time in seconds. With a definition other than "0" the caching mechanism of the internal Sonos-Module-Proxy will be activated. If the filetime of the chached cover is older than this time, it will be reloaded from the Sonosplayer.
targetSpeakMP3FileConverter <string> Defines an MP3-File converter, which properly converts the resulting speaking-file. With this option you can avoid timedisplay problems. Please note that the waittime before the speaking starts can increase with this option be set.
targetSpeakURL <string> Defines, which URL has to be used for accessing former stored Speakfiles as seen from the SonosPlayer
targetSpeakFileTimestamp <int> One of (0, 1). Defines, if the Speakfile should have a timestamp in his name. That makes it possible to store all historical Speakfiles.
targetSpeakFileHashCache <int> One of (0, 1). Defines, if the Speakfile should have a hash-value in his name. If this value is set to one an already generated file with the same hash is re-used and not newly generated.
Speak1 <Fileextension>:<Commandline> Defines a systemcall commandline for generating a speaking file out of the given text. If such an attribute is defined, an associated setter at the Sonosplayer-Device is available. The following placeholders are available: '''%language%''': Will be replaced by the given language-parameter '''%filename%''': Will be replaced by the complete target-filename (incl. fileextension). '''%text%''': Will be replaced with the given text
ExportSonosBibliothek <filename> Exports a file with a textual representation of a structure- and titlehash of the complete Sonos-Bibliothek. Warning: Will use a large amount of CPU-Time and RAM!
ResetAttributesToDefault <DeleteAllOtherAttributes> Sets the attributes to the inital state. If the parameter "DeleteAllOtherAttributes" is set to "1" or "on", all attributes will be deleted before the defaults will be newly retrieved from the player and set.
PlayURITemp <songURI> [Volume] Plays the given MP3-File with the optional given volume as a temporary file. After playing it, the whole state is reconstructed and continues playing at the former saved position and volume and so on. If the file given is a stream (exactly: a file where the running time could not be determined), the call would be identical to ,PlayURI, e.g. nothing is restored after playing.
Speak <Volume> <Language> <Text> Uses the Google Text-To-Speech-Engine for generating MP3-Files of the given text and plays it on the SonosPlayer. Possible languages can be obtained from Google. e.g. "de", "en", "fr", "es"...
StartFavourite <Favouritename> [NoStart] Starts the named sonos-favorite. The parameter should be URL-encoded for proper naming of lists with special characters. If the Word 'NoStart' is given as second parameter, than the Loading will be done, but the playing-state is leaving untouched e.g. not started. Additionally it's possible to use a regular expression as the name. The first hit will be used. The format is e.g. /meine.hits/.
Track <TrackNumber|Random> Sets the track with the given tracknumber as the current title. If the tracknumber is the word Random a random track will be selected.
Playing Settings
AudioDelay <Level> Sets the audiodelay of the playbar to the given value. The value can range from 0 to 5. Retrieves the new audiodelay as the result.
Balance <BalanceValue> Sets the balance to the given value. The value can range from -100 (full left) to 100 (full right). Retrieves the new balancevalue as the result.
Bass <BassValue> Sets the bass to the given value. The value can range from -10 to 10. Retrieves the new bassvalue as the result.
CrossfadeMode <State> Sets the crossfade-mode. Retrieves the new mode as the result.
LEDState <State> Sets the LED state. Retrieves the new state as the result.
Loudness <State> Sets the loudness-state. Retrieves the new state as the result.
Mute <State> Sets the mute-state. Retrieves the new state as the result.
MuteT Toggles the mute state. Retrieves the new state as the result.
Repeat <State> Sets the repeat-state. Retrieves the new state as the result.
RepeatT Toggles the repeat-state. Retrieves the new state as the result.
Shuffle <State> Sets the shuffle-state. Retrieves the new state as the result.
ShuffleT Toggles the shuffle-state. Retrieves the new state as the result.
SleepTimer <Time> Sets the Sleeptimer to the given Time. It must be in the full format of "HH:MM:SS". Deactivate with "00:00:00" or "off".
SubEnable <State> Sets the substate for sub-systems. Retrieves the new state as the result.
SubGain <Level> Sets the sub-gain for sub-systems. The value can range from -15 to 15. Retrieves the new gainlevel as the result.
SurroundEnable <State> Sets the surround-state for surround-systems (like playbars). Retrieves the new state as the result.
SurroundLevel <Level> Sets the surround-level for surround-systems (like playbars). The value can range from -15 to 15. Retrieves the new level as the result.
Treble <TrebleValue> Sets the treble to the given value. The value can range from -10 to 10. Retrieves the new treblevalue as the result.
Volume <VolumeLevel> [RampType] Sets the volume to the given value. The value could be a relative value with + or - sign. In this case the volume will be increased or decreased according to this value. Retrieves the new volume as the result. Optional can be a RampType defined with a value between 1 and 3 which describes different templates defined by the Sonos-System.
VolumeD Turns the volume by volumeStep-ticks down.
VolumeRestore Restores the volume of a formerly saved volume.
VolumeSave <VolumeLevel> Sets the volume to the given value. The value could be a relative value with + or - sign. In this case the volume will be increased or decreased according to this value. Retrieves the new volume as the result. Additionally it saves the old volume to a reading for restoreing.
CurrentPlaylist Sets the current playing to the current queue, but doesn't start playing (e.g. after hearing of a radiostream, where the current playlist still exists but is currently "not in use")
DeletePlaylist Deletes the Sonos-Playlist with the given name. According to the possibilities of the playlistname have a close look at LoadPlaylist.
LoadPlaylist <Playlistname|Fhem-Devicename> [EmptyQueueBeforeImport] Loads the named playlist to the current playing queue. The parameter should be URL-encoded for proper naming of lists with special characters. The Playlistnamen can be an Fhem-Devicename, then the current playlist of this referenced player will be copied. The Playlistname can also be a filename and then must be startet with 'file:' (e.g. 'file:c:/Test.m3u') If EmptyQueueBeforeImport is given and set to 1, the queue will be emptied before the import process. If not given, the parameter will be interpreted as 1. Additionally it's possible to use a regular expression as the name. The first hit will be used. The format is e.g. /hits.2014/.
LoadRadio <Radiostationname> Loads the named radiostation (favorite). The current queue will not be touched but deactivated. The parameter should be URL-encoded for proper naming of lists with special characters. Additionally it's possible to use a regular expression as the name. The first hit will be used. The format is e.g. /radio/.
SavePlaylist <Playlistname> Saves the current queue as a playlist with the given name. An existing playlist with the same name will be overwritten. The parameter should be URL-encoded for proper naming of lists with special characters. The Playlistname can be a filename and then must be startet with 'file:' (e.g. 'file:c:/Test.m3u')
Groupcontrol
AddMember <devicename> Adds the given devicename to the current device as a groupmember. The current playing of the current device goes on and will be transfered to the given device (the new member).
CreateStereoPair <rightPlayerDevicename> Adds the given devicename to the current device as the right speaker of a stereopair. The current playing of the current device goes on (as left-side speaker) and will be transfered to the given device (as right-side speaker).
GroupMute <State> Sets the mute state of the complete group in one step. The value can be on or off.
GroupVolume <VolumeLevel> Sets the group-volume in the way the original controller does. This means, that the relative volumelevel between the different players will be saved during change.
GroupVolumeD Turns the group volume by volumeStep-ticks down.
GroupVolumeU Turns the group volume by volumeStep-ticks up.
RemoveMember <devicename> Removes the given device, so that they both are not longer a group. The current playing of the current device goes on normally. The cutted device stops his playing and has no current playlist anymore (since Sonos Version 4.2 the old playlist will be restored).
SeparateStereoPair Divides the stereo-pair into two independant devices.
SnapshotGroupVolume Save the current volume-relation of all players of the same group. It's neccessary for the use of "GroupVolume" and is stored until the next call of "SnapshotGroupVolume".
Get
Common
Alarm <ID> It's an exception to the normal getter semantics. Returns directly a Perl-Hash with the Alarm-Informations to the given id. It's just a shorthand for eval(ReadingsVal(<Devicename>, 'Alarmlist', ()))->{<ID>};.
PossibleRoomIcons Retreives a list of all possible Roomiconnames for the use with "set RoomIcon".
Lists
Favourites Retrieves a list with the names of all sonos favourites. This getter retrieves the same list on all Zoneplayer. The format is a comma-separated list with quoted names of favourites. e.g. "Liste 1","Entry 2","Test"
FavouritesWithCovers Retrieves a list with the stringrepresentation of a perl-hash which can easily be converted with "eval". It consists of the names and coverlinks of all of the favourites stored in Sonos e.g. {'FV:2/22' => {'Cover' => 'urlzumcover', 'Title' => '1. Favorit'}}
Playlists Retrieves a list with the names of all saved queues (aka playlists). This getter retrieves the same list on all Zoneplayer. The format is a comma-separated list with quoted names of playlists. e.g. "Liste 1","Liste 2","Test"
PlaylistsWithCovers Retrieves a list with the stringrepresentation of a perl-hash which can easily be converted with "eval". It consists of the names and coverlinks of all of the playlists stored in Sonos e.g. {'SQ:14' => {'Cover' => 'urlzumcover', 'Title' => '1. Playlist'}}
Radios Retrieves a list with the names of all saved radiostations (favorites). This getter retrieves the same list on all Zoneplayer. The format is a comma-separated list with quoted names of radiostations. e.g. "Sender 1","Sender 2","Test"
RadiosWithCovers Retrieves a list with the stringrepresentation of a perl-hash which can easily be converted with "eval". It consists of the names and coverlinks of all of the radiofavourites stored in Sonos e.g. {'R:0/0/2' => {'Cover' => 'urlzumcover', 'Title' => '1. Radiosender'}}
SearchlistCategories Retrieves a list with the possible categories for the setter "LoadSearchlist". The Format is a comma-separated list with quoted names of categories.
'''Attention''' The attributes can only be used after a restart of fhem, because it must be initially transfered to the subprocess.
Common
disable <int> One of (0,1). Disables the event-worker for this Sonosplayer.
generateSomethingChangedEvent <int> One of (0,1). 1 if a 'SomethingChanged'-Event should be generated. This event is thrown every time an event is generated. This is useful if you wants to be notified on every change with a single event.
generateVolumeEvent <int> One of (0,1). Enables an event generated at volumechanges if minVolume or maxVolume is set.
getAlarms <int> One of (0..1). Initializes a callback-method for Alarms. This included the information of the DailyIndexRefreshTime.
volumeStep <int> One of (0..100). Defines the stepwidth for subsequent calls of VolumeU and VolumeD.
Information Generation
generateInfoSummarize1 <string> Generates the reading 'InfoSummarize1' with the given format. More Information on this in the examples-section.
generateInfoSummarize2 <string> Generates the reading 'InfoSummarize2' with the given format. More Information on this in the examples-section.
generateInfoSummarize3 <string> Generates the reading 'InfoSummarize3' with the given format. More Information on this in the examples-section.
generateInfoSummarize4 <string> Generates the reading 'InfoSummarize4' with the given format. More Information on this in the examples-section.
stateVariable <string> One of (TransportState,NumberOfTracks,Track,TrackURI,TrackDuration,Title,Artist,Album,OriginalTrackNumber,AlbumArtist, Sender,SenderCurrent,SenderInfo,StreamAudio,NormalAudio,AlbumArtURI,nextTrackDuration,nextTrackURI,nextAlbumArtURI, nextTitle,nextArtist,nextAlbum,nextAlbumArtist,nextOriginalTrackNumber,Volume,Mute,Shuffle,Repeat,CrossfadeMode,Balance, HeadphoneConnected,SleepTimer,Presence,RoomName,SaveRoomName,PlayerType,Location,SoftwareRevision,SerialNum,InfoSummarize1, InfoSummarize2,InfoSummarize3,InfoSummarize4). Defines, which variable has to be copied to the content of the state-variable.
Controloptions
maxVolume <int> One of (0..100). Define a maximal volume for this Zoneplayer
minVolume <int> One of (0..100). Define a minimal volume for this Zoneplayer
maxVolumeHeadphone <int> One of (0..100). Define a maximal volume for this Zoneplayer for use with headphones
minVolumeHeadphone <int> One of (0..100). Define a minimal volume for this Zoneplayer for use with headphones
buttonEvents <Time:Pattern>[ <Time:Pattern> ...] Defines that after pressing a specified sequence of buttons at the player an event has to be thrown. The definition itself is a tupel: the first part (before the colon) is the time in seconds, the second part (after the colon) is the button sequence of this event.
The following button-shortcuts are possible:
M: The Mute-Button
H: The Headphone-Connector
U: Up-Button (Volume Up)
D: Down-Button (Volume Down)
The event thrown is named ButtonEvent, the value is the defined button-sequence.
E.G.: 2:MM
Here an event is defined, where in time of 2 seconds the Mute-Button has to be pressed 2 times. The created event is named ButtonEvent and has the value MM.
Examples / Tips
Format of InfoSummarize: infoSummarizeX := <NormalAudio>:summarizeElem:</NormalAudio> <StreamAudio>:summarizeElem:</StreamAudio>|:summarizeElem: :summarizeElem: := <:variable:[ prefix=":text:"][ suffix=":text:"][ instead=":text:"][ ifempty=":text:"]/[ emptyVal=":text:"]> :variable: := TransportState|NumberOfTracks|Track|TrackURI|TrackDuration|Title|Artist|Album|OriginalTrackNumber|AlbumArtist| Sender|SenderCurrent|SenderInfo|StreamAudio|NormalAudio|AlbumArtURI|nextTrackDuration|nextTrackURI|nextAlbumArtURI| nextTitle|nextArtist|nextAlbum|nextAlbumArtist|nextOriginalTrackNumber|Volume|Mute|Shuffle|Repeat|CrossfadeMode|Balance| HeadphoneConnected|SleepTimer|Presence|RoomName|SaveRoomName|PlayerType|Location|SoftwareRevision|SerialNum|InfoSummarize1| InfoSummarize2|InfoSummarize3|InfoSummarize4 :text: := [Any text without double-quotes]
STACKABLE_CC
This module handles the stackable CC1101 devices for the Raspberry PI from
busware.de. You can attach a lot of CUL-Type devices to a single RPi this way.
The first device is defined as a CUL, the rest of them as STACKABLE_CC.
Define
define <name> STACKABLE_CC <Base-Device-Name>
<Base-Device-Name> is the name of the device, which this device is
attached on, the first one has to be defined as a CUL device
Example:
The rfmode has to be specified explicitely (valid for the STACKABLE_CC
types only, not for the first, which is defined as a CUL).
In case of SlowRF, the FHTID has to be specified explicitely with the
command "set SCCX raw T01HHHH". Again, this is valid for the STACKABLE_CC
types only.
If you rename the base CUL or a STACKABLE_CC, which is a base for
another one, the define of the next one has to be adjusted, and FHEM has to be
restarted.
perl functions, to be used in at or FS20 on-till commands.
First you should set the longitude and latitude global attributes to the
exact longitude and latitude values (see e.g. maps.google.com for the exact
values, which should be in the form of a floating point value). The default
value is Frankfurt am Main, Germany.
The default altitude ($defaultaltit in SUNRISE_EL.pm) defines the
sunrise/sunset for Civil twilight (i.e. one can no longer read outside
without artificial illumination), which differs from sunrise/sunset times
found on different websites. See perldoc "DateTime::Event::Sunrise" for
alternatives.
sunrise()/sunset() returns the absolute time of the next sunrise/sunset,
adding 24 hours if the next event is tomorrow, to use it in the timespec of
an at device or for the on-till command for FS20 devices.
sunrise_rel()/sunset_rel() returns the relative time to the next
sunrise/sunset.
sunrise_abs()/sunset_abs() return the absolute time of the corresponding
event today (no 24 hours added).
sunrise_abs_dat()/sunset_abs_dat() return the absolute time of the
corresponding event to a given date(no 24 hours added).
All functions take up to three arguments:
The first specifies an offset (in seconds), which will be added to the
event.
The second and third specify min and max values (format: "HH:MM").
isday() can be used in some notify or at commands to check if the sun is up
or down. isday() ignores the seconds parameter, but respects min and max.
If min < max, than the day starts not before min, and ends not after max.
If min > max, than the day starts not after max, and ends not before min.
Optionally, for all functions you can set first argument which defines a
horizon value which then is used instead of the $defaultaltit in
SUNRISE_EL.pm. Possible values are: "REAL", "CIVIL", "NAUTIC",
"ASTRONOMIC" or a positive or negative number preceded by "HORIZON=" REAL
is 0, CIVIL is -6, NATUIC is -12, ASTRONOMIC is -18 degrees above
horizon.
Examples:
# When sun is 6 degrees below horizon - same as sunrise();
sunrise("CIVIL");
# When sun is 3 degrees below horizon (between real and civil sunset)
sunset("HORIZON=-3");
# When sun is 1 degree above horizon
sunset("HORIZON=1");
# Switch lamp1 on at real sunset, not before 18:00 and not after 21:00
define a15 at *{sunset("REAL",0,"18:00","21:00")} set lamp1 on
The functions sunrise_abs_dat()/sunset_abs_dat() need as a very first
parameter the date(format epoch: time()) for which the events should be
calculated.
Examples:
# to calculate the sunrise of today + 7 days
my $date = time() + 7*86400;
sunrise_abs_dat($date);
# to calculate the sunrise of today + 7 days 6 degrees below horizon
my $date = time() + 7*86400;
sunrise_abs_dat($date, "CIVIL");
Define
N/A
Set
N/A
Get
N/A
Attributes
latitude
If set, this latitude is used to calculate sunset/sunrise
Notation need to be in decimal format (for example Berlin = 52.666)
As default Frankfurt/Main, Germany (50.112) is used.
longitude
If set, this longitude is used to calculate sunset/sunrise
Notation need to be in decimal format (for example Berlin = 13.400)
As default Frankfurt/Main, Germany (8.686) is used.
altitude
Used by other modules.
Note: these are global attributes, e.g.
attr global latitude 50.112
attr global longitude 8.686
This is the Plotting/Charting device of FHEMWEB
Examples:
define MyPlot SVG inlog:temp4hum4:CURRENT
Notes:
Normally you won't define an SVG device manually, as
FHEMWEB makes it easy for you, just plot a logfile (see logtype) and click on "Create SVG instance".
Specifying CURRENT as a logfilename will always access the current
logfile, even if its name changes regularly.
For historic reasons this module uses a Gnuplot file description
to store different attributes. Some special commands (beginning with
#FileLog or #DbLog) are used additionally, and not all gnuplot
attribtues are implemented.
Set
copyGplotFile
Copy the currently specified gplot file to a new file, which is named
after the SVG device, existing files will be overwritten.
This operation is needed in order to use the plot editor (see below)
without affecting other SVG instances using the same gplot file.
Creating the SVG instance from the FileLog detail menu will also
create a unique gplot file, in this case this operation is not needed.
Get
N/A
Attributes
fixedrange [offset]
Contains two time specs in the form YYYY-MM-DD separated by a space.
In plotmode gnuplot-scroll(-svg) or SVG the given time-range will be
used, and no scrolling for this SVG will be possible. Needed e.g. for
looking at last-years data without scrolling.
If the value is
one of hour, day, <N>days, week, month, year than set the zoom
level for this SVG independently of the user specified zoom-level. This
is useful for pages with multiple plots: one of the plots is best
viewed in with the default (day) zoom, the other one with a week
zoom.
If given, the optional integer parameter offset refers to a different
period (e.g. last year: fixedrange year -1, 2 days ago: fixedrange day
-2).
fixedoffset <nDays>
Set an fixed offset (in days) for the plot.
startDate
Set the start date for the plot. Used for demo installations.
label
Double-Colon separated list of values. The values will be used to replace
<L#> type of strings in the .gplot file, with # beginning at 1
(<L1>, <L2>, etc.). Each value will be evaluated as a perl
expression, so you have access e.g. to the Value functions.
If the plotmode is gnuplot-scroll(-svg) or SVG, you can also use the min,
max, mindate, maxdate, avg, cnt, sum, firstval, firstdate, currval (last
value) and currdate (last date) values of the individual curves, by
accessing the corresponding values from the data hash, see the example
below:
.gplot file entry:
set ylabel <L1>
set y2label <L2>
Title with maximum and current values of the 1st curve (FileLog)
Fhem config:
attr wl_1 label "Max $data{max1}, Current $data{currval1}"
.gplot file entry:
set title <L1>
The value minAll and maxAll (representing the minimum/maximum over all
values) is also available from the data hash.
title
A special form of label (see above), which replaces the string <TL>
in the .gplot file. It defaults to the filename of the logfile.
captionLeft
Show the legend on the left side.
plotfunction
Space value separated list of values. The value will be used to replace
<SPEC#> type of strings in the .gplot file, with # beginning at 1
(<SPEC1>, <SPEC2>, etc.) in the #FileLog or #DbLog directive.
With this attribute you can use the same .gplot file for multiple devices
with the same logdevice.
Example:
#FileLog
with: attr plotfunction "4:IR\x3a:0:"
instead of
#FileLog 4:IR\x3a:0:
#DbLog
with: attr plotfunction
"Garage_Raumtemp:temperature::" instead of
#DbLog Garage_Raumtemp:temperature::
Plot-Editor
This editor is visible on the detail screen of the SVG instance.
Most features are obvious here, up to some exceptions:
if you want to omit the title for a Diagram label, enter notitle in the
input field.
if you want to specify a fixed value (not taken from a column) if a
string found (e.g. 1 if the FS20 switch is on and 0 if it is off), then
you have to specify the Tics first, and write the .gplot file, before you
can select this value from the dropdown.
Example:
Enter in the Tics field: ("On" 1, "Off" 0)
Write .gplot file
Select "1" from the column dropdown (note the double quote!) for the
regexp switch.on, and "0" for the regexp switch.off.
Write .gplot file again
If the range is of the form {...}, then it will be evaluated with perl.
The result is a string, and must have the form [min:max]
The visibility of the ploteditor can be configured with the FHEMWEB attribute
ploteditor.
SWAP
The SWAP protocoll is used by panStamps (panstamp.com).
This is a generic module that will handle all SWAP devices with known device description files via
a panStick as the IODevice.
All communication is done on the SWAP register level. FHEM readings are created for all user registers
and userReadings are created to map low level SWAP registers to 'human readable' format with the
mapping from the device descriprion files.
For higher level features like "on,off,on-for-timer,..." specialized modules have to be used.
Messages for devices in power-down-state are queued and send when the device enters SYNC state.
This typicaly happens during device startup after a reset.
Notes:
This module requires XML::Simple.
Devices with the default address FF will be changed to the first free address in the range F0-FE.
For power-down devices the default transmit interval of FFFF will be changed to 0384 (900 seconds).
Define
define <name> SWAP <ID>
The ID is a 2 digit hex number to identify the moth in the panStamp network.
Set
regGet <reg>
request status message for register id <reg>.
for system registers the register name can be used instead if the two digit register id in hex.
regSet <reg> <data>
write <data> to register id <reg>.
for system registers the register name can be used instead if the twi digit register id in hex.
regSet <reg>.<ep> <data>
write <data> to endpoint <ep> of register <reg>. will not work if no reading for register <reg> is available as all nibbles that are not part of endpoint <ep> will be filled from this reading.
statusRequest
request transmision of all registers.
readDeviceXML
reload the device description xml file.
clearUnconfirmed
clears the list of unconfirmed messages.
flash [<productCode>|<firmwareFile>]
will initiate an ota firmware update. only possible for panStamp NRG devices.
no params -> will use the SWAP_<current productCode>.hex file from the FHEM/firmware directory.
<productCode> -> will use the SWAP_<productCode>.hex file from the FHEM/firmware directory.
<firmwareFile> -> will use <firmwareFile> as the absolute file name of the hex file.
Get
regList
list all non-system registers of this device.
regListAll
list all registers of this device.
listUnconfirmed
list all unconfirmed messages.
products
dumps all known devices.
deviceXML
dumps the device xml data.
Attributes
createUnknownReadings
Create readings for unknown registers, i.e. registers not defined in the device xml file.
ProductCode
ProductCode of the device. used to read the register configuration from the device definition file.
hast to be set manualy for devices that are in sleep mode during definition.
SWAP_0000002200000003
Module for the justme version of the panstamp rgb driver board with ir (sketch product code 0000002200000003).
to learn an ir command the simplest way ist to use 'learnIR #'. the on board led will start to blink indicating ir learning mode. after an ir command is received the blinking will switch to slow and the boards waits for a fhem command (on/off/...) and will link the ir command to the fhem command.
received ir commands that will not trigger one of the 16 possible learned commands will be send as SWAP register 0C to fhem and can be used in notifys.
SWAP register 0E will configure the power on state of the board: off, configured color, last color before power down.
listIR
list all IR registers of this device. use getIR first.
listFade
list all fade registers. use getFade first.
Attributes
color-icon
1 -> use lamp color as icon color and 100% shape as icon shape
2 -> use lamp color scaled to full brightness as icon color and dim state as icon shape
ProductCode
must be 0000002200000003
SWAP_0000002200000008
Module for the justme version of the panstamp indoor multi sensor board (sketch product code 0000002200000008).
This module provides statistics about the system running FHEM server. Furthermore, remote systems can be accessed (Telnet). Only Linux-based systems are supported.
Some informations are hardware specific and are not available on every platform.
So far, this module has been tested on the following systems:
Raspberry Pi (Debian Wheezy), BeagleBone Black, FritzBox 7390, WR703N under OpenWrt, CubieTruck and some others.
For more information on a FritzBox check other moduls: FRITZBOX and FB_CALLMONITOR.
The modul uses the Perl modul 'Net::Telnet' for remote access. Please make sure that this module is installed.
This statement creates a new SYSMON instance. The parameters M1 to M4 define the refresh interval for various Readings (statistics). The parameters are to be understood as multipliers for the time defined by INTERVAL_BASE. Because this time is fixed at 60 seconds, the Mx-parameter can be considered as time intervals in minutes.
If one (or more) of the multiplier is set to zero, the corresponding readings is deactivated.
The parameters are responsible for updating the readings according to the following scheme:
The following parameters are always updated with the base interval (regardless of the Mx-parameter):
fhemuptime, fhemuptime_text, idletime, idletime_text, uptime, uptime_text, starttime, starttime_text
To query a remote system at least the address (HOST) must be specified. Accompanied by the port and / or user name, if necessary. The password (if needed) has to be defined once with the command 'set password '. For MODE parameter are 'telnet' and 'local' only allowed. 'local' does not require any other parameters and can also be omitted.
Readings:
cpu_core_count
CPU core count
cpu_model_name
CPU model name
cpu_bogomips
CPU Speed: BogoMIPS
cpu_freq (and cpu1_freq for dual core systems)
CPU frequency
cpu_temp
CPU temperature
cpu_temp_avg
Average of the CPU temperature, formed over the last 4 values.
fhemuptime
Time (in seconds) since the start of FHEM server.
fhemuptime_text
Time since the start of the FHEM server: human-readable output (text representation).
fhemstarttime
Start time (in seconds since 1.1.1970 1:00:00) of FHEM server.
fhemstarttime_text
Start time of the FHEM server: human-readable output (text representation).
idletime
Time spent by the system since the start in the idle mode (period of inactivity).
idletime_text
The inactivity time of the system since system start in human readable form.
loadavg
System load (load average): 1 minute, 5 minutes and 15 minutes.
ram
memory usage.
swap
swap usage.
uptime
System uptime.
uptime_text
System uptime (human readable).
starttime
System starttime.
starttime_text
System starttime (human readable).
Network statistics
Statistics for the specified network interface about the data volumes transferred and the difference since the previous measurement.
Examples:
Amount of the transmitted data via interface eth0. eth0: RX: 940.58 MB, TX: 736.19 MB, Total: 1676.77 MB
Change of the amount of the transferred data in relation to the previous call (for eth0). eth0_diff: RX: 0.66 MB, TX: 0.06 MB, Total: 0.72 MB
IP and IP v6 adresses
eth0_ip 192.168.0.15 eth0_ip6 fe85::49:4ff:fe85:f885/64
Network Speed (if avialable)
speed of the network connection.
Examples: eth0_speed 100
File system information
Usage of the desired file systems.
Example: fs_root: Total: 7340 MB, Used: 3573 MB, 52 %, Available: 3425 MB at /
user defined
These readings provide output of commands, which are passed to the operating system or delivered by user defined functions.
FritzBox specific Readings
wlan_state
WLAN state: on/off
wlan_guest_state
GuestWLAN state: on/off
internet_ip
current IP-Adresse
internet_state
state of the Internet connection: connected/disconnected
night_time_ctrl
state night time control (do not disturb): on/off
num_new_messages
Number of new Voice Mail messages
fw_version_info
Information on the installed firmware version:
DSL Informations (FritzBox)
dsl_rate
Information about the down und up stream rate
dsl_synctime
sync time with DSLAM
dsl_crc_15
number of uncorrectable errors (CRC) for the last 15 minutes
dsl_fec_15
number of correctable errors (FEC) for the last 15 minutes
Power Supply Readings
power_ac_stat
status information to the AC socket: online (0|1), present (0|1), voltage, current
Example: power_ac_stat: 1 1 4.807 264
power_ac_text
human readable status information to the AC socket
Example: power_ac_text ac: present / online, voltage: 4.807 V, current: 264 mA
power_usb_stat
status information to the USB socket
power_usb_text
human readable status information to the USB socket
power_battery_stat
status information to the battery (if installed): online (0|1), present (0|1), voltage, current, actual capacity
Example: power_battery_stat: 1 1 4.807 264 100
power_battery_text
human readable status information to the battery (if installed)
power_battery_info
human readable additional information to the battery (if installed): technology, capacity, status, health, total capacity
Example: power_battery_info: battery info: Li-Ion , capacity: 100 %, status: Full , health: Good , total capacity: 2100 mAh
The capacity must be defined in script.bin (e.g. ct-hdmi.bin). Parameter name pmu_battery_cap. Convert with bin2fex (bin2fex -> script.fex -> edit -> fex2bin -> script.bin).
cpuX_freq_stat
Frequency statistics for CPU X: minimum, maximum and average values
Example: cpu0_freq_stat: 100 1000 900
cpuX_idle_stat
Idle statistik for CPU X: minimum, maximum and average values
Example: cpu0_freq_stat: 23.76 94.74 90.75
cpu[X]_temp_stat
Temperature statistik for CPU: minimum, maximum and average values
Example: cpu_temp_stat: 41.00 42.50 42.00
ram_used_stat
RAM usage statistics: minimum, maximum and average values
Example: ram_used_stat: 267.55 1267.75 855.00
swap_used_stat
SWAP usage statistics: minimum, maximum and average values
Example: swap_used_stat: 0 1024.00 250.00
interval_base
Lists the specified polling intervalls.
interval_multipliers
Displays update intervals.
list
Lists all readings.
update
Refreshs all readings.
version
Displays the version of SYSMON module.
list_lan_devices
Displays known LAN Devices (FritzBox only).
Set:
interval_multipliers
Defines update intervals (as in the definition of the device).
clean
Clears user-definable Readings. After an update (manual or automatic) new readings are generated.
clear <reading name>
Deletes the Reading entry with the given name. After an update this entry is possibly re-created (if defined). This mechanism allows the selective deleting unnecessary custom entries.
password <Passwort>
Specify the password for remote access (usually only necessary once).
Attributes:
filesystems <reading name>[:<mountpoint>[:<comment>]],...
Specifies the file system to be monitored (a comma-separated list).
Reading-name is used in the display and logging, the mount point is the basis of the evaluation, comment is relevant to the HTML display (see SYSMON_ShowValuesHTML)
Examples: /boot,/,/media/usb1 fs_boot:/boot,fs_root:/:Root,fs_usb1:/media/usb1:USB-Stick
network-interfaces <name>[:<interface>[:<comment>]],...
Comma-separated list of network interfaces that are to be monitored. Each entry consists of the Reading-name, the name of the Netwerk adapter and a comment for the HTML output (see SYSMON_ShowValuesHTML). If no colon is used, the value is used simultaneously as a Reading-name and interface name.
Example ethernet:eth0:Ethernet,wlan:wlan0:WiFi
user-defined <readingsName>:<Interval_Minutes>:<Comment>:<Cmd>,...
This comma-separated list defines user defined Readings with the following data: Reading name, refresh interval (in minutes), a Comment, and operating system command.
The os commands are executed according to the specified Intervals and are noted as Readings with the specified name. Comments are used for the HTML output (see SYSMON_ShowValuesHTML)..
All parameter parts are required!
It is important that the specified commands are executed quickly, because at this time the entire FHEM server is blocked!
If results of the long-running operations required, these should be set up as a CRON job and store results as a text file.
Example: Display of package updates for the operating system:
cron-Job: sudo apt-get update 2>/dev/null >/dev/null apt-get upgrade --dry-run| perl -ne '/(\d*)\s[upgraded|aktualisiert]\D*(\d*)\D*install|^ \S+.*/ and print "$1 aktualisierte, $2 neue Pakete"' 2>/dev/null > /opt/fhem/data/updatestatus.txt uder-defined attribute sys_updates:1440:System Aktualisierungen:cat /opt/fhem/data/updatestatus.txt
the number of available updates is daily recorded as 'sys_updates'.
user-fn <fn_name>:<interval_minutes>:<reading_name1>:<reading_name2>...[:<reading_nameX>], ...
List of perl user subroutines.
As <fn_name> can be used either the name of a Perl subroutine or a Perl expression.
The perl function gets the device hash as parameter and must provide an array of values.
These values are taken according to the parameter <reading_nameX> in Readings.
A Perl expression must be enclosed in curly braces and can use the following parameters: $ HASH (device hash) and $ NAME (device name).
Return is expected analogous to a Perl subroutine.
Important! The separation between multiple user functions must be done with a comma AND a space! Within the function definition commas may not be followed by spaces.
disable
Possible values: 0 and 1. '1' means that the update is stopped.
telnet-prompt-regx, telnet-login-prompt-regx
RegExp to detect login and command line prompt. (Only for access via Telnet.)
exclude
Allows to suppress reading certain information.
supported values: user-defined (s. user-defined und user-fn), cpucount, uptime, fhemuptime,
loadavg, cputemp, cpufreq, cpuinfo, diskstat, cpustat, ramswap, filesystem, network,
fbwlan, fbnightctrl, fbnewmessages, fbdecttemp, fbversion, fbdsl, powerinfo
HTML output method (see Weblink): SYSMON_ShowValuesHTML(<SYSMON-Instance>[,<Liste>])
The module provides a function that returns selected Readings as HTML.
As a parameter the name of the defined SYSMON device is expected.
It can also Reading Group, Clone dummy or other modules be used. Their readings are simple used for display.
The second parameter is optional and specifies a list of readings to be displayed in the format <ReadingName>[:<Comment>[:<Postfix>[:<FormatString>]]]. ReadingName is the Name of desired Reading, Comment is used as the display name and postfix is displayed after the value (such as units or as MHz can be displayed).
If FormatString is specified, the output is formatted with sprintf (s. sprintf in Perl documentation).
If no Comment is specified, an internally predefined description is used.
If no list specified, a predefined selection is used (all values are displayed).
Text output method (see Weblink): SYSMON_ShowValuesHTMLTitled(<SYSMON-Instance>[,<Title>,<Liste>])
According to SYSMON_ShowValuesHTML, but with a Title text above. If no title provided, device alias will be used (if any)
Text output method (see Weblink): SYSMON_ShowValuesText(<SYSMON-Instance>[,<Liste>])
According to SYSMON_ShowValuesHTML, but formatted as plain text.
Text output method (see Weblink): SYSMON_ShowValuesTextTitled(<SYSMON-Instance>[,<Title>,<Liste>])
According to SYSMON_ShowValuesHTMLTitled, but formatted as plain text.
Reading values with perl: SYSMON_getValues(<name>[, <array of desired keys>])
Returns a hash ref with desired values. If no array is passed, all values are returned.
{(SYSMON_getValues("sysmon"))->{'cpu_temp'}}
{(SYSMON_getValues("sysmon",("cpu_freq","cpu_temp")))->{"cpu_temp"}}
{join(" ", values (SYSMON_getValues("sysmon")))}
{join(" ", values (SYSMON_getValues("sysmon",("cpu_freq","cpu_temp"))))}
# Anzeige der Readings zum Einbinden in ein 'Raum'.
define SysValues weblink htmlCode {SYSMON_ShowValuesHTML('sysmon')}
attr SysValues group RPi
attr SysValues room 9.03_Tech
Provides system statistics for the host FHEM runs on or a remote Linux system that is reachable by preconfigured passwordless ssh access.
Notes:
This module needs Sys::Statistics::Linux on Linux.
It can be installed with 'cpan install Sys::Statistics::Linux'
or on debian with 'apt-get install libsys-statistics-linux-perl'
To monitor a target by snmp Net::SNMP hast to be installed.
To plot the load values the following code can be used:
to match the root filesystem (mount point '/') in diskusage plots use
'#FileLog 4:/\x3a:0:' or '#FileLog 4:\s..\s:0:'
and not '#FileLog 4:/:0:' as the later will match all mount points
The load is updated every <interval> seconds. The default and minimum is 60.
The diskusage is updated every <interval_fs> seconds. The default is <interval>*60 and the minimum is 60.
<interval_fs> is only aproximated and works best if <interval_fs> is an integral multiple of <interval>.
If <host> is given it has to be accessible by ssh without the need for a password.
Examples:
mibs
space separated list of <mib>:<reding> pairs that sould be polled.
showpercent
If set the usage is shown in percent. If not set the remaining free space in bytes is shown.
snmp
1 -> use snmp to monitor load, uptime and filesystems (including physical and virtual memory)
stat
1 -> monitor user,system,idle and iowait percentage of system utilization (available only for linux targets)
raspberrytemperature
If set and > 0 the raspberry pi on chip termal sensor is read.
If set to 2 a geometric average over the last 4 values is created.
synologytemperature
If set and > 0 the main temperaure of a synology diskstation is read. requires snmp.
If set to 2 a geometric average over the last 4 values is created.
raspberrycpufreq
If set and > 0 the raspberry pi on chip termal sensor is read.
uptime
If set and > 0 the system uptime is read.
If set to 2 the uptime is displayed in seconds.
useregex
If set the entries of the filesystems list are treated as regex.
The TCM module serves an USB or TCP/IP connected TCM 120 or TCM 310x, TCM 410J
EnOcean Transceiver module. These are mostly packaged together with a serial to USB
chip and an antenna, e.g. the BSC BOR contains the TCM 120, the USB 300 from
EnOcean and the EUL from busware contains a TCM 310. See also the datasheet
available from www.enocean.com.
As the TCM 120 and the TCM 310, TCM 410J speak completely different protocols, this
module implements 2 drivers in one. It is the "physical" part for the EnOcean module.
Please note that EnOcean repeaters also send Fhem data telegrams again. Use
attr <name> blockSenderID own
to block receiving telegrams with TCM SenderIDs.
The address range used by your transceiver module, can be found in the
parameters BaseID and LastID.
The transceiver moduls do not always support all commands. The supported range
of commands depends on the hardware and the firmware version. A firmware update
is usually not provided.
The TCM module enables also a wired connection to Eltako actuators over the
Eltako RS485 bus in the switchboard or distribution box via Eltako FGW14 RS232-RS485
gateway modules. These actuators are linked to an associated wireless antenna module
(FAM14) on the bus. The FAM14 device frequently polls the actuator status of all
associated devices if the FAM14 operating mode rotary switch is on position 4.
Therefore, actuator states can be retrieved more reliable, even after any fhem downtime,
when switch events or actuator confirmations could not have been tracked during the
downtime. As all actuators are polled approx. every 1-2 seconds, it should be avoided to
use event-on-update-reading. Use instead either event-on-change-reading or
event-min-interval.
The Eltako bus uses the EnOcean Serial Protocol version 2 (ESP2). For this reason,
a FGW14 can be configured as a ESP2. The attribute comType
must be set to RS485.
Define
define <name> TCM [ESP2|ESP3] <device>
First you have to specify the type of the EnOcean Transceiver Chip, i.e
either ESP2 for the TCM 120 or ESP3 for the TCM 310x, TCM 410J, USB 300, USB400J.
device can take the same parameters (@baudrate, @directio,
TCP/IP, none) like the CUL, but you probably have
to specify the baudrate: the TCM 120 should be opened with 9600 Baud, the
TCM 310 with 57600 baud. For Eltako FGW14 devices, type has to be set to 120 and
the baudrate has to be set to 57600 baud if the FGW14 operating mode
rotary switch is on position 6.
baseID [FF800000 ... FFFFFF80]
Set the BaseID.
Note: The firmware executes this command only up to then times to prevent misuse.
modem_off
Deactivates TCM modem functionality
modem_on [0000 ... FFFF]
Activates TCM modem functionality and sets the modem ID
teach <t/s>
Set Fhem in learning mode, see learningMode.
The command is always required for UTE and to teach-in bidirectional actuators
e. g. EEP 4BS (RORG A5-20-XX),
see Teach-In / Teach-Out.
reset
Reset the device
sensitivity [00|01]
Set the TCM radio sensitivity: low = 00, high = 01
sleep
Enter the energy saving mode
wake
Wakes up from sleep mode
For details see the TCM 120 User Manual available from www.enocean.com.
ESP3 (TCM 310x, TCM 410J, USB 300, USB400J)
baseID [FF800000 ... FFFFFF80]
Set the BaseID.
Note: The firmware executes this command only up to then times to prevent misuse.
maturity [00|01]
Waiting till end of maturity time before received radio telegrams will transmit:
radio telegrams are send immediately = 00, after the maturity time is elapsed = 01
mode [00|01]
mode = 00: Compatible mode - ERP1 - gateway uses Packet Type 1 to transmit and receive radio telegrams
mode = 01: Advanced mode – ERP2 - gateway uses Packet Type 10 to transmit and receive radio telegrams
(for FSK products with advanced protocol)
teach <t/s>
Set Fhem in learning mode, see learningMode.
The command is always required for UTE and to teach-in bidirectional actuators
e. g. EEP 4BS (RORG A5-20-XX)
reset
Reset the device
repeater [0000|0101|0102]
Set Repeater Level: off = 0000, 1 = 0101, 2 = 0102.
sleep <t/10 ms> (Range: 00000000 ... 00FFFFFF)
Enter the energy saving mode
baseID <FF800000 ... FFFFFF80>,
[baseID] = is default.
Set Transceiver baseID and override automatic allocation. Use this attribute only if the IODev does not allow automatic allocation.
comType <TCM|RS485>,
[comType] = TCM is default.
Type of communication device
learningMode <always|demand|nearfield>,
[learningMode] = demand is default.
Learning method for automatic setup of EnOcean devices:
[learningMode] = always: Teach-In/Teach-Out telegrams always accepted, with the exception of bidirectional devices
[learningMode] = demand: Teach-In/Teach-Out telegrams accepted if Fhem is in learning mode, see also set <IODev> teach <t/s>
[learningMode] = nearfield: Teach-In/Teach-Out telegrams accepted if Fhem is in learning mode and the signal strength RSSI >= -60 dBm.
sendInterval <0 ... 250>
ESP2: [sendInterval] = 100 ms is default.
ESP3: [sendInterval] = 0 ms is default.
Smallest interval between two sending telegrams
The TEK603 is a fhem module for the Tekelek TEK603 Eco Monitor a liquid level monitor designed for residential and small commercial applications.
It works in conjunction with a TEK653 Sonic transmitter mounted on the top of the tank.
Define
define <name> TEK603 /dev/ttyUSBx
Defines an TEK603 Eco Monitor device connected to USB.
Examples:
define OelTank TEK603 /dev/ttyUSB0
Readings
Time
TEK603 internal Time
Temperature
Sensor Temperature
Ullage
Sensor Measured Ullage
RemainingUsableLevel
This is the usable level, with deductions due to the sensor offset and outlet height. (Liters)
TotalUsableCapacity
This is the usable volume, with deductions due to the sensor offset and outlet height. (Litres)
THRESHOLD
Diverse controls can be realized by means of the module by evaluation of sensor data.
In the simplest case, this module reads any sensor that provides values in decimal and execute FHEM/Perl commands, if the value of the sensor is higher or lower than the threshold value.
A typical application is the simulation of a thermostat or humidistat.
With one or more such modules, complex systems can be implemented for heating, cooling, ventilation, dehumidification or shading.
But even simple notification when crossing or falling below a specific value can be easily realized. It no if-statements in Perl or notify definitions need to be made.
This leads to quickly create and clear controls, without having to necessarily go into the Perl matter.
Some application examples are at the end of the module description.
According to the definition of a module type THRESHOLD eg:
define <name> THRESHOLD <sensor> <actor>
It is controlled by setting a desired value with:
set <name> desired <value>
The module begins with the control system only when a desired value is set!
The specification of the desired value may also come from another sensor. This control may take place by the comparison of two sensors.
Likewise, any wall thermostats can be used (eg, HM, MAX, FHT) for the definition of the reference temperature.
The switching behavior can also be influenced by another sensor or sensor group.
The combination of multiple THRESHOLD modules together is possible, see examples below.
reading (optional)
reading of the sensor, which includes a value in decimal
default value: temperature
hysteresis (optional)
Hysteresis, this provides the threshold_min = desired_value - hysteresis
default value: 1 at temperature, 10 at huminity
target_value (optional)
number: Initial value, if no value is specified, it must be set with "set desired value".
else:<sensorname>:<reading>, an additional sensor can be specified, which sets the target value dynamically.
default value: no value
offset (optional)
Offset to desired value
This results:
threshold_max = desired_value + offset and threshold_min = desired_value - hysteresis + offset
Defaultwert: 0
AND|OR (optional)
logical operator with an optional second sensor
sensor2 (optional, nur in Verbindung mit AND oder OR)
the second sensor
reading2 (optional)
reading of the second sensor
default value: state
state (optional)
state of the second sensor
default value: open
actor (optional)
actor device defined in FHEM
cmd1_gt (optional)
FHEM/Perl command that is executed, if the value of the sensor is higher than desired value and/or the value of sensor 2 is matchted. @ is a placeholder for the specified actor.
default value: set actor off, if actor defined
cmd2_lt (optional)
FHEM/Perl command that is executed, if the value of the sensor is lower than threshold_min or the value of sensor 2 is not matchted. @ is a placeholder for the specified actor.
default value: set actor on, if actor defined
cmd_default_index (optional)
Index of command that is executed after setting the desired value until the desired value or threshold_min value is reached.
0 - no command
1 - cmd1_gt
2 - cmd2_lt
default value: 2, if actor defined, else 0
state_cmd1_gt (optional, is defined as an attribute at the same time and can be changed there)
state, which is displayed, if FHEM/Perl-command cmd1_gt was executed. If state_cmd1_gt state ist set, other states, such as active or deactivated are suppressed.
default value: none
state_cmd2_lt (optional, is defined as an attribute at the same time and can be changed there)
state, which is displayed, if FHEM/Perl-command cmd1_gt was executed. If state_cmd1_gt state ist set, other states, such as active or deactivated are suppressed.
default value: none
state_format (optional, is defined as an attribute at the same time and can be changed there)
Format of the state output: arbitrary text with placeholders.
Possible placeholders:
_m: mode
_dv: desired_value
_s1v: sensor_value
_s2s: sensor2_state
_sc: state_cmd
Default value: _m _dv _sc, _sc when state_cmd1_gt and state_cmd2_lt set without actor.
Examples:
Example for heating:
It is heated up to the desired value of 20. If the value below the threshold_min value of 19 (20-1)
the heating is switched on again.
define thermostat THRESHOLD temp_sens heating
set thermostat desired 20
Example for heating with window contact:
define thermostat THRESHOLD temp_sens OR win_sens heating
Example for heating with multiple window contacts:
define TH_living_room THRESHOLD T_living_room heating attr TH_living_room state_cmd1_gt off attr TH_living_room state_cmd2_lt on attr TH_living_room state_format _m _sc _dv _s1v
Set
set <name> desired <value>
Set the desired value. If no desired value is set, the module is not active.
set <name> deactivated <command>
Module is disabled.
<command> is optional. It can be "cmd1_gt" or "cmd2_lt" passed in order to achieve a defined state before disabling the module.
set <name> active <value>
Module is activated. If under target_value a sensor for reference input has been defined, the current setpoint will be inhibited until set "set external".
set <name> externel
Module is activated, reference input comes from the target sensor, if a sensor has been defined under target_value.
set <name> hysteresis <value>
Set hysteresis value.
set <name> offset <value>
Set offset value.
Defaultwert: 0
set <name> cmd1_gt
Executes the command defined in cmd1_gt.
set <name> cmd2_lt
Executes the command defined in cmd2_lt.
The specified format is used in the state for formatting desired_value (_dv) and Sensor_value (_s1v) using the sprintf function.
The default value is "% .1f" to one decimal place. Other formatting, see Formatting in the sprintf function in the Perldokumentation.
If the attribute is deleted, numbers are not formatted in the state.
target_func
Here, a Perl expression used to calculate a target value from a value of the external sensor.
The sensor value is given as "_tv" in the expression.
Example: attr TH_heating target_func -0.578*_tv+33.56
setOnDeactivated
Command to be executed before deactivating. Possible values: cmd1_gt, cmd2_lt
desiredActivate
If the attribute is set to 1, a disabled module is automatically activated by "set ... desired ". "set ... active" is not needed in this case.
THZ
THZ module: comunicate through serial interface RS232/USB (eg /dev/ttyxx) or through ser2net (e.g 10.0.x.x:5555) with a Tecalor/Stiebel Eltron heatpump.
Tested on a THZ303/Sol (with serial speed 57600/115200@USB) and a THZ403 (with serial speed 115200) with the same Firmware 4.39.
Tested on a LWZ404 (with serial speed 115200) with Firmware 5.39.
Tested on fritzbox, nas-qnap, raspi and macos.
Implemented: read of status parameters and read/write of configuration parameters.
A complete description can be found in the 00_THZ wiki http://www.fhemwiki.de/wiki/Tecalor_THZ_Heatpump
Define
define <name> THZ <device>
device can take the same parameters (@baudrate, @directio,
TCP/IP, none) like the CUL, e.g 57600 baud or 115200.
Example:
direct connection
If the attributes interval_XXXX are not defined (or 0 seconds), their internal polling is disabled.
This module is starting to support older firmware 2.06 or newer firmware 5.39; the following attribute adapts decoding
attr Mythz firmware 2.06
attr Mythz firmware 5.39
If no attribute firmware is set, it is assumed your firmware is compatible with 4.39.
TRX
This module is for the RFXCOM RFXtrx433 USB based 433 Mhz RF transmitters.
This USB based transmitter is able to receive and transmit many protocols like Oregon Scientific weather sensors, X10 security and lighting devices, ARC ((address code wheels) HomeEasy, KlikAanKlikUit, ByeByeStandBy, Intertechno, ELRO,
AB600, Duewi, DomiaLite, COCO) and others.
Currently the following parser modules are implemented:
46_TRX_WEATHER.pm (see device TRX): Process messages Oregon Scientific weather sensors.
See http://www.rfxcom.com/oregon.htm for a list of
Oregon Scientific weather sensors that could be received by the RFXtrx433 tranmitter.
Until now the following Oregon Scientific weather sensors have been tested successfully: BTHR918, BTHR918N, PCR800, RGR918, THGR228N, THGR810, THR128, THWR288A, WTGR800, WGR918. It will also work with many other Oregon sensors supported by RFXtrx433. Please give feedback if you use other sensors.
46_TRX_SECURITY.pm (see device TRX_SECURITY): Receive X10, KD101 and Visonic security sensors.
46_TRX_LIGHT.pm (see device RFXX10REC): Process X10, ARC, ELRO AB400D, Waveman, Chacon EMW200, IMPULS, RisingSun, Philips SBC, AC, HomeEasy EU and ANSLUT lighting devices (switches and remote control). ARC is a protocol used by devices from HomeEasy, KlikAanKlikUit, ByeByeStandBy, Intertechno, ELRO, AB600, Duewi, DomiaLite and COCO with address code wheels. AC is the protocol used by different brands with units having a learning mode button:
KlikAanKlikUit, NEXA, CHACON, HomeEasy UK.
Note: this module requires the Device::SerialPort or Win32::SerialPort module
if the devices is connected via USB or a serial port.
Define
define <name> TRX <device> [noinit]
USB-connected:
<device> specifies the USB port to communicate with the RFXtrx433 receiver.
Normally on Linux the device will be named /dev/ttyUSBx, where x is a number.
For example /dev/ttyUSB0. Please note that RFXtrx433 normally operates at 38400 baud. You may specify the baudrate used after the @ char.
Example: define RFXTRXUSB TRX /dev/ttyUSB0@38400
Network-connected devices:
<device> specifies the host:port of the device. E.g.
192.168.1.5:10001
noninit is optional and issues that the RFXtrx433 device should not be
initialized. This is useful if you share a RFXtrx433 device via LAN. It is
also useful for testing to simulate a RFXtrx433 receiver via netcat or via
FHEM2FHEM.
longids
Comma separated list of device-types for TRX_WEATHER that should be handled using long IDs. This additional ID is a one byte hex string and is generated by the Oregon sensor when is it powered on. The value seems to be randomly generated. This has the advantage that you may use more than one Oregon sensor of the same type even if it has no switch to set a sensor id. For example the author uses two BTHR918N sensors at the same time. All have different deviceids. The drawback is that the deviceid changes after changing batteries. All devices listed as longids will get an additional one byte hex string appended to the device name.
Default is to use no long IDs.
Examples:
# Do not use any long IDs for any devices (this is default):
attr RFXCOMUSB longids 0
# Use long IDs for all devices:
attr RFXCOMUSB longids 1
# Use longids for BTHR918N devices.
# Will generate devices names like BTHR918N_f3.
attr RFXTRXUSB longids BTHR918N
# Use longids for TX3_T and TX3_H devices.
# Will generate devices names like TX3_T_07, TX3_T_01 ,TX3_H_07.
attr RFXTRXUSB longids TX3_T,TX3_H
rssi
1: enable RSSI logging, 0: disable RSSI logging
Default is no RSSI logging.
Examples:
# Do log rssi values (this is default):
attr RFXCOMUSB rssi 0
# Enable rssi logging for devices:
attr RFXCOMUSB rssi 1
TRX_ELSE
The TRX_ELSE module is invoked by TRX if a code is received by RFXCOM RFXtrx433 RF receiver that is currently not handled by a TRX_-Module. You need to define an RFXtrx433 receiver first.
See TRX.
Define
define <name> TRX_ELSE <hextype>
<hextype>
specifies the hexvalue (00 - ff) of the type received by the RFXtrx433 transceiver.
Example: define TRX_UNKNOWN_9A TRX_ELSE 9A
TRX_LIGHT
The TRX_LIGHT module receives and sends X10, ARC, ELRO AB400D, Waveman, Chacon EMW200, IMPULS, RisingSun, AC, HomeEasy EU and ANSLUT lighting devices (switches and remote control). Allows to send Philips SBC (receive not possible). ARC is a protocol used by devices from HomeEasy, KlikAanKlikUit, ByeByeStandBy, Intertechno, ELRO, AB600, Duewi, DomiaLite and COCO with address code wheels. AC is the protocol used by different brands with units having a learning mode button:
KlikAanKlikUit, NEXA, CHACON, HomeEasy UK. You need to define an RFXtrx433 transceiver receiver first.
See TRX.
specifies the type of the device:
Lighting devices:
MS14A (X10 motion sensor. Reports [normal|alert] on the first deviceid (motion sensor) and [on|off] for the second deviceid (light sensor))
X10 (All other x10 devices. Report [off|on|dim|bright|all_off|all_on] on both deviceids.)
ARC (ARC devices. ARC is a protocol used by devices from HomeEasy, KlikAanKlikUit, ByeByeStandBy, Intertechno, ELRO, AB600, Duewi, DomiaLite and COCO with address code wheels. Report [off|on|all_off|all_on|chime].)
AC (AC devices. AC is the protocol used by different brands with units having a learning mode button: KlikAanKlikUit, NEXA, CHACON, HomeEasy UK. Report [off|on|level <NUM>|all_off|all_on|all_level <NUM>].)
HOMEEASY (HomeEasy EU devices. Report [off|on|level|all_off|all_on|all_level].)
PT2262 (Devices using PT2262/PT2272 (coder/decoder) chip. To use this enable Lighting4 in RFXmngr. Please note that this disables ARC. For more information see FHEM-Wiki)
specifies the first device id of the device.
A lighting device normally has a house code A..P followed by a unitcode 1..16 (example "B1").
For AC, HomeEasy EU and ANSLUT it is a 10 Character-Hex-String for the deviceid, consisting of
- unid-id: 8-Char-Hex: 00000001 to 03FFFFFF
- unit-code: 2-Char-Hex: 01 to 10
For LIGHTWAVERF, EMW100, BBSB, MDREMOTE, RSL2, LIVOLO and TRC02 it is a 8 Character-Hex-String for the deviceid, consisting of
- unid-id: 8-Char-Hex: 000001 to FFFFFF
- unit-code: 2-Char-Hex: 01 to 10
For RFY and RFY-ext it is a 8 Character-Hex-String for the deviceid, consisting of
- unid-id: 8-Char-Hex: 000001 to FFFFFF
- unit-code: 2-Char-Hex: 01 to 04 for RFY (00 for all units) and 00 to 0F for RFY_ext
<devicelog>
is the name of the Reading used to report. Suggested: "motion" for motion sensors. If you use "none" then no additional Reading is reported. Just the state is used to report the change.
<deviceid2>
is optional and specifies the second device id of the device if it exists. For example ms14a motion sensors report motion status on the first deviceid and the status of the light sensor on the second deviceid.
<devicelog2>
is optional for the name used for the Reading of <deviceid2>.If you use "none" then no addional Reading is reported. Just the state is used to report the change.
<commandcodes>
is used for PT2262 and specifies the possible base4 digits for the command separated by : and a string that specifies a string that is the command. Example '0:off,1:on'.
off
on
dim # only for X10, KOPPLA
bright # only for X10, KOPPLA
all_off # only for X10, ARC, EMW200, AC, HOMEEASY, ANSLUT
all_on # only for X10, ARC, EMW200, AC, HOMEEASY, ANSLUT
chime # only for ARC
level <levelnum> # only AC, HOMEEASY, ANSLUT: set level to <levelnum> (range: 0=0% to 15=100%)
on-till # Special, see the note
on-for-timer # Special, see the note
Example: set Steckdose on
Notes:
on-till requires an absolute time in the "at" format
(HH:MM:SS, HH:MM) or { <perl code> }, where the perl code
returns a time specification).
If the current time is greater than the specified time, then the
command is ignored, else an "on" command is generated, and for the
given "till-time" an off command is scheduleld via the at command.
on-for-timer requires a relative time in the "at" format
(HH:MM:SS, HH:MM) or { <perl code> }, where the perl code
returns a time specification).
The TRX_SECURITY module interprets X10, KD101 and Visonic security sensors received by a RFXCOM RFXtrx433 RF receiver. You need to define an RFXtrx433 receiver first. See TRX.
DS10A (X10 security ds10a Door/Window Sensor or compatible devices. This device type reports the status of the switch [Open/Closed], status of the delay switch [min|max]], and battery status [ok|low].)
MS10A (X10 security ms10a motion sensor. This device type reports the status of motion sensor [normal|alert] and battery status [ok|low].))
SD90 (Marmitek sd90 smoke detector. This device type reports the status of the smoke detector [normal|alert] and battery status [ok|low].)
KR18 (X10 security remote control. Report the Reading "Security" with values [Arm|Disarm], "ButtonA" and "ButtonB" with values [on|off] )
KD101 (KD101 smoke sensor. Report the Reading "smoke" with values [normal|alert])
VISONIC_WINDOW (VISONIC security Door/Window Sensor or compatible devices. This device type reports the status of the switch [Open/Closed] and battery status [ok|low].)
VISONIC_MOTION (VISONIC security motion sensor. This device type reports the status of motion sensor [normal|alert] and battery status [ok|low].))
<deviceid>
specifies the first device id of the device. X10 security (DS10A, MS10A) and SD90 have a a 16 bit device id which has to be written as a hex-string (example "5a54"). All other devices have a 24 bit device id.
<devicelog>
is the name of the Reading used to report. Suggested: "Window" or "Door" for ds10a, "motion" for motion sensors, "smoke" for sd90. If you use "none" then no additional Reading is reported. Just the state is used to report the change.
<deviceid2>
is optional and specifies the second device id of the device if it exists. For example sd90 smoke sensors can be configured to report two device ids.
<devicelog2>
is optional for the name used for the Reading of <deviceid2>. If you use "none" then no additional Reading is reported. Just the state is used to report the change.
The TRX_WEATHER module interprets weather sensor messages received by a RTXtrx receiver. See http://www.rfxcom.com/oregon.htm for a list of
Oregon Scientific weather sensors that could be received by the RFXtrx433 tranmitter. You need to define a RFXtrx433 receiver first. See
See TRX.
Define
define <name> TRX_WEATHER <deviceid>
<deviceid>
is the device identifier of the sensor. It consists of the sensors name and (only if the attribute longids is set of the RFXtrx433) an a one byte hex string (00-ff) that identifies the sensor. If an sensor uses an switch to set an additional is then this is also added. The define statement with the deviceid is generated automatically by autocreate. The following sensor names are used:
"THR128" (for THR128/138, THC138),
"THGR132N" (for THC238/268,THN132,THWR288,THRN122,THN122,AW129/131),
"THWR800",
"RTHN318",
"TX3_T" (for LaCrosse TX3, TX4, TX17),
"THGR228N" (for THGN122/123, THGN132, THGR122/228/238/268),
"THGR810",
"RTGR328",
"THGR328",
"WTGR800_T" (for temperature of WTGR800),
"THGR918" (for THGR918, THGRN228, THGN500),
"TFATS34C" (for TFA TS34C),
"BTHR918",
"BTHR918N (for BTHR918N, BTHR968),
"RGR918" (for RGR126/682/918),
"PCR800",
"TFA_RAIN" (for TFA rain sensor),
"WTGR800_A" (for wind sensor of WTGR800),
"WGR800" (for wind sensor of WGR800),
"WGR918" (for wind sensor of STR918 and WGR918),
"TFA_WIND" (for TFA wind sensor),
"BWR101" (for Oregon Scientific BWR101),
"GR101" (for Oregon Scientific GR101)
is the device identifier of the energy sensor. It consists of the sensors name and (only if the attribute longids is set of the RFXtrx433) an a two byte hex string (0000-ffff) that identifies the sensor. The define statement with the deviceid is generated automatically by autocreate. The following sensor names are used:
"CM160" (for OWL CM119 or CM160),
"CM180" (for OWL CM180),
"CM180i"(for OWL CM180i),
The following Readings are generated:
"energy_current:":
Only for CM160 and CM180: current usage in Watt. If <scale_current> is defined the result is: energy_current * <scale_current>.
"energy_chx:":
Only for CM180i (where chx is ch1, ch2 or ch3): current usage in Ampere. If <scale_current> is defined the result is: energy_chx * <scale_current>.
"energy_total:":
current usage in kWh. If scale_total and add_total is defined the result is: energy_total * <scale_total> + <add_total>.
The TUL module is the representation of a EIB / KNX connector in FHEM.
EIB instances represent the EIB / KNX devices and will need a TUL as IODev to communicate with the EIB / KNX network.
The TUL module is designed to connect to EIB network either using EIBD or the TUL usb stick created by busware.de
Note: this module may require the Device::SerialPort or Win32::SerialPort
module if you attach the device via USB and the OS sets strange default
parameters for serial devices.
Define
define <name> TUL <device> <physical address>
TUL usb stick / TPUART serial devices:
<device> specifies the serial port to communicate with the TUL.
The name of the serial-device depends on your distribution, under
linux the cdc_acm kernel module is responsible, and usually a
/dev/ttyACM0 device will be created. If your distribution does not have a
cdc_acm module, you can force usbserial to handle the TUL by the
following command:
modprobe usbserial vendor=0x03eb
product=0x204b
In this case the device is most probably
/dev/ttyUSB0.
You can also specify a baudrate if the device name contains the @
character, e.g.: /dev/ttyACM0@19200
Note: For TUL usb stick the baudrate 19200 is needed and this is the default
when no baudrate is given.
Example: define tul TUL tul:/dev/ttyACM0 1.1.249
EIBD:
<device> specifies the host:port of the eibd device. E.g.
eibd:192.168.0.244:2323. When using the standard port, the port can be omitted.
Example: define tul TUL eibd:localhost 1.1.249
If the device is called none, then no device will be opened, so you
can experiment without hardware attached.
The physical address is used as the source address of telegrams sent to EIB network.
ID: 4 digit ID displayed at techem or 8 digit as printed on bill
speaking name: (optional) human readable identification
Readings
current_period: meter data for current billing period
unit-less data, cumulated since start of the current billing period. The reading will be updated once a day, after receiving the first update. Reading time will reflect the time of data (not the time where they were received)
previous_period: meter data for last billing period
unit-less data, sum of the last billing period. The reading will be updated only if a new billing period starts. Reading time will reflect the last day of previous billing period (not the time where they were received)
temp1: ambient temperature
temp2: heater surface temperature
Internals
friendly: human readable identification of meter as specified by define
longID: 8 digit id of meter
TechemWZ
This module reads the transmission of techem volume data meter. Currently supported device:
Messkapsel-Wasserzähler radio 3 (cold, warm water)
Messkapsel-Wärmemengenzähler compact V (heating energy)
It will display
meter data for current billing period
meter data for previous billing period including date of request
cumulative meter data
It will require a CUL in WMBUS_T mode, although the CUL may temporary set into that mode.
The module keeps track of the CUL rfmode.
preliminary
Techem volume data meter does not transmit their printed meter ID. Instead they transmit the ID of the build in radio module.
Therefore a "list-mode" is available which collects all Techem meter device in range to help you find out the right one.
That "list-mode" will be activated by defining a TechemWZ device with id "00000000". Let it run for a while and do a "get <name> list".
You will see a list of available (received) Techem device with their ID and meter data. Choose the right one (keep in mind that the meter reading reflects last midnight), note down their ID and define the appropriate device. After done the device with ID "00000000" can be removed.
speaking name: (optional) human readable identification
Readings
current_period: meter data for current billing period
cumulated since the start of the current billing period. The reading will be updated once a day, after receiving the first update. Reading time will reflect the time of data (not the time where the data were received)
previous_period: meter data for last billing period
meter rading at the end of the last billing period. The reading will be updated if a new billing period starts. Reading time will reflect the last day of previous billing period (not the time where the data were received)
meter: cumulative meter data.
The same data that will be shown at the Techem (mechanical) display
Get
list: print a list of available (received) Techem device with their ID and meter data
only available if device ID is "00000000" (list-mode)
Internals
friendly: human readable identification of meter as specified by define
TelegramBot
The TelegramBot module allows the usage of the instant messaging service Telegram from FHEM in both directions (sending and receiving).
So FHEM can use telegram for notifications of states or alerts, general informations and actions can be triggered.
TelegramBot makes use of the telegram bot api and does NOT rely on any addition local client installed.
Telegram Bots are different from normal telegram accounts, without being connected to a phone number. Instead bots need to be registered through the
botfather to gain the needed token for authorizing as bot with telegram.org.
The token (e.g. something like 110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw is required for defining a working telegram bot in fhem.
Bots also differ in other aspects from normal telegram accounts. Here some examples:
Bots can not initiate connections to arbitrary users, instead users need to first initiate the communication with the bot.
Bots have a different privacy setting then normal users (see Privacy mode)
Bots support commands and specialized keyboards for the interaction (not yet supported in the fhem telegramBot)
Note:
This module requires the perl JSON module.
Please install the module (e.g. with sudo apt-get install libjson-perl) or the correct method for the underlying platform/system.
The attribute pollingTimeout needs to be set to a value greater than zero, to define the interval of receiving messages (if not set or set to 0, no messages will be received!)
The TelegramBot module allows receiving of (text) messages from any peer (telegram user) and can send text messages to known users.
The contacts/peers, that are known to the bot are stored in a reading (named Contacts) and also internally in the module in a hashed list to allow the usage
of contact ids and also full names and usernames. Contact ids are made up from only digits, user names are prefixed with a @, group names are prefixed with a #.
All other names will be considered as full names of contacts. Here any spaces in the name need to be replaced by underscores (_).
Each contact is considered a triple of contact id, full name (spaces replaced by underscores) and username or groupname prefixed by @ respectively #.
The three parts are separated by a colon (:).
Contacts are collected automatically during communication by new users contacting the bot or users mentioned in messages.
Updates and messages are received via long poll of the GetUpdates message. This message currently supports a maximum of 20 sec long poll.
In case of failures delays are taken between new calls of GetUpdates. In this case there might be increasing delays between sending and receiving messages!
Define
define <name> TelegramBot <token>
Defines a TelegramBot device using the specified token perceived from botfather
message|msg [@<peer>] <text> Sends the given message to the given peer or if peer is ommitted currently defined default peer user. If a peer is given it needs to be always prefixed with a '@'. Peers can be specified as contact ids, full names (with underscore instead of space), usernames (prefixed with another @) or chat names (also known as groups in telegram groups must be prefixed with #).
Messages do not need to be quoted if containing spaces.
Examples:
set aTelegramBotDevice message @@someusername a message to be sent
to send to a user having someusername as username (not first and last name) in telegram
set aTelegramBotDevice message @Ralf_Mustermann another message
to send to a user Ralf as firstname and Mustermann as last name in telegram
set aTelegramBotDevice message @#justchatting Hello
to send the message "Hello" to a chat with the name "justchatting"
set aTelegramBotDevice message @1234567 Bye
to send the message "Bye" to a contact or chat with the id "1234567". Chat ids might be negative and need to be specified with a leading hyphen (-).
sendImage [@<peer>] <file> [<caption>] Sends a photo to the given or if ommitted to the default peer.
File is specifying a filename and path to the image file to be send.
Local paths should be given local to the root directory of fhem (the directory of fhem.pl e.g. /opt/fhem).
filenames containing spaces need to be given in parentheses.
Rule for specifying peers are the same as for messages. Captions can also contain multiple words and do not need to be quoted.
replaceContacts <text> Set the contacts newly from a string. Multiple contacts can be separated by a space.
Each contact needs to be specified as a triple of contact id, full name and user name as explained above.
reset Reset the internal state of the telegram bot. This is normally not needed, but can be used to reset the used URL,
internal contact handling, queue of send items and polling
ATTENTION: Messages that might be queued on the telegram server side (especially commands) might be then worked off afterwards immedately.
If in doubt it is recommened to temporarily deactivate (delete) the cmdKeyword attribute before resetting.
DEPRECATED: sendImageTo <peer> <file> [<caption>] Sends a photo to the given peer,
other arguments are handled as with sendPhoto
DEPRECATED: messageTo <peer> <text> Sends the given message to the given peer.
Peer needs to be given without space or other separator, i.e. spaces should be replaced by underscore (e.g. first_last)
Attributes
defaultPeer <name> Specify contact id, user name or full name of the default peer to be used for sending messages.
defaultPeerCopy <1 (default) or 0> Copy all command results also to the defined defaultPeer. If set results are sent both to the requestor and the defaultPeer if they are different.
cmdKeyword <keyword> Specify a specific text that needs to be sent to make the rest of the message being executed as a command.
So if for example cmdKeyword is set to ok fhem then a message starting with this string will be executed as fhem command
(see also cmdTriggerOnly).
Please also consider cmdRestrictedPeer for restricting access to this feature!
Example: If this attribute is set to a value of ok fhem a message of ok fhem attr telegram room IM
send to the bot would execute the command attr telegram room IM and set a device called telegram into room IM.
The result of the cmd is sent to the requestor and in addition (if different) always sent also as message to the defaultPeer
cmdSentCommands <keyword> Specify a specific text that will trigger sending the last commands back to the sender
Example: If this attribute is set to a value of last cmd a message of last cmd
woud lead to a reply with the list of the last sent fhem commands will be sent back.
Please also consider cmdRestrictedPeer for restricting access to this feature!
cmdFavorites <keyword> Specify a specific text that will trigger sending the list of defined favorites or executes a given favorite by number (the favorites are defined in attribute favorites).
Example: If this attribute is set to a value of favorite a message of favorite to the bot will return a list of defined favorite commands and their index number. In the same case the message favorite <n> (with n being a number) would execute the command that is the n-th command in the favorites list. The result of the command will be returned as in other command executions.
Please also consider cmdRestrictedPeer for restricting access to this feature!
favorites <list of commands> Specify a list of favorite commands for Fhem (without cmdKeyword). Multiple commands are separated by semicolon (;). This also means that only simple commands (without embedded semicolon) can be defined.
cmdRestrictedPeer <peername(s)> Restrict the execution of commands only to messages sent from the given peername or multiple peernames
(specified in the form of contact id, username or full name, multiple peers to be separated by a space).
A message with the cmd and sender is sent to the default peer in case of another user trying to sent messages
cmdTriggerOnly <0 or 1> Restrict the execution of commands only to trigger command. If this attr is set (value 1), then only the name of the trigger even has to be given (i.e. without the preceding statement trigger).
So if for example cmdKeyword is set to ok fhem and cmdTriggerOnly is set, then a message of ok fhem someMacro would execute the fhem command trigger someMacro.
pollingTimeout <number> Used to specify the timeout for long polling of updates. A value of 0 is switching off any long poll.
In this case no updates are automatically received and therefore also no messages can be received.
As of now the long poll timeout is limited to a maximium of 20 sec, longer values will be ignored from the telegram service.
maxFileSize <number of bytes> Maximum file size in bytes for transfer of files (images). If not set the internal limit is specified as 10MB (10485760B).
Contacts <text> The current list of contacts known to the telegram bot.
Each contact is specified as a triple in the same form as described above. Multiple contacts separated by a space.
msgId <text> The id of the last received message is stored in this reading.
For secret chats a value of -1 will be given, since the msgIds of secret messages are not part of the consecutive numbering
msgPeer <text> The sender name of the last received message (either full name or if not available @username)
msgPeerId <text> The sender id of the last received message
msgText <text> The last received message text is stored in this reading.
prevMsgId <text> The id of the SECOND last received message is stored in this reading
prevMsgPeer <text> The sender name of the SECOND last received message (either full name or if not available @username)
prevMsgPeerId <text> The sender id of the SECOND last received message
prevMsgText <text> The SECOND last received message text is stored in this reading
StoredCommands <text> A list of the last commands executed through TelegramBot. Maximum 10 commands are stored.
Examples
Send a telegram message if fhem has been newly started
define notify_fhem_reload notify global:INITIALIZED set <telegrambot> message fhem newly started - just now !
Allow telegram bot commands to be used
If the keywords for commands are starting with a slash (/), the corresponding commands can be also defined with the Bot Father. So if a slash is typed a list of the commands will be automatically shown.
Assuming that cmdSentCommands is set to /History. Then you can initiate the communication with the botfather, select the right bot and then with the command /setcommands define one or more commands like
History-Show a history of the last 10 executed commands
When typing a slash, then the text above will immediately show up in the client.
TellStick
Define
define <name> TellStick </path/to/tdtool>
Defines a path to the program "tdtool", which is used to control a (locally attached)
"Telldus TellStick [Duo]" USB device. A TellStick controls a wide range of 433 MHz
devices, like the widely available switchable power outlets from InterTechno.
To keep things simple, FHEM interfaces with the telldus-core suite (available
for Linux, Windows, Mac OSX) via the supplied tool, "tdtool". This FHEM module
will initially use "tdtool --list" to receive a list of configured devices, then let
autocreate (if enabled) create them as SIS_PMS devices. Please make sure that the user running FHEM under ("fhem" in a standard setup on
Linux) has the r/w-right to access the stick's device ("/dev/tellstick"
in telldus-core version 2.0) — if the state of your devices do not change when
modified im FHEM, access rights problems are the most probable cause
(chmod o+rw /dev/tellstick should fix that; you may want to automate it
via udev or adding the fhem user to the proper group ;))
This module has only been tested with the 2.0 branch of teldus-core because of a known bug
in 2.1, preventing
version 2.1 working properly with some TellSticks and/or "tdtool" application; FTR, the
"Batch: 8" version a was granted usage of for writing this module was impacted by it ...
To actually control any power sockets, you need to define a SIS_PMS
device — TellStick.pm uses SIS_PMS devices ("socket" is te:ll:st:ck:01, "socketnr"
is the ID of the device in "tdtool"), as as of now only on/off switching is supported and
this was the easiest implementation path. SIS_PMS is supported by andFHEM, the Android
frontend, so this make some sense. (Furthermore, I don't own dimmable devices and they are
actually not really cheap; >15 EUR/socket compared to the 15 EUR for 5 switch-only, non-self
learning socket adapters from Intertechno at your local home improvement store.)
This module converts any text into speech with serveral possible providers. The Device can be defined as locally
or remote device.
Local Device
The output will be send to any connected audiodevice. For example external speakers connected per jack
or with bluetooth speakers - connected per bluetooth dongle. Its important to install mplayer. apt-get install mplayer
The given alsadevice has to be configured in /etc/asound.conf
Special AlsaDevice: none
The internal mplayer command will be without any audio directive if the given alsadevice is none.
In this case mplayer is using the standard audiodevice.
This module can configured as remote-device for client-server Environments. The Client has to be configured
as local device.
Notice: the Name of the locally instance has to be the same!
Host: setting up IP-adress
PortNr: setting up TelnetPort of FHEM; default: 7072
SSL: setting up if connect over SSL; default: no SSL
PortPassword: setting up the configured target telnet passwort
tts:
Giving a text to translate into audio. You play set mp3-files directly. In this case you have to enclosure them with a single colon before and after the declaration.
The files must save under the directory of given TTS_FileTemplateDir.
Please note: The text doesn´t have any colons itself.
volume:
Setting up the volume audio response.
Notice: Only available in locally instances!
Get
N/A
Attributes
TTS_Delemiter
optional: By using the google engine, its not possible to convert more than 100 characters in a single audio brick.
With a delemiter the audio brick will be split at this character. A delemiter must be a single character.!
By default, ech audio brick will be split at sentence end. Is a single sentence longer than 100 characters,
the sentence will be split additionally at comma, semicolon and the word and.
Notice: Only available in locally instances with Google engine!
TTS_Ressource
optional: Selection of the Translator Engine
Notice: Only available in locally instances!
Google
Using the Google Engine. It´s nessessary to have internet access. This engine is the recommend engine
because the quality is fantastic. This engine is using by default.
VoiceRSS
Using the VoiceRSS Engine. Its a free engine till 350 requests per day. If you need more, you have to pay.
It´s nessessary to have internet access. This engine is the 2nd recommend engine
because the quality is also fantastic. To use this engine you need an APIKey (see TTS_APIKey)
ESpeak
Using the ESpeak Engine. Installation Espeak and lame is required. apt-get install espeak lame
SVOX-pico
Using the SVOX-Pico TTS-Engine (from the AOSP).
Installation of the engine and lame is required: sudo apt-get install libttspico-utils lame
On ARM/Raspbian the package libttspico-utils,
so you may have to compile it yourself or use the precompiled package from this guide, in short: sudo apt-get install libpopt-dev lame cd /tmp wget http://www.dr-bischoff.de/raspi/pico2wave.deb sudo dpkg --install pico2wave.deb
TTS_APIKey
An APIKey its needed if you want to use VoiceRSS. You have to register at the following page:
http://www.voicerss.org/registration.aspx
After this, you will get your personal APIKey.
TTS_User
Actual without any usage. Needed in case if a TTS Engine need an username and an apikey for each request.
TTS_CacheFileDir
optional: The downloaded Goole audio bricks are saved in this folder for reusing.
No automatically implemented deleting are available.
Default: cache/
Notice: Only available in locally instances!
TTS_UseMP3Wrap
optional: To become a liquid audio response its recommend to use the tool mp3wrap.
Each downloaded audio bricks are concatinated to a single audio file to play with mplayer.
Installtion of the mp3wrap source is required. apt-get install mp3wrap
Notice: Only available in locally instances!
TTS_MplayerCall
optional: Setting up the Mplayer system call. The following example is default.
Example: sudo /usr/bin/mplayer
TTS_SentenceAppendix
Optional: Definition of one mp3-file to append each time of audio response.
Using of Mp3Wrap is required. The audio bricks has to be downloaded before into CacheFileDir.
Example: silence.mp3
TTS_FileMapping
Definition of mp3files with a custom templatedefinition. Separated by space.
All templatedefinitions can used in audiobricks by tts.
The definition must begin and end with e colon.
The mp3files must saved in the given directory by TTS_FIleTemplateDir. attr myTTS TTS_FileMapping ring:ringtone.mp3 beep:MyBeep.mp3 set MyTTS tts Attention: This is my ringtone :ring: Its loud?
TTS_FileTemplateDir
Directory to save all mp3-files are defined in TTS_FileMapping und TTS_SentenceAppendix
Optional, Default: cache/templates
disable
If this attribute is activated, the soundoutput will be disabled.
Possible values: 0 => not disabled , 1 => disabled
Default Value is 0 (not disabled)
verbose 4: each step will be logged 5: Additionally the individual debug informations from mplayer and mp3wrap will be logged
Beispiele
define MyTTS Text2Speech hw=0.0 set MyTTS tts Die Alarmanlage ist bereit. set MyTTS tts :beep.mp3: set MyTTS tts :mytemplates/alarm.mp3:Die Alarmanlage ist bereit.:ring.mp3:
Defines a virtual device for Twilight calculations
latitude, longitude
The parameters latitude and longitude are decimal numbers which give the position on earth for which the twilight states shall be calculated.
indoor_horizon
The parameter indoor_horizon gives a virtual horizon higher than 0, that shall be used for calculation of indoor twilight (typical values are between 0 and 6)
Weather_Position
The parameter Weather_Position is the yahoo weather id used for getting the weather condition. Go to http://weather.yahoo.com/ and enter a city or zip code. In the upcoming webpage, the id is a the end of the URL. Example: Munich, Germany -> 676757
A Twilight device periodically calculates the times of different twilight phases throughout the day.
It calculates a virtual "light" element, that gives an indicator about the amount of the current daylight.
Besides the location on earth it is influenced by a so called "indoor horizon" (e.g. if there are high buildings, mountains) as well as by weather conditions. Very bad weather conditions lead to a reduced daylight for nearly the whole day.
The light calculated spans between 0 and 6, where the values mean the following:
light 0 - total night, sun is at least -18 degree below horizon 1 - astronomical twilight, sun is between -12 and -18 degree below horizon 2 - nautical twilight, sun is between -6 and -12 degree below horizon 3 - civil twilight, sun is between 0 and -6 degree below horizon 4 - indoor twilight, sun is between the indoor_horizon and 0 degree below horizon (not used if indoor_horizon=0) 5 - weather twilight, sun is between indoor_horizon and a virtual weather horizon (the weather horizon depends on weather conditions (optional) 6 - maximum daylight
Azimut, Elevation, Twilight
The module calculates additionally the azimuth and the elevation of the sun. The values can be used to control a roller shutter.
As a new (twi)light value the reading Twilight ist added. It is derived from the elevation of the sun with the formula: (Elevation+12)/18 * 100). The value allows a more detailed
control of any lamp during the sunrise/sunset phase. The value ist betwenn 0% and 100% when the elevation is between -12° and 6°.
You must know, that depending on the latitude, the sun will not reach any elevation. In june/july the sun never falls in middle europe
below -18°. In more northern countries(norway ...) the sun may not go below 0°.
Any control depending on the value of Twilight must
consider these aspects.
the time when the next event will probably happen (during light phase 5 and 6 this is updated when weather conditions change
sr_astro
time of astronomical sunrise
sr_naut
time of nautical sunrise
sr_civil
time of civil sunrise
sr
time of sunrise
sr_indoor
time of indoor sunrise
sr_weather
time of weather sunrise
ss_weather
time of weather sunset
ss_indoor
time of indoor sunset
ss
time of sunset
ss_civil
time of civil sunset
ss_nautic
time of nautic sunset
ss_astro
time of astro sunset
azimuth
the current azimuth of the sun 0° ist north 180° is south
compasspoint
a textual representation of the compass point
elevation
the elevaltion of the sun
twilight
a percetal value of a new (twi)light value: (elevation+12)/18 * 100)
twilight_weather
a percetal value of a new (twi)light value: (elevation-WEATHER_HORIZON+12)/18 * 100). So if there is weather, it
is always a little bit darker than by fair weather
condition
the yahoo condition weather code
condition_txt
the yahoo condition weather code as textual representation
use data from other devices to calculate twilight_weather.
The reading used shoud be in the range of 0 to 100 like the reading c_clouds in an openweathermap device, where 0 is clear sky and 100 are overcast clouds.
With the use of this attribute weather effects like heavy rain or thunderstorms are neglegted for the calculation of the twilight_weather reading.
Functions
twilight($twilight, $reading, $min, $max)
- implements a routine to compute the twilighttimes like sunrise with min max values.
$twilight
name of the twilight instance
$reading
name of the reading to use example: ss_astro, ss_weather ...
$min
parameter min time - optional
$max
parameter max time - optional
UNIRoll
The protocol is used by the Lott UNIROLL R-23700 reciever. The radio
(868.35 MHz) messages are either received through an FHZ
or an CUL device, so this must be defined first.
Recieving sender messages is not integrated jet.
The CUL has to allow working with zero synchbits at the beginning of a raw-message.
This is possible with culfw 1.49 or higher.
The values of devicegroup address (similar to the housecode) and device address (button)
has to be defined as hexadecimal value.
There is no master or group code integrated.
<devicecode> is a 4 digit hex number,
corresponding to the housecode address.
<channel> is a 1 digit hex number,
corresponding to a button of the transmitter.
Example:
define roll UNIRoll 7777 0
Set
set <name> <value> [<time>]
where value is one of:
up
stop
down
pos (The attribute useRolloPos has to be set to 1 to use this.)
[<time>] in seconds for up, down or pos
Examples:
set roll up set roll up 10 set roll1,roll2,roll3 up set roll1-roll3 up
Get
N/A
Attributes
IODev
Set the IO or physical device which should be used for sending signals
for this "logical" device. An example for the physical device is an FHZ
or a CUL. The device will not work without this entry.
eventMap
Replace event names and set arguments. The value of this attribute
consists of a list of space separated values, each value is a colon
separated pair. The first part specifies the "old" value, the second
the new/desired value. If the first character is slash(/) or komma(,)
then split not by space but by this character, enabling to embed spaces.
Examples:
attr device eventMap up:open down:closed
set device open
sendStopBeforeCmd <value>
Before any up/down-command a stop-command will be sent to stop a random
operation. This might cause failure in some situations. This attribute
can be used to switch off the stop-command by setting it to these values.
where value is one of:
1 - send always stop (default)
0 - send no stop
2 - send stop only before up
3 - send stop only before down
useRolloPos <value>
The position of each device can be stored. By this it is possible to move from
any position to any other position. As this feature is software-based, a
manual operation will not be recognized. To set the device into a definite
state, a up or down command will reset the counter for the position.
where value is one of:
1 - RolloPos will be used
0 - RolloPos is not used (default)
These attributes will be created automatical if useRolloPos is set to 1.
They will not be deleted, if the value is set to 0 or the attribut is deleted.
rMin - Time in seconds for the topmost position
rMax - Time in seconds until the device is fully closed
rPos - This is an internal value and must not be changed!
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.
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:
Receiver/Actor: there is only one reciever: R_23700
USBWX
The USBWX module interprets the messages received by the ELV USB-WDE1
weather receiver. This receiver is compaptible with the following ELV sensors:
KS200/KS300, S300IA, S300TH, ASH2200, PS50. It also known to work with Conrad
weather sensors KS555, S555TH and ASH555. This module was tested with ELV
S300TH, ELV ASH2200, ELV KS300, Conrad S555TH and Conrad KS555. Readings
and STATE of temperature/humidity sensors are compatible with the CUL_WS
module. For KS300/KS555 sensors STATE is compatible with the KS300 module. The
module is integrated into autocreate to generate the appropriate filelogs and
weblinks automatically.
Note: this module requires the Device::SerialPort or Win32::SerialPort module
if the devices is connected via USB or a serial port.
Define
define <name> USBWX <serial device>
Defines USB-WDE1 attached via usb.
define <name> USBWX <code> [corr1...corr4]
<code> is the code which must be set on the sensor. Valid values
are 1 through 8. 9 is used as the sensor id of the ks300 sensor.
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.
Fhem can receive your tank's fill level from the USF1000S device
through a FHZ device, so one must be defined first.
The state contains the fill level in % (lower case v in the device state)
and the current volume in liters (upper case V in the device state).
Measured distance to the liquid's surface, fill level, volume and warnings
(Test mode, Battery low) are available. Due to the design of the USF1000S
protocol, you can have only one USF1000S in range of your FHZ as these
devices cannot be distinguished.
Define
define <name> USF1000 <geometry>
<geometry> determines the form of the tank and the
position of the sensor. The following geometries are currently
supported:
cub <length> <width> <height> <offset>
cylv <diameter> <height> <offset>
cub stands for a cuboid whose base is <length> × <width>.
cylv stands for a vertical cylinder whose diameter is <diameter>.
<height> is the distance of the surface of the liquid from the ground
if the tank is full. <offset> is the distance of the sensor relative to
the surface of the liquid. All quantities are expressed in meters.
Example:
define MyTank USF1000 cylv 2 1 0.3: a cylindrical water tank with
2 meters diameter. The water stands 1 meter high if the tank is full. The
sensor is fixed 1,3 meters above ground.
FHEM module for the Ubiquiti mFi mPower modules
Please read also the Wiki at http://www.fhemwiki.de/wiki/Ubiquit_mFi/mPower
FHEM Forum : http://forum.fhem.de/index.php/topic,35722.0.html
Define
define <name> UbiquitiMP <IP or FQDN>
example :
define myPM UbiquitiMP 192.168.0.100
define myPM UbiquitiMP myhost.dyndns.org
Perl Net::Telnet and JSON module are required. On a Raspberry you can install them with :
apt-get install libjson-perl
apt-get install libnet-telnet-perl
Set
Outx on / off (force) -> turns Port x on or off
Outx toggle -> toggle port
Outx lock / unlock -> protects port to switch port on/off
Outx reset -> reset power counter for this port
Outx enable / disable -> power counting for this port
Get
status -> returns the status of all Outs
info -> returns some internal informations of the device
reboot -> reboot the device
Attributes
ignoreList -> list of ignored ports e.g. attr name ignoreList 456 ignores all values of ports 4,5 & 6
groupPorts -> space separeted list to group ports so you can use them like a single device
e.g. attr name groupPorts TV=12 Media=4,5,6 (GroupName=Port numbers in the group)
set name TV on or set name Media toggle
ledconnect -> led color since fhem connect
subDevices -> use a single sub devices for each out port
(default 1 for the 3 and 6 port mPower, default 0 for the mPower mini) requires 98_UbiquitiOut.pm
interval -> polling interval in seconds, set to 0 to disable polling (default 300)
timeout -> seconds to wait for a answer from the Power Module (default 5 seconds)
user -> defined user on the Power Module (default ubnt)
Unifi is the FHEM module for the Ubiquiti Networks (UBNT) - Unifi Controller.
e.g. you can use the 'presence' function, which will tell you if a device is connected to your WLAN (even in PowerSave Mode!).
Immediately after connecting to your WLAN it will set the device-reading to 'connected' and about 5 minutes after leaving your WLAN it will set the reading to 'disconnected'.
The device will be still connected, even it is in PowerSave-Mode. (In this mode the devices are not pingable, but the connection to the unifi-controller does not break off.)
Or you can use the other readings or set and get features to control your unifi-controller, accesspoints and wlan-clients.
Prerequisites
The Perl module JSON is required.
On Debian/Raspbian: apt-get install libjson-perl
Via CPAN: cpan install JSON
The port of your unifi-controller. Normally it's 8443 or 443.
<username>:
The Username to log on.
<password>:
The password to log on.
[<interval>]:
(optional without <siteID> and <version>)
Interval to fetch the information from the unifi-api.
default: 30 seconds
[<siteID>]:
(optional without <version>)
You can find the site-ID by selecting the site in the UniFi web interface.
e.g. https://192.168.12.13:8443/manage/s/foobar the siteId you must use is: foobar.
default: default
[<version>]:
(optional if you use unifi v4)
Unifi-controller version.
Version must be specified if version is not 4. At the moment version 3 and 4 are supported.
default: 4
Or with optional parameters <interval>, <siteID> and <version>: define my_unifi_controller Unifi 192.168.1.15 443 admin secret 30 default 3
Set
Note: Some setters are not available if controller is not connected, or no data is available for them.
set <name> update
Makes immediately a manual update.
set <name> clear <readings|clientData|all>
Clears the readings, clientData or all.
set <name> archiveAlerts
Archive all unarchived Alerts.
set <name> disconnectClient <all|user_id|controllerAlias|hostname|devAlias>
Disconnect one ore all clients.
set <name> restartAP <all|_id|name|ip>
Restart one ore all accesspoints.
set <name> setLocateAP <all|_id|name|ip>
Start 'locate' on one or all accesspoints.
set <name> unsetLocateAP <all|_id|name|ip>
Stop 'locate' on one or all accesspoints.
Get
Note: Some getters are not available if no data is available for them.
get <name> clientData <all|user_id|controllerAlias|hostname|devAlias>
Show more details about clients.
get <name> events
Show events in specified 'eventPeriod'.
get <name> unarchivedAlerts
Show all unarchived Alerts.
Attributes
attr devAlias
Can be used to rename device names in the format <user_id|controllerAlias|hostname>:Aliasname.
Separate using blank to rename multiple devices.
Example (user_id): attr unifi devAlias 5537d138e4b033c1832c5c84:iPhone-Claudiu
Example (controllerAlias): attr unifi devAlias iPhoneControllerAlias:iPhone-Claudiu
Example (hostname): attr unifi devAlias iphone:iPhone-Claudiu
attr eventPeriod <1...168>
Can be used to configure the time-period (hours) of fetched events from controller. default: 24
attr disable <1|0>
With this attribute you can disable the whole module.
If set to 1 the module will be stopped and no updates are performed.
If set to 0 the automatic updating will performed.
attr verbose 5
This attribute will help you if something does not work as espected.
attr httpLoglevel <1,2,3,4,5>
Can be used to debug the HttpUtils-Module. Set it smaller or equal as your 'global verbose level'. default: 5
Each client has 6 readings for connection-state, SNR, uptime, last_seen-time, connected-AP and hostname.
Each AP has 3 readings for state (can be 'ok' or 'error'), essid's and count of connected-clients.
The unifi-controller has 6 readings for event-count in configured 'timePeriod', unarchived-alert count, accesspoint count, overall wlan-state (can be 'ok', 'warning', or other?), connected user count and connected guest count.
The Unifi-device reading 'state' represents the connection-state to the unifi-controller (can be 'connected', 'disconnected', 'initialized' and 'disabled').
Utils
This is a collection of functions that can be used module-independant
in all your own development Defined functions
abstime2rel("HH:MM:SS") tells you the difference as HH:MM:SS
between now and the argument
ltrim("string") returns string without leading
spaces
max(str1, str2, ...) returns the highest value from a given
list (sorted alphanumeric)
maxNum(num1, num2, ...) returns the highest value from a
given list (sorted numeric)
min(str1, str2, ...) returns the lowest value from a given
list (sorted alphanumeric)
minNum(num1, num2, ...) returns the lowest value from a given
list (sorted numeric)
rtrim("string") returns string without trailing
spaces
time_str2num("YYYY-MM-DD HH:MM:SS") convert a time string to
number of seconds since 1970
trim("string") returns string without leading and without
trailing spaces
UntoggleDirect("deviceName") For devices paired directly,
converts state 'toggle' into 'on' or 'off'
UntoggleIndirect() For devices paired indirectly, switches
the target device 'on' or 'off', also when a 'toggle' was sent from the
source device
defInfo("devspec", "internal") return an array with the
internal values of all devices found with devspec, e.g.
defInfo("TYPE=SVG", "GPLOTFILE").
SVG_time_to_sec("YYYY-MM-DD_HH:MM:SS") converts the argument
to the number of seconds since 1970. Optimized for repeated use of similar
timestamps.
fhemNc("host:port", "textToSend", waitForReturn)
sends textToSend to host:port, and if waitForReturn is set, then read
the answer (wait up to 5 seconds) and return it. Intended as small
nc replacement.
round(value, digits)
round <value> to given digits behind comma
getUniqueId()
return the FHEM uniqueID used by the fheminfo command. Uses the
getKeyValue / setKeyValue functions.
setKeyValue(keyName, value)
store the value in the file $modpath/FHEM/FhemUtils/uniqueID (the name is
used for backward compatibility), or in the database, if using configDB.
value may not contain newlines, and only one value per key is stored.
The file/database entry will be written immediately, no explicit save is
required. If the value is undef, the entry will be deleted.
Returns an error-string or undef.
getKeyValue(keyName)
return ($error, $value), stored previously by setKeyValue.
$error is set if there was an error. Both are undef, if there is no
value yet for this key.
VCONTROL
VCONTROL is a fhem-Modul to control and read information from a VIESSMANN heating via Optolink-adapter.
ADDRESSE
Memory Address leading to the value, the will be read in the memory on the heating.
It is subdivided in 3 parts:
Beginning is fix 01F7 (defines a reading command)
followed by actuak address
followed by number of Bytes to be read.
PARSEMETHODE
Method how to parse the read bytes.
methods so far:
1ByteU : Read value is 1 Byte without algebraic sign (if column Divisor set to state -> only 0 / 1 or off / on)
1ByteS : Read value is 1 Byte with algebraic sign (wenn Spalte Divisor state ist -> nur 0 / 1 also off / on)
2ByteS : Read value is 2 Byte with algebraic sign
2ByteU : Read value is 2 Byte without algebraic sign
2BytePercent : Read value is 2 Byte in percent
4Byte : Read value is 4 Byte
mode : Read value is the actual operating status
timer : Read value is an 8 Byte timer value
date : Read value is an 8 Byte timestamp
POLL Commands unsing the method timer will not be polled permanent, they have to be read by a GET Commando explicitly.
GET <devicename> TIMER
DIVISOR
If the parsed value is multiplied by a factor, you can configure a divisor.
Additionally for values, that just deliver 0 or 1, you can configure state in this column.
This will force the reading to off and on, instead of 0 and 1.
READING-NAME
The read and parsed value will be stored in a reading with this name in the device.
KUMULATION
Accumulated Day values will be automatically stored for polling commands with the value day in the column KUMULATION.
Futhermore there will be stored the values of the last day in additional readings after 00:00.
So you have the chance to plot daily values.
The reading names will be supplemented by DayStart, Today and LastDay!
SET,SETCMD, ADRESSE, CONVMETHODE, NEXT_CMD or DAY for timer
SET
is fix SET
SETCMD
SETCMD are commands that will be used in FHEM to set a value of a device
set <devicename> <setcmd>
e.g. SET <devicename> WW to set the actual operational status to Warm Water processing
ADDRESSE
Memory Address where the value has to be written in the memory of the heating.
It is subdivided in 4 parts:
Beginning is fix 01F4 (defines a writing command)
followed by actual address
followed by number of data-bytes to be written
followed by the data-bytes themselves
There are two Address versions:
Version 1: Value to be set is fix, e.g. Spar Mode on is fix 01
Version 2: Value has to be passed, e.g. warm water temperature
CONVMETHODE
Method how to convert the value with Version 2 in Bytes.
For Version 1 you can use - here.
Methods so far:
1ByteU : Value to be written in 1 Byte without algebraic sign with Version 2 it has to be a number
1ByteS : Value to be written in 1 Byte with algebraic sign with Version 2 it has to be a number
2ByteS : Value to be written in 2 Byte with algebraic sign with Version 2 it has to be a number
2ByteU : Value to be written in 2 Byte without algebraic sign with Version 2 it has to be a number
timer : Value to be written is an 8 Byte Timer value with Version 2 it has to be a string with this structure:
8 times of day comma separeted. (ON1,OFF1,ON2,OFF2,ON3,OFF3,ON4,OFF4)
no time needed ha to be specified with -- .
Minutes of the times are just allowed to thi values: 00,10,20,30,40 or 50
Example: 06:10,12:00,16:00,23:00,--,--,--,--
date : Value to be written is an 8 Byte timestamp with Version 2 it has to be a string with this structure:
format specified is DD.MM.YYYY_HH:MM:SS
Example: 21.03.2014_21:35:00
NEXT_CMD or DAY
This column has two functions:
If this columns is configured with a name of another SETCMD, it will be processed directly afterwards.
Example: after setting Spar Mode on (S-ON), you have to set Party Mode off (P-OFF)
Using timer as CONVMETHODE, so it has to be specified a week day in this columns.
possible values: MO DI MI DO FR SA SO
The values read will be stored in readings, that will be configured as described above.
VIERA
Define
define <name> VIERA <host> [<interval>]
This module controls Panasonic TV device over ethernet. It's possible to
power down the tv, change volume or mute/unmute the TV. Also this modul is simulating
the remote control and you are able to send different command buttons actions of remote control.
The module is tested with Panasonic plasma TV tx-p50vt30e
Defining a VIERA device will schedule an internal task (interval can be set
with optional parameter <interval> in seconds, if not set, the value is 30
seconds), which periodically reads the status of volume and mute status and triggers
notify/filelog commands.
Example:
define myTV1 VIERA 192.168.178.20
define myTV1 VIERA 192.168.178.20 60 #with custom interval of 60 seconds
Remote control (depending on your model, maybe)
For this application the following commands are available:
3D => 3D button
BLUE => Blue
CANCEL => Cancel / Exit
CHG_INPUT => AV
CH_DOWN => Channel down
CH_UP => Channel up
D0 => Digit 0
D1 => Digit 1
D2 => Digit 2
D3 => Digit 3
D4 => Digit 4
D5 => Digit 5
D6 => Digit 6
D7 => Digit 7
D8 => Digit 8
D9 => Digit 9
DISP_MODE => Display mode / Aspect ratio
DOWN => Control DOWN
ENTER => Control Center click / enter
EPG => Guide / EPG
FF => Fast forward
GREEN => Green
HOLD => TTV hold / image freeze
INDEX => TTV index
INFO => Info
INTERNET => VIERA connect
LEFT => Control LEFT
MENU => Menu
MUTE => Mute
PAUSE => Pause
PLAY => Play
POWER => Power off
P_NR => P-NR (Noise reduction)
REC => Record
RED => Red
RETURN => Return
REW => Rewind
RIGHT => Control RIGHT
R_TUNE => Seems to do the same as INFO
SD_CARD => SD-card
SKIP_NEXT => Skip next
SKIP_PREV => Skip previous
STOP => Stop
STTL => STTL / Subtitles
SUBMENU => Option
TEXT => Text / TTV
TV => TV
UP => Control UP
VIERA_LINK => VIERA link
VOLDOWN => Volume down
VOLUP => Volume up
VTOOLS => VIERA tools
YELLOW => Yellow
Example:
set <name> mute on
set <name> volume 20
set <name> remoteControl CH_DOWN
Notes:
Activate volume remotecontrol by DLNA: Menu -> Setup -> Network Setup -> Network Link Settings -> DLNA RemoteVolume -> On
Get
get <name> <what>
Currently, the following commands are defined and return the current state of the TV.
mute
volume
power
presence
Attributes
N/A
Generated events:
volume
mute
presence
power
state
VantagePro2
Note: this module needs the Net::Telnet perl module.
Define
define <name> <ip-address> <port> <delay>
Defines a Davis VantagePro2 weatherstation attached on transparent ethernet/usb|serial server accessable by telnet.
VolumeLink links the volume-level & mute-state from a physical device (e.g. a Philips-TV) with the volume & mute control of a fhem device (e.g. a SONOS-Playbar, Onkyo, Yamaha or Denon Receiver, etc.).
interval to fetch current volume & mute level from physical-device.
<url>:
url to fetch volume & mute level, see Example below. (Example applies to many Philips TV's)
<ampDevice>:
the target fhem-device.
[<timeout>]:
optional: timeout of a http-get. default: 0.5 seconds
[<httpErrorLoglevel>]:
optional: loglevel of http-errors. default: 4
[<httpLoglevel>]:
optional: loglevel of http-messages. default: 5
Example
define tvVolume_LivingRoom VolumeLink 0.2 http://192.168.1.156:1925/5/audio/volume Sonos_LivingRoom set tvVolume_LivingRoom on
Note:
- This example will work out of the box with many Philips TV's and a SONOS-Playbar as fhem-device.
- Pre 2014 Philips TV's use another protocoll, which can be accessed on http://<ip>/1/audio/volume
Set
set <name> <on|off>
Set on or off, to start or to stop.
Get
N/A
Attributes
Note:
- All Attributes takes effect immediately.
- The default value of volumeRegexPattern & muteRegexPattern applies to many Philips-TV's, otherwise it must be configured.
- The default values of amp* applies to a SONOS-Playbar, otherwise it must be configured.
- If you don't receive a result from url, or the lastHttpErrorMessage shows every time 'timed out', try setting attribute 'httpNoShutdown' to 0.
disable <1|0>
With this attribute you can disable the whole module.
If set to 1 the module will be stopped and no volume will be fetched from physical-device or transfer to the amplifier-device.
If set to 0 you can start the module again with: set <name> on.
httpNoShutdown <1|0>
If set to 0 VolumeLink will tell the http-server to explicit close the connection. Default: 1
ampInputReading <value>
Name of the Input-Reading on amplifier-device
To disable the InputCheck if your amplifier-device does not support this, set this attribute to 0. Default (which applies to SONOS-Player's): currentTitle
ampInputReadingVal <RegEx>
RegEx for the Reading value of the corresponding Input-Channel on amplifier-device Default (which applies to a SONOS-Playbar's SPDIF-Input and if no Input is selected): SPDIF-Wiedergabe|^$
ampVolumeReading <value>
Name of the Volume-Reading on amplifier-device Default: Volume
ampVolumeCommand <value>
Command to set the volume on amplifier device Default: Volume
ampMuteReading <value>
Name of the Mute-Reading on amplifier-device Default: Mute
ampMuteReadingOnVal <value>
Reading value if muted Default: 1
ampMuteReadingOffVal <value>
Reading value if not muted Default: 0
ampMuteCommand <value>
Command to mute the amplifier device Default: Mute
volumeRegexPattern <RegEx>
RegEx which is applied to url return data. Must return a number for volume-level. Default (which applies to many Phlips-TV's): current":\s*(\d+)
muteRegexPattern <RegEx>
RegEx which is applied to url return data. Must return true, false, 1 or 0 as mute-state. Default (which applies to many Phlips-TV's): muted":\s*(\w+|\d+)
Readings
Note: All VolumeLink Readings except of 'state' does not generate events!
lastHttpError
The last HTTP-Error will be recorded in this reading.
Define httpErrorLoglevel, httpLoglevel or attribute verbose for more information.
Note: Attr verbose will not output all HTTP-Messages, define httpLoglevel for this.
mute
The current mute-state fetched from physical device.
volume
The current volume-level fetched from physical device.
state
on if VolumeLink is running, off if VolumeLink is stopped.
WEBCOUNT
Note: this module needs the HTTP::Request and LWP::UserAgent perl modules.
Defines an Web-IO-Digital device (Box with up to 12 digital in/outputs, www.wut.de) via ip address. The status of the device is also pooled (delay interval).
Examples:
define motor1 WEBIO_12DIGITAL 192.168.8.200 1 60
Set
set <name> <value>
where value is one of:
on off
Examples:
set motor1 on
WMBUS - Wireless M-Bus
This module supports Wireless M-Bus meters for e.g. water, heat, gas or electricity.
Wireless M-Bus is a standard protocol supported by various manufacturers.
It uses the 868 MHz band for radio transmissions.
Therefore you need a device which can receive Wireless M-Bus messages, e.g. a CUL with culfw >= 1.59.
WMBus uses two different radio protocols, T-Mode and S-Mode. The receiver must be configured to use the same protocol as the sender.
In case of a CUL this can be done by setting rfmode to WMBus_T or WMBus_S respectively.
WMBus devices send data periodically depending on their configuration. It can take days between individual messages or they might be sent
every minute.
WMBus messages can be optionally encrypted. In that case the matching AESkey must be specified with attr AESkey. Otherwise the decryption
will fail and no relevant data will be available.
Prerequisites
This module requires the perl modules Crypt::CBC, Digest::CRC and Crypt::OpenSSL::AES (AES only if encrypted messages should be processed).
On a debian based system these can be installed with
sudo apt-get install libcrypt-cbc-perl libdigest-crc-perl libssl-dev
sudo cpan -i Crypt::OpenSSL::AES
Normally a WMBus device isn't defined manually but automatically through the autocreate mechanism upon the first reception of a message.
For a manual definition there are two ways.
By specifying a raw WMBus message as received by a CUL. Such a message starts with a lower case 'b' and contains at least 24 hexadecimal digits.
The WMBUS module extracts all relevant information from such a message.
Explictly specify the information that uniquely identifies a WMBus device.
The manufacturer code, which is is a three letter shortcut of the manufacturer name. See
dlms.com for a list of registered ids.
The identification number is the serial no of the meter.
version is the version code of the meter
type is the type of the meter, e.g. water or electricity encoded as a number.
Set
N/A
Get
N/A
Attributes
IODev
Set the IO or physical device which should be used for receiving signals
for this "logical" device. An example for the physical device is a CUL.
AESKey
A 16 byte AES-Key in hexadecimal digits. Used to decrypt messages from meters which have encryption enabled.
rawmsg_as_reading
If set to 1, received raw messages will be stored in the reading rawmsg. This can be used to log raw messages to help with debugging.
Readings
Meters can send a lot of different information depending on their type. An electricity meter will send other data than a water meter.
The information also depends on the manufacturer of the meter. See the WMBus specification on oms-group.org for details.
The readings are generated in blocks starting with block 1. A meter can send several data blocks.
Each block has at least a type, a value and a unit, e.g. for an electricity meter it might look like
1_type VIF_ENERGY_WATT 1_unit Wh 1_value 2948787
There is also a fixed set of readings.
is_encrypted is 1 if the received message is encrypted.
decryption_ok is 1 if a message has either been successfully decrypted or if it is unencrypted.
state contains the state of the meter and may contain error message like battery low. Normally it contains 'no error'.
battery contains ok or low.
For some well known devices specific readings like the energy consumption in kWh created.
WOL
Defines a WOL device via its MAC and IP address.
when sending the on command to a WOL device it wakes up the dependent device by sending a magic packet. When running in repeat mode the magic paket ist sent every n seconds to the device.
So, for example a Buffalo NAS can be kept awake.
Define
define <name> WOL <MAC> <IP> [<mode> [<repeat>]]
MAC
MAC-Adress of the host
IP
IP-Adress of the host (or broadcast address of the local network if IP of the host is unknown)
mode [EW|UDP]
EW: wakeup by usr/bin/ether-wake
UDP: wakeup by an implementation like Net::Wake(CPAN)
Examples:
define computer1 WOL 72:11:AC:4D:37:13 192.168.0.24 switching only one time define computer1 WOL 72:11:AC:4D:37:13 192.168.0.24 EW by ether-wake(linux command) define computer1 WOL 72:11:AC:4D:37:13 192.168.0.24 BOTH by both methods define computer1 WOL 72:11:AC:4D:37:13 192.168.0.24 UDP 200 in repeat modeusr/bin/ether-wake in repeatmode
Notes:
Not every hardware is able to wake up other devices by default. Oftenly firewalls filter magic packets. Switch them first off.
You may need a packet sniffer to check some malfunktion.
With this module you get two methods to do the job: see the mode parameter.
Set
set <name> <value>
where value is one of:
refresh # checks(by ping) whether the device is currently running
on # sends a magic packet to the defined MAC address
off # stops sending magic packets and sends the shutdownCmd(see attributes)
Examples:
set computer1 on set computer1 off set computer1 refresh
Attributes
attr <name> sysCmd <string> Custom command executed to wakeup a remote machine, i.e. /usr/bin/ether-wake or /usr/bin/wakeonlan
attr <name> shutdownCmd <command> Custom command executed to shutdown a remote machine. You can use <command>, like you use it in at, notify or Watchdog
Examples:
attr wol shutdownCmd set lamp on # fhem command
attr wol shutdownCmd { Log 1, "Teatime" } # Perl command
attr wol shutdownCmd "/bin/echo "Teatime" > /dev/console" # shell command
attr <name> interval <seconds> defines the time between two checks by a ping if state of <name> is on. By using 0 as parameter for interval you can switch off checking the device.
attr <name> useUdpBroadcast <broardcastAdress> When using UDP then the magic packet can be send to one of the broardcastAdresses (x.x.x.255, x.x.255.255, x.255.255.255) instead of the target host address.
Try using this, when you want to wake up a machine in your own subnet and the wakekup with the target adress is instable or doesn't work.
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
N/A
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
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.
Defines a weather station, which is queried by means of an external
program. That program is executed by FHEM and is expected to deliver the
data at stdout in the format of a WS3600 series weather station (details
see below).
full path to the executable which queries the weatherstation
(for WS3600 series fetch3600 should be used)
<options>
options for <wsreaderprog>, if necessary
<interval>
this optional parameter is the time between subsequent calls to
<wsreaderprog>. It defaults to 60s.
Supported Stations are:
WS3600 series weather station (Europe Supplies, technotrade, etc;
refer to Wetterstationen.info
(german) for details on this model) with fetch3600 from the
toolchain open3600).
Fetch3600 delivers the current readings line by line as
reading-value-pairs. These are read periodically and translated into
more readable names for FHEM by the module WS3600.pm.
WS2300
with toolchain open2300,
because it is rather similar to the WS3600.
WS1080
(and other stations which come with the EasyWeather windows
application) with fowsr
(version 2.0 or above)
Currently, it is expected that the WS is attached to the local computer
and <wsreaderprog> is run locally. Basically the executable called
needs to supply on stdout an output similar to what fetch3600 returns;
how to implement a "networked setup" is left as an excercise to the
reader.
For the records, this is an output of fetch3600:
There is no expectation on the readings received from the fetch3600
binary; so, in essence, if you have a similar setup (unsupported,
attached weather station and a means to get it's reading into an output
similar to above's), you should be able to use WS3600.pm with
a custom written script to interface FHEM with your station as well.
WS3600.pm only recognizes the above readings (and translates
these into, e. g., Temp-inside for Ti for
use within FHEM), other lines are silently dropped on the floor. Note:
To step down the number of readings date and time records will now be
merged to one reading containing date and time. This now also allows
records with merged date / time values delivered from
<wsreaderprog> - detected by prefix DT (e.g. Date
+ Time --> DTime, DRPmin +
TRPmin --> DTRPmin and so on).
fetch3600 is available as binary for the Windows OS as well, but
operation under that OS isn't tested yet.
model WS3600, WS2300,
WS1080 (not used for anything, yet)
WWO
Define
define <name> WWO <location> <apikey>
Defines a virtual device for WWO forecasts.
A WWO device periodically gathers current and forecast weather conditions
from worldweatheronline.com (the free api version)
You need to signup at http://developer.worldweatheronline.com to get an apikey)
The parameter location is the WOEID (WHERE-ON-EARTH-ID), go to
http://www.worldweatheronline.com to find it out for your valid location.
The natural language in which the forecast information appears is english.
The interval is set to update the values every hour.
Examples:
define MyWeather WWO Berlin,Germany
The module provides one additional function WWOAsHtml. The function return the HTML code for a
vertically arranged weather forecast.
Forces the retrieval of the weather data. The next automatic retrieval is scheduled to occur
interval seconds later.
Get
get <name> <reading>
Valid readings and their meaning (? can be one of 0, 1, 2, 3, 4, 5 and stands
for today, tomorrow, etc. - with 'fc?_' or without! - without is meaning 'current condition'):
cloudcover
cloudcover in percent
current_date_time
last update of forecast on server
fc?_date
date of the forecast condition - not valid without 'fc?'
A Weather device periodically gathers current and forecast weather conditions
from the Yahoo Weather API.
The parameter location is the WOEID (WHERE-ON-EARTH-ID), go to
http://weather.yahoo.com to find it out for your location.
The optional parameter interval is the time between subsequent updates
in seconds. It defaults to 3600 (1 hour).
The optional language parameter may be one of
de,
en,
pl,
fr,
nl,
It determines the natural language in which the forecast information appears.
It defaults to en. If you want to set the language you also have to set the interval.
The module provides four additional functions WeatherAsHtml, WeatherAsHtmlV, WeatherAsHtmlH and
WeatherAsHtmlD. The former two functions are identical: they return the HTML code for a
vertically arranged weather forecast. The third function returns the HTML code for a horizontally arranged weather forecast. The
latter function dynamically picks the orientation depending on wether a smallscreen style is set (vertical layout) or not (horizontal layout). Each version accepts an additional paramter to limit the numer of icons to display.
You can define different switchingtimes for every day.
The new parameter is sent to the <device> automatically with
set <device> <para>
If you have defined a <condition> and this condition is false if the switchingtime has reached, no command will executed.
An other case is to define an own perl command with <command>.
The following parameter are defined:
device
The device to switch at the given time.
language
Specifies the language used for definition and profiles.
de,en,fr are possible. The parameter is optional.
weekdays
Specifies the days for all timer in the WeekdayTimer.
The parameter is optional. For details see the weekdays part in profile.
profile
Define the weekly profile. All timings are separated by space. A switchingtime is defined
by the following example:
[<weekdays>|]<time>|<parameter>
weekdays: optional, if not set every day of the week is used.
Otherwise you can define a day with its number or its shortname.
0,su sunday
1,mo monday
2,tu tuesday
3,we wednesday
4 ...
7,$we weekend ($we)
8,!$we weekday (!$we)
It is possible to define $we or !$we in daylist to easily allow weekend an holiday. $we !$we are coded as 7 8, when using a numeric daylist.
time:define the time to switch, format: HH:MM:[SS](HH in 24 hour format) or a Perlfunction like {sunrise_abs()}. Within the {} you can use the variable $date(epoch) to get the exact switchingtimes of the week. Example: {sunrise_abs_dat($date)}
parameter:the parameter to be set, using any text value like on, off, dim30%, eco or comfort - whatever your device understands.
command
If no condition is set, all the rest is interpreted as a command. Perl-code is setting up
by the well-known Block with {}.
Note: if a command is defined only this command is executed. In case of executing
a "set desired-temp" command, you must define the hole commandpart explicitly by yourself.
in the command section you can access the event:
The variable $EVENT will contain the complete event, e.g.
measured-temp: 21.7 (Celsius)
$EVTPART0,$EVTPART1,$EVTPART2,etc contain the space separated event
parts (e.g. $EVTPART0="measured-temp:", $EVTPART1="21.7",
$EVTPART2="(Celsius)". This data is available as a local
variable in perl, as environment variable for shell scripts, and will
be textually replaced for FHEM commands.
$NAME contains the device to send the event, e.g.
myFht
Note: the following is deprecated and will be removed in a future
release. The described replacement is attempted if none of the above
variables ($NAME/$EVENT/etc) found in the command.
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. The space separated event "parts"
are available as %EVTPART0, %EVTPART1, etc. A single %
looses its special meaning if any of these parameters appears in the
definition.
The following parameter are replaced:
@ => the device to switch
% => the new temperature
condition
if a condition is defined you must declared this with () and a valid perl-code.
The return value must be boolean.
The parameter @ and % will be interpreted.
Example:
define shutter WeekdayTimer bath 12345|05:20|up 12345|20:30|down
Mo-Fr are setting the shutter at 05:20 to up, and at 20:30 down.
define heatingBath WeekdayTimer bath 07:00|16 Mo,Tu,Th-Fr|16:00|18.5 20:00|eco
{fhem("set dummy on"); fhem("set @ desired-temp %");}
At the given times and weekdays only(!) the command will be executed.
define dimmer WeekdayTimer livingRoom Sa-Su,We|07:00|dim30% Sa-Su,We|21:00|dim90% (ReadingsVal("WeAreThere", "state", "no") eq "yes")
The dimmer is only set to dimXX% if the dummy variable WeAreThere is "yes"(not a real live example).
If you want to have set all WeekdayTimer their current value (after a temperature lowering phase holidays)
you can call the function WeekdayTimer_SetParm(<"WD-device">) or WeekdayTimer_SetAllParms().
This call can be automatically coupled to a dummy by a notify: define dummyNotify notify Dummy:. * {WeekdayTimer_SetAllTemps()}
Some definitions without comment:
define hc Heating_Control HeizungKueche de 7|23:35|25 34|23:30|22 23:30|16 23:15|22 8|23:45|16
define hc Heating_Control HeizungKueche de fr,$we|23:35|25 34|23:30|22 23:30|16 23:15|22 12|23:45|16
define hc Heating_Control HeizungKueche de 20:35|25 34|14:30|22 21:30|16 21:15|22 12|23:00|16
define hw Heating_Control HeizungKueche de mo-so, $we|{sunrise_abs_dat($date)}|18 mo-so, $we|{sunset_abs_dat($date)}|22
define ht Heating_Control HeizungKueche de mo-so,!$we|{sunrise_abs_dat($date)}|18 mo-so,!$we|{sunset_abs_dat($date)}|22
define hh Heating_Control HeizungKueche de {sunrise_abs_dat($date)}|19 {sunset_abs_dat($date)}|21
define hx Heating_Control HeizungKueche de 22:35|25 23:00|16
The daylist can be given globaly for the whole Heating_Control:
define HeizungWohnen_an_wt Heating_Control HeizungWohnen de !$we 09:00|19 (heizungAnAus("Ein"))
define HeizungWohnen_an_we Heating_Control HeizungWohnen de $we 09:00|19 (heizungAnAus("Ein"))
define HeizungWohnen_an_we Heating_Control HeizungWohnen de 78 09:00|19 (heizungAnAus("Ein"))
define HeizungWohnen_an_we Heating_Control HeizungWohnen de 57 09:00|19 (heizungAnAus("Ein"))
define HeizungWohnen_an_we Heating_Control HeizungWohnen de fr,$we 09:00|19 (heizungAnAus("Ein"))
Setset <name> <value>
where value is one of:
disable # disables the Weekday_Timer
enable # enables the Weekday_Timer
Examples:
set wd disable set wd enable
Get
N/A
Attributes
delayedExecutionCond
defines a delay Function. When returning true, the switching of the device is delayed until the function retruns a false value. The behavior is just like a windowsensor in Heating_Control.
switchInThePast
defines that the depending device will be switched in the past in definition and startup phase when the device is not recognized as a heating.
Heatings are always switched in the past.
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
Set
set <name> <value> [<argument>]
where value is one of:
dimdown # requires argument, see the note
dimup # requires argument, see the note
off
on
on-till # Special, see the note
on-for-timer # Special, see the note
Examples:
set lamp1 dimup 10 set lamp1,lamp2 off set pump off set lamp2 on-till 19:59 set lamp2 on-for-timer 00:02:30
Notes:
Only switching and dimming are supported by now.
Dimming is valid only for a dimmable device as specified by
the model argument in its define
statement.
An X10 device has 210 discrete brightness levels. If you use a
X10 sender, e.g. a remote control or a wall switch to dim, a
brightness step is 100%/210.
dimdown and dimup take a number in the
range from 0 to 22 as argument. It is assumed that argument 1 is
a 1% brightness change (microdim) and arguments 2 to 22 are
10%..100% brightness changes. The meaning of argument 0 is
unclear.
This currently leads to some confusion in the logs as the
dimdown and dimup codes are logged with
different meaning of the arguments depending on whether the commands
were sent from the PC or from a remote control or a wall switch.
dimdown and dimup from on and off states may
have unexpected results. This seems to be a feature of the X10
devices.
on-till requires an absolute time in the "at" format
(HH:MM:SS, HH:MM) or { <perl code> }, where the perl code
returns a time specification).
If the current time is greater than the specified time, then the
command is ignored, else an "on" command is generated, and for the
given "till-time" an off command is scheduleld via the at command.
on-for-timer requires a relative time in the "at" format
(HH:MM:SS, HH:MM) or { <perl code> }, where the perl code
returns a time specification).
This module allows you to control XBMC and receive events from XBMC. It can also be used to control Plex (see attribute compatibilityMode).
Prerequisites
Requires XBMC "Frodo" 12.0.
To use this module you will have to enable JSON-RPC. See here.
The Perl module JSON is required.
On Debian/Raspbian: apt-get install libjson-perl
Via CPAN: cpan install JSON
To get it working on a Fritzbox the JSON module has to be installed manually.
To receive events it is necessary to use TCP. The default TCP port is 9090. Username and password are optional for TCP. Be sure to enable JSON-RPC
for TCP. See here.
Example:
define htpc XBMC 192.168.0.10 tcp
define htpc XBMC 192.168.0.10:9000 tcp # With custom port
define htpc XBMC 192.168.0.10 http # Use HTTP instead of TCP - Note: to receive events use TCP!
define htpc XBMC 192.168.0.10 http xbmc passwd # Use HTTP with credentials - Note: to receive events use TCP!
Remote control:
There is an simple remote control layout for XBMC which contains the most basic buttons. To add the remote control to the webinterface execute the
following commands:
define <rc_name> remotecontrol #adds the remote control
set <rc_name> layout XBMC_RClayout #sets the layout for the remote control
set <rc_name> makenotify <XBMC_device> #links the buttons to the actions
Known issues:
XBMC sometimes creates events twices. For example the Player.OnPlay event is created twice if play a song. Unfortunately this
is a issue of XBMC. The fix of this bug is included in future version of XBMC (> 12.2).
Set
set <name> <command> [<parameter>]
This module supports the following commands:
Player related commands:
play [<all|audio|video|picture>] - starts the playback (might only work if previously paused). The second argument defines which player should be started. By default the active players will be started
pause [<all|audio|video|picture>] - pauses the playback
playpause [<all|audio|video|picture>] - toggles between play and pause for the given player
stop [<all|audio|video|picture>] - stop the playback
next [<all|audio|video|picture>] - jump to the next track
prev [<all|audio|video|picture>] - jump to the previous track or the beginning of the current track.
goto <position> [<audio|video|picture>] - Goes to the in the playlist. has to be a number.
shuffle [<toggle|on|off>] [<audio|video|picture>] - Enables/Disables shuffle mode. Without furhter parameters the shuffle mode is toggled.
repeat <one|all|off> [<audio|video|picture>] - Sets the repeat mode.
open <URI> - Plays the resource located at the URI (can be a url or a file)
opendir <path> - Plays the content of the directory
openmovieid <path> - Plays a movie by id
openepisodeid <path> - Plays an episode by id
openchannelid <path> - Switches to channel by id
addon <addonid> <parametername> <parametervalue> - Executes addon with one Parameter, for example set xbmc addon script.json-cec command activate
Input related commands:
back - Back-button
down - Down-button
up - Up-button
left - Left-button
right - Right-button
home - Home-button
select - Select-button
info - Info-button
showosd - Opens the OSD (On Screen Display)
showcodec - Shows Codec information
exec <action> - Execute an input action. All available actions are listed here
send <text> - Sends <text> as input to XBMC
jsonraw - Sends raw JSON data to XBMC
Libary related commands:
videolibrary clean - Removes non-existing files from the video libary
videolibrary scan - Scan for new video files
audiolibrary clean - Removes non-existing files from the audio libary
audiolibrary scan - Scan for new audio files
Application related commands:
mute [<0|1>] - 1 for mute; 0 for unmute; by default the mute status will be toggled
volume <n> - sets the volume to <n>. <n> must be a number between 0 and 100
volumeDown <n> - volume down
volumeUp <n> - volume up
quit - closes XBMC
off - depending on the value of the attribute "offMode" XBMC will be closed (see quit) or the system will be shut down, put into hibernation or stand by. Default is quit.
System related commands:
eject - will eject the optical drive
shutdown - the XBMC host will be shut down
suspend - the XBMC host will be put into stand by
hibernate - the XBMC host will be put into hibernation
reboot - the XBMC host will be rebooted
connect - try to connect to the XBMC host immediately
Messaging
To show messages on XBMC (little message PopUp at the bottom right egde of the screen) you can use the following commands: set <XBMC_device> msg <title> <msg> [<duration>] [<icon>]
The default duration of a message is 5000 (5 seconds). The minimum duration is 1500 (1.5 seconds). By default no icon is shown. XBMC provides three
different icon: error, info and warning. You can also use an uri to define an icon. Please enclose title and/or message into quotes (" or ') if it consists
of multiple words.
Generated Readings/Events:
audiolibrary - Possible values: cleanfinished, cleanstarted, remove, scanfinished, scanstarted, update
currentAlbum - album of the current song/musicvideo
currentArtist - artist of the current song/musicvideo
currentMedia - file/URL of the media item being played
currentTitle - title of the current media item
currentTrack - track of the current song/musicvideo
episode - episode number
episodeid - id of the episode in the video library
fullscreen - indicates if XBMC runs in fullscreen mode (on/off)
label - label of the current media item
movieid - id of the movie in the video library
musicvideoid - id of the musicvideo in the video library
mute - indicates if XBMC is muted (on/off)
name - software name (e.g. XBMC)
originaltitle - original title of the movie being played
partymode - indicates if XBMC runs in party mode (on/off) (not available for Plex)
playlist - Possible values: add, clear, remove
playStatus - Indicates the player status: playing, paused, stopped
repeat - current repeat mode (one/all/off)
season - season of the current episode
showtitle - title of the show being played
shuffle - indicates if the playback is shuffled (on/off)
skin - current skin of XBMC
songid - id of the song in the music library
system - Possible values: lowbattery, quit, restart, sleep, wake
time - current position in the playing media item (only updated on play/pause)
totaltime - total run time of the current media item
type - type of the media item. Possible values: episode, movie, song, musicvideo, picture, unknown
version - version of XBMC
videolibrary - Possible values: cleanfinished, cleanstarted, remove, scanfinished, scanstarted, update
volume - value between 0 and 100 stating the current volume setting
year - year of the movie being played
3dfile - is a 3D movie according to filename
sd__ - stream details of the current medium. type can be video, audio or subtitle, n is the stream index (a stream can have multiple audio/video streams)
Remarks on the events
The event playStatus = playing indicates a playback of a media item. Depending on the event type different events are generated:
type = song generated events are: album, artist, file, title and track
type = musicvideo generated events are: album, artist, file and title
type = episode generated events are: episode, file, season, showtitle, and title
type = movie generated events are: originaltitle, file, title, and year
type = picture generated events are: file
type = unknown generated events are: file
Attributes
compatibilityMode
This module can also be used to control Plex, since the JSON Api is mostly the same, but there are some differences.
If you want to control Plex set the attribute compatibilityMode to plex.
offMode
Declares what should be down if the off command is executed. Possible values are quit (closes XBMC), hibernate (puts system into hibernation),
suspend (puts system into stand by), and shutdown (shuts down the system). Default value is quit
fork
If XBMC does not run all the time it used to be the case that FHEM blocks because it cannot reach XBMC (only happened
if TCP was used). If you encounter problems like FHEM not responding for a few seconds then you should set attr <XBMC_device> fork enable
which will move the search for XBMC into a separate process.
updateInterval
The interval which is used to check if Kodi is still alive (by sending a JSON ping) and also it is used to update current player item.
disable
Disables the device. All connections will be closed immediately.
xmllist
xmllist [devspec]
Returns an XML tree of device definitions. devspec is
optional, and restricts the list of devices if specified.
This module controls AV receiver from Yamaha via network connection. You are able
to power your AV reveiver on and off, query it's power state,
select the input (HDMI, AV, AirPlay, internet radio, Tuner, ...), select the volume
or mute/unmute the volume.
Defining a YAMAHA_AVR device will schedule an internal task (interval can be set
with optional parameter <status_interval> in seconds, if not set, the value is 30
seconds), which periodically reads the status of the AV receiver (power state, selected
input, volume and mute status) and triggers notify/filelog commands.
Different status update intervals depending on the power state can be given also.
If two intervals are given in the define statement, the first interval statement stands for the status update
interval in seconds in case the device is off, absent or any other non-normal state. The second
interval statement is used when the device is on.
Example:
define AV_Receiver YAMAHA_AVR 192.168.0.10
# With custom status interval of 60 seconds
define AV_Receiver YAMAHA_AVR 192.168.0.10 mainzone 60
# With custom "off"-interval of 60 seconds and "on"-interval of 10 seconds
define AV_Receiver YAMAHA_AVR 192.168.0.10 mainzone 60 10
Zone Selection
If your receiver supports zone selection (e.g. RX-V671, RX-V673,... and the AVANTAGE series)
you can select the zone which should be controlled. The RX-V3xx and RX-V4xx series for example
just have a "Main Zone" (which is the whole receiver itself). In general you have the following
possibilities for the parameter <zone> (depending on your receiver model).
mainzone - this is the main zone (standard)
zone2 - The second zone (Zone 2)
zone3 - The third zone (Zone 3)
zone4 - The fourth zone (Zone 4)
Depending on your receiver model you have not all inputs available on these different zones.
The module just offers the real available inputs.
Example:
define AV_Receiver YAMAHA_AVR 192.168.0.10 # If no zone is specified, the "Main Zone" will be used.
attr AV_Receiver YAMAHA_AVR room Livingroom
# Define the second zone
define AV_Receiver_Zone2 YAMAHA_AVR 192.168.0.10 zone2
attr AV_Receiver_Zone2 room Bedroom
For each Zone you will need an own YAMAHA_AVR device, which can be assigned to a different room.
Each zone can be controlled separatly from all other available zones.
Set
set <name> <command> [<parameter>]
Currently, the following commands are defined; the available inputs are depending on the used receiver.
The module only offers the real available inputs and scenes. The following input commands are just an example and can differ.
on - powers on the device
off - shuts down the device
input hdm1,hdmX,... - selects the input channel (only the real available inputs were given)
scene scene1,sceneX - select the scene
volume 0...100 [direct] - set the volume level in percentage. If you use "direct" as second argument, no volume smoothing is used (if activated) for this volume change. In this case, the volume will be set immediatly.
volumeStraight -80...15 [direct] - set the volume level in decibel. If you use "direct" as second argument, no volume smoothing is used (if activated) for this volume change. In this case, the volume will be set immediatly.
volumeUp [0-100] [direct] - increases the volume level by 5% or the value of attribute volumeSteps (optional the increasing level can be given as argument, which will be used instead). If you use "direct" as second argument, no volume smoothing is used (if activated) for this volume change. In this case, the volume will be set immediatly.
volumeDown [0-100] [direct] - decreases the volume level by 5% or the value of attribute volumeSteps (optional the decreasing level can be given as argument, which will be used instead). If you use "direct" as second argument, no volume smoothing is used (if activated) for this volume change. In this case, the volume will be set immediatly.
mute on|off|toggle - activates volume mute
bass [-6...6] step 0.5 (main zone), [-10...10] step 2 (other zones), [-10...10] step 1 (other zones, DSP models) - set bass tone level in decibel
treble [-6...6] step 0.5 (main zone), [-10...10] step 2 (other zones), [-10...10] step 1 (other zones, DSP models) - set treble tone level in decibel
dsp hallinmunich,hallinvienna,... - sets the DSP mode to the given preset
enhancer on|off - controls the internal sound enhancer
3dCinemaDsp auto|off - controls the CINEMA DSP 3D mode
adaptiveDrc auto|off - controls the Adaptive DRC
straight on|off - bypasses the internal codec converter and plays the original sound codec
direct on|off - bypasses all internal sound enhancement features and plays the sound straight directly
sleep off,30min,60min,...,last - activates the internal sleep timer
shuffle on,off - activates the shuffle mode on the current input
repeat one,all,off - activates the repeat mode on the current input for one or all titles
pause - pause playback on current input
play - start playback on current input
stop - stop playback on current input
skip reverse,forward - skip track on current input
statusRequest - requests the current status of the device
remoteControl up,down,... - sends remote control commands as listed below
Remote control (not in all zones available, depending on your model)
In many receiver models, inputs exist, which can't be used just by selecting them. These inputs needs
a manual interaction with the remote control to activate the playback (e.g. Internet Radio, Network Streaming).
For this application the following commands are available:
Cursor Selection:
remoteControl up
remoteControl down
remoteControl left
remoteControl right
remoteControl enter
remoteControl return
The button names are the same as on your remote control.
A typical example is the automatical turn on and play an internet radio broadcast:
# the initial definition.
define AV_receiver YAMAHA_AVR 192.168.0.3
And in your myUtils.pm (based on myUtilsTemplate.pm) the following function:
sub startNetRadio()
{
fhem("set AV_Receiver on;
sleep 5;
set AV_Receiver input netradio;
sleep 4;
set AV_Receiver remoteControl enter;
sleep 2;
set AV_Receiver remoteControl enter;
sleep 2;
set AV_Receiver remoteControl enter");
}
The remote control commands must be separated with a sleep, because the receiver is loading meanwhile and don't accept commands. These commands will be executed in background and does not harm the FHEM main process.
Now you can use this function by typing the following line in your FHEM command line or in your notify-definitions:
{startNetRadio()}
Get
get <name> <reading>
Currently, the get command only returns the reading values. For a specific list of possible values, see section "Generated Readings/Events".
Optional attribute to define the default increasing and decreasing level for the volumeUp and volumeDown set command. Default value is 5%
Generated Readings/Events:
3dCinemaDsp - The status of the CINEMA DSP 3D mode (can be "auto" or "off")
adaptiveDrc - The status of the Adaptive DRC (can be "auto" or "off")
bass Reports the current bass tone level of the receiver or zone in decibel values (between -6 and 6 dB (mainzone) and -10 and 10 dB (other zones)
dsp - The current selected DSP mode for sound output
direct - indicates if all sound enhancement features are bypassed or not ("on" => all features are bypassed, "off" => sound enhancement features are used).
enhancer - The status of the internal sound enhancer (can be "on" or "off")
input - The selected input source according to the FHEM input commands
inputName - The input description as seen on the receiver display
mute - Reports the mute status of the receiver or zone (can be "on" or "off")
newFirmware - indicates if a firmware update is available (can be "available" or "unavailable")
power - Reports the power status of the receiver or zone (can be "on" or "off")
presence - Reports the presence status of the receiver or zone (can be "absent" or "present"). In case of an absent device, it cannot be controlled via FHEM anymore.
volume - Reports the current volume level of the receiver or zone in percentage values (between 0 and 100 %)
volumeStraight - Reports the current volume level of the receiver or zone in decibel values (between -80.5 and +15.5 dB)
sleep - indicates if the internal sleep timer is activated or not.
straight - indicates if the internal sound codec converter is bypassed or not (can be "on" or "off")
state - Reports the current power state and an absence of the device (can be "on", "off" or "absent")
treble Reports the current treble tone level of the receiver or zone in decibel values (between -6 and 6 dB (mainzone) and -10 and 10 dB (other zones)
Input dependent Readings/Events:
currentChannel - Number of the input channel (SIRIUS only)
currentStation - Station name of the current radio station (available on NET RADIO, PANDORA
currentAlbum - Album name of the current song
currentArtist - Artist name of the current song
currentTitle - Title of the current song
playStatus - indicates if the input plays music or not
shuffle - indicates the shuffle status for the current input
repeat - indicates the repeat status for the current input
Implementator's note
The module is only usable if you activate "Network Standby" on your receiver. Otherwise it is not possible to communicate with the receiver when it is turned off.
This module controls Blu-Ray players from Yamaha via network connection. You are able
to switch your player on and off, query it's power state,
control the playback, open and close the tray and send all remote control commands.
Defining a YAMAHA_BD device will schedule an internal task (interval can be set
with optional parameter <status_interval> in seconds, if not set, the value is 30
seconds), which periodically reads the status of the player (power state, current disc, tray status,...)
and triggers notify/filelog commands.
Different status update intervals depending on the power state can be given also.
If two intervals are given to the define statement, the first interval statement represents the status update
interval in seconds in case the device is off, absent or any other non-normal state. The second
interval statement is used when the device is on.
Example:
define BD_Player YAMAHA_BD 192.168.0.10
# With custom status interval of 60 seconds
define BD_Player YAMAHA_BD 192.168.0.10 60
# With custom "off"-interval of 60 seconds and "on"-interval of 10 seconds
define BD_Player YAMAHA_BD 192.168.0.10 60 10
Set
set <name> <command> [<parameter>]
Currently, the following commands are defined.
on - powers on the device
off - shuts down the device
tray open,close - open or close the disc tray
statusRequest - requests the current status of the device
remoteControl up,down,... - sends remote control commands as listed in the following chapter
Playback control commands
play - start playing the current media
pause - pause the current media playback
stop - stop the current media playback
skip forward,reverse - skip the current track or chapter
fast forward,reverse - fast forward or reverse playback
slow forward,reverse - slow forward or reverse playback
trickPlay normal,repeatChapter,repeatTitle,... - controls the Trick-Play features
Optional attribute change the response timeout in seconds for all queries to the player.
Possible values: 1-5 seconds. Default value is 4 seconds.
Generated Readings/Events:
input - The current playback source (can be "DISC", "USB" or "Network")
discType - The current type of disc, which is inserted (e.g. "No Disc", "CD", "DVD", "BD",...)
contentType - The current type of content, which is played (e.g. "audio", "video", "photo" or "no contents")
error - indicates an hardware error of the player (can be "none", "fan error" or "usb overcurrent")
power - Reports the power status of the player or zone (can be "on" or "off")
presence - Reports the presence status of the player or zone (can be "absent" or "present"). In case of an absent device, it cannot be controlled via FHEM anymore.
trayStatus - The disc tray status (can be "open" or "close")
trickPlay - The current trickPlay mode
state - Reports the current power state and an absence of the device (can be "on", "off" or "absent")
Input dependent Readings/Events:
currentChapter - Number of the current DVD/BD Chapter (only at DVD/BD's)
currentMedia - Name of the current file (only at USB)
currentTrack - Number of the current CD-Audio title (only at CD-Audio)
currentTitle - Number of the current title (only at DVD/BD's)
playTimeCurrent - current timecode of played media
playTimeTotal - the total time of the current movie (only at DVD/BD's)
playStatus - indicates if the player plays media or not (can be "play", "pause", "stop", "fast fwd", "fast rev", "slow fwd", "slow rev")
totalTracks - The number of total tracks on inserted CD-Audio
Implementator's note
Some older models (e.g. BD-S671) cannot be controlled over networked by delivery. A firmware update is neccessary to control these models via FHEM. In general it is always recommended to use the latest firmware.
The module is only usable if you activate "Network Control" on your player. Otherwise it is not possible to communicate with the player.
This module controls a Yamaha Network Player (such as CRX-N560, CRX-N560D, CD-N500 or NP-S2000) via Ethernet.
Theoretically, any device understanding the communication protocol of the Yamaha Network Player App should work.
Currently implemented features:
Power on/off
Timer on/off
Input selection
Timer on/off
Volume +/-
Mute on/off
System Clock Update
Tuner: tune +/-, preset +/-, Station information (FM/DAB)
Stand-by mode: eco/normal
Player (play, stop, next, prev, shuffle, repeat)
Menu navigation
...
Defining a YAMAHA_NP device will schedule an internal task (interval can be set
with optional parameters <off_status_interval> and <on_status_interval> in seconds.
<off_status_interval> is a parameter used in case the device is powered off or not available.
<on_status_interval> is a parameter used in case the device is powered on.
If both parameters are unset, a default value 30 (seconds) for both is used.
If <off_status_interval> is set only the same value is used for both parameters.
The internal task periodically reads the status of the Network Player (power state, selected
input, volume and mute status etc.) and triggers notify/filelog commands.
Example:
Add the following code into the fhem.cfg configuration file and restart fhem:
# With custom status interval of 60 seconds
define NP_Player YAMAHA_NP 192.168.0.15 60
attr NP_player webCmd input:volume:mute:volumeDown:volumeUp
# With custom "off"-interval of 60 seconds and "on"-interval of 10 seconds
define NP_Player YAMAHA_NP 192.168.0.15 60 10
attr NP_player webCmd input:volume:mute:volumeDown:volumeUp
Set
set <name> <command> [<parameter>]
Currently, the following commands are defined.
The available inputs are depending on the used network player.
The module offers only available inputs.
Note: Commands and parameters are case sensitive.
Available commands:
cdTray - open/close the CD tray.
clockUpdate - updates the system clock with current time. The time information is taken from the FHEM server.
dimmer [1..3] - Sets the display brightnes.
input [<parameter>] - selects the input channel. The inputs are read dynamically from the device. Available inputs can be set (e.g. cd, tuner, aux1, aux2, ...).
mute [on|off] - activates/deactivates muting
off - shuts down the device
on - powers on the device
player [<parameter>] - sets player related commands.
play - play.
stop - stop.
pause - pause.
next - next item.
prev - previous item.
shuffleToggle - Toggles the shuffle mode.
repeatToggle - Toggles the repeat modes.
playerListCursorDown - Command for list navigation in inputs such as Net Radio or Server. Command moves the cursor down. Next line displayed.
playerListCursorReturn - Command for list navigation in inputs such as Net Radio or Server. Command returns from a hierarchical sub-menu. Higher level menu displayed.
playerListCursorUp - Command for list navigation in inputs such as Net Radio or Server. Command moves the cursor up. Previous line displayed.
playerListGetList - Command for list navigation in inputs such as Net Radio or Server. Command returns readings relevant for list/menu navigation.
playerListJumpLine [value] - Command for list navigation in inputs such as Net Radio or Server. Command jumps to a given line.
playerListSelectLine [value] - Command for list navigation in inputs such as Net Radio or Server. Command selects the given line. In case the line is a 'Container' (folder) it's entered. In case of 'Item' the playback starts.
sleep [off|30min|60min|90min|120min] - activates the internal sleep timer
standbyMode [eco|normal] - set the standby mode.
statusRequest [<parameter>] - requests the current status of the device
basicStatus - requests the basic status such as volume input etc.
playerStatus - requests the player status such as play status, song info, artist info etc.
standbyMode - requests the standby mode information
systemConfig - requests the system configuration
tunerStatus - requests the tuner status such as FM frequency, preset number, DAB information etc.
timerStatus - requests device's internal wake-up timer status
networkInfo - requests device's network related information such as IP, Gateway, MAC address etc.
timerHour [0...23] - sets hour of device's internal wake-up timer
timerMinute [0...59] - sets minutes of device's internal wake-up timer
timerSet - configures the timer according to timerHour, timerMinute, timerRepeat, timerVolume. (ALL parameters must be set before. This command does not switch on the timer. → 'timer on'.)
timerVolume [<VOL_MIN>...<VOL_MAX>] - sets volume of device's internal wake-up timer
timer [on|off] - sets device's internal wake-up timer. (Note: The timer will be activated according to the last stored timer parameters in the device. In order to modify please use the 'timerSet' command.)
tuner [<parameter>] - sets tuner related commands.
bandDAB - sets the tuner band to DAB (if available).
bandFM - sets the tuner band to FM.
tuneUp - tuner tune up.
tuneDown - tuner tune down.
presetUp - tuner preset up.
presetDown - tuner preset down.
tunerPresetDAB [1...30] - Sets the DAB preset.
tunerPresetFM [1...30] - Sets the FM preset.
volume [0...100] - set the volume level in %
volumeStraight [<VOL_MIN>...<VOL_MAX>] - set the volume as used and displayed in the device. <VOL_MIN> and <VOL_MAX> are read and set from the device automatically.
volumeUp [<VOL_MIN>...<VOL_MAX>] - increases the volume by one device's absolute step. <VOL_MIN> and <VOL_MAX> are read and set from the device automatically.
volumeDown [<VOL_MIN>...<VOL_MAX>] - increases the volume by one device's absolute step. <VOL_MIN> and <VOL_MAX> are read and set from the device automatically.
A typical example is powering the device remotely and tuning the favourite radio station:
Add the following code into the fhem.cfg configuration file:
It's a good idea to insert a 'sleep' instruction between each fhem commands due to internal processing time of the network player. During that time the following commands might be ignored...
Now the function can be called by typing the following line in the FHEM command line or by the notify-definitions:
{startMyFavouriteRadioStation()}
Get
get <name> <reading>
Currently, the 'get' command returns reading values only. For a specific list of possible values, see section "Generated Readings".
Optional attribute to disable the internal cyclic status update of the receiver. Manual status updates via statusRequest command is still possible.
Possible values: 0 → perform cyclic status update, 1 → don't perform cyclic status updates.
Readings
Basic readings:
input - The selected input source according to the FHEM input commands
mute - Reports the mute status of the receiver (on|off)
power - Reports the power status of the receiver (on|off)
presence - Reports the presence status of the receiver or zone (absent|present). Note: In case of "absent", the device cannot be controlled by FHEM. Check standbyMode.
volume - Reports the current volume level of the receiver in % (0...100%)
volumeStraight - Reports the current volume level of the receiver as used and displayed in the device (values device specific)
sleep - Reports the current sleep timer status (30min|60min|90min|120min|off).
standbyMode - Reports the standby mode (eco|normal).
state - Reports the current power state and an absence of the device (on|off|absent)
Player related readings:
Note: In order to update the following readings use "statusRequest playerStatus" first.
playerPlaybackInfo - Reports current player state (play|stop|pause).
playerDeviceType - Reports the device type (ipod|msc).
playerIpodMode - Reports the Ipod Mode (normal|off)
playerRepeat - Reports the Repeat Mode (one|off)
playerShuffle - Reports the Shuffle Mode (on|off)
playerPlayTime - Reports the play time of the currently played audio (HH:MM:SS).
playerTrackNumber - Reports the track number of the currently played audio.
playerTotalTracks - Reports the total number of tracks for playing.
playerArtist - Reports the artist (if available) of the currently played audio.
playerAlbum - Reports the album (if available) of the currently played audio.
playerSong - Reports the song name (if available) of the currently played audio.
playerAlbumArtURL - Reports the album art url (if available) of the currently played audio. The URL points to the network player.
playerAlbumArtID - Reports the album art ID (if available) of the currently played audio.
playerAlbumArtFormat - Reports the album art format (if available) of the currently played audio.
Player List (Menu) related readings:
Note: In order to update the following readings use "statusRequest playerStatus" first.
playerListCurrentLine - Reports the current active list line as displayd.
playerListLine_1..._8 - Reports the content of the Line 1...8 as provided by the device.
playerListLine_Attribute_1..._8 - Reports the attribute of the Line 1...8 (Container|Item|Unselectable).
playerListMaxLine - Reports the number of lines in current list/menu.
playerListMenuName - Reports the name of the current list/menu.
playerListStatus - Reports the status of the current list/menu (Busy|Ready).
Tuner related readings:
Note: In order to update the following readings use "statusRequest tunerStatus" first.
tunerAudioModeDAB - Reports current audio mode (Mono|Stereo).
tunerBand - Reports the currently selected tuner band (FM|DAB). DAB if available.
tunerBitRateDAB - Reports current DAB stream bit rate (kbit/s).
tunerPresetFM - Reports the currently selected FM preset. If stored as such (1...30).
tunerFrequencyDAB - Reports the currently tuned DAB frequency. (xxx.xxx MHz)
tunerFrequencyFM - Reports the currently tuned FM frequency. (xxx.xx MHz)
tunerModeDAB - Reports current DAB audio mode (DAB|DAB+).
tunerProgramServiceFM - Reports the FM service name.
tunerRadioTextAFM - Reports the Radio Text A of the selected FM service.
tunerRadioTextBFM - Reports the Radio Text B of the selected FM service.
tunerPresetDAB - Reports the currently selected DAB preset. If stored as such (1...30).
tunerServiceLabelDAB - Reports the service label of the selected DAB service.
tunerChannelLabelDAB - Reports the channel label of the selected DAB service.
tunerDLSDAB - Reports the dynamic label segment of the selected DAB service.
tunerEnsembleLabelDAB - Reports the ensemble label of the selected DAB service.
Timer related readings:
Note: In order to update the following readings use "statusRequest timerStatus" first.
timer - Reports the time mode (on|off).
timerRepeat - Reports the timer repeat mode (once|every).
timerStartTime - Reports the timer start time (HH:MM).
timerVolumeLevel - Reports the timer volume level.
Implementer's note
Trivial: In order to use that module the network player must be connected to the Ethernet.
The device must be in standbyMode "Normal" in order to power on.
However, even if the standbyMode is set to "Eco" the device can be powered off. In that case it has to be switched on manually.
ZWDongle
This module serves a ZWave dongle, which is attached via USB or TCP/IP, and
enables the use of ZWave devices (see also the ZWave
module). It was tested wit a Goodway WD6001, but since the protocol is
standardized, it should work with other devices too. A notable exception is
the USB device from Merten.
Define
define <name> ZWDongle <device>
Upon initial connection the module will get the homeId of the attached
device. Since the DevIo module is used to open the device, you can also use
devices connected via TCP/IP. See this paragraph on
device naming details.
Example:
addNode [nwOn|on|off] [sec]
Activate (or deactivate) inclusion mode. The controller (i.e. the dongle)
will accept inclusion (i.e. pairing/learning) requests only while in this
mode. After activating inclusion mode usually you have to press a switch
three times within 1.5 seconds on the node to be included into the network
of the controller. If autocreate is active, a fhem device will be created
after inclusion. "on" activates standard inclusion. "nwOn" activates network
wide inclusion (only SDK 4.5-4.9, SDK 6.x and above).
If sec is specified, the ZWDongle networkKey ist set, and the device
supports the SECURITY class, then a secure inclusion is attempted.
removeNode [nwOn|on|off]
Activate (or deactivate) exclusion mode. "on" activates standard exclusion.
"nwOn" activates network wide exclusion (only SDK 4.5-4.9, SDK 6.x and above).
Note: the corresponding fhem device have to be deleted manually.
createNode id
Request the class information for the specified node, and create a fhem
device upon reception of the answer. Used for previously included nodes,
see the nodeList get command below.
removeFailedNode
Remove a non-responding node -that must be on the failed Node list- from
the routing table in controller. Instead,always use removeNode if possible.
Note: the corresponding fhem device have to be deleted manually.
replaceFailedNode
Replace a non-responding node with a new one. The non-responding node
must be on the failed Node list.
reopen
First close and then open the device. Used for debugging purposes.
Get
nodeList
return the list of included nodenames or UNKNOWN_id, if there is no
corresponding device in FHEM. Can be used to recreate fhem-nodes with the
createNode command.
homeId
return the six hex-digit homeId of the controller.
isFailedNode
return if a node is stored in the failed node List.
caps, ctrlCaps, version
return different controller specific information. Needed by developers
only.
nodeInfo
return node specific information. Needed by developers only.
random N
request N random bytes from the controller.
raw
Send raw data to the controller. Developer only.
This module is used to control ZWave devices via FHEM, see www.z-wave.com on details for this device family.
This module is a client of the ZWDongle module, which
is directly attached to the controller via USB or TCP/IP.
To use the SECURITY features, the Crypt-Rijndael perl module is needed.
Define
define <name> ZWave <homeId> <id> [classes]
<homeId> is the homeId of the controller node, and id is the id of the
slave node in the network of this controller.
classes is a hex-list of ZWave device classes. This argument is usually
specified by autocreate when creating a device. If you wish to manually
create a device, use the classes attribute instead, see below for details.
Defining a ZWave device the first time is usually done by autocreate.
Example:
define lamp ZWave 00ce2074 9 attr lamp classes SWITCH_BINARY BASIC MANUFACTURER_SPECIFIC VERSION
SWITCH_ALL ASSOCIATION METER CONFIGURATION ALARM
Note: the sets/gets/generated events of a gven node depend on the classes
supported by this node. If a node supports 3 classes, then the union of
these sets/gets/events will be available for this node.
Commands for battery operated nodes will be queues internally, and sent when
the node sends a message. Answer to get commands appear then as events, the
corresponding readings will be updated.
Set
Note: devices with on/off functionality support the set extensions.
All
neighborUpdate
Requests controller to update his routing table which is based on
slave's neighbor list. The update may take significant time to complete.
With the event "done" or "failed" ZWDongle will notify the end of the
update process. To read node's neighbor list see neighborList get
below.
Class ASSOCIATION
associationAdd groupId nodeId ...
Add the specified list of nodeIds to the assotion group groupId. Note:
upon creating a fhem-device for the first time fhem will automatically add
the controller to the first association group of the node corresponding to
the fhem device, i.e it issues a "set name associationAdd 1
controllerNodeId"
associationDel groupId nodeId ...
Remove the specified list of nodeIds from the assotion group groupId.
associationRequest groupId
corresponds to "get association", used by associationRequestAll
associationRequestAll
request association info for all possibe groups.
Class BASIC
basicValue value
Send value (0-255) to this device. The interpretation is device dependent,
e.g. for a SWITCH_BINARY device 0 is off and anything else is on.
basicValue value
Alias for basicValue, to make mapping from the incoming events easier.
Class BASIC_WINDOW_COVERING
coveringClose
Starts closing the window cover. Moving stops if blinds are fully closed or
a coveringStop command was issued.
coveringOpen
Starts opening the window cover. Moving stops if blinds are fully open or
a coveringStop command was issued.
coveringStop
Stop moving the window cover. Blinds are partially open (closed).
Class CLIMATE_CONTROL_SCHEDULE
ccs [mon|tue|wed|thu|fri|sat|sun] HH:MM tempDiff HH:MM tempDiff ...
set the climate control schedule for the given day.
Up to 9 pairs of HH:MM tempDiff may be specified.
HH:MM must occur in increasing order.
tempDiff is relative to the setpoint temperature, and may be between -12
and 12, with one decimal point, measured in Kelvin (or Centigrade).
Class CLOCK
clock
set the clock to the current date/time (no argument required)
Class COLOR_CONTROL
rgb
Set the color of the device as a 6 digit RGB Value (RRGGBB), each color is
specified with a value from 00 to ff.
wcrgb
Used for sending warm white, cold white, red, green and blue values
to device. Values must be decimal (0 - 255) and separated by blanks.
set <name> wcrgb 0 255 0 0 0 (setting full cold white)
Class CONFIGURATION
configByte cfgAddress 8bitValue
configWord cfgAddress 16bitValue
configLong cfgAddress 32bitValue
Send a configuration value for the parameter cfgAddress. cfgAddress and
value is node specific.
Note: if the model is set (see MANUFACTURER_SPECIFIC get), then more
specific config commands are available.
configDefault cfgAddress
Reset the configuration parameter for the cfgAddress parameter to its
default value. See the device documentation to determine this value.
configRequestAll
If the model of a device is set, and configuration descriptions are
available from the database for this device, then request the value of all
known configuration parameters.
Class INDICATOR
indicatorOn
switch the indicator on
indicatorOff
switch the indicator off
indicatorDim value
takes values from 1 to 99.
If the indicator does not support dimming. It is interpreted as on.
Class MANUFACTURER_PROPRIETARY
positionBlinds
Fibaro FGRM-222 only: drive blinds to position %
positionSlat
Fibaro FGRM-222 only: drive slat to position %
Class METER
meterReset
Reset all accumulated meter values.
Note: see meterSupported command and its output to detect if resetting the
value is supported by the device.
The command will reset ALL accumulated values, it is not possible to
choose a single value.
Class MULTI_CHANNEL_ASSOCIATION
mcaAdd groupId node1 node2 ... 0 node1 endPoint1 node2 endPoint2 ...
Add a list of node or node:endpoint associations. The latter can be used to
create channels on remotes. E.g. to configure the button 1,2,... on the
zwave.me remote, use:
set remote mcaAdd 2 0 1 2
set remote mcaAdd 3 0 1 3
....
For each button a separate FHEM device will be generated.
mcaDel groupId node1 node2 ... 0 node1 endPoint1 node2 endPoint2 ...
delete node or node:endpoint associations.
Special cases: just specifying the groupId will delete everything for this
groupId. Specifying 0 for groupid will delete all associations.
Class NODE_NAMING
name NAME
Store NAME in the EEPROM. Note: only ASCII is supported.
location LOCATION
Store LOCATION in the EEPROM. Note: only ASCII is supported.
Class POWERLEVEL
Class is only used in an installation or test situation
powerlevel level timeout/s
set powerlevel to level [0-9] for timeout/s [1-255].
level 0=normal, level 1=-1dBm, .., level 9=-9dBm.
powerlevelTest nodeId level frames
send number of frames [1-65535] to nodeId with level [0-9].
Class PROTECTION
protectionOff
device is unprotected
protectionOn
device is protected
protectionSeq
device can be operated, if a certain sequence is keyed.
protectionBytes LocalProtectionByte RFProtectionByte
for commandclass PROTECTION V2 - see devicemanual for supported protectionmodes
Class SCENE_ACTIVATION
sceneConfig
activate settings for a specific scene.
Parameters are: sceneId, dimmingDuration (00..ff)
Class SCENE_ACTUATOR_CONF
sceneConfig
set configuration for a specific scene.
Parameters are: sceneId, dimmingDuration, finalValue (00..ff)
Class SCENE_CONTROLLER_CONF
groupConfig
set configuration for a specific scene.
Parameters are: groupId, sceneId, dimmingDuration.
Class SECURITY
secScheme
(internaly used to) set the security scheme '00'
sendNonce
(internaly used to) send a security NONCE to the device
secEncap
(internaly used to) send an encrypted message to the device
Notes:
This class needs the installation of the perl module Crypt::Rijndael
and a defined networkkey in the attributes of the ZWDongle device
Currently a secure inclusion can only be started from the command input
with "set <ZWDongle_device_name> addNode <On|nwOn> sec"
These commands are only described here for completeness of the
documentation, but are not intended for manual usage. These commands
will be removed from the interface in future version.
Class SWITCH_ALL
swaIncludeNone
the device does not react to swaOn and swaOff commands
swaIncludeOff
the device reacts to the swaOff command
but does not react to the swaOn command
swaIncludeOn
the device reacts to the swaOn command
but does not react to the swaOff command
swaIncludeOnOff
the device reacts to the swaOn and swaOff commands
swaOn
sends the all on command to the device
swaOff
sends the all off command to the device.
Class SWITCH_BINARY
on
switch the device on
off
switch the device off
Class SWITCH_MULTILEVEL
on, off
the same as for SWITCH_BINARY.
dim value
dim/jump to the requested value (0..100)
stop
stop dimming/operation
Class THERMOSTAT_MODE
tmOff
tmCooling
tmHeating
tmManual
set the thermostat mode to off, cooling, heating or manual.
Class THERMOSTAT_SETPOINT
setpointHeating value
set the thermostat to heat to the given value.
The value is a whole number and read as celsius.
setpointCooling value
set the thermostat to heat to the given value.
The value is a whole number and read as celsius.
Class USER_CODE
userCode id status code
set code and status for the id n. n ist starting at 1, status is 0 for
available (deleted) and 1 for set (occupied). code is a hexadecimal string.
Class VERSION
versionClassRequest
executes "get devicename versionClass class" for each class from the
classes attribute in the background without generating events, and sets the
vclasses attribute at the end.
Class WAKE_UP
wakeupInterval value nodeId
Set the wakeup interval of battery operated devices to the given value in
seconds. Upon wakeup the device sends a wakeup notification to nodeId.
wakeupNoMoreInformation
put a battery driven device into sleep mode.
Get
All
neighborList
returns the list of neighbors. Provides insights to actual network
topology. List includes dead links and non-routing neighbors.
Since this information is stored in the dongle, the information will be
returned directly even for WAKE_UP devices.
Class ALARM
alarm alarmId
return the value for alarmId. The value is device specific.
Class ASSOCIATION
association groupId
return the list of nodeIds in the association group groupId in the form:
assocGroup_X:Max Y, Nodes id,id...
associationGroups
return the number of association groups
Class ASSOCIATION_GRP_INFO
associationGroupName groupId
return the name of association groups
associationGroupCmdList groupId
return Command Classes and Commands that will be sent to associated
devices in this group
Class BASIC
basicStatus
return the status of the node as basicReport:XY. The value (XY) depends on
the node, e.g a SWITCH_BINARY device report 00 for off and FF (255) for on.
Class BATTERY
battery
return the charge of the battery in %, as battery:value % or battery:low
Class CLIMATE_CONTROL_SCHEDULE
ccsOverride
request the climate control schedule override report
ccs [mon|tue|wed|thu|fri|sat|sun]
request the climate control schedule for the given day.
Class CLOCK
clock
request the clock data
Class COLOR_CONTROL
ccCapability
return capabilities.
ccStatus channelId
return status of channel ChannelId.
Class CONFIGURATION
config cfgAddress
return the value of the configuration parameter cfgAddress. The value is
device specific.
Note: if the model is set (see MANUFACTURER_SPECIFIC get), then more
specific config commands are available.
Class DOOR_LOCK
doorLockConfiguration cfgAddress
return the configuration of the door lock.
Class HRV_STATUS
hrvStatus
report the current status (temperature, etc)
hrvStatusSupported
report the supported status fields as a bitfield.
Class INDICATOR
indicatorStatus
return the indicator status of the node, as indState:on, indState:off or
indState:dim value.
Class MANUFACTURER_PROPRIETARY
position
Fibaro FGRM-222 only: return the blinds position and slat angle.
Class MANUFACTURER_SPECIFIC
model
return the manufacturer specific id (16bit),
the product type (16bit)
and the product specific id (16bit).
Note: if the openzwave xml files are installed, then return the name of the
manufacturer and of the product. This call is also necessary to decode more
model specific configuration commands and parameters.
Class METER
meter scale
return the meter report for the requested scale.
Note: protocol V1 does not support the scale parameter, the parameter will
be ignored and the default scale will be returned.
For protocol V2 and higher, scale is supported and depends on the type of
the meter (energy, gas or water).
The device may not support all scales, see the meterSupported command and
its output. If the scale parameter is omitted, the default unit will be
reported.
Example: For an electric meter, meter 0 will report energy in kWh,
meter 2 will report power in W and meter 6 will report current in A
(if these scales are supported).
meterSupported
request the type of the meter, the supported scales and the capability to
reset the accumulated value.
Note: The output contains the decimal numbers of the supported scales that
can be used as parameter for the meter command.
Class MULTI_CHANNEL
mcEndpoints
return the list of endpoints available, e.g.:
mcEndpoints: total 2, identical
mcCapability chid
return the classes supported by the endpoint/channel chid. If the channel
does not exists, create a FHEM node for it. Example:
mcCapability_02:SWITCH_BINARY Note: This is the best way to create the secondary nodes of a
MULTI_CHANNEL device. The device is only created for channel 2 or greater.
Class MULTI_CHANNEL_ASSOCIATION
mca groupid
return the associations for the groupid. for the syntax of the returned
data see the mcaAdd command above.
Class NODE_NAMING
name
Get the name from the EEPROM. Note: only ASCII is supported.
location
Get the location from the EEPROM. Note: only ASCII is supported.
Class POWERLEVEL
powerlevel
Get the current powerlevel and remaining time in this level.
powerlevelTest
Get the result of last powerlevelTest.
Class PROTECTION
protection
returns the protection state. It can be on, off or seq.
Class SCENE_ACTUATOR_CONF
sceneConfig
returns the settings for a given scene. Parameter is sceneId
Class SCENE_CONTROLLER_CONF
groupConfig
returns the settings for a given group. Parameter is groupId
Class SECURITY
secSupported
(internaly used to) request the command classes that are supported
with SECURITY
secNonce
(internaly used to) request a security NONCE from the device
secEncap
(internaly used to) send an encrypted message to the device
Notes:
This class needs the installation of the perl module Crypt::Rijndael and
a defined networkkey in the attributes of the ZWDongle device
Currently a secure inclusion can only be started from the command input
with "set <ZWDongle_device_name> addNode <On|nwOn> sec"
These commands are only described here for completeness of the
documentation, but are not intended for manual usage. These commands
will be removed from the interface in future version.
Class SENSOR_ALARM
alarm alarmType
return the nodes alarm status of the requested alarmType. 00 = GENERIC,
01 = SMOKE, 02 = CO, 03 = CO2, 04 = HEAT, 05 = WATER, ff = returns the
nodes first supported alarm type.
Class SENSOR_BINARY
sbStatus
return the status of the node.
Class SENSOR_MULTILEVEL
smStatus
request data from the node (temperature/humidity/etc)
Class SWITCH_ALL
swaInclude
return the switch-all mode of the node.
Class SWITCH_BINARY
swbStatus
return the status of the node, as state:on or state:off.
Class SWITCH_MULTILEVEL
swmStatus
return the status of the node, as state:on, state:off or state:dim value.
Class THERMOSTAT_MODE
thermostatMode
request the mode
Class THERMOSTAT_SETPOINT
setpoint
request the setpoint
Class USER_CODE
userCode n
request status and code for the id n
Class VERSION
version
return the version information of this node in the form:
Lib A Prot x.y App a.b
versionClass classId or className
return the supported command version for the requested class
Class WAKE_UP
wakeupInterval
return the wakeup interval in seconds, in the form
wakeupReport:interval seconds target id
wakeupIntervalCapabilities (V2 only)
return the wake up interval capabilities in seconds, in the form
wakeupIntervalCapabilitiesReport:min seconds max seconds default seconds
step seconds
WNMI_delay
This attribute set the time delay between the last message sent to an
WakeUp device and the sending of the WNMI Message
(WakeUpNoMoreInformation) that will set the device to sleep mode. Value
is in seconds, subseconds my be specified. Values outside of 0.2-5.0 are
probably harmful.
classes
This attribute is needed by the ZWave module, as the list of the possible
set/get commands depends on it. It contains a space separated list of
class names (capital letters).
secure_classes
This attribute is the result of the "get DEVICE secSupported" command. It
contains a space seperated list of the the command classes that
supported with SECURITY.
vclasses
This is the result of the "set DEVICE versionClassRequest" command, and
contains the version information for each of the supported classes.
version:Lib A Prot x.y App a.b HW B FWCounter C FW c.d
V1 and V2:
versionClass_$classId:$version
Class WAKE_UP
wakeup:notification
wakeupReport:interval:X target:Y
wakeupIntervalCapabilitiesReport:min W max X default Y step Z
Class ZWAVEPLUS_INFO
zwavePlusInfo:version: V role: W node: X installerIcon: Y userIcon: Z
apptime
apptime
apptime provides information about application procedure execution time.
It is designed to identify long runner jobs causing latency as well as
overall high cpu usage jobs
No information about FHEM kernel times and delays will be provided.
Once started apptime monitors tasks. User may reset counter during operation.
apptime adds about 1% CPU load in average to FHEM.
in order to remove apptime shutdown restart is necessary.
Features:
apptime
apptime is started with the its first call nad continously monitor operation.
To unload apptime shutdown restart is necessary
apptime clear
reset all counter and start fom Zero
apptime [count|funktion|average|clear|max|name|total] [all]
display a table sorted by the field selected all will display the complete table while by default only the top lines are printed.
Columns:
name
name of the entity executing the procedure
if it is a function called by InternalTimer the name starts with tmr-.
by then it gives the name of the funktion to be called
function
procedure name which was executed
if it is an InternalTimer call it gives its calling parameter
max
longest duration measured for this procedure in ms
count
number of calls for this procedure
total
accumulated duration of this procedure over all calls monitored
average
average time a call of this procedure takes
maxDly
maximum delay of a timer call to its schedules time. This column is not relevant
for non-timer calls.
param Max call
gives the parameter of the call with the max duration
at
Start an arbitrary FHEM command at a later time.
Define
define <name> at [<timespec>|<datespec>]
<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.
<timespec> is either HH:MM, HH:MM:SS or {perlfunc()}. perlfunc must
return a string in timedet format. Note: {perlfunc()} may not contain
any spaces or tabs.
<datespec> is either ISO8601 (YYYY-MM-DDTHH:MM:SS) or number of
seconds since 1970.
Examples:
# absolute ones:
define a1 at 17:00:00 set lamp on # fhem command
define a2 at 17:00:00 { Log 1, "Teatime" } # Perl command
define a3 at 17:00:00 "/bin/echo "Teatime" > /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 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
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(+600)}
# Switch the lamp off 2 minutes after sunrise each day
define a14 at +{sunrise(+120)} set lamp on
# Switch lamp1 on at sunset, not before 18:00 and not after 21:00
define a15 at *{sunset(0,"18:00","21:00")} set lamp1 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 than the time specified, then the
command will be executed tomorrow.
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
modifyTimeSpec <timespec>
Change the execution time. Note: the N-times repetition is ignored.
It is intended to be used in combination with
webCmd, for an easier modification from the room
overview in FHEMWEB.
inactive
Inactivates the current device. Note the slight difference to the
disable attribute: using set inactive the state is automatically saved
to the statefile on shutdown, there is no explicit save necesary.
This command is intended to be used by scripts to temporarily
deactivate the at.
The concurrent setting of the disable attribute is not recommended.
active
Activates the current device (see inactive).
Get
N/A
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.
disabledForIntervals HH:MM-HH:MM HH:MM-HH-MM...
Space separated list of HH:MM tupels. If the current time is between
the two time specifications, the current device is disabled. Instead of
HH:MM you can also specify HH or HH:MM:SS. To specify an interval
spawning midnight, you have to specify two intervals, e.g.:
23:00-24:00 00:00-01:00
skip_next
Used for at commands: skip the execution of the command the next
time.
alignTime
Applies only to relative at definitions: adjust the time of the next
command execution so, that it will also be executed at the desired
alignTime. The argument is a timespec, see above for the
definition.
Example:
# Make sure that it chimes when the new hour begins
define at2 at +*01:00 set Chime on-for-timer 1
attr at2 alignTime 00:00
autocreate
Automatically create not yet defined fhem devices upon reception of a message
generated by this device. Note: devices which are polled (like the EMEM/EMWZ
accessed through the EM1010PC) will NOT be automatically created.
Define
define <name> autocreate
By defining an instance, the global attribute autoload_undefined_devices
is set, so that modules for unknnown devices are automatically loaded.
The autocreate module intercepts the UNDEFINED event generated by each
module, creates a device and optionally also FileLog and SVG
entries. Note 1: devices will be created with a unique name, which contains
the type and a unique id for this type. When renaming
the device, the automatically created filelog and SVG devices
will also be renamed. Note 2: you can disable the automatic creation by setting the
disable attribute, in this case only the rename
hook is active, and you can use the createlog
command to add FileLog and SVG to an already defined device.
Note 3: It makes no sense to create more than one instance of this
module.
autosave
After creating a device, automatically save the config file with the
command save command. Default is 1 (i.e. on), set
it to 0 to switch it off. Note: this attribute is deprecated, use the global autosave
attribute instead.
device_room
"Put" the newly created device in this room. The name can contain the
wildcards %TYPE and %NAME, see the example above.
filelog
Create a filelog associated with the device. The filename can contain
the wildcards %TYPE and %NAME, see the example above. The filelog will
be "put" in the same room as the device.
weblink
Create an SVG associated with the device/filelog.
weblink_room
"Put" the newly created SVG in this room. The name can contain the
wildcards %TYPE and %NAME, see the example above.
ignoreTypes
This is a regexp, to ignore certain devices, e.g. you neighbours FHT.
You can specify more than one, with usual regexp syntax, e.g.
attr autocreate ignoreTypes CUL_HOERMANN.*|FHT_1234|CUL_WS_7
autocreateThreshold
A list of <type>:<count>:<interval> triplets. A new
device is only created if there have been at least count
events of TYPE type in the last interval
seconds. attr autocreateThreshold
LaCrosse:2:30,EMT7110:2:60
createlog
Use this command to manually add a FileLog and an SVG to an existing
device.
This command is part of the autocreate module.
usb
Usage:
usb scan
usb create
This command will scan the /dev directory for attached USB devices, and
will try to identify them. With the argument scan you'll get back a list
of fhem commands to execute, with the argument create there will be no
feedback, and the devices will be created instead.
Note that switching a CUL to HomeMatic mode is still has to be done
manually.
On Linux it will also check with the lsusb command, if unflashed CULs are
attached. If this is the case, it will call CULflash with the appropriate
parameters (or display the CULflash command if scan is specified). The
usb command will only flash one device per call.
This command is part of the autocreate module.
average
Compute additional average, minimum and maximum values for current day and
month.
Define
define <name> average <regexp>
The syntax for <regexp> is the same as the
regexp for notify.
If it matches, and the event is of the form "eventname number", then this
module computes the daily and monthly average, maximum and minimum values
and sums depending on attribute settings and generates events of the form
<device> <eventname>_avg_day: <computed_average>
<device> <eventname>_min_day: <minimum day value>
<device> <eventname>_max_day: <maximum day value>
<device> <eventname>_cum_day: <sum of the values during the day>
<device> <eventname>_cum_month: <sum of the values during the month>
at the beginning of the next day or month respectively depending on attributes defined.
The current average, minimum, maximum and the cumulated values are stored
in the device readings depending on attributes defined.
Example:
# Compute the average, minimum and maximum for the temperature events of
# the ws1 device
define avg_temp_ws1 average ws1:temperature.*
# Compute the average, minimum and maximum for each temperature event
define avg_temp_ws1 average .*:temperature.*
# Compute the average, minimum and maximum for all temperature and humidity events
# Events:
# ws1 temperature: 22.3
# ws1 humidity: 67.4
define avg_temp_ws1 average .*:(temperature|humidity).*
# Compute the same from a combined event. Note: we need two average
# definitions here, each of them defining the name with the first
# paranthesis, and the value with the second.
#
# Event: ws1 T: 52.3 H: 67.4
define avg_temp_ws1_t average ws1:(T):.([-\d\.]+).*
define avg_temp_ws1_h average ws1:.*(H):.([-\d\.]+).*
defines how values are added up for the average calculation. This
attribute can be set to integral or counter.
The integral mode is meant for measuring continuous values like
temperature, counter is meant for adding up values, e.g. from a
feeding unit. In the first case, the time between the events plays an
important role, in the second case not. Default is integral.
nominmax
don't compute min and max values. Default is 0 (compute min & max).
noaverage
don't compute average values. Default is 0 (compute avarage).
Generated events:
<eventname>_avg_day: $avg_day
<eventname>_avg_month: $avg_month
<eventname>_cum_day: $cum_day (only if cumtype is set to raw)
<eventname>_cum_month: $cum_month (only if cumtype is set to raw)
<eventname>_min_day: $min_day
<eventname>_min_month: $min_month
<eventname>_max_day: $max_day
<eventname>_max_month: $max_month
backup
backup
The complete FHEM directory (containing the modules), the WebInterface
pgm2 (if installed) and the config-file will be saved into a .tar.gz
file by default. The file is stored with a timestamp in the
modpath/backup directory or to a directory
specified by the global attribute backupdir.
Note: tar and gzip must be installed to use this feature.
If you need to call tar with support for symlinks, you could set the
global attribute backupsymlink to everything
else as "no".
You could pass the backup to your own command / script by using the
global attribute backupcmd.
cloneDummy
This module provides a cloneDummy which will receive readings from any other device sending data
to fhem.
E.g. may be used in an FHEM2FHEM environment. Duplicate source events which may occur within the
time given by the global attribute dupTimeout, will be suppressed in order
to avoid overhead. The value of this attribute is to be changed with great care, as it affects other
parts of FHEM, too.
the order of precedence for STATE is following:
if there is no parameter preset then state of cloneDummy (initialized,active)
if addStateEvent is set then the "state" of cloned Device is set
(no "state" from cloneDummy)
if the optional reading is set in define, then value of the optional reading.
(this will overstrike the previous two lines)
if stateFormat set ass attr, it will dominate all previous lines
Optional parameter [reading] will be written to STATE if provided.
Example:
define clone_OWX_26_09FF26010000 cloneDummy OWX_26_09FF26010000 temperature
Set
N/A
Get
N/A
Attributes
addStateEvent
When paremeter in Modul is set to 1 the originalstate of the original Device will be STATE
(Momentarily not possible in Connection with FHEM2FHEM)
cloneIgnore
- comma separated list of readingnames that will NOT be generated.
Usefull to prevent truncated readingnames coming from state events.
Important: You MUST use different names for cloneDevice and sourceDevice!
cmdalias
create new commands or replace internal ones.
Define
define <name> cmdalias <cmd> [parameter]
AS newcommand..."
parameter is optional and is a regexp which must match the command
entered.
If it matches, then the specified newcommand will be executed, which is
a fhem command (see Fhem command types for
details). Like in the notify commands, $EVENT or
$EVTPART may be used, in this case representing the command arguments as
whole or the unique words entered.
Notes:
newcommand may contain cmd, but recursion is not allowed.
if there are multiple definitions, they are checked/executed in
alphabetically sorted name oder.
Examples:
define s1 cmdalias shutdown update AS save;;shutdown
define s2 cmdalias set lamp .* AS { Log 1, "$EVENT";; fhem("set $EVENT") }
configDB
This is the core backend library for configuration from SQL database.
See configdb command documentation for detailed info.
configdb
Starting with version 5079, fhem can be used with a configuration database instead of a plain text file (e.g. fhem.cfg).
This offers the possibility to completely waive all cfg-files, "include"-problems and so on.
Furthermore, configDB offers a versioning of several configuration together with the possibility to restore a former configuration.
Access to database is provided via perl's database interface DBI.
Interaction with other modules
Currently the fhem modules
02_RSS.pm
55_InfoPanel.pm
91_eventTypes
93_DbLog.pm
95_holiday.pm
98_SVG.pm
will use configDB to read their configuration data from database
instead of formerly used configuration files inside the filesystem.
This requires you to import your configuration files from filesystem into database.
This does not affect the definitons of your holiday or RSS entities.
During migration all external configfiles used in current configuration
will be imported aufmatically.
Each fileimport into database will overwrite the file if it already exists in database.
Prerequisits / Installation
Please install perl package Text::Diff if not already installed on your system.
You must have access to a SQL database. Supported database types are SQLITE, MYSQL and POSTGRESQL.
The corresponding DBD module must be available in your perl environment,
e.g. sqlite3 running on a Debian systems requires package libdbd-sqlite3-perl
Create an empty database, e.g. with sqlite3:
mba:fhem udo$ sqlite3 configDB.db
SQLite version 3.7.13 2012-07-17 17:46:21
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> pragma auto_vacuum=2;
sqlite> .quit
mba:fhem udo$
The database tables will be created automatically.
Create a configuration file containing the connection string to access database.
IMPORTANT:
This file must be named "configDB.conf"
This file must be located in the same directory containing fhem.pl and configDB.pm, e.g. /opt/fhem
## for MySQL
################################################################
#%dbconfig= (
# connection => "mysql:database=configDB;host=db;port=3306",
# user => "fhemuser",
# password => "fhempassword",
#);
################################################################
#
## for PostgreSQL
################################################################
#%dbconfig= (
# connection => "Pg:database=configDB;host=localhost",
# user => "fhemuser",
# password => "fhempassword"
#);
################################################################
#
## for SQLite (username and password stay empty for SQLite)
################################################################
#%dbconfig= (
# connection => "SQLite:dbname=/opt/fhem/configDB.db",
# user => "",
# password => ""
#);
################################################################
Start with a complete new "fresh" fhem Installation
It's easy... simply start fhem by issuing following command:
perl fhem.pl configDB
configDB is a keyword which is recognized by fhem to use database for configuration.
That's all. Everything (save, rereadcfg etc) should work as usual.
or:
Migrate your existing fhem configuration into the database
It's easy, too...
start your fhem the last time with fhem.cfg
perl fhem.pl fhem.cfg
transfer your existing configuration into the database
enter
configdb migrate
into frontend's command line
Be patient! Migration can take some time, especially on mini-systems like RaspberryPi or Beaglebone.
Completed migration will be indicated by showing database statistics.
Your original configfile will not be touched or modified by this step.
shutdown fhem
restart fhem with keyword configDB
perl fhem.pl configDB
configDB is a keyword which is recognized by fhem to use database for configuration.
That's all. Everything (save, rereadcfg etc) should work as usual.
Additional functions provided
A new command configdb is propagated to fhem.
This command can be used with different parameters.
configdb attr [attribute] [value]
Provides the possibility to pass attributes to backend and frontend.
configdb attr private 1 - set the attribute named 'private' to value 1.
configdb attr private - delete the attribute named 'private'
configdb attr - show all defined attributes.
Currently, only one attribute is supported. If 'private' is set to 1 the user and password info
will not be shown in 'configdb info' output.
configdb diff <device> <version>
Compare configuration dataset for device <device>
from current version 0 with version <version>
Example for valid request:
configdb diff telnetPort 1
will show a result like this:
compare device: telnetPort in current version 0 (left) to version: 1 (right)
+--+--------------------------------------+--+--------------------------------------+
| 1|define telnetPort telnet 7072 global | 1|define telnetPort telnet 7072 global |
* 2|attr telnetPort room telnet * | |
+--+--------------------------------------+--+--------------------------------------+
Special: configdb diff all current
Will show a diff table containing all changes between saved version 0
and UNSAVED version from memory (currently running installation).
configdb filedelete <Filename>
Delete file from database.
configdb fileexport <targetFilename>
Exports specified fhem file from database into filesystem.
Example:
configdb fileexport FHEM/99_myUtils.pm
configdb fileimport <sourceFilename>
Imports specified text file from from filesystem into database.
Example:
configdb fileimport FHEM/99_myUtils.pm
configdb filelist
Show a list with all filenames stored in database.
configdb filemove <sourceFilename>
Imports specified fhem file from from filesystem into database and
deletes the file from local filesystem afterwards.
Example:
configdb filemove FHEM/99_myUtils.pm
configdb fileshow <Filename>
Show content of specified file stored in database.
configdb info
Returns some database statistics
--------------------------------------------------------------------------------
configDB Database Information
--------------------------------------------------------------------------------
dbconn: SQLite:dbname=/opt/fhem/configDB.db
dbuser:
dbpass:
dbtype: SQLITE
--------------------------------------------------------------------------------
fhemconfig: 7707 entries
Ver 0 saved: Sat Mar 1 11:37:00 2014 def: 293 attr: 1248
Ver 1 saved: Fri Feb 28 23:55:13 2014 def: 293 attr: 1248
Ver 2 saved: Fri Feb 28 23:49:01 2014 def: 293 attr: 1248
Ver 3 saved: Fri Feb 28 22:24:40 2014 def: 293 attr: 1247
Ver 4 saved: Fri Feb 28 22:14:03 2014 def: 293 attr: 1246
--------------------------------------------------------------------------------
fhemstate: 1890 entries saved: Sat Mar 1 12:05:00 2014
--------------------------------------------------------------------------------
Ver 0 always indicates the currently running configuration.
configdb list [device] [version]
Search for device named [device] in configuration version [version]
in database archive.
Default value for [device] = % to show all devices.
Default value for [version] = 0 to show devices from current version.
Examples for valid requests:
get configDB list get configDB list global get configDB list '' 1 get configDB list global 1
configdb recover <version>
Restores an older version from database archive. configdb recover 3 will copy version #3 from database
to version #0.
Original version #0 will be lost.
Important!
The restored version will NOT be activated automatically!
You must do a rereadcfg or - even better - shutdown restart yourself.
configdb reorg [keep]
Deletes all stored versions with version number higher than [keep].
Default value for optional parameter keep = 3.
This function can be used to create a nightly running job for
database reorganisation when called from an at-Definition.
configdb search [searchVersion]
Search for specified searchTerm in any given version (default=0)
You can find two template files for datebase and configfile (sqlite only!) for easy installation.
Just copy them to your fhem installation directory (/opt/fhem) and have fun.
The frontend option "Edit files"->"config file" will be removed when running configDB.
Please be patient when issuing a "save" command
(either manually or by clicking on "save config").
This will take some moments, due to writing version informations.
Finishing the save-process will be indicated by a corresponding message in frontend.
There still will be some more (planned) development to this extension,
especially regarding some perfomance issues.
Have fun!
copy
copy <orig name> <copy name>
Create a copy of device <orig name> with the name <copy name>.
dewpoint
Dewpoint calculations. Offers three different ways to use dewpoint:
dewpoint
Compute additional event dewpoint from a sensor offering temperature and humidity.
fan
Generate a event to turn a fan on if the outside air has less water than the inside.
alarm
Generate a mold alarm if a reference temperature is lower that the current dewpoint.
Calculates dewpoint for device <devicename-regex> from temperature and humidity
and write it to a new reading named dewpoint.
If optional <temp_name>, <hum_name> and <new_name> is specified
then read temperature from reading <temp_name>, humidity from reading <hum_name>
and write the calculated dewpoint to reading <new_name>.
If <temp_name> is T then use temperature from state T: H:, add <new_name> to the state.
Example:
# Compute the dewpoint for the temperature/humidity
# events of the temp1 device and generate reading dewpoint.
define dew_temp1 dewpoint dewpoint temp1
define dew_temp1 dewpoint dewpoint temp1 temperature humidity dewpoint
# Compute the dewpoint for the temperature/humidity
# events of all devices offering temperature and humidity
# and generate reading dewpoint.
define dew_all dewpoint dewpoint .*
define dew_all dewpoint dewpoint .* temperature humidity dewpoint
# Compute the dewpoint for the temperature/humidity
# events of the device Aussen_1 offering temperature and humidity
# and insert is into STATE.
define dew_state dewpoint dewpoint Aussen_1 T H D
# Compute the dewpoint for the temperature/humidity
# events of all devices offering temperature and humidity
# and insert the result into the STATE.
# Example STATE: "T: 10 H: 62.5" will change to
# "T: 10 H: 62.5 D: 3.2"
define dew_state dewpoint dewpoint .* T H D
define <name> dewpoint fan <devicename-regex> <devicename-outside> <min-temp> [<diff_temp>]
May be used to turn an fan on or off if the outside air has less water.
Generate event "fan: on" if (dewpoint of <devicename-outside>) + <diff_temp> is lower
than dewpoint of <devicename> and temperature of <devicename-outside> is >= min-temp
and reading "fan" was not already "on". The event will be generated for <devicename>. Parameter <diff-temp> is optional
Generate event "fan: off": else and if reading "fan" was not already "off".
Example:
# Generate event "fan: on" when dewpoint of Aussen_1 is first
# time lower than basement_tempsensor and outside temperature is >= 0
# and change it to "fan: off" is this condition changes.
# Set a switch on/off (fan_switch) depending on the state.
define dew_fan1 dewpoint fan basement_tempsensor Aussen_1 0
define dew_fan1_on notify basement_tempsensor.*fan:.*on set fan_switch on
define dew_fan1_off notify basement_tempsensor.*fan:.*off set fan_switch off
Generate a mold alarm if a reference temperature is lower that the current dewpoint.
Generate reading/event "alarm: on" if temperature of <devicename-reference> - <diff-temp> is lower
than dewpoint of <devicename> and reading "alarm" was not already "on". The event will be generated for <devicename>.
Generate reading/event "alarm: off" if temperature of <devicename-reference> - <diff-temp> is higher than dewpoint of <devicename> and reading "alarm" was not already "off".
Example:
# Using a wall temperature sensor (wallsensor) and a temp/hum sensor
# (roomsensor) to alarm if the temperature of the wall is lower than
# the dewpoint of the air. In this case the water of the air will
# condense on the wall because the wall is cold.
# Set a switch on (alarm_siren) if alarm is on using notify.
define dew_alarm1 dewpoint alarm roomsensor wallsensor 0
define roomsensor_alarm_on notify roomsensor.*alarm:.*on set alarm_siren on
define roomsensor_alarm_off notify roomsensor.*alarm:.*off set alarm_siren off
# If you do not have a temperature sensor in/on the wall, you may also
# compare the rooms dewpoint to the temperature of the same or another
# inside sensor. Alarm is temperature is 5 degrees colder than the
# inside dewpointinside.
define dev_alarm2 dewpoint alarm roomsensor roomsensor 5
AbsFeuchte also becomes by the absolute humidity set the attribute into the Readings of all things.
One can by these show information also in the status.
Example: ( = the FHEM name of the adapter this one you must change)
max_timediff
Maximum time difference in seconds allowed between the temperature and humidity values for a device. dewpoint uses the Readings for temperature or humidity if they are not delivered in the event. This is necessary for using dewpoint with event-on-change-reading. Also needed for sensors that do deliver temperature and humidity in different events like for example technoline sensors TX3TH.
If not set default is 1 second.
Examples:
# allow maximum time difference of 60 seconds
define dew_all dewpoint dewpoint .*
attr dew_all max_timediff 60
dummy
Define a dummy. A dummy can take via set any values.
Used for programming.
Define
define <name> dummy
Example:
define myvar dummy set myvar 7
Set
set <name> <value>
Set any value.
Get
N/A
Attributes
readingList
Space separated list of readings, which will be set, if the first
argument of the set command matches one of them.
setList
Space separated list of commands, which will be returned upon "set name
?", so the FHEMWEB frontend can construct a dropdown and offer on/off
switches. Example: attr dummyName setList on off
Collect event types for all devices. This service is used by frontends,
e.g. notify and FileLog, to assist you in selecting the correct events.
The filename is used to store the collected events before shutdown.
More than one instance of eventTypes should not be necessary.
Examples:
define et eventTypes log/eventTypes.txt
Set
flush
used to write all collected event types into datafile.
clear
used to clear the internal table containing all collected event types.
Get
list [devicename]
return the list of collected event types for all devices or for
devicename if specified.
ignoreList
Comma separated device names to ignore whe collecting the events.
E.g. ECMD-Devices are used to post RAW data as events.
fheminfo
fheminfo [send]
fheminfo displays information about the system and FHEM definitions.
The optional parameter send transmitts the collected data
to a central server in order to support the development of FHEM. The
transmitted data is processed graphically. The results can be viewed
on http://fhem.de/stats/statistics.html.
Based on the IP address, the approximate location is determined with
an accuracy of about 40-80 km. The IP address is not saved.
Features:
Operating System Information
Hardware architecture
Installed Perl version
Installed FHEM release
Defined modules (only official FHEM Modules are counted)
The following attributes are used only in conjunction with the
send parameter. They are set on attr global.
sendStatistics
This attribute is used in conjunction with the update command.
onUpdate: transfer of data on every update (recommended setting).
manually: manually transfer of data via the fheminfo send command.
never: prevents transmission of data at anytime.
harmony
Defines a device to integrate a Logitech Harmony Hub based remote control into fhem.
It is possible to: start and stop activities, send ir commands to devices, send keyboard input by bluetooth and
smart keyboard usb dongles.
Notes:
JSON has to be installed on the FHEM host.
For hubs with firmware version 3.x.y <username> and <password> are not required as no authentication
with the logitech myharmony server is needed for the full functionality of this module.
For hubs with firmware version 4.x.y <username> and <password> are required for device level control.
Activit level control is (currently) still possible without authentication.
activity and device names can be given as id or name. names can be given as a regex and spaces in names musst be replaced by a single '.' (dot).
currentActivity
the name of the currently selected activity.
previousActivity
the name of the previous selected activity. does not trigger an event.
newVersion
will be set if a new firmware version is avaliable.
Internals
currentActivityID
the id of the currently selected activity.
previousActivityID
the id of the previous selected activity.
sleeptimer
timeout for sleeptimer if any is set.
Set
activity <id>|<name>
switch to this activity
channel <channel>
switch to <channel> in the current activity
command [<id>|<name>] <command>
send the given ir command for the current activity or for the given device
getConfig
request the configuration from the hub
getCurrentActivity
request the current activity from the hub
off
switch current activity off
reconnect [all]
close connection to the hub and reconnect, if all is given also reconnect to the logitech server
sleeptimer [<timeout>]
<timeout> -> timeout in minutes
-1 -> timer off
default -> 60 minutes
sync
syncs the hub to the myHarmony config
hidDevice [<id>|<name>]
sets the target device for keyboard commands, if no device is given -> set the target to the
default device for the current activity.
text <text>
sends <text> by bluetooth/smart keaboard dongle. a-z ,A-Z ,0-9, \n, \e, \t and space are currently possible
cursor <direction>
moves the cursor by bluetooth/smart keaboard dongle. <direction> can be one of: up, down, left, right, pageUp, pageDown, home, end.
special <key>
sends special key by bluetooth/smart keaboard dongle. <key> can be one of: previousTrack, nextTrack, stop, playPause, volumeUp, volumeDown, mute.
autocreate [<id>|<name>]
creates a fhem device for a single/all device(s) in the harmony hub. if activities are startet the state
of these devices will be updatet with the power state defined in these activites.
update
triggers a firmware update. only available if a new firmware is available.
The command, hidDevice, text, cursor and special commmands are also available for the autocreated devices. The <id>|<name> paramter hast to be omitted.
Get
activites [<param>]
lists all activities
parm = power -> list power state for each device in activity
devices [<param>]
lists all devices
commands [<id>|<name>]
lists the commands for the specified activity or for all activities
deviceCommands [<id>|<name>]
lists the commands for the specified device or for all devices
activityDetail [<id>|<name>]
deviceDetail [<id>|<name>]
configDetail
currentActivity
returns the current activity name
showAccount
display obfuscated user and password in cleartext
The commands commmand is also available for the autocreated devices. The <id>|<name> paramter hast to be omitted.
Attributes
disable
1 -> disconnect from the hub
?, help
? [<moduleName>] [] help [<moduleName>] []
Returns a list of available commands, when called without a
moduleName.
Returns a module dependent helptext, same as in commandref.
language will be determined in following order:
valid parameter <language> given
global attribute language
nothing founde: return english
holiday
Define
define <name> holiday
Define a set of holidays. The module will try to open the file
<name>.holiday in the modpath/FHEM directory.
If entries in the holiday file match the current day, then the STATE of
this holiday instance displayed in the list command
will be set to the corresponding values, else the state is set to the text
none. Most probably you'll want to query this value in some perl script:
see Value() in the perl section or the global attribute
holiday2we. The file will be reread once
every night, to compute the value for the current day, and by each get
command (see below).
Holiday file definition:
The file may contain comments (beginning with #) or empty lines.
Significant lines begin with a number (type) and contain some space
separated words, depending on the type. The different types are:
2
Easter-dependent date. Arguments: <day-offset>
<holiday-name>.
The offset is counted from Easter-Sunday.
Exampe: 2 1 Easter-Monday
Sidenote: You can check the easter date with:
fhem> { join("-", western_easter(2011)) }
5
Date relative, weekday fixed holiday. Arguments: <nth>
<weekday> <month> <day> < holiday-name>
Note that while +0 or -0 as offsets are not forbidden, their behaviour
is undefined in the sense that it might change without notice.
Examples:
5 -1 Wed 11 23 Buss und Bettag (first Wednesday before Nov, 23rd)
5 1 Mon 01 31 First Monday after Jan, 31st (1st Monday in February)
See also he.holiday in the contrib directory for official holidays in the
german country of Hessen, and by.holiday for the Bavarian definition.
Set
N/A
Get
get <name> <MM-DD> get <name> yesterday get <name> today get <name> tomorrow get <name> days
Return the holiday name of the specified date or the text none.
Attributes
N/A
KM200
The Buderus KM200 or KM50 is a communication device to establish a connection between the Buderus central heating control unit and the internet.
It has been designed in order to allow the inhabitants accessing their heating system via his Buderus App EasyControl.
Furthermore it allows the maintenance companies to access the central heating control system to read and change settings.
The km200 module enables read/write access to these parameters.
In order to use the KM200 or KM50 with fhem, you must define the private password with the Buderus App EasyControl first.
Remark:
Despite the instruction of the Buderus KM200 Installation guide, the ports 5222 and 5223 should not be opened and allow access to the KM200/KM50 module from outside.
You should configure (or leave) your internet router with the respective settings.
If you want to read or change settings on the heating system, you should access the central heating control system via your fhem system only.
As soon the module has been defined within the fhem.cfg, the module is trying to obtain all known/possible services.
After this initial contact, the module differs between a set of continuous (dynamically) changing values (e.g.: temperatures) and not changing static values (e.g.: Firmware version).
This two different set of values can be bound to an individual polling interval. Refer to Attributes
The name of the device. Recommendation: "myKm200".
<IPv4-address> :
A valid IPv4 address of the KM200. You might look into your router which DHCP address has been given to the KM200/KM50.
<GatewayPassword> :
The gateway password which is provided on the type sign of the KM200/KM50.
<PrivatePassword> :
The private password which has been defined by the user via EasyControl.
Set
The set function is able to change a value of a service which has the "writeable" - tag within the KM200/KM50 service structure.
Most of those values have an additional list of allowed values which are the only ones to be set.
Other floatable type values can be changed only within their range of minimum and maximum value.
set <service> <value>
<service> :
The name of the service which value shall be set. E.g.: "/heatingCircuits/hc1/operationMode"
<value> :
A valid value for this service.
Get
The get function is able to obtain a value of a service within the KM200/KM50 service structure.
The additional list of allowed values or their range of minimum and maximum value will not be handed back.
get <service> <option>
<service> :
The name of the service which value shall be obtained. E.g.: "/heatingCircuits/hc1/operationMode"
It returns only the value but not the unit or the range or list of allowed values possible.
<option> :
The optional Argument for the result of the get-command e.g.: "json"
The following options are available:
json - Returns the raw json-answer from the KMxxx as string.
Attributes
The following user attributes can be used with the km200 module in addition to the global ones e.g. room.
IntervalDynVal :
A valid polling interval for the dynamically changing values of the KM200/KM50. The value must be >=20s to allow the km200 module to perform a full polling procedure.
The default value is 90s.
IntervalStatVal :
A valid polling interval for the statical values of the KM200/KM50. The value must be >=20s to allow the km200 module to perform a full polling procedure.
The default value is 3600s.
The value of "0" will disable the polling of statical values until the next fhem restart or a reload of the fhem.cfg - file.
PollingTimeout :
A valid time in order to allow the module to wait for a response of the KM200/KM50. Usually this value does not need to be changed but might in case of slow network or slow response.
The default and minimum value is 5s.
ConsoleMessage :
A valid boolean value whether the activity and error messages shall be displayed in the console window. "0" (deactivated) or "1" (activated)
The default value 0 (deactivated).
DoNotPoll :
A list of services separated by blanks which shall not be downloaded due to repeatable crashes or irrelevant values.
The list can be filled with the name of the top - hierarchy service, which means everything below that service will also be ignored.
The default value (empty) therefore nothing will be ignored.
ReadBackDelay :
A valid time in milliseconds [ms] for the delay between writing and re-reading of values after using the "set" - command. The value must be >=0ms.
The default value is 100 = 100ms = 0,1s.
logProxy
Allows the manipulation of data to be plotted in an SVG device:
addition of horizontal lines at fixed values
addition of horizontal lines at dynamic values eg: min, max or average values of another plot
addition of vertical lines at fixed or dynamic times between two fixed or dynamic y values
addition of calculated data like week profiles of HeatingControll devices or heating thermostats
merge plot data from different sources. eg. different FileLog devices
horizontaly shifting a (merged) plot to align average or statistic data to the correct day,week and month
Define
define <name> logProxy
Only one logProxy device can be defined and is needed.
#logProxy <column_spec>
where <column_spec> can be one or more of the following:
FileLog:<log device>[,<options>]:<column_spec>
DbLog:<log device>[,<options>]:<column_spec>
options is a comma separated list of zero or more of:
clip
clip the plot data to the plot window
extend=<value>
extend the query range to the log device by <value> seconds (or <value> months if <value> ends in m).
also activates cliping.
interpolate
perform a linear interpolation to the values in the extended range to get the values at the plot boundary. only usefull
if plotfunction is lines.
offset=<value>
shift plot by <value> seconds (or <value> months if <value> ends in m).
allows alignment of values calculated by average or statsitics module to the correct day, week or month.
predict[=<value>]
no value -> extend the last plot value to now.
value -> extend the last plot value by <value> but maximal to now.
postFn='<myPostFn>'
myPostFn is the name of a postprocessing function that is called after all processing of the data by logProxy
has been done. it is called with two arguments: the devspec line from the gplot file and a reference to a data
array containing the points of the plot. each point is an array with three components: the point in time in seconds,
the value at this point and the point in time in string form. the return value must return a reference to an array
of the same format. the third component of each point can be omittet and is not evaluated.
scale2reading=<scaleHashRef>
Use zoom step dependent reading names.
The reading name to be used is the result of a lookup with the current zoom step into scaleHashRef.
The keys can be from the following list: year, month, week, day, qday, hour
Example:
ConstX:<time>,<y>[,<y2>]
Will draw a vertical line (or point) at <time> between <y> to <y2>.
Everything after the : is evaluated as a perl expression that hast to return one time string and one or two y values.
Examples:
ConstY:<value>[,<from>[,<to>]]
Will draw a horizontal line at <value>, optional only between the from and to times.
Everything after the : is evaluated as a perl expression that hast to return one value and optionaly one or two time strings.
Examples:
Polar:[<options>]:<values>
Will draw a polar/spiderweb diagram with the given values. <values> has to evaluate to a perl array.
If <values> contains numbers these values are plottet and the last value will be connected to the first.
If <values> contains strings these strings are used as labels for the segments.
The axis are drawn automaticaly if the values are strings or if no values are given but the segments option is set.
The corrosponding SVG device should have the plotsize attribute set (eg: attr plotsize 340,300) and the used gplot file has to contain xrange and yrange entries and the x- and y-axis labes should be switched off with xtics, ytics and y2tics entries.
The following example will plot the temperature and desiredTemperature values of all devices named MAX.*:
set xtics () set ytics () set y2tics () set xrange [-40:40] set yrange [-40:40]
plot "" using 1:2 axes x1y1 title 'Ist' ls l0 lw 1 with lines,\ plot "" using 1:2 axes x1y1 title 'Soll' ls l1fill lw 1 with lines,\ plot "" using 1:2 axes x1y1 notitle ls l0 lw 1 with points,\ plot "" using 1:2 axes x1y1 notitle ls l2 lw 1 with lines,\
options is a comma separated list of zero or more of:
axis
force to draw the axis
noaxis
disable to draw the axis
range=<value>
the range to use for the radial axis
segments=<value>
the number of circle/spiderweb segments to use for the plot
Func:<perl expression>
Specifies a perl expression that returns the data to be plotted and its min, max and last value. It can not contain
space or : characters. The data has to be
one string of newline separated entries of the form: yyyy-mm-dd_hh:mm:ss value Example:
logProxy_WeekProfile2Plot is a sample implementation of a function that will plot the week profile
of a Heating_Control, WeekdyTimer, HomeMatic or MAX Thermostat device can be found in the 98_logProxy.pm module file.
logProxy_Func2Plot($from,$to,$func) is a sample implementation of a function that will evaluate the given
function (3rd parameter) for a zoom factor dependent number of times. the current time is given in $sec.
the step width can be given in an optional 4th parameter. either as a number or as an hash with the keys from
the following list: hour,qday,day,week,month,year and the values representing the step with for the zoom level.
logProxy_xy2Plot(\@xyArray) is a sample implementation of a function that will accept a ref to an array
of xy-cordinate pairs as the data to be plotted.
logProxy_values2Plot(\@xyArray) is a sample implementation of a function that will accept a ref to an array
of date-y-cordinate pairs as the data to be plotted.
The perl expressions have access to $from and $to for the begining and end of the plot range and also to the
SVG specials min, max, avg, cnt, sum, currval (last value) and currdate (last date) values of the individual curves
already plotted are available as $data{<special-n>}.
logProxy_Range2Zoom($seconds) can be used to get the approximate zoom step for a plot range of $seconds.
SVG_time_to_sec($timestamp) can be used to convert the timestamp strings to epoch times for calculation.
Please see also the column_spec paragraphs of FileLog, DbLog and SVG.
NOTE: spaces are not allowed inside the colums_specs.
To use any of the logProxy features with an existing plot the associated SVG file hast to be changed to use the logProxy
device and the .gplot file has to be changed in the following way:
All existing #FileLog and #Dblog lines have to be changed to #logProxy lines and the column_spec of these line has to
be prepended by FileLog:<log device>: or DbLog:<log device>: respectively.
Examples:
Watches a mailbox with imap idle and for each new mail triggers an event with the subject of this mail.
This can be used to send mails *to* FHEM and react to them from a notify. Application scenarios are for example
a geofencing apps on mobile phones, networked devices that inform about warning or failure conditions by e-mail or
(with a little logic in FHEM) the absence of regular status messages from such devices and so on.
Notes:
Mail::IMAPClient and IO::Socket::SSL and IO::Socket::INET hast to be installed on the FHEM host.
Probably only works reliably if no other mail programm is marking messages as read at the same time.
If you experience a hanging system caused by regular forced disconnects of your internet provider you
can disable and enable the mailcheck instance with an at.
If MIME::Parser is installed non ascii subjects will be docoded to utf-8
If MIME::Parser and Mail::GnuPG are installed gpg signatures can be checked and mails from unknown senders can be ignored.
<user> and <password> can be of the form {perl-code}. no spaces are allowed. for both evals $NAME and $HOST is set to the name and host of the mailcheck device and $USER is set to the user in the password eval.
Defines a mailcheck device.
delete_message
1 -> delete message after Subject reading is created
interval
the interval in seconds used to trigger an update on the connection.
if idle is supported the defailt is 600, without idle support the default is 60. the minimum is 60.
nossl
1 -> don't use ssl.
disable
1 -> disconnect and stop polling
debug
1 -> enables debug output. default target is stdout.
logfile
set the target for debug messages if debug is enabled.
accept_from
comma separated list of gpg keys that will be accepted for signed messages. Mail::GnuPG and MIME::Parser have to be installed
If a netatmo device of the account type is created all fhem devices for the netatmo devices are automaticaly created
(if autocreate is not disabled).
Examples:
autocreate
Create fhem devices for all netatmo devices.
Get
devices
list the netatmo devices for this account
update
trigger an update
public [<station>] [<address>] <args>
no arguments -> get all public stations in a radius of 0.025° around global fhem longitude/latitude
<rad> -> get all public stations in a radius of <rad>° around global fhem longitude/latitude
<lon> <lat> [<rad>] -> get all public stations in a radius of 0.025° or <rad>° around <lon>/<lat>
<lon_ne> <lat_ne> <lon_sw> <lat_sw> -> get all public stations in the area of <lon_ne> <lat_ne> <lon_sw> <lat_sw>
if <address> is given then list stations in the area of this address. can be given as 5 digit german postal code or a: followed by a textual address. all spaces have to be replaced by a +.
if <station> is given then print fhem define for this station
Attributes
interval
the interval in seconds used to check for new values.
During an update or a system start from FHEM sometimes it is necessary to
inform the user about important changes or additions. It may be necessary
to confirm a system message by the user.
By entering the command 'notice' a list of all messages is displayed.
Are messages available in different languages, they are ordered by language.
Example:
fhem> notice
==> Language: de
ID Published Expired Confirmed Description
advice-20130128-002 actually never not needed kurze beschreibung
update-20130128-002 31.01.2013 01.02.2013 no kurze beschreibung
==> Language: en
ID Published Expired Confirmed Description
advice-20130128-001 actually never no short description
advice-20130128-002 actually never not needed short description
update-20130128-001 actually never no short description
update-20130128-002 31.01.2013 01.02.2013 no short description
By entering 'notice list <keyword>' the output of the list contains only
available messages that starts with '<keyword>'.
Example:
fhem> notice list update
==> Language: de
ID Published Expired Confirmed Description
update-20130128-002 31.01.2013 01.02.2013 no kurze beschreibung
==> Language: en
ID Published Expired Confirmed Description
update-20130128-001 actually never no short description
update-20130128-002 31.01.2013 01.02.2013 no short description
To display a single message, enter the command 'notice view <id>' where id
is the Identifier of the message. You can use the optional parameter noheader
or the language codes de or en to display the message
without the header informations or in your prefered language if available.
Example:
fhem> notice view advice-20130128-002 de
ID : advice-20130128-002
From : M. Fischer
Date : 28.01.2013
Expire : 0
Title : kurze beschreibung
### Start of Text
test-advice
dies ist ein test
001
### End of Text
If it is necessary to confirm a message, this is be done by entering 'notice confirm <id> [value]'.
The optional argument value will also be stored with the confirmation.
Example:
These arguments are normally not needed by any user.
A message may optionally contains one or more code snippets. The argument condition supplies the determined
value(s) of the embedded test(s) as a key:value pair. If more than one pair returned, they they are seperated by |.
It is possible to define your own rules for a condition, like !empty or >>5 and so on. An example
of a condition is shown in the below example message file.
Example:
The argument get, followed by a keyword and a number from 0 to 8, returns a
comma seperated list of message ids.
The possible outputs are:
0 returns a list of all messages.
1 returns a list of unconfirmed messages.
2 returns a list of messages that are not expired.
3 returns a list of messages that are not expired and unconfirmed.
4 returns a list of published messages.
5 returns a list of unconfirmed and published messages.
6 returns a list of published messages that are not expired.
7 returns a list of published, unconfirmed and not expired messages.
8 returns a list of confirmed messages.
Example:
fhem> notice get all 2
advice-20130128-001,advice-20130128-002,update-20130128-001,update-20130128-002
The argument position followed by an <id> returns the view position of a message if defined.
Example:
fhem> notice position update-20130128-001
before
Example of a message file:
# FROM: M. Fischer
# DATE: 28.01.2013
# CONFIRM: 1
# PUBLISH: 31.01.2013
# EXPIRE: 01.02.2013
# KEY_1: sendStatistics
# VAL_1: AttrVal("global","sendStatistics",undef);
# CON_1: !empty
# KEY_2: configfile
# VAL_2: AttrVal("global","configfile",undef);
# POSITION: top
# TITLE_DE: kurze beschreibung
# NOTICE_DE
Hinweis:
dies ist ein test
# TITLE_EN: short description
# NOTICE_EN
Advice:
this is a test
The keywords 'FROM, DATE, CONFIRM, PUBLISH, EXPIRE, TITLE_DE, TITLE_EN, NOTICE_DE, NOTICE_EN' are fixed.
It is possible to add any key:value string to these files. Also it is possible to set only one or both keywords of
'TITLE_DE, TITLE_EN' and 'NOTICE_DE, NOTICE_EN'.
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:
<pattern> is either the name of the triggering
device, or devicename:event.
<pattern> must completely (!)
match either the device name, or the compound of the device name and
the event. To identify the events use the inform command from the
telnet prompt or the "Event Monitor" link in the browser
(FHEMWEB), and wait for the event to be printed. See also the
eventTypes device.
in the command section you can access the event:
The variable $EVENT will contain the complete event, e.g.
measured-temp: 21.7 (Celsius)
$EVTPART0,$EVTPART1,$EVTPART2,etc contain the space separated event
parts (e.g. $EVTPART0="measured-temp:", $EVTPART1="21.7",
$EVTPART2="(Celsius)". This data is available as a local
variable in perl, as environment variable for shell scripts, and will
be textually replaced for FHEM commands.
$NAME and $TYPE contain the name and type of the device triggering
the event, e.g. myFht and FHT
Note: the following is deprecated and will be removed in a future
release. It is only active for featurelevel up to 5.6.
The described replacement is attempted if none of the above
variables ($NAME/$EVENT/etc) found in the command.
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. The space separated event "parts"
are available as %EVTPART0, %EVTPART1, etc. A single %
looses its special meaning if any of these parameters appears in the
definition.
Following special events will be generated for the device "global"
INITIALIZED after initialization is finished.
REREADCFG after the configuration is reread.
SAVE before the configuration is saved.
SHUTDOWN before FHEM is shut down.
DEFINED <devname> after a device is defined.
DELETED <devname> after a device was deleted.
RENAMED <old> <new> after a device was renamed.
UNDEFINED <defspec> upon reception of a message for an
undefined device.
Notify can be used to store macros for manual execution. Use the trigger command to execute the macro.
E.g. fhem> define MyMacro notify MyMacro { Log 1, "Hello"} fhem> trigger MyMacro
Set
addRegexpPart <device> <regexp>
add a regexp part, which is constructed as device:regexp. The parts
are separated by |. Note: as the regexp parts are resorted, manually
constructed regexps may become invalid.
removeRegexpPart <re>
remove a regexp part. Note: as the regexp parts are resorted, manually
constructed regexps may become invalid.
The inconsistency in addRegexpPart/removeRegexPart arguments originates
from the reusage of javascript functions.
inactive
Inactivates the current device. Note the slight difference to the
disable attribute: using set inactive the state is automatically saved
to the statefile on shutdown, there is no explicit save necesary.
This command is intended to be used by scripts to temporarily
deactivate the notify.
The concurrent setting of the disable attribute is not recommended.
active
Activates the current device (see inactive).
forwardReturnValue
Forward the return value of the executed command to the caller,
default is disabled (0). If enabled (1), then e.g. a set command which
triggers this notify will also return this value. This can cause e.g
FHEMWEB to display this value, when clicking "on" or "off", which is
often not intended.
addStateEvent
The event associated with the state Reading is special, as the "state: "
string is stripped, i.e $EVENT is not "state: on" but just "on". In some
circumstances it is desireable to get an additional event where "state: "
is not stripped. In such a case the addStateEvent attribute should be
set to 1 (default is 0, i.e. do not generate an additional event).
Note 1: you have to set this attribute for the event "receiver", i.e.
notify, FileLog, etc.
Note 2: this attribute will only work for events generated by devices
supporting the readingFnAttributes.
panStamp
The panStamp is a family of RF devices sold by panstamp.com.
It is possible to attach more than one device in order to get better
reception, fhem will filter out duplicate messages.
This module provides the IODevice for the SWAP modules that implement the SWAP protocoll
to communicate with the individual moths in a panStamp network.
Note: currently only panSticks are know to work. The panStamp shield for a Rasperry Pi is untested.
Note: this module may require the Device::SerialPort or Win32::SerialPort
module if you attach the device via USB and the OS sets strange default
parameters for serial devices.
<device> specifies the serial port to communicate with the panStamp.
The name of the serial-device depends on your distribution, under
linux the cdc_acm kernel module is responsible, and usually a
/dev/ttyACM0 device will be created. If your distribution does not have a
cdc_acm module, you can force usbserial to handle the panStamp by the
following command:
modprobe usbserial vendor=0x0403
product=0x6001
In this case the device is most probably
/dev/ttyUSB0.
You can also specify a baudrate if the device name contains the @
character, e.g.: /dev/ttyACM0@38400
If the baudrate is "directio" (e.g.: /dev/ttyACM0@directio), then the
perl module Device::SerialPort is not needed, and fhem opens the device
with simple file io. This might work if the operating system uses sane
defaults for the serial parameters, e.g. some Linux distributions and
OSX.
The address is a 2 digit hex number to identify the moth in the panStamp network. The default is 01.
The channel is a 2 digit hex number to define the channel. the default is 00.
The syncword is a 4 digit hex number to identify the panStamp network. The default is B547.
Uppon initialization a broadcast message is send to the panStamp network to try to
autodetect and autocreate all listening SWAP devices (i.e. all devices not in power down mode).
Set
raw data
send raw data to the panStamp to be transmitted over the RF link.
Get
Attributes
pilight
Define
define <name> pilight <protocol>
Defines a module for setting pilight compartible switches on or off. See Sweetpi.
Supported protocols: kaku_switch, quigg_*, elro_he, elro_hc, silvercrest, pollin, brennenstuhl, mumbi, impuls, rsl366, rev1_switch, rev2_switch, clarus_switch, raw, and intertechno_old. If you need more, just write an issue!
If your pilight server does not run on localhost, please set both the attributes remote_ip and remote_port. If you are running pilight >3.0, then please define the port used by pilight settings: http://www.pilight.org/getting-started/settings/; fhem-plight uses 5000 by default.
This version is written for pilight 6.0. If you run a prior version, please set the following attribute: attr Weihnachtsbaum useOldVersion 1
pilight_ctrl is the base device for the communication (sending and receiving) with the pilight-daemon.
You have to define client devices e.q. pilight_switch for switches.
Further information to pilight: http://www.pilight.org/
disconnectDiconnect from pilight daemon and do not reconnect automatically
Readings
rcv_raw
The last complete received message in json format.
Attributes
ignoreProtocol
Comma separated list of protocol:id combinations to ignore.
protocol:* ignores the complete protocol.
* All incomming messages will be ignored. Only protocol id combinations from defined submodules will be accepted
Example:
ignoreProtocol tfa:0
ignoreProtocol tfa:*
ignoreProtocol *
brands
Comma separated list of : combinations to rename protocol names.
pilight uses different protocol names for the same protocol e.q. arctech_switch and kaku_switch
Example: brands archtech:kaku
ContactAsSwitch
Comma separated list of ids which correspond to a contact but will be interpreted as switch.
In this case opened will be interpreted as on and closed as off.
Example: ContactAsSwitch 12345
It is possible to add the screen feature to a dimmer. So you can change the dimlevel by set 'up' or 'down'.
If you push up or down on the remote control the dimlevel will be changed by dimlevel_step.
Further it is possible to define a simulated dimmer with a screen and switch protocol. See example three.
That means if you change the dimlevel a up or down command will be send n times to dim the device instead of send a dimlevel directly.
Define
define <name> pilight_dimmer protocol id unit [protocol] The second protocol is optional. With it you can add the pilight screen feature (up|down)
Example:
Calculates rain values for device <devicename-regex> from incremental rain-value and israining-state
and write it to some new readings named rain_calc_???????.
If optional <rain_name>, <israining_name> and <new_name> is specified
then read rain from reading <rain_name>, israining from reading <israining_name>
and write the calculated rain to reading <new_name>.
The following values are generated:
rain_calc_all --> all values in one line
rain_calc_d_curr --> liter rain at the current day (from 7:30 local time)
rain_calc_d_last --> liter rain of 24h before 7:30 local time
rain_calc_d_start --> first incremental rain value from the rain device after 7:30 local time
rain_calc_h_curr --> liter rain at the current hour (from XX:30)
rain_calc_h_last --> liter rain of 1 hour before the last XX:30 time
rain_calc_h_start --> first incremental rain value from the rain device after last XX:30
rain_calc_now_diff --> fallen rain in liter since last value from rain device
rain_calc_now_rate --> fallen rain in liter/hour since last value from rain device
Example:
# Compute the rain for the rain/israining
# events of the ks300 device and generate reading rain_calc.
define rain_ks300 rain ks300
DontUseIsRaining 0/1
Don't use the devicevalue IsRaining, if set to 1
DayChangeTime HHMM
Change the default (day)time of the 'set value to zero' time (use the timecode as four digits!)
The minutevalue is used to set the (hour)time of the 'set value to zero' time
CorrectionValue 1
Use this value if you wish to do a correction of the rain-device-values. It is used as an factor. The value 1 will not change anything.
readingsGroup
Displays a collection of readings from on or more devices.
<device> can be of the form INTERNAL=VALUE where INTERNAL is the name of an internal value and VALUE is a regex.
<device> can be of the form ATTRIBUTE&VALUE where ATTRIBUTE is the name of an attribute and VALUE is a regex.
<device> can be of the form <STRING> or <{perl}> where STRING or the string returned by perl is
inserted as a line in the readings list. skipped if STRING is undef.
<device> can be a devspec (see devspec) with at least one FILTER expression.
If regex is a comma separatet list the reading values will be shown on a single line.
If regex starts with a '+' it will be matched against the internal values of the device instead of the readings.
If regex starts with a '?' it will be matched against the attributes of the device instead of the readings.
If regex starts with a '!' the display of the value will be forced even if no reading with this name is available.
If regex starts with a '$' the calculation with value columns and rows is possible.
regex can be of the form <regex>@device to use readings from a different device.
if the device name part starts with a '!' the display will be foreced.
use in conjunction with ! in front of the reading name.
regex can be of the form <regex>@{perl} to use readings from a different device.
regex can be of the form <STRING> or <{perl}[@readings]> where STRING or the string returned by perl is
inserted as a reading or:
the item will be skipped if STRING is undef
if STRING is br a new line will be started
if STRING is hr a horizontal line will be inserted
if STRING is of the form %ICON[%CMD] ICON will be used as the name of an icon instead of a text and CMD
as the command to be executed if the icon is clicked. also see the commands attribute.
if readings is given the perl expression will be reevaluated during longpoll updates.
For internal values and attributes longpoll update is not possible. Refresh the page to update the values.
the <{perl}> expression is limited to expressions without a space. it is best just to call a small sub
in 99_myUtils.pm instead of having a compex expression in the define.
hide
will hide all visible instances of this readingsGroup
show
will show all visible instances of this readingsGroup
toggle
will toggle the hidden/shown state of all visible instances of this readingsGroup
toggle2
will toggle the expanded/collapsed state of all visible instances of this readingsGroup
Get
Attributes
alwaysTrigger
1 -> alwaysTrigger update events. even if not visible.
2 -> trigger events for calculated values.
disable
1 -> disable notify processing and longpoll updates. Notice: this also disables rename and delete handling.
2 -> also disable html table creation
3 -> also disable html creation completely
sortDevices
1 -> sort the device lines alphabetically. use the first of sortby or alias or name that is defined for each device.
noheading
If set to 1 the readings table will have no heading.
nolinks
Disables the html links from the heading and the reading names.
nostate
If set to 1 the state reading is excluded.
nonames
If set to 1 the reading name / row title is not displayed.
notime
If set to 1 the reading timestamp is not displayed.
mapping
Can be a simple string or a perl expression enclosed in {} that returns a hash that maps reading names
to the displayed name. The keys can be either the name of the reading or <device>.<reading>.
%DEVICE, %ALIAS, %ROOM, %GROUP, %ROW and %READING are replaced by the device name, device alias, room attribute,
group attribute and reading name respectively. You can also prefix these keywords with $ instead of %. Examples: attr temperatures mapping $DEVICE-$READING attr temperatures mapping {temperature => "%DEVICE Temperatur"}
separator
The separator to use between the device alias and the reading name if no mapping is given. Defaults to ':'
a space can be enteread as
setList
Space separated list of commands, which will be returned upon "set name ?",
so the FHEMWEB frontend can construct a dropdown and offer on/off switches.
set commands not in this list will be rejected.
setFn
perl expresion that will be executed for the commands from the setList.
has access to $CMD and $ARGS.
style
Specify an HTML style for the readings table, e.g.: attr temperatures style style="font-size:20px"
cellStyle
Specify an HTML style for a cell of the readings table. regular rows and colums are counted starting with 1,
the row headings are column number 0. perl code has access to $ROW and $COLUMN. keys for hash lookup can be
r:#, c:# or r:#,c:# , e.g.: attr temperatures cellStyle { "c:0" => 'style="text-align:right"' }
nameStyle
Specify an HTML style for the reading names, e.g.: attr temperatures nameStyle style="font-weight:bold"
valueStyle
Specify an HTML style for the reading values, e.g.: attr temperatures valueStyle style="text-align:right"
valueColumn
Specify the minimum column in which a reading should appear. attr temperatures valueColumn { temperature => 2 }
valueColumns
Specify an HTML colspan for the reading values, e.g.: attr wzReceiverRG valueColumns { eventdescription => 'colspan="4"' }
valueFormat
Specify an sprintf style format string used to display the reading values. If the format string is undef
this reading will be skipped. Can be given as a string, a perl expression returning a hash or a perl
expression returning a string, e.g.: attr temperatures valueFormat %.1f °C attr temperatures valueFormat { temperature => "%.1f °C", humidity => "%i %" } attr temperatures valueFormat { ($READING eq 'temperature')?"%.1f °C":undef }
valuePrefix
text to be prepended to the reading value
valueSuffix
text to be appended after the reading value attr temperatures valueFormat { temperature => "%.1f", humidity => "%i" } attr temperatures valueSuffix { temperature => "°C", humidity => " %" }
nameIcon
Specify the icon to be used instead of the reading name. Can be a simple string or a perl expression enclosed
in {} that returns a hash that maps reading names to the icon name. e.g.: attr devices nameIcon $DEVICE
valueIcon
Specify an icon to be used instead of the reading value. Can be a simple string or a perl expression enclosed
in {} that returns a hash that maps reading value to the icon name. e.g.: attr devices valueIcon $VALUE attr devices valueIcon {state => '%VALUE'} attr devices valueIcon {state => '%devStateIcon'} attr rgMediaPlayer valueIcon { "playStatus.paused" => "rc_PLAY", "playStatus.playing" => "rc_PAUSE" }
commands
Can be used in to different ways:
To make a reading or icon clickable by directly specifying the command that should be executed. eg.: attr rgMediaPlayer commands { "playStatus.paused" => "set %DEVICE play", "playStatus.playing" => "set %DEVICE pause" }
Or if the mapped command is of the form <command>:[<modifier>] then the normal FHEMWEB
webCmd widget for <modifier> will be used for this command. if <modifier> is omitted then the FHEMWEB lookup mechanism for <command> will be used. eg: attr rgMediaPlayer commands { volume => "volume:slider,0,1,100" } attr lights commands { pct => "pct:", dim => "dim:" }
commands can be used for attribtues. eg: attr commands { disable => "disable:" }
visibility
if set to hidden or hideable will display a small button to the left of the readingsGroup name to expand/hide the contents of the readingsGroup. if a readingsGroup is expanded then all others in the same group will be hidden.
hidden -> default state is hidden but can be expanded
hideable -> default state is visible but can be hidden
if set to collapsed or collapsible readingsGroup will recognise the specials <->,<+> and <+-> as the first elements of
a line to add a + or - symbol to this line. clicking on the + or - symbol will toggle between expanded and collapsed state. if a readingsGroup is expanded then all others in the same group will be collapsed.
- -> line will be visible in expanded state
+ -> line will be visible in collapsed state
+- -> line will be visible in both states
collapsed -> default state is collapsed but can be expanded
collapsible -> default state is visible but can be collapsed
For the hash version of all mapping attributes it is possible to give a default value
with { '' => <default> }.
The style attributes can also contain a perl expression enclosed in {} that returns the style
string to use. For nameStyle and valueStyle The perl code can use $DEVICE,$READING,$VALUE and $NUM, e.g.:
Note: Only valueStyle, valueFomat, valueIcon and <{...}@reading> are evaluated during longpoll updates
and valueStyle has to return a non empty style for every possible value. All other perl expressions are
evaluated only once during html creation and will not reflect value updates with longpoll.
Refresh the page to update the dynamic style. For nameStyle the color attribut is not working at the moment,
the font-... and background attributes do work.
Calculation: to be written...
eg: define rg readingsGroup .*:temperature rg:$avg
readingsHistory
Displays a history of readings from on or more devices.
<device> can be of the form INTERNAL=VALUE where INTERNAL is the name of an internal value and VALUE is a regex.
If regex is a comma separatet list it will be used as an enumeration of allowed readings.
if no device/reading argument is given only lines with 'set add ...' are displayed.
Examples:
Set
add ...
directly add text as new line to history.
clear
clear the history.
Get
history
list history
Attributes
alwaysTrigger
1 -> alwaysTrigger update events. even if not visible.
disable
1 -> disable notify processing and longpoll updates. Notice: this also disables rename and delete handling.
2 -> also disable html table creation
3 -> also disable html creation completely
noheading
If set to 1 the readings table will have no heading.
nolinks
Disables the html links from the heading and the reading names.
notime
If set to 1 the reading timestamp is not displayed.
mapping
Can be a simple string or a perl expression enclosed in {} that returns a hash that maps device names
to the displayed name. The keys can be either the name of the reading or <device>.<reading>.
%DEVICE, %ALIAS, %ROOM and %GROUP are replaced by the device name, device alias, room attribute and
group attribute respectively. You can also prefix these keywords with $ instead of %.
style
Specify an HTML style for the readings table, e.g.: attr history style style="font-size:20px"
timestampFormat
POSIX strftime compatible string for used as the timestamp for each line.
valueFormat
Specify an sprintf style format string used to display the reading values. If the format string is undef
this reading will be skipped. Can be given as a string, a perl expression returning a hash or a perl
expression returning a string, e.g.: attr history valueFormat %.1f °C attr history valueFormat { temperature => "%.1f °C", humidity => "%.1f %" } attr history valueFormat { ($READING eq 'temperature')?"%.1f °C":undef }
rows
Number of history rows to show.
readingsProxy
Makes (a subset of) a reading from one device available as a new device.
This can be used to map channels from 1-Wire, EnOcean or SWAP devices to independend devices that
can have state,icons and webCmd different from the parent device and can be used in a floorplan.
Define
define <name> readingsProxy <device>:<reading>
Examples:
define myProxy readingsProxy myDS2406:latch.A
Set
Get
Attributes
disable
1 -> disable notify processing. Notice: this also disables rename and delete handling.
getList
Space separated list of commands, which will be returned upon "get name ?",
so the FHEMWEB frontend can construct a dropdown.
%PARENT% will result in the complete list of commands from the parent device.
get commands not in this list will be rejected.
setList
Space separated list of commands, which will be returned upon "set name ?",
so the FHEMWEB frontend can construct a dropdown and offer on/off switches.
%PARENT% will result in the complete list of commands from the parent device.
set commands not in this list will be rejected.
Example: attr proxyName setList on off
getFn
perl expresion that will return the get command forwarded to the parent device.
has access to $DEVICE, $READING, $CMD and $ARGS.
undef -> do nothing
"" -> pass-through
(,1) -> directly return , don't call parent getFn
everything else -> use this instead
setFn
perl expresion that will return the set command forwarded to the parent device.
has access to $CMD, $DEVICE, $READING and $ARGS.
undef -> do nothing
"" -> pass-through
everything else -> use this instead
Examples: attr myProxy setFn {($CMD eq "on")?"off":"on"}
valueFn
perl expresion that will return the value that sould be used as state.
has access to $LASTCMD, $DEVICE, $READING and $VALUE.
undef -> do nothing
"" -> pass-through
everything else -> use this instead
Examples: attr myProxy valueFn {($VALUE == 0)?"off":"on"}
remotecontrol
Displays a graphical remote control. Buttons (=icons) can be chosen and arranged. Predefined layouts are available for e.g. Samsung-TV or iTunes.
Any buttonclick can be forwarded to the actual fhem-device. For further explanation, please check the Wiki-Entry<>. Define
define <rc-name> remotecontrol
Typical steps to implement a remotecontrol:
define rc1 remotecontrol
# defines a "blank" remotecontrol
get rc1 layout
# displays all available predefined layouts
set rc1 layout samsung
# assigns keys for a SamsungTV
set rc1 makenotify myTV
# creates notify_rc1 which forwards every buttonclick to myTV for execution
Note: keys can be changed at any time, it is not necessary to redefine the weblink
attr rc1 row15 VOLUP,VOLDOWN
Set
set <rc-name> layout [delete|<layoutname>] layout delete deletes all rowXX-attributes layout <layoutname> assigns a predefined layout to rowXX-attributes
set <rc-name> makeweblink [<name>]
creates a weblink to display the graphical remotecontrol. Default-name is weblink_<rc-name> .
set <rc-name> makenotify <executingDevice>
creates a notify to trigger <executingDevice> every time a button has been pressed. name is notify_<rc-name> .
Get
get <rc-name> [htmlcode|layout]
htmlcode displays htmlcode for the remotecontrol on fhem-page
layout shows which predefined layouts ae available
rc_iconpath
path for icons, default is "icons" . The attribute-value will be used for all icon-files except .svg .
rc_iconprefix
prefix for icon-files, default is "" . The attribute-value will be used for all icon-files except .svg .
Note: Icon-names (button-image-file-names) will be composed as fhem/<rc_iconpath>/<rc_iconprefix><command|image>
For .svg -icons, the access sequence is according to the FHEMWEB-attribute iconPath, default is openautomation:fhemSVG:default .
rc_devStateIcon
In FHEMWEB-room-overview, displays the button-layout on the rc-device itself. Default is 1, set to 0 is the remotecontrol-device should not display its buttons in FHEMWEB roomview.
rowXX attr <rc-name> rowXX <command>[:<image>][,<command>[:<image>]][,...]
Comma-separated list of buttons/images per row. Any number of buttons can be placed in one row. For each button, use
<command> is the command that will trigger the event after a buttonclick. Case sensitive.
<image> is the filename of the image
Per button for the remotecontrol, use
<command> where an icon with the name <command> is displayed
Example: attr rc1 rc_iconprefix black_btn_ # used for ALL icons on remotecontrol rc1 attr rc1 row00 VOLUP
icon is black_btn_VOLUP, a buttonclick creates the event VOLUP
or
<command>:<image> where an icon with the name <rc_iconprefix><image> is displayed
Example: row00=LOUDER:VOLUP
icon is black_btn_VOLUP, a buttonclick creates the event LOUDER
Examples: attr rc1 row00 1,2,3,TV,HDMI attr rc2 row00 play:PLAY,pause:PAUSE,louder:VOLUP,quieter:VOLDOWN
Hint: use :blank for a blank space, use e.g. :blank,:blank,:blank for a blank row
restore
restore list []
restore []
Restore the files saved previously by the update command. Check the available
files with the list argument. See also the update command and its restoreDirs
attribute. After a restore normally a "shutdown restart" is necessary.
A sequence is used to allow to trigger events for a certain combination of
button presses on a remote. E.g. to switch on a lamp when pressing the
Btn1:on, then Btn2:off and at last Btn1:on one after the other you could
define the following:
define lampseq sequence Btn1:on 0.5 Btn2:off 0.5 Btn1:on
define lampon notify lampseq:trigger set lamp on
triggerPartial
if set (to 1), and not all the events of a sequence are received, then a
partial_X event is generated by the sequence. Example:
fhem> define seq sequence d1:on 1 d1:on 1 d1:on
fhem> attr seq triggerPartial
fhem> set d1 on;; sleep 0.5;; set d1 on
generates the event seq partial_2. This can be used to assign different
tasks for a single button, depending on the number of times it is
pressed.
reportEvents
if set (to 1), report the events (space separated) after the
"trigger" or "partial_X" keyword. This way one can create more general
sequences, and create different notifies to react:
define seq sequence remote:btn.* remote:btn.*
attr seq reportEvents
define n_b1b2 notify seq:trigger.remote:btn1.remote:btn2 set lamp1 on
define n_b2b1 notify seq:trigger.remote:btn2.remote:btn1 set lamp1 off
This modul calculates for certain readings of given devices statistical values and adds them to the devices.
For detail instructions, look at and please maintain the FHEM-Wiki.
Until now statistics for the following readings are automatically built:
Min|Avg|Max Minimum, average and maximum of instantaneous values:
over a period of day, month and year:
brightness, current, energy_current, humidity, temperature, voltage
over a period of hour, day, month and year:
wind, wind_speed, windSpeed
Tendency over 1h, 2h, 3h und 6h: pressure
Delta between start and end values - over a period of hour, day, month and year:
count, energy, energy_total, power, total, rain, rain_rate, rain_total
Duration (and counter) of the states (on, off, open, closed...) over a period of day, month and year:
lightsensor, lock, motion, Window, window, state (if no other reading is recognized)
Further readings can be added via the attributesdeltaReadings, durationReadings, minAvgMaxReadings, tendencyReadings.
This allows also to assign a reading to another statistic type.
Define
define <name> statistics <deviceNameRegExp> [Prefix]
Example: define Statistik statistics Sensor_.*|Wettersensor
<DeviceNameRegExp>
Regular expression of device names. !!! Not the device readings !!!
[Prefix]
Optional. Prefix set is place before statistical data. Default is stat
Set
resetStatistics <All|DeviceName>
Resets the statistic values of the selected device.
doStatistics
Calculates the current statistic values of all monitored devices.
Get
not implemented yet
Attributes
dayChangeTime <time>
Time of day change. Default is 00:00. For weather data the day change can be set e.g. to 06:50.
deltaReadings <readings>
Comma separated list of reading names for which a delta statistic shall be calculated.
durationReadings <readings>
Comma separated list of reading names for which a duration statistic shall be calculated.
excludedReadings <DeviceRegExp:ReadingNameRegExp>
Regular expression of the readings that shall be excluded from the statistics.
The reading have to be entered in the form deviceName:readingName.
E.g. FritzDect:current|Sensor_.*:humidity
ignoreDefaultAssignments < 0 | 1 >
Ignores the default assignments of readings to a statistic type (see above).
So, only the readings that are listed in the specific attributes are evaluated.
minAvgMaxReadings <readings>
Comma separated list of reading names for which a min/average/max statistic shall be calculated.
periodChangePreset <seconds>
Preponed start of the calculation of periodical data. Default is 5 seconds before each full hour.
Allows thus the correct timely assignment within plots. Should be adapted to the CPU speed or load of the server.
Regulare expression of statistic values, which for which singular readings are created additionally to the summary readings. Eases the creation of plots. For duration readings the name of the state has to be used as statTypes.
Example: Wettersensor:rain:Delta:(Hour|Day)|(FritzDect:(current|power):(Avg|Max|Delta):(Hour|Day) Badfenster:Window:(Open|Open_Count):Month
specialDeltaPeriodHours <hours>
Adds, for readings of delta statistics, a singular reading for the given period of hours (e.g. for the rain of the last 72 hours)
tendencyReadings <readings>
Comma separated list of reading names for which a tendendy statistic shall be calculated.
The structure device is used to organize/structure devices in order to
set groups of them at once (e.g. switching everything off in a house).
The list of attached devices can be modified through the addstruct /
delstruct commands. Each attached device will get the attribute
<struct_type>=<name> when it is added to the list, and the
attribute will be deleted if the device is deleted from the structure.
The structure devices can also be added to a structure, e.g. you can have
a building consisting of levels which consists of rooms of devices.
Example:
define kitchen structure room lamp1 lamp2
addstruct kitchen TYPE=FS20
delstruct kitchen lamp1
define house structure building kitchen living
set house off
Set
Every set command is propagated to the attached devices. Exception: if an
attached device has an attribute structexclude, and the attribute value
matches (as a regexp) the name of the current structure.
If the set is of the form set <structure> [FILTER=<filter>] <type-specific>
then :FILTER=<filter> will be appended to the device name in the propagated set for
the attached devices like this: set :FILTER=<filter> <type-specific>
Get
get is not supported through a structure device.
Attributes
async_delay
If this attribute is defined, unfiltered set commands will not be
executed in the clients immediately. Instead, they are added to a queue
to be executed later. The set command returns immediately, whereas the
clients will be set timer-driven, one at a time. The delay between two
timercalls is given by the value of async_delay (in seconds) and may be
0 for fastest possible execution. This way, excessive delays often
known from large structures, can be broken down in smaller junks.
clientstate_behavior
The backward propagated status change from the devices to this structure
works in two different ways.
absolute
The structure status will changed to the common device status of all
defined devices to this structure if all devices are identical.
Otherwise the structure status is "undefined".
relative
See below for clientstate_priority.
relativeKnown
Like relative, but do not trigger on events not described in
clientstate_priority. Needed e.g. for HomeMatic devices.
last
The structure state corresponds to the state of the device last changed.
clientstate_priority
If clientstate_behavior is set to relative, then you have to set the
attribute "clientstate_priority" with all states of the defined devices
to this structure in descending order. Each group is delemited by
space or /. Each entry of one group is delimited by "pipe". The status
represented by the structure is the first entry of each group.
Example:
attr house clientstate_priority Any_On|An All_Off|Aus
In this example the status of kitchen is either on or off. The status
of house is either Any_on or All_off.
<struct_type>_map
With this attribute, which has to specified for the structure-
member, you can redefine the value reported by a specific
structure-member for the structure value. The attribute has three
variants:
readingName
take the value from readingName instead of state.
oldVal:newVal
if the state reading matches oldVal, then replace it with newVal
readingName:oldVal:newVal
if readingName matches oldVal, then replace it with newVal
Example:
define door OWSWITCH <ROMID>
define lamp1 dummy
attr lamp1 cmdlist on off
define kitchen structure struct_kitchen lamp1 door
attr door struct_kitchen_map A:open:on A:closed:off
attr door2 struct_kitchen_map A
structexclude
exclude the device from set/notify or attribute operations. For the set
and notify the value of structexclude must match the structure name,
for the attr/deleteattr commands ist must match the combination of
structure_name:attribute_name. Examples:
define <name> telnet <portNumber> [global]
or define <name> telnet <servername>:<portNumber>
First form, server mode:
Listen on the TCP/IP port <portNumber> for incoming
connections. If the second parameter global is not specified,
the server will only listen to localhost connections.
To use IPV6, specify the portNumber as IPV6:<number>, in this
case the perl module IO::Socket:INET6 will be requested.
On Linux you may have to install it with cpan -i IO::Socket::INET6 or
apt-get libio-socket-inet6-perl; OSX and the FritzBox-7390 perl already has
this module.
Examples:
Note: The old global attribute port is automatically converted to a
telnet instance with the name telnetPort. The global allowfrom attibute is
lost in this conversion.
Second form, client mode:
Connect to the specified server port, and execute commands received from
there just like in server mode. This can be used to connect to a fhem
instance sitting behind a firewall, when installing exceptions in the
firewall is not desired or possible. Note: this client mode supprts SSL,
but not IPV6.
Example:
Start tcptee first on publicly reachable host outside the firewall.
perl contrib/tcptee.pl --bidi 3000
Configure fhem inside the firewall:
define tClient telnet <tcptee_host>:3000
Connect to the fhem from outside of the firewall:
telnet <tcptee_host> 3000
Set
N/A
Get
N/A
Attributes:
password
Specify a password, which has to be entered as the very first string
after the connection is established. If the argument is enclosed in {},
then it will be evaluated, and the $password variable will be set to
the password entered. If the return value is true, then the password
will be accepted. If thies parameter is specified, fhem sends telnet
IAC requests to supress echo while entering the password.
Also all returned lines are terminated with \r\n.
Example:
Note: if this attribute is set, you have to specify a password as the
first argument when using fhem.pl in client mode:
perl fhem.pl localhost:7072 secret "set lamp on"
globalpassword
Just like the attribute password, but a password will only required for
non-local connections.
prompt
Sets the string for the telnet prompt, the default is fhem>
SSL
Enable SSL encryption of the connection, see the description here on generating the needed SSL certificates. To
connect to such a port use one of the following commands:
Update the FHEM installation. Technically this means update will download
http://fhem.de/fhemupdate/controls_fhem.txt first, compare it to the local
version in FHEM/controls_fhem.txt, and will download each file where the
attributes (timestamp and filelength) are different.
Notes:
The contrib directory will not be updated.
The files are automatically transferred from the source repository
(SVN) to the web site once a day, at 7:45 CET / CEST.
The all argument is default.
The force argument will disregard the local file.
The check argument will only display the files it would download, and
the last section of the CHANGED file.
Specifying a filename will only download matching files (regexp).
updateInBackground
If this attribute is set (to 1), the update will be executed in a
background process. The return message is communicated via events, and
in telnet the inform command is activated, in FHEMWEB the Event
Monitor.
updateNoFileCheck
If set, the command won't compare the local file size with the expected
size. This attribute was introduced to satisfy some experienced FHEM
user, its default value is 0.
backup_before_update
If this attribute is set, an update will back up your complete
installation via the backup command. The default
is not set as update relies on the restore feature (see below).
Example:
attr global backup_before_update
exclude_from_update
Contains a space separated list of fileNames (regexps) which will be
excluded by an update. The special value commandref will disable calling
commandref_join at the end, i.e commandref.html will be out of date.
The module-only documentation is not affected and is up-to-date.
Example:
attr global exclude_from_update 21_OWTEMP.pm FS20.off.png
restoreDirs
update saves each file before overwriting it with the new version from
the Web. For this purpose update creates a directory restoreDir in the
global modpath directory, then a subdirectory with the current date,
where the old version of the currently replaced file is stored.
The default value of this attribute is 3, meaning that 3 old versions
(i.e. date-directories) are kept, and the older ones are deleted. If
the attribute is set to 0, the feature is deactivated.
Start an arbitrary FHEM 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 in the at or notify
Examples:
# Request data from the FHT80 _once_ if we do not receive any message for
# 15 Minutes.
define w watchdog FHT80 00:15:00 SAME set FHT80 date
# Request data from the FHT80 _each_ time we do not receive any message for
# 15 Minutes, i.e. reactivate the watchdog after it triggered. Might be
# dangerous, as it can trigger in a loop.
define w watchdog FHT80 00:15:00 SAME set FHT80 date;; trigger w .
# Shout once if the HMS100-FIT is not alive
define w watchdog HMS100-FIT 01:00:00 SAME "alarm-fit.sh"
# Send mail if the window is left open
define w watchdog contact1:open 00:15 contact1:closed "mail_me close window1"
attr w regexp1WontReactivate
Notes:
if <regexp1> is . (dot), then activate the watchdog at
definition time. Else it will be activated when the first matching
event is received.
<regexp1> resets the timer of a running watchdog, to avoid it
use the regexp1WontReactivate attribute.
if <regexp2> is SAME, then it will be the same as the first
regexp, and it will be reactivated, when it is received.
trigger <watchdogname> . will activate the trigger if its state
is defined, and set it into state defined if its state is
triggered. You always have to reactivate the watchdog with this
command once it has triggered (unless you restart fhem)
a generic watchdog (one watchdog responsible for more devices) is
currently not possible.
with modify all parameters are optional, and will not be changed if
not specified.
regexp1WontReactivate
When a watchdog is active, a second event matching regexp1 will
normally reset the timeout. Set this attribute to prevents this.
execOnActivate
If set, its value will be executed as a FHEM command when the watchdog is
reactivated (after triggering) by receiving an event matching regexp1.
wecoInterval - Interval (seconds) to send data to www.wetter.com
Will be adjusted to 600 if set to a value lower than 600.
wecotest - If set to "true" data will not be stored on server. Used for development and testing.
weco.... - Attribute name corresponding to parameter name from api.
Each of this attributes contains information about weather data to be sent in format
sensorName:readingName[:offset]
Example: attr weco wecote outside:temperature will define the attribut wecote and
reading "temperature" from device "outside" will be sent to network as paramater "te" (which indicates current temperature)
Optional Parameter "offset" will be added to the read value
(e.g. sometimes necessary to send dewpoint - use offset 273.15 if needed in Kelvin)
interval
the interval in seconds used to check for new values.
disable
1 -> stop polling
xxLG7000
Define
define <name> xxLG7000 <serial-device>
Defines a serial link to a TV set of LG's xxLG70yy (e. g. 47LG7000) series
and similar TV sets from LG. As of January 2010, the following TV sets should
be compatible:
xxLG7000, e. g. 47LG7000 (tested)
xxPG7000, e. g. 50PG7000 (same Manual as 47LG7000 ;))
PS3000/6000/7000/8000 series (according to LG brochure; no liabilities assumed)
PQ3000/6000 series (see PS3000)
LU4000/5000 series (not LU7000; see PS3000)
LH2000/3000/4000/5000 series (see PS3000)
SL9500/9000/8000 series (see PS3000)
These TV sets feature a serial connector which can officially be used to control
the TV set (see your Onwer's Manual, there's an Appendix labelled "External Control
Device setup", referening to cabling and command set). The xxLG7000 module is
the FHEM module to actually utilize this. (BTW, those TVs run Linux internally ;))
To exercise control over your TV set, use the LGTV module and
bind it ("attr <LGTV-name> IODev <xxLG7000-name>") to xxLG7000.
SetID (1, 2, ...; see your TV's Owner's Manual how to set it. Defaults to 1 if unset.)
yowsup
Module to interface to the yowsup library to send and recive WhatsApp messages.
Notes:
Probably only works on linux/unix systems.
Define
define <name> yowsup
Defines a yowsup device.
Examples:
define WhatsApp yowsup
Set
image <path>
sends an image
send <text>
sends <text>
Attributes
cmd
complette commandline to start the yowsup cli client
eg: attr WhatsApp cmd /opt/local/bin/yowsup-cli demos -c /root/config.yowsup --yowsup
home
set $HOME for the started yowsup process
PWD -> set to $PWD
anything else -> use as $HOME
nickname
nickname that will be send as sender
accept_from
comma separated list of contacts (numbers) from which messages will be accepted
commandPrefix
not set -> don't accept commands
0 -> don't accept commands
1 -> allow commands, every message is interpreted as a fhem command
anything else -> if the message starts with this prefix then everything after the prefix is taken as the command
allowedCommands
A comma separated list of commands that are allowed from this contact.
If set to an empty list , (i.e. comma only) no commands are accepted. Note: allowedCommands should work as intended, but no guarantee
can be given that there is no way to circumvent it.
Perl specials
If you want to automate some tasks via fhem, then you'll probably use at or notify. For more complex tasks
you'll use either a shell-script or a perl "oneliner" as the at/notify
argument. This chapter gives some tips in using the perl oneliners.
To test perl oneliners, type them on the telnet prompt (or FHEMWEB text
input) by enclosing it in {}, one line at once. The last line will only
write something in the logfile, the output of the other lines is directly
visible.
Perl expressions are separated by ;, in fhem oneliners they have to
escaped with ;;
{ my $a = 1+1;; Log 1, "Hello $a" }
To use fhem commands from the perl expression, use the function fhem(),
which takes a string argument, this string will be evaluated as a fhem
command:
Note: if this function returns a value, it will also be logged into the
global fhem log. Use 1 as a second argument to disable this logging, this
makes sense when obtainig some values via fhem "get...".
Notify can be used to store macros for manual execution. Use the trigger command to execute the macro:
To make date and time handling easier, the variables $sec, $min, $hour,
$mday, $month, $year, $wday, $yday, $isdst are available in the perl
oneliners (see also perldoc -f localtime). Exceptions: $month is in the
range of 1 to 12, and $year is corrected by 1900 (as I would expect).
Additionally the variable $hms contains the time in the HH:MM:SS format.
Additionally the variabe $we is 1 if it is weekend (i.e $wday == 0 or
$wday == 6), and 0 otherwise. If the holida2we
global attribute is set, $we is 1 for holidays too.
offset is in seconds, and the format of min/max is "HH:MM" or "HH:MM:SS".
isday returns 1 if the sun is visible, and 0 else.
gnuplot file syntax
The .gplot files are also used by the FHEMWEB/SVG module
when the plotmode attribute is set to SVG. In this case
only a subset of the .gnuplot attributes are used, and some lines have special
meanings: the difference will be explained in this chapter. See also this fhemwiki entry on
creating logs.
Following is a minimal .gplot definition (valid only for plotmode SVG):
set terminal size <SIZE>
#FileLog 4:::
plot title 'Temperature' with lines
The .gnuplot file consists of 3 parts:
set commands
Following sets are recognized:
terminal, only the size parameter.
This is usually set to <SIZE>, which is replaced by the plotsize attribute of the FHEMWEB or weblink
instance.
title
Usually set to <TL> which is replace by the weblink title attribute, or to <Lx>, which is replaced
by the weblink label attribute.
ylabel,y2label
Left and right labels, printed vertically. Are also subject to label
replacement.
yrange,y2range
Specify the range of the left and right axis. Examples:
set yrange [-0.1:1.1]
set y2range [0:]
ytics,y2tics
the label for the left/right axis tics. Examples:
set ytics ("on" 0, "off" 1)
set y2tics
#FileLog entries
Each line from the plot section must have one corresponding #FileLog
line. For the syntax see the column_spec paragraph of the Filelog get description.
Note that for SVG plots the first column of the input file always has to
be in the standard fhem timestamp format (YYYY-MM-DD_HH:MM:SS)
plot entries
There is always one plot command with comma separated argument-blocks.
Each argument-block represents one line, and has its own parameters.
Following parameters are recognized:
axes x1y1 / x1y2
tells the program to assign the current line to one of the two axes
(left or right).
title
Caption of the line. Whan clicking on this title, a small javascript
program will change the title to the min/max and last values of the plot,
will enable copying this line or pasting an already copied one (the
existing scale of the plot wont'be changed, only the pasted line will
be scaled), and other lines of the plot will temporarily be hidden.
with <linetype>
Specify the line type. Following types are recognized: points,
steps, fsteps, histeps and lines. Everything unknown will be mapped to
the type lines.
SVG special: cubic and quadratic, are mapped to the SVG path types C,
and Q respectively.
ls <linestyle>
The linestyle defaults to l0 for the first line, l1 for the second, and
so on. It is defined in the svg_style.css file. There are two sets
defined here: l0-l8 and l0fill-l6fill. The second set must be specified
explicitly. If the name of the linestyle contains the word fill, then
plots of the lineytype "lines" will have an additional starting and
ending segment, so that filling is done correctly.
See the SVG spec for details of this CSS file.
Note: if you plan to use this attribute, you have to specify it for all
the lines (attribute-blocks) in the plot command.
lw <linewidth>
Sets the stroke-width style of the line. This attribute is deprecated,
the corresponding feature of the CSS file / (attribute ls) should be
used instead.