fhem.pl reference

Version: EN DE

Contents

    Introduction
    Fhem command types
    Device specification

    Fhem commands
      attr   backup   CULflash   createlog   define   delete   deleteattr   deletereading   fheminfo   get   getstate   ?,help   include   inform   JsonList   list   modify   notice   quit   reload   rename   rereadcfg   save   set   setdefaultattr   setstate   shutdown   sleep   trigger   update   usb   xmllist  

    Devices
      global
      ALL3076   ALL4000T   ALL4027   BS   CM11   CUL   CUL_EM   CUL_FHTTK   CUL_HM   CUL_HOERMANN   CUL_IR   CUL_MAX   CUL_RFR   CUL_TX   CUL_WS   ECMD   ECMDDevice   EIB   EM   EMEM   EMGZ   EMWZ   ESA2000   EnOcean   FBAHA   FBDECT   FHT   FHT8V   FHZ   FRM   FRM_AD   FRM_I2C   FRM_IN   FRM_LCD   FRM_OUT   FRM_PWM   FRM_SERVO   FS20   HMLAN   HMS   HMinfo   HTTPSRV   HUEBridge   HUEDevice   IPCAM   IPWE   IT   Itach_Relay   KM271   KS300   LGTV   LIRC   LUXTRONIK2   M232   M232Counter   M232Voltage   MAX   MAXLAN   MSG   MSGFile   MSGMail   NetIO230B   OREGON   OWAD   OWCOUNT   OWDevice   OWFS   OWID   OWLCD   OWMULTI   OWSWITCH   OWServer   OWTEMP   OWTHERM   OWX   POKEYS   RFXCOM   RFXMETER   RFXX10REC   RSS   SCIVT   SISPM   SIS_PMS   SML   STV   SVG   SYSSTAT   TCM   TRX   TRX_ELSE   TRX_LIGHT   TRX_SECURITY   TRX_WEATHER   TUL   TellStick   USBWX   USF1000   Utils   VIERA   VantagePro2   WEBCOUNT   WEBIO   WEBIO_12DIGITAL   WEBTHERM   WS2000   WS300   WS3600   Weather   X10   XmlList   YAMAHA_AVR   ZWDongle   ZWave   xxLG7000  

    Helper modules
      at   autocreate   average   Calendar   DbLog   dewpoint   dummy   eventTypes   FHEM2FHEM   FHEMWEB   FB_CALLMONITOR   FileLog   FLOORPLAN   HCS   Heating_Control   holiday   LightScene   notify   PID   PRESENCE   PachLog   SUNRISE_EL   sequence   structure   telnet   Twilight   THRESHOLD   watchdog   weblink   WOL  

    Perl specials
    gnuplot file syntax

Introduction

    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:
      telnet <fhemhost> 7072
      <NL>
      (This newline switches into "prompt" mode)
      <command>...
      quit

    or
      fhem.pl <fhemhost>:7072 "<command>..."

Fhem command types

    There are three types of commands: "fhem" commands (described in this document), shell commands (they must be enclosed in double quotes ") and perl expressions (enclosed in curly brackets {}). shell commands or perl expressions are needed for complex at or notify arguments, but can also issued as a "normal" command.

    E.g. the following three commands all do the same when issued from a telnet prompt:
      set lamp off
      "fhem.pl 7072 "set lamp off""
      {fhem("set lamp off")}

    Shell commands will be executed in the background, perl expressions and fhem commands will be executed in the main "thread". In order to make perl expressions easier to write, some special functions and variables are available. See the section Perl special for a description. To trigger fhem commands from a shell script (this is the "other way round"), use the client form of fhem.pl (described above).

    Multiple fhem commands are separated by semicolon (;). In order to use semicolon in perl code or shell programs, they have to be escaped by the double semicolon (;;). 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

    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 \) .

Device specification (devspec)

    The commands attr, deleteattr, delete, get, list, set, setstate, trigger can take a more complex device specification as argument, which will be expanded to a list of devices. A device specification (short devspec) can be:
    • a single device name. This is the most common case.
    • a list of devices, separated by comma (,)
    • a range of devices, separated by dash (-)
    • a regular expression, if the the spec contains on e of the following characters: ^*[]$
    • an attribute of the device, followed by an equal sign (=) and then a regexp for this attribute. As attribute you can specify either attributes set with the attr command or one of the "internal" attributes DEF, STATE and TYPE.
    Example:
      set lamp1 on
      set lamp1,lamp2,lamp3 on
      set lamp[1-3] on
      set lamp.* on
      set lamp1-lamp3 on
      set lamp1-lamp3,lamp3 on
      set room=kitchen off
      list disabled=
      list TYPE=FS20
    Notes:
    • first the spec is separated by komma, then the range or the regular expression operations are executed.
    • if there is a device which exactly corresponds to the spec, then no special processing is done.
    • the returned list can contain the same device more than once, so "set lamp1-lamp3,lamp3 on" switches lamp3 twice.
    • for more complex structuring demands see the structure device.

?, help

    ?
    help

    Get a list of all commands and short description for each one

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>.

    Attributes used by all devices:
    • 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.
    • 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.

    • readingFnAttributes
      The following attributes are honored by the modules that make use of the standardized readings updating mechanism in fhem.pl. Check the modules attribute list if you want to know if it is supporting it.
    • 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.

    • 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.

    • The precedence of event-on-update-reading and event-on-change-reading is as follows:
      1. If both attributes are not set, any update of any reading of the device creates an event.
      2. If any of the attributes is set, no events occur for updates or changes of readings not listed in any of the attributes.
      3. 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.

    • userReadings
      A comma-separated list of definitions of user-defined readings. Each definition has the form:
        <reading>[:<trigger>] [<modifier>] { <perl code> }
      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:
        attr myEnergyMeter userReadings energy { ReadingsVal("myEnergyMeter","counters.A",0)/1250.0;; }
        attr myMultiMeter userReadings energy1:counters.A { ReadingsVal("myMultiMeter","counters.A",0)/1250.0;; }, energy2:counters.B { ReadingsVal("myMultiMeter","counters.B",0)/1250.0;; }
      <modifier> can take one of these values:
      • 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.
      Example:
        attr myPowerMeter userReadings power differential { ReadingsVal("myPowerMeter","counters.A",0)/1250.0;; }
      Note: 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!


    Device specific attributes are documented in the corresponding device section.

    Examples:
      attr global verbose 3
      attr lamp room kitchen
      attr lamp group lights
      attr lamp loglevel 6
      attr weatherstation event-on-update-reading wind,temperature,humidity
      attr weatherstation event-on-change-reading israining
      attr weatherstation event-on-change-reading israining,state
      attr heating stateFormat Temp:measured-temp, Valve:actuator

    Notes:
    • See deleteattr to delete attributes.

setdefaultattr

    setdefaultattr [<attrname> [<value>]]

    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:
      setdefaultattr room kitchen
      setdefaultattr loglevel 4
      define lamp1 FS20 1234 11
      define lamp2 FS20 1234 12
      define lamp3 FS20 1234 13
      setdefaultattr

    Notes:
    • There is no way to delete a single default-attribute from the list

define

    define <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)".
    Use "define <name> ?" to get a list of possible types.
    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.

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>.

    Examples:
      deleteattr lamp follow-on-for-timer
      deleteattr lamp

deletereading

    deletereading <devspec> <readingname>

    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>.

    Examples:
      deletereading mySensor temp1
      deletereading mySensor temp\d+

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
      get <device> ?
    See the Device specification section for details on <devspec>.

    Each device has different get parameters, see the corresponding device section for details.

getstate

    getstate <devspec>

    Output a short space seperated status for <devspec>. It is useful for monitoring the device in e.g. Cacti.
    Examples:
      getstate lamp
      state:1

      getstate fl
      ack:0 actuator:2 day-temp:21.5 desired-temp:22.5 [...] measured-temp:22.9 [...]
    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.

    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.


    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.
    • off-till <timedet>
      see on-till 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

setstate

    setstate <devspec> <value>

    Set the "STATE" for <name> as shown in paranthesis in the list command to <value> without sending any signals to the device itself. This command is also used in the statefile. See the Device specification section for details on <devspec>.

    Examples:
      setstate lamp on
    Note:
    • The statefile uses another version of this command, don't be surprised.

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.

    Example:
      shutdown
      shutdown restart

trigger

    trigger <devspec> <state>

    Trigger a notify definition. See the Device specification section for details on <devspec>.

    Example:
      trigger btn3 on

sleep

    sleep <sec>

    Sleep for a given amount, millisecond accuracy.

    Example:
      sleep 0.5
      define n3 notify btn3.* set lamp toggle;;sleep 0.5;;set lamp toggle

    Note: sleep followed by another command and issued in at/notify/etc is not blocking fhem.

global

    The global device is used to set different global attributes. It will be automatically defined, it cannot be deleted or renamed and has no set or get parameters

    Define
      N/A

    Set
      N/A

    Get
      N/A

    Attributes
    • archivedir
    • archivecmd
    • nrarchive

    • 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.

    • backup_before_update
      If this attribute is set to 0, an update skip always backing up your installation via the backup command. The default is to backup always before updates.
      Note: Set this attribute only if you know what you do!
      This Attribute is used by the update command.
      Example:
        attr global backup_before_update 0

    • 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.:
        "/etc/fhem.cfg /var/log/fhem/fhem.save /usr/share/fhem/contrib /usr/share/fhem/FHEM /usr/share/fhem/foo /usr/share/fhem/foobar /usr/share/fhem/www"
      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 backupsymlinks 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.

    • exclude_from_update
      Contains a space separated list of file which will be excluded by an update. This Attribute is used by the update command.
      Example:
        attr global exclude_from_update 21_OWTEMP.pm temp4hum4.gplot FS20.on.png FS20.off.png

    • 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

    • 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, 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

    • 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.

    • 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.

    • sendStatistics
    • 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.

    • uniqueID
    • updatebranch
      The update branch will be set by the file FhemUtils/release.pm contained in the modpath. For example, if a stable version (version 5.3 upwards) of fhem is installed via a direct download connection of the archieve on the fhem-website, then the branch of the update is automatically on "stable". In this branch, only updates fixing confirmed errors, relevant security fixes or new stable versions are provided.
      By using the command "update development <filename>", particular files or packages can always be installed directly from the development branch (e.g. "update development <package>").
      If you want to update from the development branch in stable verion in general, you can force this behaviour by using the attribute "updatebranch DEVELOPMENT". In case the installation of fhem should generally using the development branch, this attribute would not have to be set. Instead, use "update development force" to update all files including release.pm (containing the release-information) to the newest version.

    • userattr
      A space separated list which contains the names of additional attributes. Without specifying them you will not be able to set them (in order to prevent typos).

    • verbose
      Set the verbosity level. Possible values:
      • 0 - server start/stop
      • 1 - error messages or unknown packets
      • 2 - major events/alarms.
      • 3 - commands sent out will be logged.
      • 4 - you'll see whats received by the different devices.
      • 5 - debugging.
      Recommended level is 3 for normal use.

    • 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.

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.

    Define
      define <name> ALL4000T <ip-address> <port> <delay>

      Defines a temperature sensor connected on an Allnet 4000 device via its ip address and port. Use the delay argument to define the delay between polls.

      Examples:
        define AUSSEN.POOL.TEMP.vorlauf ALL4000T 192.168.68.20 t2 120

ALL4027

    Note: this module needs the HTTP::Request and LWP::UserAgent perl modules.

    Define
      define <name> ALL4027 <ip-address> <port> <relay_nr> <delay>

      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

BS

    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Ω.

      Example:
        define bs1 BS 1 40000

    Set
      N/A

    Get
      N/A

    Attributes
    • do_not_notify
    • showtime
    • loglevel
    • model (bs)
    • ignore
    • readingFnAttributes

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.

    Attributes
    • do_not_notify
    • dummy
    • loglevel
    • model (CM11)

CUL

    The CUL/CUR/CUN is a family of RF devices sold by busware.de. With the opensource firmware (see this link) they are capable to receive and send different 868MHz protocols (FS20/FHT/S300/EM/HMS). 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/CUR/CUN):
        <device> specifies the serial port to communicate with the CUL or CUR. 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):
        <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/CUR talks to FHT devices or when CUR requests data. Set it to 0000 to avoid answering any FHT80b request by the CUL.

    Set
    • 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.3MHz (or 433MHz)
      • bWidth can be set to values between 58kHz and 812kHz. Large values are susceptible to interference, but make possible to receive inaccurate or multiple transmitters. It affects tranmission too. Default is 325kHz.
      • 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 boundery 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 4dB.

    • 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
      return the CUL firmware version

    • uptime
      return the CUL uptime (time since CUL reset).

    • raw
      Issue a CUL firmware command, and wait for one line of data returned by the CUL. See the CUL firmware README document for details on CUL commands.

    • 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 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.

    Attributes
    • do_not_notify
    • dummy
    • showtime
    • loglevel
    • model (CUL,CUN,CUR)
    • sendpool
      If using more than one CUL/CUN 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 @1kHz datarate. This is the default.
      • HomeMatic
        To communicate with HomeMatic type of devices @20kHz datarate
      • MAX
        To communicate with MAX! type of devices @20kHz datarate

    • 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 wont 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:
        2012-05-17 09:44:22.515 CUL CULHM RCV L:0B N:81 CMD:A258 SRC:...... DST:...... 0000 (TYPE=88,WAKEMEUP,BIDI,RPTEN)


CUL_EM

    The CUL_EM module interprets EM type of messages received by the CUL, notably from EMEM, EMWZ or EMGZ devices.

    Define
      define <name> CUL_EM <code> [corr1 corr2 CostPerUnit BasicFeePerMonth]

      <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 mothly fees. Your COST will appear in the log, generated once daiy (without the basic fee) or month (with the bassic fee included). Your definition should look like E.g.:
        define emwz 1 75 900 0.15 12.50
      and the Log looks like:
        CUM_DAY: 6.849 CUM: 60123.4 COST: 1.02
        CUM_MONTH: 212.319 CUM: 60123.4 COST: 44.34
      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 substract the RAW CUM value from it. Now set the basis reading of your EMWZ device (named emwz) to this value.

    Set
      N/A

    Get
      N/A

    Attributes
    • ignore

    • do_not_notify

    • showtime

    • loglevel

    • model (EMEM,EMWZ,EMGZ)

    • IODev

    • eventMap

    • readingFnAttributes

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.

    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
      Nothing to set here yet ...

    Get
      No get implemented yet ...

    Attributes
    • do_not_notify

    • loglevel

    • model (FHT80TF)

    • showtime

    • IODev

    • ignore

    • eventMap


CUL_HM

    Support for eQ-3 HomeMatic devices via the CUL or the HMLAN.

    Define
      define <name> CUL_HM <6-digit-hex-code|8-digit-hex-code>

      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:
        define livingRoomSwitch CUL_HM 123456
        define LivingroomMainLight CUL_HM 12345601
        define LivingroomBackLight CUL_HM 12345602

      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 not useable with a CUL device as the interface, but it is supported with a HMLAN. 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):
      • actiondetect <[hhh:mm]|off>
        outdated command. This functionality is started by entering or modify of the attribute actCycle. see attribure section for details
      • clear <[readings|msgEvents]>
        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
          msgEvents: all message event counter will be removed. Also commandstack will be cleared.
      • 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 1' or 'set <name> setRegRaw List0 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 directly peered remotes and the hardware buttons of the device. If inhibit set on, the channel status can be controlled only by FHEM.

        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
        peerBulk will add peer channels to the channel. All channels in the list will be added. This includes that the parameter and behavior defined for this 'link' will return to the defaults. peerBulk is only meant to add peers. More suffisticated funktionality as provided by peerChan is not supported. peerBulk will only add channels in 'single' button mode.
        Also note that peerBulk will not delete any existing peers, just add and re-add given peers.
        Main purpose of this command is the usage for re-store data to a device. It is recommended to restore register configuration utilising regBulk Example:
          set myChannel peerBulk 12345601,
          set myChannel peerBulk self01,self02,FB_Btn_04,FB_Btn_03,
      • regRaw [List0|List1|List2|List3|List4] <addr> <data> replaced by regBulk
      • 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:
          set myChannel regBulk RegL_00: 02:01 0A:17 0B:43 0C:BF 15:FF 00:00
          RegL_03:FB_Btn_07 01:00 02:00 03:00 04:32 05:64 06:00 07:FF 08:00 09:FF 0A:01 0B:44 0C:54 0D:93 0E:00 0F:00 11:C8 12:00 13:00 14:00 15:00 16:00 17:00 18:00 19:00 1A:00 1B:00 1C:00 1D:FF 1E:93 1F:00 81:00 82:00 83:00 84:32 85:64 86:00 87:FF 88:00 89:FF 8A:21 8B:44 8C:54 8D:93 8E:00 8F:00 91:C8 92:00 93:00 94:00 95:00 96:00 97:00 98:00 99:00 9A:00 9B:00 9C:00 9D:05 9E:93 9F:00 00:00
          set myblind regBulk 01 0B:10
          set myblind regBulk 01 0C:00
        myblind will set the max drive time up for a blind actor to 25,6sec
      • regSet <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.
        <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 won't be able to switch it (or deactivate signing) from fhem before you reset the device directly.
      • 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
        see also press

      subType (i.e family) dependent commands:

      • switch
        • on - set the switch on
        • off - set the switch off
        • on-for-timer <sec> - set the switch on for the given seconds [0-85825945].
          Note: off-for-timer like FS20 is not supported. It needs to be programmed on link level.
        • 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]> simulate a press of the local button or direct connected switch of the actor.
          [short|long] choose whether to simulate a short or long press of the button.
          [on|off] is relevant only for devices with direct buttons per channel. Those are available for dimmer and blind-actor, usually not for switches
        • toggle - toggle the switch.

      • 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_V. 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
        • on set level to 100%
        • off set level to 0%
        • press <[short|long]><[on|off]>
        • toggle - toggle between off and the last on-value
        • on-for-timer <sec> - Dimmer only!
        • on-till <time> - Dimmer only!
        • stop - stop motion or dim ramp
        • up [changeValue] [ontime] [ramptime] dim up one step
        • down [changeValue] [ontime] [ramptime] dim up one step

      • 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'.
        • peerChan <btn_no> <actChan> [single|dual] [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.
          '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

      • virtual
        • peerChan see remote
        • press [long|short] simulates a button press short (default) or long. Note that the current implementation will not specify the duration for long. Only one trigger will be sent of type "long".

      • 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.
        • test - execute a network test
        • alarmOn - initiate an alarm
        • alarmOff - switch off the alarm

      • 4Dis (HM-PB-4DIS-WM)
        • 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. 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)
        • day-temp <tmp>
          night-temp <tmp>
          party-temp <tmp>
          desired-temp <tmp>
          Set different temperatures. Temp must be between 6 and 30 Celsius, and precision is half a degree.
        • tempListSat HH:MM temp ... 24:00 temp
          tempListSun HH:MM temp ... 24:00 temp
          tempListMon HH:MM temp ... 24:00 temp
          tempListTue HH:MM temp ... 24:00 temp
          tempListThu HH:MM temp ... 24:00 temp
          tempListWed HH:MM temp ... 24:00 temp
          tempListFri 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: set th tempListSat 06:00 19 23:00 22.5 24:00 19
          Meaning: 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.
        • displayMode [temp-only|temp-hum]
          displayTemp [actual|setpoint]
          displayTempUnit [celsius|fahrenheit]
          controlMode [manual|auto|central|party]
          decalcDay <day>
        • systime
          set time in climate channel to system time

      • 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]. 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

      • keyMatic

          The Keymatic uses the AES signed communication. Therefore the control of the Keymatic is only together with the HM-LAN adapter possible. But the CUL can read and react on the status information of the Keymatic.

        • 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
      • HM-Sys-sRP-Pl

        setRepeat => "[no1..36] [bdcast-yes|no]"
        • 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 repPeer.
          attribut repPeer is formated:
          src1:dst1:[y/n],src2:dst2:[y/n],src2:dst2:[y/n],...
          up to 36entries can be applied.


      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 untill 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.
    • 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.

    Attributes
    • eventMap
    • do_not_notify
    • ignore
    • dummy
    • showtime
    • loglevel
    • readingFnAttributes
    • actCycle actCycle <[hhh:mm]|off>
      Supports 'alive' or better 'not alive' detection for devices. [hhh:mm] is the maxumin 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.
    • 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.
    • 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.
    • 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.
    • unit
      set the reported unit by the KFM100 if rawToReadable is active. E.g.
      attr KFM100 unit Liter
    • autoReadReg
      '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
      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 sice 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".

    Generated events:
    • KS550/HM-WDS100-C6-O:
      T: $t H: $h W: $w R: $r IR: $ir WD: $wd WDR: $wdr S: $s B: $b
      temperature $t
      humidity $h
      windSpeed $w
      windDirection $wd
      windDirRange $wdr
      rain $r
      isRaining $ir
      sunshine $s
      brightness $b
      unknown $p
    • HM-CC-TC:
      T: $t H: $h
      measured-temp $t
      humidity $h
      actuator $vp %
      desired-temp $dTemp
      desired-temp-manu $dTemp
      windowopen-temp-%d %.1f (sensor:%s)
      tempList$wd hh:mm $t hh:mm $t ...
      displayMode temp-[hum|only]
      displayTemp [setpoint|actual]
      displayTempUnit [fahrenheit|celsius]
      controlMode [manual|auto|central|party]
      decalcDay [Sat|Sun|Mon|Tue|Wed|Thu|Fri]
      tempValveMode [Auto|Closed|Open|unknown]
      param-change offset=$o1, value=$v1
      ValveErrorPosition_for_$dname $vep %
      ValveOffset_for_$dname : $of %
      ValveErrorPosition $vep %
      ValveOffset $of %
      time-request
    • HM-CC-VD:
      $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] # operational condition
      operStateErrCnt:$cnt # number of failed settings
    • KFM100:
      $v
      $cv,$unit
      rawValue:$v
      Sequence:$seq
      content:$cv,$unit
    • HM-LC-BL1-PB-FM:
      motor: [opening|closing]
    • HM-SEC-SFA-SM:
      powerError [on|off]
      sabotageError [on|off]
      battery: [critical|low|ok]
    • HM-LC-SW1-BA-PCB:
      battery: [low|ok]
    • 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
    • HM-OU-CFM-PL
      [on|off|$val]
    • switch/dimmer/blindActuator:
      $val
      powerOn [on|off|$val]
      [unknown|motor|dim] [up|down|stop]:$val
    • dimmer:
      overload [on|off]
      overheat [on|off]
      reduced [on|off]
      dim: [up|down|stop]
    • remote/pushButton/outputUnit
        (to $dest) is added if the button is peered and does not send to broadcast
        Release is provided for peered channels only
      Btn$x onShort
      Btn$x offShort
      Btn$x onLong $counter
      Btn$x offLong $counter
      Btn$x onLongRelease $counter
      Btn$x offLongRelease $counter
      Btn$x onShort (to $dest)
      Btn$x offShort (to $dest)
      Btn$x onLong $counter (to $dest)
      Btn$x offLong $counter (to $dest)
      Btn$x onLongRelease $counter (to $dest)
      Btn$x offLongRelease $counter (to $dest)
    • remote/pushButton
      battery [low|ok]
      trigger [Long|Short]_$no trigger event from channel
    • swi
      Btn$x toggle
      Btn$x toggle (to $dest)
      battery: [low|ok]
    • motionDetector
      brightness:$b
      alive
      motion on (to $dest)
      motionCount $cnt _next:$nextTr"-"[0x0|0x1|0x2|0x3|15|30|60|120|240|0x9|0xa|0xb|0xc|0xd|0xe|0xf]
      cover [closed|open]
      battery [low|ok]
      devState_raw.$d1 $d2
    • 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 on from $src
      test:from $src
    • threeStateSensor
      [open|tilted|closed]]
      [wet|damp|dry] #HM-SEC-WDS only
      cover [open|closed] #HM-SEC-WDS only
      alive yes
      battery [low|ok]
      contact [open|tilted|closed]
      contact [wet|damp|dry] #HM-SEC-WDS only
    • THSensor and HM-WDC7000
      T: $t H: $h AP: $ap
      temperature $t
      humidity $h
      airpress $ap #HM-WDC7000 only
    • winMatic
      [locked|$value]
      motorError [no|TurnError|TiltError]
      direction [no|up|down|undefined]
      charge [trickleCharge|charge|dischange|unknown]
      airing [inactiv|$air]
      course [tilt|close]
      airing [inactiv|$value]
      contact tesed
    • keyMatic
      unknown:40
      battery [low|ok]
      uncertain [yes|no]
      error [unknown|motor aborted|clutch failure|none']
      lock [unlocked|locked]
      [unlocked|locked|uncertain]
    • HM-CC-SCD
      [normal|added|addedStrong]
      battery [low|ok]
    • HM-Sen-Wa-Od
      $level%
      level $level%

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.

    Define
      define <name> CUL_HOERMANNEM <10-digit-hex-code>

    Set
      N/A

    Get
      N/A

    Attributes
    • do_not_notify
    • showtime
    • loglevel

CUL_IR

    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

    Define
      define <name> CUL_IR <IODev>

      <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
    Get
      N/A
    Attributes
    • do_not_notify

    • showtime

    • loglevel

    • 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
      The syntax for this is:
              attr <device-name> <attribute-name> <IR-Code> <command>
              
    • 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". Make sure you associate the target device 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). Make sure you associate the target device with fakeWallThermostat beforehand.

    Get
      N/A

    Attributes
    • ignore

    • do_not_notify

    • showtime

    • loglevel

    • readingFnAttributes

    Generated events:
      N/A

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

    Set
      Same as for the CUL.

    Get
      Same as for the CUL.

    Attributes
    • ignore

    • IODev

    • The rest of the attributes is the same as for the CUL.


CUL_TX

    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)

    Set
      N/A

    Get
      N/A

    Attributes
    • ignore

    • do_not_notify

    • showtime

    • loglevel

    • readingFnAttributes

    Generated events:
    • temperature: $temp
    • humidity: $hum

CUL_WS

    The CUL_WS module interprets S300 type of messages received by the CUL.

    Define
      define <name> CUL_WS <code> [corr1...corr4]

      <code> is the code which must be set on the S300 device. Valid values are 1 through 8.
      corr1..corr4 are up to 4 numerical correction factors, which will be added to the respective value to calibrate the device. Note: rain-values will be multiplied and not added to the correction factor.

    Set
      N/A

    Get
      N/A

    Attributes
    • IODev (!)
    • do_not_notify
    • eventMap
    • ignore
    • loglevel
    • model (S300,KS300,WS7000)
    • showtime
    • readingFnAttributes

CULflash

    CULflash <CUL-Name> <CUL-Version>

    Download the CUL firmware from a nightly SVN chekout and flash the hardware. Currently only the CUL is supported with its versions: CUL_V2, CUL_V2_HM, CUL_V3, CUL_V4.
    Note: dfu-programmer has to be installed in the path, this is already the case with the Fritz!Box 7390 image from fhem.de
    If the CUL is not yet flashed, then specify "none" as CUL-Name. Example:
      CULflash CUL CUL_V3
      CULflash none CUL_V3
    Note: the message "dfu-programmer: failed to release interface 0." is normal on the FB7390.

Calendar


    Define
      define <name> Calendar ical url <URL> [<interval>]

      Defines a calendar device.

      A calendar device periodically gathers calendar events from the source calendar at the given URL. The file at the given URL 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. Google App accounts do not work since requests to the URL get redirected first and the fhem mechanism for retrieving data via http/https cannot handle this. 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://.

      The optional parameter interval is the time between subsequent updates in seconds. It defaults to 3600 (1 hour).

      Examples:
            define MyCalendar Calendar ical url https://www.google.com­/calendar/ical/john.doe%40example.com­/private-foo4711/basic.ics
            define YourCalendar Calendar ical url http://www.google.com­/calendar/ical/jane.doe%40example.com­/private-bar0815/basic.ics 86400
            

    Set
      set <name> update

      Forces the retrieval of the calendar from the URL. The next automatic retrieval is scheduled to occur interval seconds later.


    Get
      get <name> full|text|summary|location|alarm|start|end <reading>|<uid>

      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>.

      get <name> find <regexp>

      Returns, line by line, the UIDs of all calendar events whose summary matches the regular expression <regexp>.


    Attributes
    • readingFnAttributes

    Description
      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 not supported.

      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:

      newThe 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.
      knownThe calendar event was already there before the most recent update.
      updatedThe calendar event was already there before the most recent update but it has changed since it was last retrieved.
      deletedThe 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:

      upcomingNeither the alarm time nor the start time of the calendar event is reached.
      alarmThe alarm time has passed but the start time of the calendar event is not yet reached.
      startThe start time has passed but the end time of the calendar event is not yet reached.
      endThe 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:

      calnamename of the calendar
      allall events
      modeAlarmevents in alarm mode
      modeAlarmOrStartevents in alarm or start mode
      modeAlarmedevents that have just transitioned from upcoming to alarm mode
      modeChangedevents that have just changed their mode somehow
      modeEndevents in end mode
      modeEndedevents that have just transitioned from start to end mode
      modeStartevents in start mode
      modeStartedevents that have just transitioned to start mode
      modeUpcomingevents in upcoming mode
      stateChangedevents that have just changed their state somehow
      stateDeletedevents in state deleted
      stateNewevents in state new
      stateUpdatedevents 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
        2767324dsfretfvds7dsfn3e4­dsa234r234sdfds6bh874­googlecom known alarm 31.05.2012 17:00:00 07.06.2012 16:30:00-07.06.2012 18:00:00 Erna for coffee
        992hydf4y44awer5466lhfdsr­gl7tin6b6mckf8glmhui4­googlecom 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.*
        2767324dsfretfvds7dsfn3e4­dsa234r234sdfds6bh874­googlecom


        Then define a notify:

        define ErnaComes notify MyCalendar:modeStarted.*2767324dsfretfvds7dsfn3e4­dsa234r234sdfds6bh874­googlecom.* set MyLight on

        You can also do some logging:

        define LogErna notify MyCalendar:modeAlarmed.*2767324dsfretfvds7dsfn3e4­dsa234r234sdfds6bh874­googlecom.* { Log 1, "ALARM name=%NAME event=%EVENT part1=%EVTPART0 part2=%EVTPART1" }

      Switch actors on and off

        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 1, "Actor: $actor, Reading $reading" }

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).

      <regexp> is the same as in FileLog.

      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:
      1. TIMESTAMP: timestamp of event, e.g. 2007-12-30 21:45:22
      2. DEVICE: device name, e.g. Wetterstation
      3. TYPE: device type, e.g. KS300
      4. EVENT: event specification as full string, e.g. humidity: 71 (%)
      5. READING: name of reading extracted from event, e.g. humidity
      6. VALUE: actual reading extracted from event, e.g. 71
      7. 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
      N/A

    Get
      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. Always set to -
      • <out>
        A dummy parameter for FileLog compatibility. Set it to - to check the output for plot-computing.
        Set it to the special keyword all to get all columns from Database.
      • <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
        • <reading>
          The reading of the given device to select. Case sensitive.
        • <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.
        • <regexp>
          The string is evaluated as a perl expression. $val is the current value returned from the Database. 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.


      Examples:
      • get myDbLog - - 2012-11-10 2012-11-20 KS300:temperature
      • 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 when used for webcharts
      get <name> <infile> <outfile> <from> <to> <device> <querytype> <xaxis> <yaxis> <savename>

      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
      N/A

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.

    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.


    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.
    • nonl
      A newline (\n) is automatically appended to every command string sent to the device unless this attribute is set. Please note that newlines (\n) in a command string are interpreted as separators to split the command string into several commands and are never literally sent.


    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:

      • params <parameter1> [<parameter2> [<parameter3> ... ]]

        Declares the names of the named parameters that must be present in the definition of the logical ECMD device.

      • set <commandname> cmd { <perl special> }

        Declares a new set command <commandname>.

      • get <commandname> cmd { <perl special> }

        Declares a new get command <commandname>.

      • set <commandname> postproc { <perl command> }
        get <commandname> postproc { <perl command> }

        Declares a postprocessor for the command <commandname>.

      • 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).

      The perl specials in the definitions of the set and get commands can contain macros. Apart from the rules outlined in the documentation of perl specials in fhem, the following rules apply:

      • The character @ will be replaced with the device name. To use @ in the text itself, use the double mode (@@).
      • The macro %NAME will expand to the device name (same as @).
      • 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.
      • If in doubt what happens, run the commands with loglevel 5 and observe 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! The perl command acts on $_. The result of the perl command is the final result of the get or set command.

ECMDDevice


    Define
      define <name> ECMDDevice <classname> [<parameter1> [<parameter2> [<parameter3> ... ]]]

      Defines a logical ECMD device. The number of given parameters must match those given in the class definition of the device class <classname>.

      Examples:
        define myADC ECMDDevice ADC
        define myRelais1 ECMDDevice relais 8

    Set
      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

    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
    • loglevel
    • eventMap
    • readingFnAttributes


    Example 1

      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"}
      get value params channel

      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" 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 for the current value of analog/digital converter number 1.

    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\nioset port 2 0%pinmask\nwait 1000\nio set port 2 00"}
      set on postproc {s/^OK\nOK\nOK\nOK$/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\nioset port 2 08\nwait 1000\nio set port 2 00" after macro substitution. Perl evaluates this to a literal string. This string is split into lines (without trailing newline characters)
      • io set ddr 2 ff
      • ioset port 2 08
      • wait 1000
      • io set port 2 00
      These lines are sent as a plain ethersex commands to the AVR-NET-IO one by one. Each line is terminated with a newline character unless the nonl attribute of the ECMDDevice is set. After each line the answer from the ECMDDevice is read back. They are concatenated with newlines and returned for further processing, e.g. by the postproc command. For any of the four plain ethersex commands, the AVR-NET-IO returns the string OK. They are concatenated and separated by line breaks (\n). The postprocessor takes the result from $_, substitutes it by the string success if it is OK\nOK\nOK\nOK, and then either returns the string ok or the string error.

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 raw ). EIB/KNX defines a series of Datapoint Type as standard data types used to allow general interpretation of values of devices manufactured by diferent companies. This datatypes are used to interpret the status of a device, so the state in FHEM will then show the correct value.

    Define
      define <name> EIB <main group> [<additional group> ..]

      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 usefull 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.
      Example:
        define lamp1 EIB 0/10/12
        define lamp1 EIB 0/10/12 0/0/5
        define lamp1 EIB 0A0C

    Set
      set <name> <value> [<time> g<groupnr>]
      where value one of:
    • on switch on device
    • off switch off device
    • on-for-timer switch on the device for the given time. After the specified seconds a switch off command is sent.
    • on-till switches the device on. The device will be switched off at the given time.
    • raw sends the given value as raw data to the device.
    • 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).
      Example:
        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

    Attributes
    • eventMap
    • webCmd
    • IODev
    • loglevel
    • do_not_notify
    • ignore
    • dummy
    • showtime
    • 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.
      • dpt5
      • dpt5.003
      • angle
      • percent
      • dpt5.004
      • percent255
      • 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
      • time
      • dpt11
      • date
      • dpt12
      • dpt14

EM

    Define
      define <name> EM <em1010pc-device>

      Define a EM1010PC USB device. As the EM1010PC was not designed to be used with a PC attached to it all the time, it won't transmit received signals automatically, fhem has to poll it every 5 minutes.
      Currently there is no way to read the internal log of the EM1010PC with fhem, use the program em1010.pl in the contrib directory for this purpose.

      Examples:
        define em EM /dev/elv_em1010pc

    Set
      set EM <value>

      where value is either time or reset.
      If time has arguments of the form YYYY-MM-DD HH:MM:SS, then the specified time will be set, else the time from the host.
      Note: after reset you should set the time.

    Get
      get EM <value>

      where value is either version or time.
    Attributes
    • model (em1010pc)
    • dummy
    • loglevel

EMEM


    Define
      define <name> EMEM <device-number>

      Define up to 4 EM1000EM attached to the EM1010PC. The device number must be between 5 and 8. Defining an EMEM will schedule an internal task, which reads the status of the device every 5 minutes, and triggers notify/filelog commands.
      Note: Currently this device does not support a "set" function.

      Example:
        define emem EMEM 5

    Set
      N/A

    Get
      get EMEM status

      This is the same command which is scheduled every 5 minutes internally.

    Attributes
    • model (EM1000EM)
    • dummy
    • loglevel
    • IODev


EMGZ

    Define
      define <name> EMGZ <device-number>

      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.

    Attributes
    • model (EM1000GZ)
    • dummy
    • loglevel
    • IODev


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.

    Attributes
    • model (EM1000WZ)
    • dummy
    • loglevel
    • IODev


ESA2000

    The ESA2000 module interprets ESA2000 type of messages received by the CUL, currently only for ESA2000 LED devices.

    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).

    Set
      N/A

    Get
      N/A

    Attributes
    • ignore

    • do_not_notify

    • showtime

    • loglevel

    • modelesa2000-led, esa2000-wz, esa2000-s0, esa1000wz-ir, esa1000wz-s0, esa1000wz-led, esa1000gas

    • IODev

    • readingFnAttributes


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). Basically three profiles will be differed, e. g. switches, contacts, sensors. Some manufacturers use additional proprietary extensions. Further technical information can be found at the EnOcean Alliance, see in particular the EnOcean Equipment Profiles (EEP)

    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 attributes subType and model, see chapter Set and Generated events. With the help of additional attributes, the behavior of the devices can be changed separately.

    The teach-in procedure depends on the type of the devices. Switches (EEP RORG F6) and contacts (EEP RORG D5) are recognized when receiving the first message. Contacts can also send a teach-in telegram. Fhem not need this telegram. Sensors (EEP RORG A5) has to send a teach-in telegram. The profile-less A5 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 attributes subType, 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 A5 devices must be paired bidirectional, see Bidirectional A5 Teach-In.

    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.

    Define
      define <name> EnOcean <def>

      Define an EnOcean device, connected via a TCM modul. The <def> is the SenderID/DestinationID of the device (8 digit hex number). The autocreate module may help you.
      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 127 IDs starting with the BaseID + 1 shown there. The BaseID is used for A5 devices with a bidectional teach-in only. If you are using an Fhem SenderID outside of the allowed range, you will see an ERR_ID_RANGE message in the Fhem log.
      In order to control bidirectional F6 devices (switches, actors) with additional SenderIDs you can use the attributes subDef, subDef0 and subDefI.
      Fhem communicates unicast with the BaseID, if the A5 devices are teached-in with the Bidirectional A5 Teach-In procedure. In this case Fhem send telegrams with its SenderID (BaseID) and the DestinationID of the device.

    Set
    • Bidirectional A5 Teach-In
        set <name> pairForSec <t/s>

        Set the EnOcean Transceiver module (TCM Modul) in the bidirectional pairing mode. A device, which is then also put in this state is to paired with Fhem bidirectional. Bidirectional pearing is only used for some EEP A5-xx-xx, e. g. EEP A5-20-01 (Battery Powered Actuator).
        name is the name of the TCM Module . t/s is the time for the teach-in period.

        Example:
          set TCM_0 pairForSec 600

    • Switch, Pushbutton Switch, Bidirectional Actor (EEP F6-02-01 ... F6-03-02)
      [Default subType]
        set <name> <value>

        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.
        With the help of additional attributes, the behavior of the devices can be adapt.

        Example:
          set switch1 BI
          set switch1 B0,CI
          attr eventMap BI:on B0:off
          set switch1 on

    • Staircase off-delay timer (EEP F6-02-01 ... F6-02-02)
      [Eltako FTN14, tested with Eltako FTN14 only]
        set <name> <value>

        where value is
      • on
        issue switch on command
      • released
        start timer

      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.
      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".


    • Single Input Contact, Door/Window Contact
      1BS Telegram (EEP D5-00-01)
      [tested with Eltako FSR14]
      • closed
        issue closed command
      • open
        issue open command
      • teach
        initiate teach-in mode
    • The attr subType must be contact. The attribute must be set manually.

    • Battery Powered Actuator (EEP A5-20-01)
      [Kieback&Peter MD15-FTL-xx]
        set <name> <value>

        where value is
      • actuator setpoint/%
        Set the actuator to the specifed setpoint (0-100)
      • desired-temp <value>
        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 MD15 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
      • valveClosed
        Maintenance Mode (service on): Valve closed
      • unattended
        Do not regulate the actuator.

      The attr subType must be MD15. This is done if the device was created by autocreate. To control the device, it must be bidirectional paired, see Bidirectional A5 Teach-In.
      The command is not sent until the device wakes up and sends a mesage, usually every 10 minutes.


    • 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.


    • Gateway (EEP A5-38-08)
      Switching
      [Eltako FLC61, FSR14]
        set <name> <value>

        where value is
      • teach
        initiate teach-in mode
      • on [lock|unlock]
        issue switch on command
      • off [lock|unlock]
        issue switch off command
      • set extensions are supported.

      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.


    • Gateway (EEP A5-38-08)
      Dimming
      [Eltako FUD12, FUD14, FUD61, FUD70, FSG14, ...]
        set <name> <value>

        where value is
      • teach
        initiate teach-in mode
      • on [lock|unlock]
        issue switch on command
      • off [lock|unlock]
        issue switch off command
      • dim dim/% [rampTime/s [lock|unlock]]
        issue dim command
      • dimup dim/% [rampTime/s [lock|unlock]]
        issue dim command
      • dimdown dim/% [rampTime/s [lock|unlock]]
        issue dim command
      • set extensions are supported.

      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]
        set <name> <value>

        where value is
      • on
        issue switch on command
      • off
        issue switch off command
      • set extensions are supported.

      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

      Setpoint 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]
        set <name> <value>

        where value is
      • teach
        initiate teach-in mode
      • presence present|absent|standby
        issue Room occupancy
      • energyHoldOff normal|holdoff
        issue Energy hold off
      • controllerMode auto|heating|cooling|off
        issue Controller mode
      • 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.


    • Gateway (EEP A5-38-08)
      Blind Command Central
      [untested, experimental status]
        set <name> <value>

        where value is
      • teach
        initiate teach-in mode
      • status
        Status request
      • opens
        issue blinds opens command
      • up tu/s ta/s
        issue roll up command
      • closes
        issue blinds closes command
      • down td/s ta/s
        issue roll down command
      • position position/% α/°
        drive blinds to postion with angle value
      • stop
        issue blinds stops command
      • runtimeSet tu/s td/s
        set runtime parameter
      • angleSet ta/s
        set angle configuration
      • positionMinMax positionMin/% positionMin/%
        set Min, Max values for position
      • angleMinMax αs/° αo/°
        set slat angle for Shut und Open 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: α|αs|αo = -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. The profile is linked with controller profile, see Blind Status.


    • Manufacturer Specific Applications (EEP A5-3F-7F)
      Shutter
      [Eltako FSB12, FSB14, FSB61, FSB70, tested with Eltako devices only]
        set <name> <value>

        where value is
      • teach
        initiate teach-in mode
      • up [position/%]
        issue roll up command
      • down [position/%]
        issue roll down command
      • position position/%
        set shutter to position
      • stop
        issue stop command

      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.


    • RAW Command

        set <name> <value>

        where value is
      • RPS|1BS|4BS data [status]
        sent data telegram

      With the help of this command data messages in hexadecimal format can be sent. Telegram types (RORG) RPS, 1BS and 4BS are supported. For further information, see EnOcean Equipment Profiles (EEP).
      Set attr subType to raw manually.


Get
    N/A

Attributes
    • actualTemp t/°C
      The value of the actual temperature, used when controlling MD15 devices. Should by filled via a notify from a distinct temperature sensor. If absent, the reported temperature from the MD15 is used.
    • devStateIcon
    • dimTime relative, [dimTime] = 1 is default.
      No ramping or for Eltako dimming speed set on the dimmer if [dimTime] = 0.
      Ramping time which fast to low dimming if [dimTime] = 1 ... 100.
      dimTime is supported for dimmer.
    • 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 dimmer.
    • do_not_notify
    • eventMap
    • gwCmd switching|dimming|setpointShift|setpointBasic|controlVar|fanStage|blindCmd
      Gateway Command Type, see Gateway profile
    • ignore
    • IODev
    • loglevel
    • model
    • rampTime t/s or relative, [rampTime] = 1 is default.
      No ramping or for Eltako dimming speed set on the dimmer if [rampTime] = 0.
      Ramping time 1 s to 255 s or relative fast to low dimming speed if [rampTime] = 1 ... 255.
      rampTime is supported for gateway, command dimming.
    • readingFnAttributes
    • 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.
    • scaleMax <floating-point number>
      Scaled maximum value of the reading setpoint
    • scaleMin <floating-point number>
      Scaled minimum value of the reading setpoint
    • showtime
    • shutTime t/s, [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.
      shutTime 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 bidirectional devices, 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.
      subDef is supported for switches, staircase off-delay timer, dimmer and shutter.
    • subDef0 <EnOcean SenderID>, [subDef0] = [def] 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.
    • subDefI <EnOcean SenderID>, [subDefI] = [def] 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.
    • subType
    • 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.
    • 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, [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 sensor type 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 sensor type central two different SenderID are required. In this case set the Attribute switchType to central and define the Attributes subDef0 and subDefI.
    • webCmd

Generated events
    • Switch / Bidirectional Actor (EEP F6-02-01 ... F6-03-02)
      • 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
      • buttons: released
      • buttons: <BtnX> released

      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.


    • Pushbutton Switch, Pushbutton Input Module (EEP F6-02-01 ... F6-02-02)
      [Eltako FT55, FSM12, FSM61, FTS12]
      • A0
      • AI
      • B0
      • BI
      • released
      • state: A0|AI|B0|BI|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 manually.


    • Smoke Detector (EEP F6-02-01 ... F6-02-02)
      [Eltako FRW, untested]
      • smoke-alarm
      • off
      • alarm: smoke-alarm|off
      • battery: low|ok
      • state: smoke-alarm|off

      Set attr subType to FRW manually.


    • Key Card Activated Switch (EEP F6-04-01)
      [Eltako FKC, FKF, FZS, untested]
      • keycard inserted
      • keycard removed
      • state: keycard inserted|keycard removed

      Set attr subType to keycard manually.


    • Window Handle (EEP F6-10-00)
      [HOPPE SecuSignal]
      • closed
      • open
      • tilted
      • open from tilted
      • state: closed|open|tilted|open from tilted

      The device windowHandle should be created by autocreate.


    • Single Input Contact, Door/Window Contact
      1BS Telegram (EEP D5-00-01)
      [Eltako FTK, Peha D 450 FU, STM-250, BSC ?]
      • closed
      • open
      • learnBtn: on
      • state: open|closed
    • The device should be created by autocreate.

    • Temperature Sensors with with different ranges (EEP A5-02-01 ... A5-02-30)
      [Thermokon SR65, untested]
      • t/°C
      • temperature: t/°C (Sensor Range: t = <t min> °C ... <t max> °C)
      • state: t/°C

      The attr subType must be tempSensor.01 ... tempSensor.30. This is done if the device was created by autocreate.


    • Temperatur and Humidity Sensor (EEP A5-04-02)
      [Eltako FAFT60, FIFT63AP]
      • T: t/°C H: rH/% B: unknown|low|ok
      • battery: unknown|low|ok
      • energyStorage: unknown|empty|charged|full
      • humidity: rH/% (Sensor Range: rH = 0 % ... 100 %)
      • temperature: t/°C (Sensor Range: t = -20 °C ... 60 °C)
      • voltage: U/V
      • (Sensor Range: U = 0 V ... 6.6 V)
      • state: T: t/°C H: rH/% B: unknown|low|ok

      The attr subType must be tempHumiSensor.02 and attr manufID must be 00D for Eltako Devices. This is done if the device was created by autocreate.


    • Light Sensor (EEP A5-06-01)
      [Eltako FAH60, FAH63, FIH63, Thermokon SR65 LI]
      • E/lx
      • brightness: E/lx (Sensor Range: 300 lx ... 30 klx, 600 lx ... 60 klx , Sensor Range for Eltako: E = 0 lx ... 100 lx, 300 lx ... 30 klx)
      • voltage: U/V
      • (Sensor Range: U = 0 V ... 5.1 V)
      • state: E/lx

      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.


    • Occupancy Sensor (EEP A5-07-01, A5-07-02)
      [untested]
      • on|off
      • errorCode: 251 ... 255
      • motion: on|off
      • 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.


    • Occupancy Sensor (EEP A5-07-03)
      [untested]
      • M: on|off E: E/lx U: U/V
      • 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]
      • M: on|off E: E/lx P: absent|present T: t/°C U: U/V
      • brightness: E/lx (Sensor Range: E = 0 lx ... 510, 1020, 1530 or 2048 lx)
      • motion: on|off
      • presence: absent|present
      • temperature: t/°C (Sensor Range: t = 0 °C ... 51 °C or -30 °C ... 50 °C)
      • voltage: U/V
      • (Sensor Range: U = 0 V ... 5.1 V)
      • state: M: on|off E: E/lx P: absent|present T: t/°C U: U/V

      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 *, 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)
      • state: CO2: c/ppm AQ: high|mean|moderate|low T: t/°C H: rH/%

      The attr subType must be tempHumiCO2Sensor.01. This is done if the device was created by autocreate.


    • Gas Sensor, Volatile organic compounds (VOC) Sensor (EEP A5-09-05)
      [untested]
      • concentration: c/ppb (Sensor Range: c = 0 ppb ... 655350 ppb)
      • vocName: Name of last measured VOC
      • state: c/ppb

      The attr subType must be vocSensor.01. This is done if the device was created by autocreate.


    • Gas Sensor, Radon Sensor (EEP A5-09-06)
      [untested]
      • Rn: A m3/Bq (Sensor Range: A = 0 Bq/m3 ... 1023 Bq/m3)
      • state: A m3/Bq

      The attr subType must be radonSensor.01. This is done if the device was created by autocreate.


    • Gas Sensor, Particles Sensor (EEP A5-09-07)
      [untested]
      Three channels with particle sizes of up to 10 μm, 2.5 μm and 1 μm are supported
      .
      • particles_10: p m3/μg | inactive (Sensor Range: p = 0 μg/m3 ... 511 μg/m3)
      • particles_2_5: p m3/μg | inactive (Sensor Range: p = 0 μg/m3 ... 511 μg/m3)
      • particles_1: p m3/μg | inactive (Sensor Range: p = 0 μg/m3 ... 511 μg/m3)
      • state: PM10: p m3/μg PM2_5: p m3/μg PM1: p m3/μg

      The attr subType must be particlesSensor.01. This is done if the device was created by autocreate.


    • Room Sensor and Control Unit (EEP A5-10-01 ... A5-10-0D)
      [Eltako FTF55, FTR55*, Thermokon SR04 *, Thanos SR *]
      • T: t/°C SP: 0 ... 255 F: 0|1|2|3|auto SW: 0|1
      • fan: 0|1|2|3|auto
      • switch: 0|1
      • setpoint: 0 ... 255
      • setpointScaled: <floating-point number>
      • temperature: t/°C (Sensor Range: t = 0 °C ... 40 °C)
      • state: T: t/°C SP: 0 ... 255 F: 0|1|2|3|auto SW: 0|1

      • Alternatively for Eltako devices
      • T: t/°C SPT: t/°C NR: t/°C
      • nightReduction: t/°C
      • setpointTemp: t/°C
      • temperature: t/°C (Sensor Range: t = 0 °C ... 40 °C)
      • state: T: t/°C SPT: t/°C NR: t/°C


      The scaling of the setpoint knob is device- and vendor-specific. Set the attributes scaleMax and scaleMin 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)
      [Thermokon SR04 * rH, Thanos SR *, untested]
      • 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 knob is device- and vendor-specific. Set the attributes scaleMax and scaleMin for the additional scaled reading setpointScaled. Use attribut userReadings to adjust the scaling alternatively.
      The attr subType must be roomSensorControl.01. 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 knob is device- and vendor-specific. Set the attributes scaleMax and scaleMin 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]
      • T: t/°C B: E/lx F: 0|1|2|3|4|5|auto|off SP: t/°C P: absent|present|disabled
      • brightness: E/lx (Sensor Range: E = 0 lx ... 1000 lx, over range)
      • fan: 0|1|2|3|4|5|auto|off
      • presence: absent|present|disabled
      • temperature: t/°C (Sensor Range: t = 0 °C ... 40 °C)
      • setpoint: t/°C (Sensor Range: t = 0 °C ... 40 °C)
      • state: T: t/°C B: E/lx F: 0|1|2|3|4|5|auto|off SP: t/°C P: absent|present|disabled

      The attr subType must be roomSensorControl.18. This is done if the device was created by autocreate.


    • Room Sensor and Control Unit (EEP A5-10-19)
      [untested]
      • T: t/°C H: rH/% F: 0|1|2|3|4|5|auto|off SP: t/°C P: absent|present|disabled
      • fan: 0|1|2|3|4|5|auto|off
      • humidity: rH/% (Sensor Range: rH = 0 % ... 100 %)
      • presence: absent|present|disabled
      • setpoint: t/°C (Sensor Range: t = 0 °C ... 40 °C)
      • temperature: t/°C (Sensor Range: t = 0 °C ... 40 °C)
      • state: T: t/°C H: rH/% F: 0|1|2|3|4|5|auto|off SP: t/°C P: absent|present|disabled

      The attr subType must be roomSensorControl.19. This is done if the device was created by autocreate.


    • Room Sensor and Control Unit (EEP A5-10-1A)
      [untested]
      • T: t/°C F: 0|1|2|3|4|5|auto|off SP: t/°C P: absent|present|disabled U: U/V
      • errorCode: 251 ... 255
      • fan: 0|1|2|3|4|5|auto|off
      • presence: absent|present|disabled
      • setpoint: t/°C (Sensor Range: t = 0 °C ... 40 °C)
      • temperature: t/°C (Sensor Range: t = 0 °C ... 40 °C)
      • voltage: U/V (Sensor Range: U = 0 V ... 5.0 V)
      • state: T: t/°C F: 0|1|2|3|4|5|auto|off SP: t/°C P: absent|present|disabled U: U/V

      The attr subType must be roomSensorControl.1A. This is done if the device was created by autocreate.


    • Room Sensor and Control Unit (EEP A5-10-1B, A5-10-1D)
      [untested]
      • T: t/°C B: E/lx F: 0|1|2|3|4|5|auto|off P: absent|present|disabled U: U/V
      • brightness: E/lx (Sensor Range: E = 0 lx ... 1000 lx, over range)
      • errorCode: 251 ... 255
      • fan: 0|1|2|3|4|5|auto|off
      • presence: absent|present|disabled
      • temperature: t/°C (Sensor Range: t = 0 °C ... 40 °C)
      • voltage: U/V (Sensor Range: U = 0 V ... 5.0 V)
      • state: T: t/°C B: E/lx F: 0|1|2|3|4|5|auto|off P: absent|present|disabled U: U/V

      The attr subType must be roomSensorControl.1B. This is done if the device was created by autocreate.


    • Room Sensor and Control Unit (EEP A5-10-1C)
      [untested]
      • T: t/°C B: E/lx F: 0|1|2|3|4|5|auto|off SP: E/lx P: absent|present|disabled
      • brightness: E/lx (Sensor Range: E = 0 lx ... 1000 lx, over range)
      • fan: 0|1|2|3|4|5|auto|off
      • presence: absent|present|disabled
      • setpoint: E/lx (Sensor Range: E = 0 lx ... 1000 lx, over range)
      • temperature: t/°C (Sensor Range: t = 0 °C ... 40 °C)
      • state: T: t/°C B: E/lx F: 0|1|2|3|4|5|auto|off SP: E/lx P: absent|present|disabled

      The attr subType must be roomSensorControl.1C. This is done if the device was created by autocreate.


    • Room Sensor and Control Unit (EEP A5-10-1D)
      [untested]
      • T: t/°C H: rH/% F: 0|1|2|3|4|5|auto|off SP: rH/% P: absent|present|disabled
      • humidity: rH/% (Sensor Range: rH = 0 % ... 100 %)
      • fan: 0|1|2|3|4|5|auto|off
      • presence: absent|present|disabled
      • setpoint: rH/% (Sensor Range: rH = 0 % ... 100 %)
      • temperature: t/°C (Sensor Range: t = 0 °C ... 40 °C)
      • state: T: t/°C H: rH/% F: 0|1|2|3|4|5|auto|off SP: rH/% P: absent|present|disabled

      The attr subType must be roomSensorControl.1D. This is done if the device was created by autocreate.


    • Room Sensor and Control Unit (EEP A5-10-1F)
      [untested]
      • T: t/°C F: 0|1|2|3|auto SP: 0 ... 255 P: absent|present|disabled
      • fan: 0|1|2|3|auto
      • presence: absent|present|disabled
      • setpoint: 0 ... 255
      • setpointScaled: <floating-point number>
      • temperature: t/°C (Sensor Range: t = 0 °C ... 40 °C)
      • state: T: t/°C F: 0|1|2|3|auto SP: 0 ... 255 P: absent|present|disabled

      The scaling of the setpoint knob is device- and vendor-specific. Set the attributes scaleMax and scaleMin 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.


    • Lighting Controller State (EEP A5-11-01)
      [untested]
      • on|off
      • brightness: E/lx (Sensor Range: E = 0 lx ... 510 lx)
      • contact: open|closed
      • daylightHarvesting: enabled|disabled
      • dimValue: 0 ... 255
      • presence: absent|present
      • illum: 0 ... 255
      • mode: switching|dimming
      • powerRelayTimer: enabled|disabled
      • powerSwitch: on|off
      • repeater: enabled|disabled
      • state: on|off

      The attr subType must be lightCtrlState.01 This is done if the device was created by autocreate.


    • Temperature Controller Output (EEP A5-11-02)
      [untested]
      • t/°C
      • alarm: on|off
      • controlVar: cvar (Sensor Range: cvar = 0 % ... 100 %)
      • controllerMode: auto|heating|cooling|off
      • controllerState: auto|override
      • energyHoldOff: normal|holdoff
      • fan: 0 ... 3|auto
      • presence: present|absent|standby|frost
      • setpointTemp: t/°C (Sensor Range: t = 0 °C ... 51.2 °C)
      • state: t/°C

      The attr subType must be tempCtrlState.01 This is done if the device was created by autocreate.


    • Blind Status (EEP A5-11-03)
      [untested, experimental status]
      • open|closed|not reached|not available
      • alarm: on|off|no endpoints defined|not used
      • anglePos: α/° (Sensor Range: α = -360 ° ... 360 °)
      • endPosition: open|closed|not reached|not available
      • position: pos/% (Sensor Range: pos = 0 % ... 100 %)
      • serviceOn: yes|no
      • shutterState: opens|closes|stopped|not available
      • positionMode: normal|inverse
      • state: open|closed|not reached|not available

      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, experimental status]
      • on|off
      • alarm: off|lamp failure|internal failure|external periphery failure
      • dimValue: 0 ... 255
      • measuredValue: <formula symbol>/<unit> (Sensor range: <formula symbol> = 0 ... 65535 <unit>
      • measureUnit: mW|W|kW|MW|Wh|kWh|MWh|GWh|mA|1/10 A|mV|1/10 V
      • lampOpHours: t/h |unknown (Sensor range: t = 0 h ... 65535 h)
      • powerSwitch: on|off
      • RGB: R G B (RGB color component values: 0 ... 255)
      • serviceOn: yes|no
      • state: on|off

      The attr subType must be lightCtrlState.02 This is done if the device was created by autocreate.


    • Automated meter reading (AMR), Counter (EEP A5-12-00)
      [Thermokon SR-MI-HS, untested]
      • 1/s
      • currentValue: 1/s
      • counter<0 ... 15>: 0 ... 16777215
      • channel: 0 ... 15
      • state: 1/s

      The attr subType must be autoMeterReading.00. This is done if the device was created by autocreate.


    • Automated meter reading (AMR), Electricity (EEP A5-12-01)
      [Eltako FSS12, DSZ14DRS, DSZ14WDRS, Thermokon SR-MI-HS, untested]
      [Eltako FWZ12-16A tested]
      • P/W
      • power: P/W
      • energy<0 ... 15>: E/kWh
      • currentTariff: 0 ... 15
      • serialNumber: S-<nnnnnn>
      • state: P/W

      The attr subType must be autoMeterReading.01 and attr manufID must be 00D for Eltako Devices. This is done if the device was created by autocreate.


    • Automated meter reading (AMR), Gas, Water (EEP A5-12-02, A5-12-03)
      [untested]
      • Vs/l
      • flowrate: Vs/l
      • consumption<0 ... 15>: V/m3
      • currentTariff: 0 ... 15
      • state: Vs/l

      The attr subType must be autoMeterReading.02|autoMeterReading.02. This is done if the device was created by autocreate.


    • Environmental Applications
      Weather Station (EEP A5-13-01)
      Sun Intensity (EEP A5-13-02)
      [Eltako FWS61, untested]
      • T: t/°C B: E/lx W: Vs/m IR: yes|no
      • brightness: E/lx (Sensor Range: E = 0 lx ... 999 lx)
      • dayNight: day|night
      • hemisphere: north|south
      • isRaining: yes|no
      • sunEast: E/lx (Sensor Range: E = 1 lx ... 150 klx)
      • sunSouth: E/lx (Sensor Range: E = 1 lx ... 150 klx)
      • sunWest: E/lx (Sensor Range: E = 1 lx ... 150 klx)
      • 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)
      • sunAzimuth: α/° (Sensor Range: α = -90 ° ... 90 °)
      • sunElevation: β/° (Sensor Range: β = 0 ° ... 90 °)
      • state:SRA: E m2/W SNA: α/° SNE: β/°

      The attr subType must be environmentApp. This is done if the device was created by autocreate.


    • Multi-Func Sensor (EEP A5-14-01 ... A5-14-06)
      [untested]
      • C: open|closed V: on|off E: E/lx U: U/V
      • brightness: E/lx (Sensor Range: E = 0 lx ... 1000 lx, over range)
      • contact: open|closed
      • errorCode: 251 ... 255
      • vibration: on|off
      • voltage: U/V (Sensor Range: U = 0 V ... 5.0 V)
      • state: C: open|closed V: on|off E: E/lx U: U/V

      The attr subType must be multiFuncSensor. This is done if the device was created by autocreate.


    • Battery Powered Actuator (EEP A5-20-01)
      [Kieback&Peter MD15-FTL-xx]
      • Actuator/%
      • actuator: ok|obstructed
      • battery: ok|low
      • currentValue: Actuator/%
      • cover: open|closed
      • energyInput: enabled|disabled
      • energyStorage: charged|empty
      • selfCtl: on|off
      • serviceOn: yes|no
      • temperature: t/°C
      • tempSensor: failed|ok
      • window: open|closed
      • state: Actuator/%

      The attr subType must be MD15. This is done if the device was created by autocreate.


    • Digital Input (EEP A5-30-01, A5-30-02)
      [Thermokon SR65 DI, untested]
      • open|closed
      • battery: ok|low (only EEP A5-30-01)
      • contact: open|closed
      • state: open|closed

      The attr subType must be digitalInput.01 or digitalInput.02. This is done if the device was created by autocreate.


    • Gateway (EEP A5-38-08)
      Switching
      [Eltako FLC61, FSR14]
      • on
      • off
      • executeTime: t/s (Sensor Range: t = 0.1 s ... 6553.5 s or 0 if no time specified)
      • executeType: duration|delay
      • lock: lock|unlock
      • 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.


    • Gateway (EEP A5-38-08)
      Dimming
      [Eltako FUD14, FUD61, FUD70, FSG14, ...]
      • on
      • off
      • dimValue: dim/% (Sensor Range: dim = 0 % ... 100 %)
      • 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)
      • 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 dimValue.


    • Gateway (EEP A5-38-08)
      Setpoint shift
      [untested]
      • 1/K
      • setpointShift: 1/K (Sensor Range: T = -12.7 K ... 12.8 K)
      • 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)
      • 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]
      • auto|heating|cooling|off
      • controlVar: cvov (Sensor Range: cvov = 0 % ... 100 %)
      • controllerMode: auto|heating|cooling|off
      • controllerState: auto|override
      • energyHoldOff: normal|holdoff
      • presence: present|absent|standby
      • state: auto|heating|cooling|off

      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
      • state: 0 ... 3|auto

      The attr subType must be gateway, gwCmd must be fanStage. This is done if the device was created by autocreate.


    • 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)
      • 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)

      Shutter (EEP F6-02-01 ... F6-02-02)
      [Eltako FSB12, FSB14, FSB61, FSB70]
      • B0
        The status of the device will become "B0" after the TOP endpoint is reached, or it has finished an "up" or "position 0" command.
      • BI
        The status of the device will become "BI" if the BOTTOM endpoint is reached
      • released
        The status of the device become "released" between one of the endpoints.
      • state: B0|BI|released

      Set attr subType to manufProfile, attr manufID to 00D and attr model to FSB14|FSB61|FSB70 manually.


    • RAW Command

      • RORG: RPS|1BS|4BS
      • dataSent: data (Range: 0x00 ... 0xFF or 0x00000000 ... 0xFFFFFFFF)
      • 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 type (RORG) 4BS can be received. For further information, see EnOcean Equipment Profiles (EEP).
      Set attr subType to raw manually.


    • Light and Presence Sensor
      [Omnio Ratio eagle-PM101]
      • yes
      • no
      • brightness: E/lx (Sensor Range: E = 0 lx ... 1000 lx)
      • channel1: yes|no
        Motion message in depending on the brightness threshold
      • channel2: yes|no
        Motion message
      • motion: yes|no
        Channel 2
      • state: yes|no
        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

    NOTE: As of FRITZ!OS 5.50 this module is known to work on the FB7390, and is known to crash the FB7270.

    This module connects to the AHA server (AVM Home Automation) on a FRITZ!Box. It serves as the "physical" counterpart to the FBDECT devices.

    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:
        define fb1 FBAHA fritz.box:2002
        define fb1 FBAHA UNIX:SEQPACKET:/var/tmp/me_avm_home_external.ctl

    Set
    • createDevs
      create a FHEM device for each DECT device found on the AHA-Host, see also get devList.

    Get
    • devList
      return a list of devices with short info.

    Attributes
    • dummy
    • loglevel

    Generated events:
    • UNDEFINED FBDECT_$ahaName_${NR} FBDECT $id"

FBDECT

    This module is used to control AVM FRITZ!DECT devices via FHEM, see also the FBAHA module for the base.

    Define
      define <name> FBDECT <homeId> <id> [classes]

      <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


    Set
    • on/off
      set the device on or off.
    • set extensions are supported.

    Get
    • devInfo
      report device information

    Attributes
    • IODev
    • do_not_notify
    • ignore
    • dummy
    • showtime
    • loglevel
    • model
    • readingFnAttributes

    Generated events:
    • on
    • off
    • set_on
    • set_off
    • current: $v A
    • voltage: $v V
    • power: $v W
    • energy: $v Wh
    • powerFactor: $v"
    • temperature: $v C

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 call.

    This module work with any FritzBox Fon model.

    Define
      define <name> FB_CALLMONITOR <ip-address>[:port]

      port is 1012 by default.

    Set
    • rereadPhonebook - Reloads the FritzBox phonebook (from given file or directly if available)

    Get
    • search <telephone-number> - returns the name of the given number via reverse-search (internal phonebook, cache or internet research)

    Attributes

    • loglevel
    • do_not_notify
    • readingFnAttributes
    • reverse-search (all|internal|klicktel.de|dasoertliche.de|search.ch|dasschnelle.at|none)
    • Activate the reverse searching of the external number (at dial and call receiving). It is possible to select a specific web service, which should be used for reverse searching. If the attribute is set to "all", the reverse search will use the internal phonebook (if running FHEM on a FritzBox) or reverse search on all websites (execept search.ch and dasschnelle.at) until a valid answer is found on of them If is set to "none", then no reverse searching will be used.

      Default value is "none".

    • reverse-search-cache
    • If this attribute is activated each reverse-search result is saved in an internal cache and will be used instead of reverse searching again the same number.

      Possible values: 0 => off , 1 => on
      Default Value is 0 (off)

    • reverse-search-cache-file <file>
    • 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.

    • reverse-search-phonebook-file <file>
    • 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)

    • remove-leading-zero
    • If this attribute is activated, a leading zero will be removed from the external_number (e.g. in telefon systems).

      Possible values: 0 => off , 1 => on
      Default Value is 0 (off)

    • unique-call-ids
    • If this attribute is activated, each call will use a biunique call id. So each call can be separated from previous calls in the past.

      Possible values: 0 => off , 1 => on
      Default Value is 0 (off)

    • local-area-code
    • Use the given local area code for reverse search in case of a local call (e.g. 0228 for Bonn, Germany)


    Generated Events:

    • event: (call|ring|connect|disconnect) - which event in detail was triggerd
    • external_number: $number - The participants number which is calling (event: ring) or beeing called (event: call)
    • external_name: $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: $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: $connection - The internal connection (FON1, FON2, ISDN, DECT, ...) which is used to take the call
    • external_connection: $connection - The external connection (fixed line, VoIP account) which is used to take the call
    • call_duration: $seconds - 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: $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 $number - This event will be raised in case of a missing incoming call. If available, also the name of the calling number will be displayed.

FHEM2FHEM

    FHEM2FHEM is a helper module to connect separate fhem installations.

    Define
      define <name> FHEM2FHEM <host>[:<portnr>][:SSL] [LOG:regexp|RAW:devicename] {portpassword}

      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
      N/A

    Get
      N/A

    Attributes
    • dummy
    • loglevel

FHEMWEB

    FHEMWEB is the builtin web-frontend (webpgm2). It implements a simple web server (optionally with Basic-Auth and HTTPS), so no additional program is needed.

    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.

      Feature: http://host:port/fhem/icons/<devicename> will return the icon associated with the current status of <devicename>.

    Set
      set <name> rereadicons

      Rereads the icons in the icon path and updates the mapping from logical icons to physical files. Use after adding, deleting or changing icons.

    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

    Attributes
    • webname
      Path after the http://hostname:port/ specification. Defaults to fhem, i.e the default http address is http://localhost:8083/fhem

    • refresh
      If set, a http-equiv="refresh" entry will be genererated with the given argument (i.e. the browser will reload the page after the given seconds).

    • plotmode
      Specifies how to generate the plots:
      • gnuplot
        Call the gnuplot script with each logfile. The filename specification of the FileLog device will determine what is in the plot. The data is converted into an image on the backend with gnuplot.
      • gnuplot-scroll
        Fhemweb will offer zoom and scroll buttons in order to navigate in the current logfile, i.e. you can select just a part of the data to be displayed. The more data is contained in a single logfile, the easier you can navigate. The recommendation is to store the data for a whole year in one logfile. The data is converted into an image on the backend with gnuplot.
      • SVG
        The same scrolling as with gnuplot scroll, but the data is sent as an SVG script to the frontend, which will compute the image: no need for gnuplot on the backend. This is the default. Note: SVG is supported on the Android platform by Opera/Firefox and the Internet Explorer before 9 needs a plugin.
      See also the attribute fixedrange. Note: for gnuplot & gnuplot-scroll mode the gnuplot output is redirected to the file gnuplot.err in the /tmp directory

    • plotsize
      the default size of the plot, in pixels, separated by comma: width,height. You can set individual sizes by setting the plotsize of the weblink. Default is 800,160 for desktop, and 480,160 for smallscreen.

    • fixedrange
      Can be applied to weblink devices (FHEMWEB).
      Contains two time specs in the form YYYY-MM-DD separated by a space. In plotmode gnuplot-scroll or SVG the given time-range will be used, and no scrolling for this weblinks will be possible. Needed e.g. for looking at last-years data without scrolling.

      If the value is one of day, week, month, year than set the zoom level for this weblink 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.

    • endPlotToday
      If this FHEMWEB attribute ist set to 1, then week and month plots will end today. Else the current week (starting at Sunday) or the current month will be shown.

    • plotfork
      If set, generate the logs in a parallel process. Note: do not use it on Windows and on systems with small memory foorprint.

    • 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" }
      attr WEB basicAuth {use FritzBoxUtils;;FB_checkPw("localhost","$password") }
      or if you defined multiple users on the Fritzbox:
      attr WEB basicAuth {use FritzBoxUtils;;FB_checkPw("localhost","$user", "$password") }

    • 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.
        mkdir certs
        cd certs
        openssl req -new -x509 -nodes -out server-cert.pem -days 3650 -keyout server-key.pem


    • allowfrom

    • loglevel

    • 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.
    • 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

    • 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

    • 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.

    • 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.

    • fwcompress
      Enable compressing the HTML data (default is 1, i.e. yes, use 0 to switch it off).

    • 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).

    • CORS
      If set to 1, FHEMWEB will supply a "Cross origin resource sharing" header, see the wikipedia for details.

    • 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 modpath directory.

    • 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 Everything: Anlagen.EDV:icoEverything

    • 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.

    • 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:
          attr lamp devStateIcon on:closed off:open
          attr lamp devStateIcon on::A0 off::AI
          attr lamp devStateIcon .*:noIcon
      Second form:
        Perl regexp enclosed in {}. Example:
        {'<div style="width:32px;height:32px;background-color:green"></div>'}

    • 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 (semicolon, followed by a comma separated list), then a different widget will be displayed:
      • if the modifier is ":time", then a javascript driven timepicker is displayed.
      • if the modifier is of the form ":slider,<min>,<step>,<max>", then a javascript driven slider is displayed
      • else a dropdown with all the modifier values is displayed
      If the command is state, then the value will be used as a command.
      Examples for the modifier:
        define d1 dummy
        attr d1 webCmd state
        attr d1 setList state:on,off
        define d2 dummy
        attr d2 webCmd state
        attr d2 setList state:slider,0,1,10
        define d3 dummy
        attr d3 webCmd state
        attr d3 setList state:time
      Note: this is an attribute for the displayed device, not for the FHEMWEB instance.

    See also room and group attributes.

FHT

    Fhem can receive FHT radio (868.35 MHz) messages either through an FHZ or an CUL device, so this must be defined first.

    Define
      define <name> FHT <housecode>

      <housecode> is a four digit hex number, corresponding to the address of the FHT80b device.
      Examples:
        define wz FHT 3232

      See the FHT section in set for more.

    Set
      set <name> <valuetype> <value>

      where value is one of:
        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 housecode. 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
        • 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 3.

    • 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.

    • ignore
    • do_not_notify
    • loglevel
    • model (fht80b)
    • showtime
    • IODev
    • eventMap
    • readingFnAttributes

    Generated events:
    • actuator
    • actuator1 actuator2 actuator3 actuator4
      actuator5 actuator6 actuator7 actuator8
      (sent if you configured an offset for the associated valve)
    • 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
    • mode
    • holiday1 holiday2
    • desired-temp
    • measured-temp measured-low measured-high
    • warnings
    • manu-temp
    • year month day hour minute
    • day-temp night-temp lowtemp-offset windowopen-temp
    • 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> FHT <housecode> [IODev]

      <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.
      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).

    Attributes
    • IODev
    • dummy
    • ignore
    • loglevel
    • eventMap

    • readingFnAttributes

FHZ

    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 loglevel 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.

    • dummy

    • showtime

    • loglevel
      Set the device loglevel to e.g. 6 if you do not wish messages from a given device to appear in the global logfile (FHZ/FS20/FHT). E.g. to set the FHT time, you should schedule "set FHZ time" every minute, but this in turn makes your logfile unreadable. These messages will not be generated if the FHZ attribute loglevel is set to 6.
      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.

    • model (fhz1000,fhz1300)

    • 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
    • N/A

    Attributes
    • userattr fp_<name> <top>,<left>[,<style>[,<description>]]

      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
      • 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, allowing to place devices easily on the screen.
      Example:
        attr Groundfloor fp_arrange 1
        attr Groundfloor fp_arrange detail #displays the devices with infos room, type, alias
        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".
    • Inherited from FHEMWEB
      The following attributes are inherited from the underlying FHEMWEB instance:
        smallscreen
        touchpad
        refresh
        plotmode
        plotsize
        webname
        redirectCmds
        longpoll


FRM

    connects fhem to Arduino using the Firmata protocol.

    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 (pulse_width_modulated) output
    FRM_I2C to read data from integrated circutes attached to Arduino supporting the i2c-protocol.

    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 requires the Device::Firmata module (perl-firmata). You can download it as a single zip file from github. Copy 'lib/Device' (with all subdirectories) to e.g. FHEM directory (or other location within perl include path)

    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> FRM {<device> | <port> [global]}
      Specifies the FRM device.

      USB-connected 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 'StandardFirmata'. You can find StandardFirmata in the Arduino-IDE under 'Examples->Firmata->StandardFirmata

      Network-connected devices:
        <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 run a Version of firmata that connects in client-mode (the connection is initiated by the arduino). 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.
        The support for Firmata over ethernet is still experimental. Firmata-ethenet-client can be found here: ConfigurableEthernetclient.ino

      If the device is called none, then no device will be opened, so you can experiment without hardware attached.

    Set
      N/A

    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

    • sampling-interval
      Configure the interval Firmata reports data to FRM. Unit is milliseconds.
      See: Firmata Protocol details about Sampling Interval

FRM_AD

    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.)
    • eventMap
    • readingFnAttributes

FRM_I2C

    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.)
    • eventMap
    • readingFnAttributes

FRM_IN

    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./li>
    • state
      returns the 'state' reading

    Attributes
    • count-mode 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 'rising'
    • count-threshold <number>
      sets the theshold-value for the counter. Whenever 'count' reaches the 'count-threshold' 'alarm' is
      set to 'on' and count is reset to 0. Use 'set alarm off' to clear the alarm.
    • IODev
      Specify which FRM to use. (Optional, only required if there is more than one FRM-device defined.)
    • eventMap
    • readingFnAttributes

FRM_LCD

    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 FRM-device to work.
    this FRM-device has to be configures for i2c by setting attr 'i2c-config' on the FRM-device
    Define
      define <name> FRM_LCD i2c <size-x> <size-y> <i2c-address>
      Specifies the FRM_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>
    Get
      N/A

    Attributes
    • backLight <on|off>
    • autoClear <on|off>
    • autoBreak <on|off>
    • restoreOnStartup <on|off>
    • restoreOnReconnect <on|off>
    • IODev
      Specify which FRM to use. (Optional, only required if there is more than one FRM-device defined.)
    • eventMap
    • readingFnAttributes

FRM_OUT

    represents a pin of an Arduino running Firmata configured for digital output.
    Requires a defined FRM-device to work.

    Define
      define <name> FRM_OUT <pin>
      Defines the FRM_OUT device. <pin>> is the arduino-pin to use.

    Set
      set <name> on|off

    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.)
    • eventMap
    • readingFnAttributes

FRM_PWM

    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.

    Set
      set <name> value <value>
      sets the pulse-width of the signal that is output on the configured arduino pin
      Range is from 0 to 255 (see analogWrite() for details)
    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.)
    • eventMap
    • readingFnAttributes

FRM_SERVO

    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
    • eventMap
    • readingFnAttributes

FS20

    The FS20 protocol is used by a wide range of devices, which are either of the sender/sensor category or the receiver/actuator category. The radio (868.35 MHz) messages are either received through an FHZ or an CUL device, so this must be defined first.

    Define
      define <name> FS20 <housecode> <button> [fg <fgaddr>] [lm <lmaddr>] [gm FF]

      The values of housecode, button, fg, lm, and gm can be either defined as hexadecimal value or as ELV-like "quad-decimal" value with digits 1-4. We will reference this ELV-like notation as ELV4 later in this document. You may even mix both hexadecimal and ELV4 notations, because FHEM can detect the used notation automatically by counting the digits.
      • <housecode> is a 4 digit hex or 8 digit ELV4 number, corresponding to the housecode address.
      • <button> is a 2 digit hex or 4 digit ELV4 number, corresponding to a button of the transmitter.
      • The optional <fgaddr> specifies the function group. It is a 2 digit hex or 4 digit ELV address. The first digit of the hex 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.

      Examples:
        define lamp FS20 7777 00 fg F1 gm F
        define roll1 FS20 7777 01
        define otherlamp FS20 24242424 1111 fg 4412 gm 4444
        define otherroll1 FS20 24242424 1114

    Set
      set <name> <value> [<time>]

      where value is one of:
        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
        on-till # Special, see the note
      The set extensions are also supported.

      Examples:
        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.
      • 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.

    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:

      Sender/Sensor: fs20fms fs20hgs fs20irl fs20kse fs20ls fs20pira fs20piri fs20piru fs20s16 fs20s20 fs20s4 fs20s4a fs20s4m fs20s4u fs20s4ub fs20s8 fs20s8m fs20sd fs20sn fs20sr fs20ss fs20str fs20tc1 fs20tc6 fs20tfk fs20tk fs20uts fs20ze fs20bf

      Dimmer: fs20di fs20di10 fs20du

      Receiver/Actor: fs20as1 fs20as4 fs20ms2 fs20rgbsa fs20rst fs20rsu fs20sa fs20sig fs20sm4 fs20sm8 fs20st fs20su fs20sv fs20ue1 fs20usr fs20ws1

    • 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.

    • do_not_notify
    • loglevel
    • showtime
    • readingFnAttributes

    Generated events:
      From an FS20 device you can receive one of the following events.
    • on
    • off
    • toggle
    • dimdown
    • dimup
    • dimupdown
    • on-for-timer
    • Which event is sent is device dependent and can sometimes configured on the device.

FileLog


    Define
      define <name> FileLog <filename> <regexp>

      Log events to <filename>. The log format is

        YYYY:MM:DD_HH:MM:SS <device> <event>

      The regexp will be checked against the 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!
      Examples:
        define lamplog FileLog %L/lamp.log lamp
        define wzlog FileLog /var/tmp/wz-%Y-%U.log wz:(measured-temp|actuator).*
        With ISO 8601 week numbers, if supported:
        define wzlog FileLog /var/tmp/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 and the file itself).
        • 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 grep. "-" is the current logfile, or you can specify an older file (or a file from the archive).
      • <outfile>
        If it is "-", you get the data back on the current connection, else it is the prefix for the output file. If more than one file is specified, the data is separated by a comment line for "-", else it is written in separate files, numerated from 0.
      • <from> <to>
        Used to grep the data. The elements should correspond to the timeformat or be an initial substring of it.
      • <column_spec>
        For each column_spec return a set of data in a separate file or separated by a comment line on the current connection.
        Syntax: <col>:<regexp>:<default>:<fn>
        • <col> The column number to return, starting at 1 with the date. If the column is enclosed in double quotes, then it is a fix text, not a column nuber.
        • <regexp> If present, return only lines containing the regexp. Case sensitive.
        • <default>
          If no values were found and the default value is set, then return one line containing the from value and this default. We need this feature as gnuplot aborts if a dataset has no value at all.
        • <fn> One of the following:
          • int
            Extract the integer at the beginning og the string. Used e.g. for constructs like 10%
          • delta-h or delta-d
            Return the delta of the values for a given hour or a given day. Used if the column contains a counter, as is the case for the KS300 rain column.
          • everything else
            The string is evaluated as a perl expression. @fld is the current line splitted by spaces. Note: The string/perl expression cannot contain spaces, as the part after the space will be considered as the next column_spec.


      Example:

        get outlog out-2008.log - 2008-01-01 2008-01-08 4:IR:int: 9:IR::

    Attributes
    • archivecmd / archivedir / nrarchive
      When a new FileLog file is opened, the FileLog archiver wil be called. This happens only, if the name of the logfile has changed (due to time-specific wildcards, see the FileLog section), and there is a new entry to be written into the file.
      If the attribute archivecmd is specified, then it will be started as a shell command (no enclosing " is needed), and each % in the command will be replaced with the name of the old logfile.
      If this attribute is not set, but nrarchive and/or archivecmd are 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).

    • disable
    • logtype
      Used by the pgm2 webfrontend to offer gnuplot/SVG images made from the logs. The string is made up of tokens separated by comma (,), each token specifies a different gnuplot program. The token may contain a colon (:), the part before the colon defines the name of the program, the part after is the string displayed in the web frontend. Currently following types of gnuplot programs are implemented:
      • fs20
        Plots on as 1 and off as 0. The corresponding filelog definition for the device fs20dev is:
        define 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.
      Example:
      attr ks300log1 logtype temp4rain10:Temp/Rain,hum6wind8:Hum/Wind,text:Raw-data


HCS

    Defines a virtual device for monitoring thermostats (FHT, HM-CC-TC) 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
      • disable
      • do_not_notify
      • event-on-change-reading
        default value: state,devicestate,eco,overdrive
      • event-on-update-reading
      • loglevel
        loglevel 3 (or lower) shows a complete statistic of scanned devices (FHT or HM-CC-TC).
        loglevel 4 shows a short summary of scanned devices.
        loglevel 5 suppressed the above messages.


HMLAN

    The HMLAN is the fhem module for the eQ-3 HomeMatic LAN Configurator.

    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


    Define
      define <name> HMLAN <ip-address>[:port]

      port is 1000 by default. If the ip-address is called none, then no device will be opened, so you can experiment without hardware attached.

    Set
    • hmPairForSec
    • hmPairSerial

    Get
      N/A


    Attributes
    • do_not_notify

    • dummy

    • loglevel

    • addvaltrigger

    • hmId

    • hmProtocolEvents

    • 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.

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:
      • There is _NO_ guarantee that the code will work as expected in all circumstances, the authors are not liable for any damage occuring as a result of incomplete or buggy code
      • Currently supported devices are the HMS100-T HMS100-TF HMS100-WD HMS100-MG HMS100-TFK HMS100-CO HMS100-FIT RM100-2 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.


    Set
      N/A

    Get
      N/A

    Attributes
    • ignore
    • do_not_notify
    • loglevel
    • showtime
    • IODev
    • eventMap
    • model (hms100-t hms100-tf hms100-wd hms100-mg hms100-co hms100-tfk hms100-fit rm100-2)
    • readingFnAttributes

HMinfo

    HMinfo is a module that shall support in getting an overview of eQ-3 HomeMatic devices as defines in CUL_HM. It also allows some HM wide commands such as store all collected register settings.

    Commands will be executed on all HM entities of the installation. If applicable and evident execution is restricted to related entities. This means that rssi is executed only on devices, never channels since they never have support rssi values.

    Filter
      can be applied as following:

      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 a 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

    Define
      define <name> HMinfo
      Just one entity needs to be defines, no parameter are necessary.

    Set
      even though the commands are more a get funktion they are implemented as set to allow simple web interface usage
      • models
        list all HM models that are supported in FHEM
      • param <name> <name>...
        returns a table parameter values (attribute, readings,...) for all entities as a table
      • regCheck
        performs a consistancy check on register readings for completeness
      • peerCheck
        performs a consistancy check on peers. If a peer is set in one channel this funktion will search wether the peer also exist on the opposit side.
      • configCheck
        performs a consistancy check of HM settings. It includes regCheck and peerCheck
      • peerXref
        provides a cross-reference on peerings, a kind of who-with-who summary over HM
      • saveConfig
        performs a save for all HM register setting.
      • clearProtocol
        executes a set clear msgEvents on all HM devices
      • clearReadings
        executes a set clear readings on all HM devices
      • clearRssi
        executes a set clear rssi on all HM devices
      • autoReadReg
        stimulates a read of the configuration for the devices.
      • sys

    Get
      N/A


    Attributes
      N/A

HTTPSRV

    Provides a mini HTTP server plugin for FHEMWEB. It serves files from a given directory.

    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

    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.


    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 are autocreated at startup and added to the room HUEDevice.

    Notes:
    • This module needs JSON.
      Pleease install with 'cpan install JSON' or your method of choice.


    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

    Set
    • devices
      list the devices known to the bridge.

    Set
    • statusRequest
      Update bridge status.
    • swupdate
      Update bridge status.


HUEDevice


    Define
      define <name> HUEDevice <id> [<interval>]

      Defines a device connected to a HUEBridge.

      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. The default and minimum is 60.

      Examples:
        define bulb HUEDevice 1
        define LC HUEDevice 2

    Readings
    • 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:
      • 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>
      set brighness to <value>; range is 1-254.
    • ct <value>
      set colortemperature to <value> mireds; range is 154-500.
    • hue <value>
      set hue to <value>; range is 0-65535.
    • sat <value>
      set saturation to <value>; range is 0-254.
    • xy <x>,<y>
      set the xy color coordinates to <x>,<y>
    • effect [none|colorloop]
    • transitiontime <time>
      set the transitiontime to <time> 1/10s
    • rgb <rrggbb>

    • Note:
      • multiple paramters can be set at once separated by :
        Examples:
        set LC on : transitiontime 100
        set bulb on : bri 100 : color 4000

    Get
    • rgb
    • devStateIcon
      returns html code that can be used to create an icon that represents the device color in the room overview.

    Attributes
    • subType
      colordimmer, dimmer or switch, default is initialized according to device model.
    • devStateIcon
      will be initialized to {CommandGet("","<name> devStateIcon")} to show device color as default in room overview.
    • webCmd
      will be initialized to rgb:rgb FF0000:rgb C8FF12:rgb 0000FF:toggle:on:off to show colorpicker and 3 color preset buttons in room overview.

Heating Control


    Define
      define <name> Heating_Control <device> <profile> <command>|<condition>

      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|desiredTemerature) <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.

        profile
        Define the weekly profile. All timings are separated by space. One switchingtime are defined by the following example:
          [<weekdays>|]<time>|<parameter>

        weekdays: optional, if not set every day is using.
        Otherwise you can define one day as number or as shortname.
        time:define the time to switch, format: HH:MM(HH in 24 hour format)
        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

        command
        If no condition is set, all others is interpreted as command. Perl-code is setting up by well-known Block with {}.
        Note: if a command is defined only this command are executed. In case of executing a "set desired-temp" command, you must define it explicit.
        The following parameter are replaced:
        1. @ => the device to switch
        2. % => the new temperature

        condition
        if a condition is defined you must declared 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".

    Set
      N/A

    Get
      N/A

    Attributes
    • disable
    • loglevel
    • event-on-update-reading
    • event-on-change-reading
    • stateFormat

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 ipcam IPCAM 192.168.1.205
        attr ipcam delay 10
        attr ipcam path snapshot.cgi?user=foo&pwd=bar
        attr ipcam snapshots 5
        attr ipcam storage /srv/share/surveillance/snapshots

      A notify on a motion detection of a specified device:
        define MOTION.not.01 notify GH.ga.SEC.MD.01:.*on.* get ipcam image

      Send an eMail after snapshots are taken:
        define MOTION.not.02 notify ipcam:.*snapshots.* { myEmailFunction("%NAME") }

      A public web-cam takes only 1 snapshot 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

      The credentials file has the following structure:
            #
            # Webcam credentials
            #
            $credentials{<name_cam1>}{username} = "<your_username>";
            $credentials{<name_cam1>}{password} = "<your_password>";
            $credentials{<name_cam2>}{username} = "<your_username>";
            $credentials{<name_cam2>}{password} = "<your_password>";
            ...
            
      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
    • disable
    • do_not_notify
    • loglevel
    • readingFnAttributes
    • 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}
    • showtime
    • 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.

    Generated events
    • last: <name_of_device>_snapshot.<image_extension>
    • snapshots: <total_number_of_taken_snapshots_at_end>

IPWE


    Define
      define <name> IPWE <hostname> [<delay>]

      Define a IPWE network attached weather data receiver device sold by ELV. Details see here. It's intended to receive the same sensors as WS300 (8 T/H-Sensors and one kombi sensor), but can be accessed via http and telnet.
      For unknown reason, my try to use the telnet interface was not working neither with raw sockets nor with Net::Telnet module. Therefore i choosed here the "easy" way to simple readout the http page and extract all data from the offered table. For this reason this module doesnt contain any option to configure this device.

      Note: You should give your sensors a name within the web interface, once they a received the first time.
      To extract a single sensor simply match for this name or sensor id

      Attributes:
      • delay: seconds between read accesses(default 300s)

      Example:
        define ipwe IPWE ipwe1 120
        attr ipwe delay 600 : 10min between readouts

    Set
      N/A

    Get
      get <name> status

      Gets actual data from device for sensors with data

      get <name> <sensorname>

      will grep output from device for this sensorname

    Attributes
    • model (ipwe)
    • delay
    • loglevel

IT - InterTechno

    The InterTechno 433MHZ protocol is used by a wide range of devices, which are either of the sender/sensor category or the receiver/actuator category. As we right now are only able to SEND InterTechno commands, but CAN'T receive them, this module at the moment supports just devices like switches, dimmers, etc. through an CUL device, so this must be defined first.

    Define
      define <name> IT <housecode> <on-code> <off-code> [<dimup-code>] [<dimdown-code>]
      or
      define <name> IT <ITRotarySwitches|FLS100RotarySwitches>

      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 your device you are using.
      Bit 11/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 consist 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 is 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

    Set
      set <name> <value> [<time>]

      where value is one of:
          dimdown
          dimup
          off
          on
          on-till           # Special, see the note
      
      Examples:
        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, 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.

    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: Upon startup fhem DOES NOT assigns an InterTechno device an IODevice! The attribute IODev needs to be used AT ANY TIME!

    • 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

    • do_not_notify

    • 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.

    • loglevel

    • showtime

    • model
      The model attribute denotes the model type of the device. The attributes will (currently) not be used by the fhem.pl directly. It can be used by e.g. external programs or web interfaces to distinguish classes of devices and send the appropriate commands (e.g. "on" or "off" to a 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:
      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 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.


    Generated events:
      From an IT device you can receive one of the following events.
    • on
    • off
    • dimdown
    • dimup
      Which event is sent is device dependent and can sometimes configured on the device.

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

JsonList

    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

    Example:
      fhem> jsonlist
      {
        "ResultSet": "full",
        "Results": [
          {
            "list": "Global",
            "devices": [
              {
                "DEF": "",
                "NAME": "global",
                "NR": "1",
                "STATE": "",
                "TYPE": "Global",
                "currentlogfile": "/var/log/fhem/fhem-2011-12.log",
                "logfile": "/var/log/fhem/fhem-%Y-%m.log",
                "ATTR": {
                  "configfile": "/etc/fhem/fhem.conf",
                  "logfile": "/var/log/fhem/fhem-%Y-%m.log",
                  "modpath": "/usr/share/fhem",
                  "pidfilename": "/var/run/fhem.pid",
                  "port": "7072 global",
                  "room": "Server",
                  "statefile": "/var/cache/fhem/fhem.save",
                  "verbose": "4",
                  "version": "=VERS= from =DATE= ($Id: 98_JsonList.pm 2102 2012-11-08 23:18:44Z mfr69bs $)"
                },
                "READINGS": []
              }
            ]
          },
          {
          "list": "CM11",
            "devices": [
              {
                "DEF": "/dev/cm11",
                "DeviceName": "/dev/cm11",
                "FD": "14",
                "NAME": "CM11",
                "NR": "19",
                "PARTIAL": "null",
                "STATE": "Initialized",
                "TYPE": "CM11",
                "ATTR": {
                  "model": "CM11"
                },
                "READINGS": []
              }
            ]
          },
          {
                  [...placeholder for more entrys...]
          },
        ],
        "totalResultsReturned": 235
      }
      
    If specifying <devspec>, then a detailed status for <devspec> will be displayed, e.g.:
      fhem> jsonlist lamp1
      {
        "ResultSet": {
          "Results": {
            "ATTRIBUTES": {
              "alias": "Lamp on Sideboard",
              "model": "fs20st",
              "room": "Livingroom"
            },
            "BTN": "01",
            "CHANGED": "ARRAY",
            "CHANGETIME": "ARRAY",
            "CODE": {
              "1": "0b0b 01",
              "2": "0b0b 0f",
              "3": "0b0b f0",
              "4": "0b0b ff"
            },
            "DEF": "12341234 1112 lm 1144 fg 4411 gm 4444",
            "IODev": "CUN868",
            "NAME": "lamp1",
            "NR": "155",
            "READINGS": {
              "state": {
                "TIME": "2011-12-01 16:23:01",
                "VAL": "on"
              }
            },
            "STATE": "on",
            "TYPE": "FS20",
            "XMIT": "0b0b"
          }
        }
      }
      
    If specifying <typespec>, then a list with the status for the defined <typespec> devices will be displayed, e.g.:
      fhem> jsonlist HMS
      {
        "ResultSet": "devices#HMS",
        "Results": [
          {
            "name": "KG.ga.WD.01",
            "state": "Water Detect: off"
          },
          {
            "name": "KG.hz.GD.01",
            "state": "Gas Detect: off"
          },
          {
            "name": "KG.k1.TF.01",
            "state": "T: 16.6  H: 51.2  Bat: ok"
          },
          {
            "name": "NN.xx.RM.xx",
            "state": "smoke_detect: off"
          }
        ],
        "totalResultsReturned": 4
      }
      
    If specifying ROOMS, then a list with the defined rooms will be displayed, e.g.:
      fhem> jsonlist ROOMS
      {
        "ResultSet": "rooms",
        "Results": [
          "Bathroom",
          "Bedroom",
          "Children",
          "Diningroom",
          "Garden",
          "House",
          "Livingroom",
          "Office",
          "hidden"
        ],
        "totalResultsReturned": 15
      }
      

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/ttyS0@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-for-timer [period]
        start hot water production for the given period
        period must have the format HH:MM
        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
      • 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
      N/A

    Attributes
    • do_not_notify
    • loglevel
    • all_km271_events
      If this attribute is set to 1, do not ignore following events:
      HK1_Vorlaufisttemperatur, HK2_Vorlaufisttemperatur, 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-for-timer command (default is tag).
      ww_on-for-timer will set the ww_betriebsart of the heater according to this attribute.

    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_Letzter_Fehlerstatus
    • 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:
    • Aussentemperatur
    • Betriebswerte
    • Brenneransteuerung
    • Brennerlaufzeit
    • Brennerschalttemperatur
    • Heizkennlinie
    • Kesselbetrieb
    • Kesselintegral
    • Ladepumpe
    • Raumsolltemperatur_HK1
    • Vorlauftemperatur
    • Warmwasser
    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.

KS300

    Fhem can receive the KS300 radio (868.35 MHz) messages through FHZ, WS300 or an CUL device, so one of them must be defined first.
    This module services messages received by the FHZ device, if you use one of the other alternetives, see the WS300 or CUL_WS entries.
    Note: The KS555 is also reported to work.

    Define
      define <name> KS300 <housecode> [ml/raincounter [wind-factor]]

      <housecode> is a four digit hex number, corresponding to the address of the KS300 device, right now it is ignored. The ml/raincounter defaults to 255 ml, but it must be specified if you wish to set the wind factor, which defaults to 1.0.
      Examples:
        define ks1 KS300 1234

    Set
      N/A

    Get
      N/A

    Attributes
    • ignore
    • IODev
    • eventMap

    • do_not_notify
    • showtime
    • loglevel
    • model (ks300)
    • rainadjustment
      If this attribute is set, fhem automatically accounts for rain counter resets after a battery change and random counter switches as experienced by some users. The raw rain counter values are adjusted by an offset in order to flatten out the sudden large increases and decreases in the received rain counter values. Default is 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.

      Example:
        define 47LG7000 LGTV
        attr 47LG7000 IODev myLG7k

    Set
      set <name> <what> <value>

      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.
      power
      input
      audio
    Attributes
    • dummy

    • loglevel

    Implementator's note
      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.

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
    • loglevel

LUXTRONIK2

    Luxtronik 2.0 is a heating controller used in Alpha Innotec and Siemens Novelan Heatpumps. It has a builtin Ethernet Port, so it can be directly integrated into a local area network.
    Define
      define <name> LUXTRONIK2 <IP-address> [<poll-interval>]
      If the pool interval is omitted, it is set to 300 (seconds).
      Example:
        define Heizung LUXTRONIK2 192.168.0.12 600

    Set
      Nothing to set here yet...

    Get
      No get implemented yet ...

    Attributes
    • statusHTML
      if set, creates a HTML-formatted reading named "floorplanHTML" for use with the FLOORPLAN module.
      Currently, if the value of this attribute is not NULL, the corresponding reading consists of the current status of the heatpump and the temperature of the water.
    • do_not_notify
    • loglevel

LightScene

    Allows to store the state of a group of lights and recall it later. Multiple states for one group can be stored.

    Define
      define <name> LightScene [<dev1>] [<dev2>] [<dev3>] ...

      Examples:
        define light_group LightScene Lampe1 Lampe2 Dimmer1

    Set
    • 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>
    • remove <scene_name>
      remove <scene_name> from list of saved scenes

    Get
    • scenes
    • scene <scene_name>


M232


    Define
      define <name> M232 <m232-device>

      Define a M232 device. You can attach as many M232 devices as you like. A M232 device provides 6 analog inputs (voltage 0..5V with 10 bit resolution) and 8 bidirectional digital ports. The eighth digital port can be used as a 16 bit counter (maximum frequency 3kHz). The M232 device needs to be connected to a 25pin sub-d RS232 serial port. A USB-to-serial converter works fine if no serial port is available.

      Examples:
        define m232 M232 /dev/ttyUSB2

    Set
      set <name> stop

      Stops the counter.

      set <name> start

      Resets the counter to zero and starts it.

      set <name> octet

      Sets the state of all digital ports at once, value is 0..255.

      set <name> io0..io7 0|1

      Turns digital port 0..7 off or on.

    Get
      get <name> [an0..an5]

      Gets the reading of analog input 0..5 in volts.

      get <name> [io0..io7]

      Gets the state of digital ports 0..7, result is 0 or 1.

      get <name> octet

      Gets the state of all digital ports at once, result is 0..255.

      get <name> counter

      Gets the number of ticks of the counter since the last reset. The counter wraps around from 65,535 to 0 and then stops. See M232Counter for how we care about this.

    Attributes
    • loglevel
    • model (m232)

M232Counter

    Define
      define <name> M232Counter [unit [factor [deltaunit [deltafactor]]]]

      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.

      Examples:
        define counter M232Counter turns
        define counter M232Counter kWh 0.0008 kW 2.88 (one tick equals 1/1250th kWh)

      Do not forget to start the counter (with set .. start for M232) or to start the counter and set the reading to a specified value (with set ... value for M232Counter).

      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).

    Attributes
    • dummy

    • loglevel
    • model (M232Counter)

M232Voltage


    Define
      define <name> M232Voltage [an0..an5] [unit [factor]]

      Define as many M232Voltages as you like for a M232 device. Defining a M232Voltage will schedule an internal task, which reads the status of the analog input every minute, and triggers notify/filelog commands. unit is the unit name, factor is used to calibrate the reading of the analog input.

      Note: the unit defaults to the string "volts", but it must be specified if you wish to set the factor, which defaults to 1.0.

      Example:
        define volt M232Voltage an0
        define brightness M232Voltage an5 lx 200.0

    Set
      N/A

    Get
      get <name> status

    Attributes
    • dummy

    • loglevel
    • model (M232Voltage)

MAX

    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 Cube, 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 <value> [until <date>]
      For devices of type HeatingThermostat only. <value> maybe one of
      • degree celcius between 3.5 and 30.5 in 0.5 degree steps
      • "on" or "off" correspondig to 30.5 and 4.5 degree celcius
      • "eco" or "comfort" using the eco/comfort temperature set on the device (just as the right-most physical button on the device itself does)
      • "auto <temperature>". The weekly program saved on the thermostat is processed. If the optional <temperature> is given, it is set as desiredTemperature until the next switch point of the weekly program.
      • "boost", activates the boost mode, where for boostDuration minutes the valve is opened up boostValveposition percent.
      All values but "auto" maybe accompanied by the "until" clause, with <data> in format "dd.mm.yyyy HH:MM" (minutes may only be "30" or "00"!) to set a temporary temperature until that date/time. Make sure that the cube has valid system time!
    • 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. The thermostat tries to match desiredTemperature to (temperature = measured temperature at sensor + measurementOffset). Usually, the 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. 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.

    Get
      N/A

    Attributes
    • eventMap
    • IODev
    • loglevel
    • do_not_notify
    • ignore
    • readingFnAttributes
    • 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. (The devices themselves are handled by the MAX module).

    Define
      define <name> MAXLAN <ip-address>[:port] [<pollintervall> [ondemand]]

      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. 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.
    • do_not_notify
    • dummy
    • loglevel
    • addvaltrigger

MSG

    The MSG device is the backend device for all the message handling (I/O-engine). Under normal conditions only one MSG device is needed to serve multiple frontend message devices like file or email.

    Define
      define <name> MSG

      Specifies the MSG device. A single MSG device could serve multiple MSG frontends. But, for special conditions there could be defined more than one MSG device.

    Set
      set <name> send|write <devicename>

    Notes:
      To send the data, both send or write could be used.
      The devicename is the name of a frontenddevice previously defined. Based on the type of the frontend device, the MSG device will send out the lines of data.
      Frontend devices are available for:
      • File
      • EMail with SSL Authentification
      For details about this devices, please review the device-definitions.
      After sending/writing the data, the data stills exists with the frontend device, MSG do not delete/purge any data, this must be done by the frontend device.

      Examples:
        define myMsg MSG
    Attributes
    • IODev
    • dummy
    • ignore
    • loglevel
    • eventMap



MSGFile

    The MSGFile device is a frontend device for message handling. With a MSGFile device data is written to disk (or other media). Multiple MSGFile devices could be defined. To write the data to disk, a MSG device is necessary. A MSGFile device needs the operating systems rights to write to the filesystem. 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 [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.


    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 myMsg MSG
      define myFile MSGFile /tmp/fhemtest.txt
      attr myFile filemode append
      set myFile add Textzeile 1
      set myFile add Textzeile 2
      set myMsg write myFile
      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
    • loglevel

MSGMail

    The MSGMail device is a frontend device for mail message handling. With a MSGMaildevice data is fowarded to a mail provider and send to a recipent. Multiple MSGMail devices could be defined. MSGMail supports by the moment only mail provider, which uses SSL secured connection like Googlemail, GMX, Yahoo or 1und1 for example. To send an email, a MSG device is necessary.
    MAIL::Lite and Net::SMTP::SSL from CPAN is needed to use MSGMail!!

    Define

      define <name> MSGMail <from> <to> <smtphost> <authfile>

      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.

    Examples:
      define myMail MSGMail from@address.com to@address.com smtp.provider.host /etc/msgauthfile

    Set
      set <name> add|clear|list [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.


      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 myMsg MSG
        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 myMsg send myMail
        set myMail clear

    Attributes
      Almost all of these attributes are not optional, most of them could set at definition.
    • from
      sets the mail address of the sender
    • to
      sets the mail address of the recipent
    • 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.
    • 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
    • loglevel

NetIO230B

    fhem-module for NetIO 230B Power Distribution Unit    (see: NetIO 230B (koukaam.se))

    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.

    Define
    • define <name> NetIO230B <ip-address> <socket number(s) > [<user name> <password>]
    • define <name> NetIO230B <ip-address> <socket number(s) > [<config file path>]
    • 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:

        %config= (
           host => "192.168.61.40",
           user => "admin",
           password => "admin"
        );


        (All settings optional)

      Examples:

      • define Socket3 NetIO230B 192.168.178.10 3
      • define Socket1_and_4 NetIO230B 192.168.178.10 14
      • define coffeemaker NetIO230B 192.168.178.10 1 username secretpassword
      • define coffeemaker_and_light NetIO230B 192.168.178.10 23 /var/log/kitchen.conf

    Get
      get <name> state

      returns the state of the socket(s)
      Example:
        get coffeemaker_and_light   => on or off

    Set
      set <name> <value>

      where value is one of:
      		on
      		off
      		
      Examples:
        set coffeemaker_and_light on

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.

      Example:
      define Kaminzimmer OREGON BTHR918N_ab

    Set
      N/A

    Get
      N/A

    Attributes
    • ignore

    • do_not_notify

OWAD

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.


Example

define OWX_AD OWAD 724610000000 45
attr OWX_AD DAlarm high
attr OWX_AD DFactor 31.907097
attr OWX_AD DHigh 50.0
attr OWX_AD DName RelHumidity|humidity
attr OWX_AD DOffset -0.8088
attr OWX_AD DUnit percent|%


Define

define <name> OWAD [<model>] <id> [<interval>] or
define <name> OWAD <fam>.<id> [<interval>]

Define a 1-Wire A/D converter.

  • [<model>]
    Defines the A/D converter model (and thus 1-Wire family id), currently the following values are permitted:
    • model DS2450 with family id 20 (default if the model parameter is omitted)
  • <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.

Set

  • set <name> interval <int>
    Measurement interval in seconds. The default is 300 seconds.

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.
  • get <name> interval
    Returns measurement interval in seconds.
  • get <name> reading
    Obtain the measuement values.
  • get <name> alarm
    Obtain the alarm values.
  • get <name> status
    Obtain the i/o status values.

Attributes

  • attr <name> stateAL0 <string>
    character string for denoting low normal condition, default is empty
  • attr <name> stateAH0 <string>
    character string for denoting high normal condition, default is empty
  • attr <name> stateAL1 <string>
    character string for denoting low alarm condition, default is down triangle, e.g. the code &#x25BE; leading to the sign ▾
  • attr <name> stateAH1 <string>
    character string for denoting high alarm condition, default is upward triangle, e.g. the code &#x25B4; leading to the sign ▴
For each of the following attributes, the channel identification A,B,C,D may be used.
  • attr <name> <channel>Name <string>|<string>
    name for the channel | a type description for the measured value.
  • attr <name> <channel>Unit <string>|<string>
    unit of measurement for this channel | its abbreviation.
  • deprecated: attr <name> <channel>Offset <float>
    offset added to the reading in this channel.
  • deprecated: attr <name> <channel>Factor <float>
    factor multiplied to (reading+offset) in this channel.
  • 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 !
  • attr <name> <channel>Alarm <string>
    alarm setting in this channel, either both, low, high or none (default).
  • attr <name> <channel>Low <float>
    measurement value (on the scale determined by offset and factor) for low alarm.
  • attr <name> <channel>High <float>
    measurement value (on the scale determined by offset and factor) for high alarm.
  • Standard attributes alias, comment, event-on-update-reading, event-on-change-reading, stateFormat, room, eventMap, loglevel, webCmd

OWCOUNT

FHEM module to commmunicate with 1-Wire Counter/RAM DS2423

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.


Example


define OWC OWCOUNT 1D.CE780F000000 60
attr OWC AName Energie|energy
attr OWC AUnit kWh|kWh
attr OWC APeriod hour
attr OWC ARate Leistung|power
attr OWX_AMode daily

Define

define <name> OWCOUNT [<model>] <id> [<interval>] or
define <name> OWCOUNT <fam>.<id> [<interval>]

Define a 1-Wire counter.

  • [<model>]
    Defines the counter model (and thus 1-Wire family id), currently the following values are permitted:
    • model DS2423 with family id 1D (default if the model parameter is omitted)
  • <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.

Set

  • set <name> interval <int>
    Measurement interval in seconds. The default is 300 seconds.
  • set <name> memory <page>
    Write 32 bytes to memory page 0..13
  • set <name> midnight <channel-name>
    Write the day's starting value for counter <channel> (A, B or named channel, see below)

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.
  • get <name> interval
    Returns measurement interval in seconds.
  • get <name> memory <page>
    Obtain 32 bytes from memory page 0..13
  • get <name> midnight <channel-name>
    Obtain the day's starting value for counter <channel> (A, B or named channel, see below)
  • get <name> counter <channel-name>
    Obtain the current value for counter <channel> (A, B or named channel, see below)
  • get <name> counters
    Obtain the current value both counters

Attributes

  • attr <name> LogM <string>|
    device name (not file name) of monthly log file.
  • attr <name> LogY <string>|
    device name (not file name) of yearly log file.

For each of the following attributes, the channel identification A,B may be used.

  • attr <name> <channel>Name <string>|<string>
    name for the channel | a type description for the measured value.
  • attr <name> <channel>Unit <string>|<string>
    unit of measurement for this channel | its abbreviation.
  • attr <name> <channel>Rate <string>|<string>
    name for the channel rate | a type description for the measured value.
  • attr <name> <channel>Offset <float>
    offset added to the reading in this channel.
  • attr <name> <channel>Factor <float>
    factor multiplied to (reading+offset) in this channel.
  • attr <name> <channel>Mode daily | normal
    factor multiplied to (reading+offset) in this channel.
  • Standard attributes alias, comment, event-on-update-reading, event-on-change-reading, stateFormat, room, eventMap, loglevel, webCmd

OWDevice


    Define
      define <name> OWDevice <address> [<interval>]

      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.
    • loglevel
    • eventMap
    • readingFnAttributes


OWFS

    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.

    Note: You need the owperl module from http://owfs.org/.

    Define
      define <name> OWFS <owserver-ip:port> <model> [<id>]

      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

    Attributes
    • dummy
    • do_not_notify
    • loglevel
    • showtime
    • temp-scale
      Specifies the temperature-scale unit:
      • C
        Celsius. This is the default.
      • F
        Fahrenheit
      • K
        Kelvin
      • R
        Rankine

OWID

FHEM module for 1-Wire devices that know only their unique ROM ID

This 1-Wire module works with the OWX interface module or with the OWServer interface module Please define an OWX device or OWServer device first.


Example


define ROM1 OWX_ID OWCOUNT 09.CE780F000000 10


Define

define <name> OWID <fam> <id> [<interval>] or
define <name> OWID <fam>.<id> [<interval>]

Define a 1-Wire device.

  • <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>
    Interval in seconds for checking the presence of the device. The default is 300 seconds.

Set

  • set <name> interval <int>
    Interval in seconds for checking the presence of the device. The default is 300 seconds.

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.

OWLCD

FHEM module to commmunicate with the 1-Wire LCD controller from Louis Swart (1-Wire family id FF). See also the corresponding Wiki page.

Note:
This 1-Wire module so far works only with the OWX interface module. Please define an OWX device first.


Example

define OWX_LCD OWLCD 9F0700000100


Define

define <name> OWLCD <id> or
define <name> OWLCD FF.<id>

Define a 1-Wire LCD device.

  • <id>
    12-character unique ROM id of the converter device without family id and CRC code

Set

  • set <name> icon <int> on|off|blink
    Set one of the icons 0..14 on, off or blinking
  • set <name> icon 15 0..6
    Set icon 15 to one of its values
  • set <name> icon none
    Set all icons off
  • set <name> line <int> <string>
    Write LCD line 0..3 with some content
  • set <name> memory <page> <string>
    Write memory page 0..6
  • set <name> gpio <value>
    Write state for all three gpio pins (value = 0..7, for each bit 0=ON, 1=OFF)
  • set <name> backlight ON|OFF
    Switch backlight on or off
  • set <name> lcd ON|OFF
    Switch LCD power on or off
  • set <name> reset
    Reset the display
  • set <name> test
    Test the display

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.
  • get <name> memory <page>
    Read memory page 0..6
  • get <name> gpio
    Obtain state of all four input channels (15 = all off, 0 = all on)
  • get <name> gpio
    Obtain state of all four input counters (4 x 16 Bit)
  • get <name> version
    Obtain firmware version of the controller

Attributes

  • Standard attributes alias, comment, room, eventMap, loglevel, webCmd

OWMULTI

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.

Example

define OWX_M OWMULTI 7C5034010000 45
attr OWX_M VName relHumidity|humidity
attr OWX_M VUnit percent|%
attr OWX_M VFunction (161.29 * V / VDD - 25.8065)/(1.0546 - 0.00216 * T)

Define

define <name> OWMULTI [<model>] <id> [<interval>] or
define <name> OWMULTI <fam>.<id> [<interval>]

Define a 1-Wire multi-sensor

  • [<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.

Set

  • set <name> interval <int>
    Measurement interval in seconds. The default is 300 seconds.

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.
  • get <name> interval
    Returns measurement interval in seconds.
  • get <name> reading
    Obtain the measurement values
  • get <name> VAD
    Obtain the measurement value from VFunction.
  • get <name> temperature
    Obtain the temperature value.
  • get <name> VDD
    Obtain the current supply voltage.
  • get <name> V or get <name> raw
    Obtain the raw external voltage measurement.

Attributes

  • attr <name> VName <string>|<string>
    name for the channel | a type description for the measured value.
  • attr <name> VUnit <string>|<string>
    unit of measurement for this channel | its abbreviation.
  • attr <name> VFunction <string>
    arbitrary functional expression involving the values VDD, V, T. Example see above.
    • VDD is replaced by the measured supply voltage in Volt,
    • V by the measured external voltage,
    • T by the measured and corrected temperature in its unit
  • attr <name> tempOffset <float>
    temperature offset in °C added to the raw temperature reading.
  • attr <name> tempUnit Celsius|Kelvin|Fahrenheit|C|K|F
    unit of measurement (temperature scale), default is Celsius = °C
  • Standard attributes alias, comment, event-on-update-reading, event-on-change-reading, stateFormat, room, eventMap, loglevel, webCmd

OWSWITCH

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.

Example

define OWX_S OWSWITCH DS2413 B5D502000000 60
attr OWX_S AName Lampe|light
attr OWX_S AUnit AN|AUS

Define

define <name> OWSWITCH [<model>] <id> [<interval>] or
define <name> OWSWITCH <fam>.<id> [<interval>]

Define a 1-Wire switch.

  • [<model>]
    Defines the switch model (and thus 1-Wire family id), currently the following values are permitted:
    • model DS2413 with family id 3A (default if the model parameter is omitted). 2 Channel switch with onboard memory
    • model DS2406 with family id 12. 2 Channel switch
    • model DS2408 with family id 29. 8 Channel switch
  • <fam>
    2-character unique family id, see above
  • <id>
    12-character unique ROM id of the device without family id and CRC code
  • <interval>
    Measurement interval in seconds. The default is 300 seconds.

Set

  • set <name> interval <int>
    Measurement interval in seconds. The default is 300 seconds.
  • 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)
  • set <name> init yes
    Re-initialize the device

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.
  • get <name> interval
    Returns measurement interval in seconds.
  • 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.
  • get <name> gpio
    Obtain state of all channels

Attributes

For each of the following attributes, the channel identification A,B,... may be used.
  • attr <name> <channel>Name <string>|<string>
    name for the channel | a type description for the measured value.
  • attr <name> <channel>Unit <string>|<string>
    display for on | off condition
  • Standard attributes alias, comment, event-on-update-reading, event-on-change-reading, stateFormat, room, eventMap, loglevel, webCmd

OWServer


    Define
      define <name> OWServer <protocol>

      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.

      Examples:
        define myLocalOWServer OWServer localhost:4304
        define myRemoteOWServer OWServer raspi:4304


      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.

    Set
      set <name> <value>

      where value is one of

    • reopen
      Reopens the connection to the owserver.
    • owserver (OWFS) specific settings:
      • timeout/directory
      • timeout/ftp
      • timeout/ha7
      • timeout/network
      • timeout/presence
      • timeout/serial
      • timeout/server
      • timeout/stable
      • timeout/uncached
      • timeout/usb
      • timeout/volatile
      • timeout/w1
      • units/pressure_scale
      • units/temperature_scale
    • For further informations have look on owserver manual).


    Get
      get <name> <value>

      where value is one of

    • 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.
    • errors
      List a view of error statistics.
    • owserver (OWFS) specific settings:
      • /settings/timeout/directory
      • /settings/timeout/ftp
      • /settings/timeout/ha7
      • /settings/timeout/network
      • /settings/timeout/presence
      • /settings/timeout/serial
      • /settings/timeout/server
      • /settings/timeout/stable
      • /settings/timeout/uncached
      • /settings/timeout/usb
      • /settings/timeout/volatile
      • /settings/timeout/w1
      • /settings/units/pressure_scale
      • /settings/units/temperature_scale
    • For further informations have look on owserver manual).


    Attributes
    • 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
    • loglevel
    • eventMap
    • readingFnAttributes


OWTEMP

    High-Precision 1-Wire Digital Thermometer.

    Note:
    Please define an OWFS device first.

    Define
      define <name> OWTEMP <id> [<interval>] [<alarminterval>]

      Define a 1-wire Digital Thermometer device.

      <id>
        Corresponding to the id of the input device.
        Set <id> to nonefor demo mode.
      <interval>
        Sets the status polling intervall in seconds to the given value. The default is 300 seconds.
      <alarminterval>
        Sets the alarm polling intervall in seconds to the given value. The default is 300 seconds.

      Note:
      Currently supported type: DS18S20.

      Example:
        define KG.hz.TF.01 OWTEMP 14B598010800 300 60

    Set
      set <name> <value>

      where value is one of:
      • templow (read-write)
        The upper limit for the low temperature alarm state.
      • temphigh (read-write)
        The lower limit for the high temperature alarm state.
      • ALARMINT (write-only)
        Sets the alarm polling intervall in seconds to the given value.
      • INTERVAL (write-only)
        Sets the status polling intervall in seconds to the given value.

    Get
      get <name> <value>

      where value is one of:
      • address (read-only)
      • crc8 (read-only)
      • family (read-only)
      • id (read-only)
      • locator (read-only)
      • present (read-only)
      • temperature (read-only)
        Read by the chip at high resolution (~12 bits). Units are selected from the defined OWFS Device. See temp-scale for choices.
      • templow (read-write)
      • temphigh (read-write)
      • type (read-only)

      Examples:
        get KG.hz.TF.01 type
        KG.hz.TF.01 type => DS18S20

        get KG.hz.TF.01 temperature
        KG.hz.TF.01 temperature => 38.2500 (Celsius)

    Attributes
    • do_not_notify
    • loglevel
    • showtime
    • IODev

OWTHERM

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.

Example

define OWX_T OWTHERM DS18B20 E8D09B030000 300
attr OWX_T tempUnit Kelvin


Define

define <name> OWTHERM [<model>] <id> [<interval>] or
define <name> OWTHERM <fam>.lt;id> [<interval>]

Define a 1-Wire digital thermometer device.

  • [<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 intervall 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.
  • get <name> interval
    Returns temperature measurement interval in seconds.
  • get <name> temperature
    Obtain the temperature.
  • get <name> alarm
    Obtain the alarm temperature values.

Attributes

  • attr <name> stateAL <string>
    character string for denoting low alarm condition, default is down triangle, e.g. the code &#x25BE; leading to the sign ▾
  • attr <name> stateAH <string>
    character string for denoting high alarm condition, default is upward triangle, e.g. the code &#x25B4; 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> tempOffset <float>
    temperature offset in °C added to the raw temperature reading.
  • attr <name> tempUnit Celsius|Kelvin|Fahrenheit|C|K|F
    unit of measurement (temperature scale), default is Celsius = °C
  • attr <name> tempHigh <float>
    high alarm temperature (on the temperature scale chosen by the attribute value).
  • attr <name> tempLow <float>
    low alarm temperature (on the temperature scale chosen by the attribute value).
  • Standard attributes alias, comment, event-on-update-reading, event-on-change-reading, stateFormat, room, eventMap, loglevel, webCmd

OWX

FHEM module to commmunicate with 1-Wire bus devices

  • via an active DS2480/DS2482/DS2490/DS9097U bus master interface attached to an USB port or
  • via a passive DS9097 interface attached to an USB port or
  • via a network-attached CUNO or through a COC on the RaspBerry Pi
  • via an Arduino running OneWireFirmata attached to USB
Internally these interfaces are vastly different, read the corresponding Wiki pages

Example


define OWio1 OWX /dev/ttyUSB1
define OWio2 OWX COC
define OWio3 OWX 10


Define

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.

Set

  • set <name> interval <value>

    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.

  • set <name> followAlarms on|off

    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> buspower real|parasitic
    tells FHEM whether power is supplied to the 1-Wire bus or not.
  • attr <name> IODev
    assignes a specific FRM-device to OWX. Required only if there is more than one FRM defined.
  • Standard attributes alias, comment, event-on-update-reading, event-on-change-reading, room, eventMap, loglevel, webCmd

PID

    The PID device is a loop controller, used to set the value e.g of a heating valve dependent of the current and desired temperature.

    Define
      define <name> PID sensor[:reading:regexp] actor[:cmd:min:max] [p i d]

      sensor[:reading:regexp] specifies the sensor, which is an already defined fhem device, e.g. a S300TH temperature sensor. The reading and regexp fields are necessary only for unknown devices (currently CUL_WS and HMS devices are "known"). Reading specifies the READINGS field of the sensor, and the regexp extracts the number from this field. E.g. for the complete definition for a CUL_WS device is: s300th_dev:temperature:([\d\.]*)

      actor[:cmd:min:max] specifies the actor, which is an already defined fhem device, e.g. an FHT8V valve. The cmd, min and max fields are necessary only for unknown devices (currently FHT8V is "known"). cmd specifies the command name for the actor, min the minimum value and max the maximum value. The complete definition for an FHT8V device is:fht8v_dev:valve:0:100

      p, i and d are the parameters use to controlling, see also the this wikipedia entry. The default values are around 25.5, 3 and 5.88, you probably need to tune these values. They can be also changed later.

      Examples:
        define wz_pid PID wz_th wz_fht8v

    Set
    • set <name> factors p i d
      Set the p, i and d factors, as described above.
    • set <name> desired <value>
      Set the desired value (e.g. temperature). Note: until this value is not set, no command is issued.

    Get
      N/A

    Attributes
    • disable
    • loglevel

POKEYS

    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


    Define

      Mode: lan-ping

      define <name> PRESENCE lan-ping <ip-address> [ <check-interval> [ <present-check-interval> ] ]

      Checks for a network device via PING requests and reports its presence state.

      Example

      define iPhone PRESENCE lan-ping 192.168.179.21

      Mode: fritzbox

      define <name> PRESENCE fritzbox <device-name> [ <check-interval> [ <present-check-interval> ] ]

      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

      This check is only applicaple when FHEM is running on a FritzBox!

      Example

      define iPhone PRESENCE fritzbox iPhone-4S

      Mode: local-bluetooth

      define <name> PRESENCE local-bluetooth <bluetooth-address> [ <check-interval> [ <present-check-interval> ] ]

      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.

      Example

      define iPhone PRESENCE local-bluetooth 0a:8d:4f:51:3c:8f

      Mode: function

      define <name> PRESENCE function {...} [ <check-interval> [ <present-check-interval> ] ]

      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")}

      Mode: shellscript

      define <name> PRESENCE shellscript "<path> [<arg1>] [<argN>]..." [ <check-interval> [ <present-check-interval> ] ]

      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

      Example

      define iPhone PRESENCE shellscript "/opt/check_device.sh iPhone"

      Mode: lan-bluetooth

      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.

      define <name> PRESENCE lan-bluetooth <ip-address>[:port] <bluetooth-address> [ <check-interval> ]

      The default port is 5111 (presenced). Alternatly you can use port 5222 (collectord)

      Example

      define iPhone PRESENCE lan-bluetooth 127.0.0.1:5222 0a:4f:36:d8:f9:89

      presenced

        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 presenced is available as:

        • direct perl script file: presenced
        • .deb package for Debian (noarch): presenced-1.0.deb
        • .deb package for Raspberry Pi (raspbian): presenced-rpi-1.0.deb


      collectord

        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.

        The collectord is available as:

        • direct perl script file: collectord
        • .deb package for Debian (noarch): collectord-1.1.deb



    Set
    • statusRequest - (Only for mode local-bluetooth, lan-ping, function and fritzbox) - Schedules an immediatly check.

    Get
      N/A

    Attributes

    • loglevel
    • do_not_notify
    • readingFnAttributes

    • disable
    • If this attribute is activated, an active check will be disabled.

      Possible values: 0 => not disabled , 1 => disabled
      Default Value is 0 (not disabled)

    • ping_count
    • (Only in Mode "ping" on non-Windows machines 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.

      Default Value is 4 (packets)

    • fritzbox_repeater
    • (Only in Mode "fritzbox" applicable)
      If your FritzBox is part of a network using repeaters, than this attribute needs to be enabled to ensure a correct recognition for devices, which are connected via repeater.

      This attribute is also needed, if your network device has no speed information on the FritzBox website (Home Network).

      BE AWARE: The recognition of device going absent in a repeated network can take about 15 - 20 minutes!!

      Possible values: 0 => Use default recognition, 1 => Use repeater-supported recognition
      Default Value is 0 (Use default recognition)


    Generated Events:

      General Events:

      • state: $state (absent|present|disabled) - The state of the device or "disabled" when the disable attribute is enabled


      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)

PachLog

    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:
        ID0temperature
        ID1humidity
        ID2wind
        ID3rain

      3. Add the KS300 to your PachLog-Device

      set <NAME> ADD <My-KS300> 1234:0temperature:1:humidity:2:wind:3:rain

      Delete a Device form Logging to www.pachube.com

      set <NAME> DEL <FHEM-DEVICENAME>


    Get
      N/A

    Attributes
    • do_not_notify

    • loglevel

    • disable
      Disables PachLog. Nor more Logging to www.pachube.com

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.
    • 42_RFXMETER.pm (see device RFXMETER): Process RFXCOM RFXMeter devices. See http://www.rfxcom.com/sensors.htm.
    • 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.

      Example:
      define RFXCOMTCP RFXCOM 192.168.1.5:10001
      define RFXCOMTCP2 RFXCOM 192.168.1.121:10001 noinit

    • dummy

    • 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.

    Define
      define <name> RFXMETER <deviceid> [<scalefactor>] [<unitname>]

      <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.

      Example:
      define RFXWater RFXMETER 00 0.5 ltr
      define RFXPower RFXMETER 01 0.001 kwh
      define RFXGas RFXMETER 02 0.01 cu_m

    Set
      N/A

    Get
      N/A

    Attributes
    • ignore

    • do_not_notify

RFXX10REC

    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.

    Define
      define <name> RFXX10REC <type> <deviceid> <devicelog> [<deviceid> <devicelog>]

      <type>
        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>.

      Example:
      define livingroom_window RFXX10REC ds10a 72cd Window
      define motion_sensor1 RFXX10REC ms10a 55c6 motion
      define smoke_sensor1 RFXX10REC sd90 54d3 Smoke 54d3 Smoketest
      define motion_sensor2 RFXX10REC ms14a A1 motion A2 light

    Set
      N/A

    Get
      N/A

    Attributes
    • ignore

    • do_not_notify

RSS

    Provides a freely configurable RSS feed.

    Currently a media RSS feed delivering status pictures in JPEG format is supported. This media RSS feed can be used to feed a status display to a network-enabled photo frame.

    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.

    Define
      define <name> RSS jpg <hostname> <filename>

      Defines the RSS feed. jpg is a fixed literal to allow for future extensions. <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.

      Examples:

        define FrameRSS RSS jpg host.example.org /etc/fhem/layout
        define MyRSS RSS jpg 192.168.1.222 /var/fhem/conf/layout.txt

    Set
      set <name> rereadcfg

      Rereads the layout definition from the file. Useful to enable changes in the layout on-the-fly.

    Attributes

    • size
      The dimensions of the JPEG picture in the format <width>x<height>.

    • bg
      The directory that contains the background pictures (must be in JPEG format).

    • tmin
      The background picture is shown at least tmin seconds, no matter how frequently the RSS feed consumer accesses the page.



    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.

      Example:

        http://host.example.org:8083/fhem/rss/FrameRSS.rss

      The media RSS feed points to a dynamically generated JPEG picture. The URL of the JPEG picture belonging to the RSS feed is http://hostname:port/fhem/rss/name.jpg, i.e. the URL of the RSS feed with the extension rss changed to jpg.

      Example:

        http://host.example.org:8083/fhem/rss/FrameRSS.jpg

      To render the JPEG 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 JPEG 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!

      This is how the fhem config part might look like:

      define ui FHEMWEB 8083 global

      define FrameRSS RSS jpg host.example.org /etc/fhem/layout
      attr FrameRSS size 800x600
      attr FrameRSS bg /usr/share/pictures
      attr FrameRSS tmin 10

    Layout definition

      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.

      Layout control commands

      • 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. <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).

      • pt <pt>
        Sets the font size in points.

      Item placement commands
      • text <x> <y> <text>
        Renders the text <text> at the position (<x>, <y>) using the current font, font size and color. (0,0) is the upper left corner. Coordinates equal or greater than 1 are considered to be pixels, coordinates between 0 and 1 are considered to be relative to the total width or height of the picture. You can use { <perl special> } for <text> to fully access device readings and do some programming on the fly. See below for examples.

      • time <x> <y>
        Renders the current time in HH:MM format.

      • seconds <x> <y> <format>
        Renders the curent seconds. Maybe usefull for a RSS Clock. With option colon a :

      • date <x> <y>
        Renders the current date in DD:MM:YYY format.

      • img <x> <y> <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 <srctype> is file, the picture is loaded from the filename <arg>, if <srctype> is url, the picture is loaded from the URL <arg>. You can use { <perl special> } for <arg>. See below for example. Notice: do not load the image from URL that is served by fhem as it leads to a deadlock.

      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" }
      img 20 530 0.5 png file { "/usr/share/fhem/www/images/weather/" . ReadingsVal("MyWeather","icon","") . ".png" }

SCIVT


    Define
      define <name> SCIVT <SCD-device>

      Define a SCD series solar controler device. Details see here. You probably need a Serial to USB controller like the PL2303.
      Defining an SCIVT device will schedule an internal task, which reads the status of the device every 5 minutes, and triggers notify/filelog commands.
      Note: Currently this device does not support a "set" function, only a single get function which reads the device status immediately.

      Example:
        define scd SCIVT /dev/ttyUSB2

    Set
      N/A

    Get
      get SCVIT data

    Attributes
    • loglevel
    • model (SCD)

SISPM


    Define
      define <name> SISPM </path/to/sispmctl>

      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 ;-)
      --- src/main.c-old      2010-01-19 16:56:15.000000000 +0100
      +++ src/main.c  2010-01-19 16:54:56.000000000 +0100
      @@ -441,7 +441,7 @@
                  }
                  break;
              case 'd': // replace previous (first is default) device by selected one
      -           if(udev!=NULL) usb_close (udev);
      +           if(udev!=NULL) { usb_close (udev); udev=NULL; }
                  devnum = atoi(optarg);
                  if(devnum>=count) devnum=count-1;
                  break;
      

      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.

      Attributes:
      • model: SISPM (ignored for now)

      Example:
        define PMS_Terrarium SISPM /usr/bin/sispmctl

    Set
      N/A

    Get
      N/A

    Attributes
    • model (SISPM)

SIS_PMS

    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)

      Examples:
        define lamp SIS_PMS 01:02:03:04:05 1
        define otherlamp SIS_PMS 01:02:03:04:05 3
        define tv SIS_PMS 01:01:38:44:55 1

    Set
      set <name> <value> [<time>]

      where value is one of:
          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.

    Get
      N/A

    Attributes
    • do_not_notify

    • 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.

    • loglevel

SML

    This module supports "Intelligenter Strom Zhler"(ENBW) and "Sparzhler" (Yellow Strom).
    The electricity meter will be polled in a defined interval for new values.

    Define
    define <name> SML <host> <port> [<interval> <timeout>]

    Example:
    define StromZ1 SML 192.168.178.20
    define StromZ2 SML 192.168.10.25 300 60

    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

STV

    This module supports Samsung TV devices with few commands. It's developed and tested with Samsung LE39B650.

    Define
    define <name> STV <host>]

    Example:
    define Television1 STV 192.168.178.20

    Set
    set <name> <value> <nummber>
    where value is one of:

    • mute
    • volume
    • call
    • sms
    • date

    Example:
    set <name> mute
    set <name> volume 20
    set <name> call Peter 012345678 Phone 87654321

    Get
      N/A

SUNRISE_EL

    This module is used to define the functions
    sunrise, sunset,
    sunrise_rel, sunset_rel
    sunrise_abs, sunset_abs
    isday
    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).
    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.

    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.

    Example:
          # When sun is 6 degrees below horizon - same as sunrise();
          sunrise("CIVIL");
      
          # When sun is 3 degrees below (-3 above) 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
        
    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.

    • Note: these are global attributes, e.g.
        attr global latitude 50.112
        attr global longitude 8.686

SYSSTAT

    Provides system statistics for the host FHEM runs on or a remote Linux system that is reachable by preconfigured passwordless ssh access.

    Notes:
    • currently only Linux is supported.
    • 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 plot the load values the following code can be used:
        define sysstatlog FileLog /usr/local/FHEM/var/log/sysstat-%Y-%m.log sysstat
        attr sysstatlog nrarchive 1
        define wl_sysstat weblink fileplot sysstatlog:sysstat:CURRENT
        attr wl_sysstat label "Load Min: $data{min1}, Max: $data{max1}, Aktuell: $data{currval1}"
        attr wl_sysstat room System
        
    • 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
    • .
    Define
      define <name> SYSSTAT [<interval> [<interval_fs>] [<host>]]

      Defines a SYSSTAT device.

      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:
        define sysstat SYSSTAT
        define sysstat SYSSTAT 300
        define sysstat SYSSTAT 60 600

    Readings
    • load
      the 1 minute load average
    • state
      the 1, 5 and 15 minute load averages
    • <mountpoint>
      free bytes for <mountpoint>

    Get
      get <name> <value>

      where value is one of

    • filesystems
      Lists the filesystems that can be monitored.

    Attributes
    • filesystems
      List of comma separated filesystems (not mountpoints) that should be monitored.
      Examples:
        attr sysstat filesystems /dev/md0,/dev/md2
        attr sysstat filesystems /dev/.*
    • showpercent
      If set the usage is shown in percent. If not set the remaining free space in bytes is shown.
    • 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.
    • useregex
      If set the entries of the filesystems list are treated as regex.
    • ssh_user
      The username for ssh remote access.

TCM

    The TCM module serves an USB or TCP/IP connected TCM120 or TCM310 EnOcean Transceiver module. These are mostly packaged together with a serial to USB chip and an antenna, e.g. the BSC BOR contains the TCM120, the EUL from busware contains a TCM310. See also the datasheet available from www.enocean.com.
    As the TCM120 and the TCM310 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, you can find in the parameters BaseID and LastID.

    Define
      define <name> TCM [120|310] <device>

      First you have to specify the type of the EnOcean Transceiver Chip , i.e either 120 for the TCM120 or 310 for the TCM310.

      device can take the same parameters (@baudrate, @directio, TCP/IP, none) like the CUL, but you probably have to specify the baudrate: the TCM120 should be opened with 9600 Baud, the TCM310 with 57600 baud. Example:
        define BscBor TCM 120 /dev/ttyACM0@9600
        define TCM310 TCM 310 /dev/ttyACM0@57600

    Set
    • baseID
      Set the BaseID.
      Note: The firmware executes this command only up to then times to prevent misuse.
    • idbase
      Set the BaseID.
      Note: The firmware executes this command only up to then times to prevent misuse.
    • modem_off
    • modem_on
    • reset
    • sensitivity
    • sleep
    • wake

    • For details see the datasheet available from www.enocean.com. If you do not understand it, than you probably don't need it :)

    Get
    • baseID
      Get the BaseID. You need this command in order to control EnOcean devices, see the EnOcean paragraph.
    • idbase
      Get the BaseID. You need this command in order to control EnOcean devices, see the EnOcean paragraph.
    • modem_status
    • sensitivity
    • sw_ver

    • For details see the datasheet available from www.enocean.com

    Attributes
    • blockSenderID <own|no>, [blockSenderID] = no is default.
      Block receiving telegrams with a TCM SenderID sent by repeaters.
    • dummy
    • do_not_notify
    • loglevel

THRESHOLD

    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. So can be easily implemented a software thermostat, hygrostat and much more.

    It is controlled by setting a desired value with:

    set <name> desired <value>

    The switching behavior can also be influenced by another sensor or sensor group.

Define

    define <name> THRESHOLD <sensor>[:[<reading>][:[<hysteresis>][:<init_desired_value>]]] [AND|OR <sensor2>[:[<reading2>][:<state>]]] [<actor>][|[<cmd1>][|[<cmd2>][|[<cmd_default_index>][|[[<state_cmd1>][:<state_cmd2>]]]]]]


  • sensor
    a defined sensor in FHEM
  • reading
    reading of the sensor, which includes a value in decimal
    default value: temperature
  • hysteresis
    Hysteresis, this provides the threshold_min = desired_value - hysteresis
    default value: 1 at temperature, 10 at huminity
  • init_desired_value
    Initial value, if no value is specified, it must be set with "set desired value".
    Defaultwert: no value


  • AND|OR
    logical operator with an optional second sensor
  • sensor2
    the second sensor
  • reading2
    reading of the second sensor
    default value: state
  • state
    state of the second sensor
    default value: open

  • actor
    actor device defined in FHEM
  • cmd1
    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
    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
    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
    2 - cmd2
    default value: 2, if actor defined, else 0

  • state_cmd1
    state, which is displayed, if FHEM/Perl-command cmd1 was executed. If state_cmd1 state ist set, other states, such as active or deactivated are suppressed.
    default value: none
  • state_cmd2
    state, which is displayed, if FHEM/Perl-command cmd1 was executed. If state_cmd1 state ist set, other states, such as active or deactivated are suppressed.
    default value: none


  • Examples:

    Example for heating:

    define thermostat THRESHOLD temp_sens heating

    set thermostat desired 20

    Description:

    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.

    Example for heating with window contact:

    define thermostat THRESHOLD temp_sens OR win_sens heating

    Example for heating with multiple window contacts:

    define W_ALL structure W1 W2 W3 ...
    attr W_ALL clientstate_behavior relative
    attr W_ALL clientstate_priority closed open

    then:

    define thermostat THRESHOLD S1 OR W_ALL heating

    More examples for dehumidification, air conditioning, watering:

    define hygrostat THRESHOLD hym_sens:humidity dehydrator|set @ on|set @ off|1
    define hygrostat THRESHOLD hym_sens:humidity AND Sensor2:state:close dehydrator|set @ on|set @ off|1
    define thermostat THRESHOLD temp_sens:temperature:1 aircon|set @ on|set @ off|1
    define thermostat THRESHOLD temp_sens AND Sensor2:state:close aircon|set @ on|set @ off|1
    define hygrostat THRESHOLD hym_sens:humidity:20 watering|set @ off|set @ on|2

    It can also FHEM/perl command chains are specified:

    Examples:

    define thermostat THRESHOLD sensor |set Switch1 on;set Switch2 on|set Switch1 off;set Switch2 off|1
    define thermostat THRESHOLD sensor alarm|{Log 2,"value is exceeded"}|set @ on;set Switch2 on
    define thermostat THRESHOLD sensor ||{Log 2,"value is reached"}|

    Example for status display on/off:

    define thermostat THRESHOLD sensor heating|set @ off|set @ on|2|off:on

    Example for status display (eg for state evaluation in other modules), if temperature drops below 30 degrees or above:

    define thermostat THRESHOLD sensor:temperature:0:30 ||||on:off

Set
  • set <name> desired <value>
    Set the desired value. If no desired value is set, the module is not active.

  • set <name> deactivated <value>
    Module is disabled.

  • set <name> active <value>
    Module is activated again.

  • set <name> hysteresis <value>
    Set hysteresis value.

Get
    N/A

Attributes
  • disable
  • loglevel

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.

      Example:
      define RFXTRXTCP TRX 192.168.1.5:10001
      define RFXTRXTCP2 TRX 192.168.1.121:10001 noinit

    Attributes
    • dummy

    • 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


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.

    Define
      define <name> TRX_LIGHT <type> <deviceid> <devicelog> [<deviceid2> <devicelog2>]
      define <name> TRX_LIGHT PT2262 <deviceid> <devicelog> <commandcodes>

      <type>
        specifies the type of the device:
        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 [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].)
        • AB400D (ELRO AB400D devices. Report [off|on].)
        • WAVEMAN (Waveman devices. Report [off|on].)
        • EMW200 (Chacon EMW200 devices. Report [off|on|all_off|all_on].)
        • IMPULS (IMPULS devices. Report [off|on].)
        • RISINGSUN (RisingSun devices. Report [off|on].)
        • PHILIPS_SBC (Philips SBC devices. Send [off|on|all_off|all_on].)
        • 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].)
        • ANSLUT (Anslut 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 )

      <deviceid>
        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

      <devicelog>
        is the name of the Reading used to report. Suggested: "motion" for motion sensors.

      <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>.

      <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'.

      Example:
      define motion_sensor2 TRX_LIGHT MS14A A1 motion A2 light
      define Steckdose TRX_LIGHT ARC G2 light
      define light TRX_LIGHT AC 0101010101 light

    Set
      set <name> <value> [<levelnum>]

      where value is one of:
          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).

    Get
      N/A

    Attributes
    • ignore
    • do_not_notify
    • readingFnAttributes

TRX_SECURITY

    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.

    Define
      define <name> TRX_SECURITY <type> <deviceid> <devicelog> [<deviceid2> <devicelog2>]

      <type>
        specifies one of the following 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] )
        • 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.

      <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>.

      Example:
      define livingroom_window TRX_SECURITY ds10a 72cd Window
      define motion_sensor1 TRX_SECURITY ms10a 55c6 motion
      define smoke_sensor1 TRX_SECURITY sd90 54d3 Smoke 54d3 Smoketest

    Set
      set <name> <value>

      where value is one of:
          alert              # only for KD101
          pair               # only for KD101
          
      Example:
      set TRX_KD101_a5ca00 alert

    Get
      N/A

    Attributes
    • ignore
    • do_not_notify
    • readingFnAttributes

TRX_WEATHER

    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)

      Example:
        define Tempsensor TRX_WEATHER TX3_T
        define Tempsensor3 TRX_WEATHER THR128_3
        define Windsensor TRX_WEATHER WGR918_A
        define Regensensor TRX_WEATHER RGR918


      define <name> TRX_WEATHER <deviceid> [<scale_current> <scale_total> <add_total>]

      <deviceid>
        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),

      The following Readings are generated:
        "energy_current:":
          current usage in Watt. If <scale_current> is defined the result is: energy_current * <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>.

      Example:
        define Tempsensor TRX_WEATHER CM160_1401
        define Tempsensor TRX_WEATHER CM180_1401 1 1 0
        define Tempsensor TRX_WEATHER CM180_1401 0.9 0.9 -1000

    Set
      N/A

    Get
      N/A

    Attributes
    • ignore
    • do_not_notify
    • readingFnAttributes

TUL

    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.

    Set
    • raw
      Issue a TUL raw telegram message

    Get
    • raw
      sends a read telegram

    Attributes
    • do_not_notify

    • dummy

    • showtime

    • loglevel


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.)

      Example:
        define TStick TellStick /usr/bin/tdtool
        define Deckenfluter SIS_PMS te:ll:st:ck:01 2

    Set
      N/A

    Get
      N/A

    Attributes
    • none

Twilight


    Define
      define <name> Twilight <latitude> <longitude> [<indoor_horizon> [<Weather_Position>]]

      Defines a virtual device for Twilight calculations

      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:

      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

      The parameters latitude and longitude are decimal numbers which give the position on earth for which the twilight states shall be calculated.
      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)
      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
      Example:
            define myTwilight Twilight 49.962529  10.324845 3 676757
          

    Set
      N/A

    Get
      get <name> <reading>

      lightthe current virtual daylight value
      nextEventthe name of the next event
      nextEventTimethe time when the next event will probably happen (durint light phase 5 and 6 this is updated when weather conditions change
      sr_astrotime of astronomical sunrise
      sr_nauttime of nautical sunrise
      sr_civiltime of civil sunrise
      srtime of sunrise
      sr_indoortime of indoor sunrise
      sr_weathertime of weather sunrise
      ss_weathertime of weather sunset
      ss_indoortime of indoor sunset
      sstime of sunset
      ss_civiltime of civil sunset
      ss_nautictime of nautic sunset
      ss_astrotime of astro sunset

    Attributes
    • readingFnAttributes

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.

      Example:
          define USBWDE1 USBWX /dev/ttyUSB0
          define USBWX_1 USBWX 1
          define USBWX_livingroom USBWX 2
          define USBWX_ks300 USBWX 9
          
    Set
      N/A

    Get
      N/A

    Attributes
    • model
    • loglevel

USF1000

    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.

    Set
      N/A

    Get
      N/A

    Attributes
    • IODev

    • do_not_notify
    • showtime
    • loglevel
    • model (usf1000s)
    • ignore
    • readingFnAttributes

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

    Set
      set <name> <command> [<value>]

      Currently, the following commands are defined.
        off
        mute [on|off]
        volume <value>
        remoteControl <command>

      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

    Attributes
      N/A

    Generated events:
    • on
    • off
    • volume
    • mute

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.

      Examples:
        define AUSSEN.wetterstation VantagePro2 192.168.8.127 4999 60
        fhem> list AUSSEN.wetterstation
        Internals:
        DEF 192.168.8.127 4999 60
        Host 192.168.8.127
        NAME AUSSEN.wetterstation
        NR 5
        Port 4999
        STATE T-OUT: 22.78 T-IN: 26.50 H-OUT: 55 H-IN: 45 W: 1.61 W-AV: 1.61 WS 257 R: 0.00 S: 770 UV: 4.1 RD: 0 RM: 41 RY: 241 BM: 76.27 BT: Steady
        TYPE VantagePro2
        Readings:
        2010-08-04 10:15:17 10 min. average windspeed 1.61 (km/h)
        2010-08-04 10:15:17 UV 4.1 (UV/Index)
        2010-08-04 10:15:17 barometer 76.27 (Millimeters)
        2010-08-04 10:15:17 barometer trend Steady
        2010-08-04 10:15:17 day rain 0 (mm/day)
        2010-08-04 10:15:17 humidity inside 45 (%)
        2010-08-04 10:15:17 humidity outside 55 (%)
        2010-08-04 10:15:17 month rain 41 (mm/month)
        2010-08-04 10:15:17 rainrate 0.00 (mm/h)
        2010-08-04 10:15:17 solar 770 (Watt/m^2)
        2010-08-04 10:15:17 temperature-inside 26.50 (Celsius)
        2010-08-04 10:15:17 temperature-outside 22.78 (Celsius)
        2010-08-04 10:15:17 wind direction 257 (Degrees)
        2010-08-04 10:15:17 windspeed 1.61 (km/h)
        2010-08-04 10:15:17 year rain 241 (mm/year)
        Attributes:
        delay 60

WEBCOUNT

    Note: this module needs the HTTP::Request and LWP::UserAgent perl modules.

    Define
      define <name> WEBCOUNT <ip-address> <port> <delay>

      Defines an WEBCOUNT device (Box with 6 count pulses, www.wut.de) via ip address. The device is pooled (delay interval).

      Examples:
        define pump WEBCOUNT 192.168.8.200 1 60

WEBIO

    Note: this module needs the HTTP::Request and LWP::UserAgent perl modules.

    Define
      define <name> WEBIO <ip-address> <port> <delay>

      Defines an Web-IO device (Box with 2 Analog-In/Out 0..10V, www.wut.de) via ip address. The status of the device is also pooled (delay interval).

      Examples:
        define pumpspeed WEBIO 192.168.8.200 1 60

    Set
      set <name> <value>

      where value is one of:
          0.00 - 10.00
          
      Examples:
        set pumpspeed 6.75

WEBIO_12DIGITAL

    Note: this module needs the HTTP::Request and LWP::UserAgent perl modules.

    Define
      define <name> WEBIO_12DIGITAL <ip-address> <outputport> <delay>

      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

WOL

    Define

      define <name> WOL <MAC> <IP> <unitcode>

      Defines a WOL device via its MAC and IP address.

      Example:
        define computer1 WOL 72:11:AC:4D:37:13 192.168.0.24
      Notes:
      • Module uses ether-wake on FritzBoxes.
      • For other computers the WOL implementation of Net::Wake is used

    Set

      set <name> <value>

      where value is one of:
          refresh           # checks whether the computer is currently running
          on                # sends a magic packet to the defined MAC address
          
      Examples:
        set computer1 on
        set computer1 refresh

    Attributes

    • attr <name> shutdownCmd <string>
      Custom command executed to shutdown a remote machine, i.e. sh /path/to/some/shell/script.sh

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

      RAW: original Data from interface

    Attributes
    • model (ws2000)
    • loglevel
    • rain
    • altitude

WS300


    Define
      define WS300Device WS300 <serial device>
      or
      define <devname> WS300 [0-9]

      The first line is mandatory if you have a WS300 device: it defines the input device with its USB port. The name of this device is fixed and must be WS300Device. It must be the first defined WS300 device.
      For each additional device (with number 0 to 9) you have to define another WS300 device, with an arbitrary name. The WS300 device which reports the readings will be defined with the port number 9, an optional KS300 with the port number 8.

      Examples:
            define WS300Device  WS300   /dev/ttyUSB1
            define ash2200.1    WS300   0
            define ks300        WS300   8
            define ws300        WS300   9
          

    Set
      set WS300Device <interval(min.)> <height(m)> <rainvalume(ml)>

      Set some WS300 configuration parameters.
    Get
      N/A

    Attributes
    • do_not_notify
    • loglevel
    • model (ws300)
    • readingFnAttributes

WS3600


    Define
      define <name> WS3600 </path/to/fetch3600>

      Define a WS3600 series weather station (Europe Supplies, technotrade, etc; refer to Wetterstationen.info (german) for details on this model); the station is queried by means of an external program, fetch3600. It talks to the attached weather station (several WS do supply an RS323 interface but seem to use some kind of "morse code" on the RTS, CTS wires instead of using propper serial communication (RX, TX); it's no use to recode that crap into FHEM when there is a stable package of tools to talk to the station available: open3600) and delivers the current readings line by line as reading-value-pairs. These are read in and translated into more readable names for FHEM by the module WS3600.pm.

      As the WS3600 is rather similar to the WS2300 and open3600 basically is a modified offspring of open2300, by exchanging the /path/to/fetch3600 with /path/to/fetch2300 this module should be able to handle the WS2300 was well.

      Currently, it is expected that the WS is attached to the local computer and fetch3600 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:
      Date 14-Nov-2009
      Time 10:50:22
      Ti 22.8
      Timin 20.8
      Timax 27.9
      TTimin 10:27
      DTimin 15-10-2009
      TTimax 23:31
      DTimax 20-08-2009
      To 14.2
      Tomin -0.4
      Tomax 35.6
      TTomin 07:03
      DTomin 15-10-2009
      TTomax 16:52
      DTomax 20-08-2009
      DP 9.2
      DPmin -2.2
      DPmax 20.3
      TDPmin 07:03
      DDPmin 15-10-2009
      TDPmax 11:58
      DDPmax 20-08-2009
      RHi 48
      RHimin 32
      RHimax 57
      TRHimin 17:03
      DRHimin 21-10-2009
      TRHimax 22:24
      DRHimax 07-10-2009
      RHo 72
      RHomin 27
      RHomax 96
      TRHomin 16:41
      DRHomin 20-08-2009
      TRHomax 06:28
      DRHomax 02-11-2009
      WS 0.0
      DIRtext WSW
      DIR0 247.5
      DIR1 247.5
      DIR2 247.5
      DIR3 247.5
      DIR4 247.5
      DIR5 247.5
      WC 14.2
      WCmin -0.4
      WCmax 35.6
      TWCmin 07:03
      DWCmin 15-10-2009
      TWCmax 16:52
      DWCmax 20-08-2009
      WSmin 0.0
      WSmax 25.6
      TWSmin 10:44
      DWSmin 14-11-2009
      TWSmax 19:08
      DWSmax 24-09-2009
      R1h 0.00
      R1hmax 24.34
      TR1hmax 22:34
      DR1hmax 07-10-2009
      R24h 0.00
      R24hmax 55.42
      TR24hmax 07:11
      DR24hmax 08-10-2009
      R1w 29.00
      R1wmax 95.83
      TR1wmax 00:00
      DR1wmax 12-10-2009
      R1m 117.58
      R1mmax 117.58
      TR1mmax 00:00
      DR1mmax 01-11-2009
      Rtot 3028.70
      TRtot 03:29
      DRtot 18-09-2005
      RP 992.200
      AP 995.900
      RPmin 970.300
      RPmax 1020.000
      TRPmin 05:25
      DRPmin 04-11-2009
      TRPmax 09:19
      DRPmax 11-09-2009
      Tendency Falling
      Forecast Cloudy
      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.

      fetch3600 is available as binary for the Windows OS as well, but I haven't tested operation under that OS, use it at your own risk and you mileage may vary ...
      Note: Currently this device does not support a "set" function nor anything to "get". The later would be possible to implement if neccessary, though.

      Implementation of WS3600.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 yet.

      Attributes:
      • model: WS3600 or WS2300 (not used for anything, yet)

      Example:
        define my3600 W36000 /usr/local/bin/fetch360

    Set
      N/A

    Get
      N/A

    Attributes
    • model (WS3600, WS2300)

Weather


    Define
      define <name> Weather <location> [<interval> [<language>]]

      Defines a virtual device for weather forecasts.

      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, 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.

      Examples:
            define MyWeather Weather 673513
            define Forecast Weather 673513 1800
           

    Set
      set <name> update

      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 1, 2 and stands for today, tomorrow):
      cityname of town returned for location
      codecurrent condition code
      conditioncurrent condition
      current_date_timelast update of forecast on server
      fc?_codeforecast condition code
      fc?_conditionforecast condition
      fc?_day_of_weekday of week for day +?
      fc?_high_cforecasted daily high in degrees centigrade
      fc?_iconforecast icon
      fc?_low_cforecasted daily low in degrees centigrade
      humiditycurrent humidity in %
      iconrelative path for current icon
      pressureair pressure in hPa
      pressure_trendair pressure trend (0= steady, 1= rising, 2= falling)
      pressure_trend_txttextual representation of air pressure trend
      pressure_trend_symsymbolic representation of air pressure trend
      temperaturecurrent temperature in degrees centigrade
      temp_ccurrent temperature in degrees centigrade
      temp_fcurrent temperature in degrees Fahrenheit
      visibilityvisibility in km
      windwind speed in km/h
      wind_chillwind chill in degrees centigrade
      wind_conditionwind direction and speed
      wind_directiondirection wind comes from in degrees (0 = north wind)
      wind_speedsame as wind

    Attributes
    • readingFnAttributes

X10

    Define
      define <name> X10 <model> <housecode> <unitcode>

      Defines an X10 device via its model, housecode and unitcode.

      Notes:
      • <model> is one of
        • lm12: lamp module, dimmable
        • lm15: lamp module, not dimmable
        • am12: appliance module, not dimmable
        • tm12: tranceiver module, not dimmable. Its unitcode is 1.
        Model determines whether a dim command is reasonable to be sent or not.
      • <housecode> ranges from A to P.
      • <unitcode> ranges from 1 to 16.

      Examples:
        define lamp1 X10 lm12 N 10
        define pump X10 am12 B 7
        define lamp2 X10 lm15 N 11

    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).

    Get
      N/A

    Attributes
    • do_not_notify
    • dummy
    • showtime
    • model (lm12,lm15,am12,tm13)
    • loglevel
    • IODev

    • eventMap


xmllist

    xmllist [devspec]

    Returns an XML tree of device definitions. devspec is optional, and restricts the list of devices if specified.

    Example:
      fhem> xmllist
      <FHZINFO>
        <internal_LIST>
          <internal name="global" state="internal" sets="" attrs="room configfile logfile ...">
            <INT key="DEF" value="<no definition>"/>
            <INT key="NR" value="0"/>
            <INT key="STATE" value="internal"/>
          [...]

YAMAHA_AVR

    Define
      define <name> YAMAHA_AVR <ip-address> [<zone>] [<status_interval>]

      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.

      Example:

        define AV_Receiver YAMAHA_AVR 192.168.0.10

        define AV_Receiver YAMAHA_AVR 192.168.0.10 mainzone 60     # With custom interval of 60 seconds


    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
        off
        input hdmi1
        input hdmi2
        input hdmi3
        input hdmi4
        input av1
        input av2
        input av3
        input av3
        input av4
        input av5
        input av6
        input usb
        input airplay
        input tuner
        input v-aux
        input audio
        input server
        scene scene1
        scene scene2
        scene scene3
        scene scene4
        volume -80..16 # (volume between -80 and +16 dB)
        mute on
        mute off


    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


      Menu Selection:

        remoteControl setup
        remoteControl option
        remoteControl display


      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 99_MyUtils.pm the following function:

        sub startNetRadio()
        {
          fhem "set AV_Receiver on";
          sleep 5;
          fhem "set AV_Receiver input netradio";
          sleep 4;
          fhem "set AV_Receiver remoteControl enter";
          sleep 2;
          fhem "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.

      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> <what>

      Currently, the following commands are defined and return the current state of the receiver.

        power
        input
        mute
        volume_level


    Attributes
    • loglevel
    • do_not_notify
    • readingFnAttributes

    • volume-smooth-change
    • Optional attribute to activate a smooth volume change.

      Possible values: 0 => off , 1 => on

    • volume-smooth-steps
    • Optional attribute to define the number of volume changes between the current and the desired volume. Default value is 5 steps

    • volume-smooth-time
    • Optional attribute to define the time window for the volume smoothing in seconds. For example the value 2 means the smooth process in general should take 2 seconds. The value 0 means "as fast as possible". Default value is 0.

    Implementator's note
      The module is only usable if you activate "Network Standby" on your receiver.

      Technically there are many more commands and readings possible, but I think these are the main usecases within FHEM.

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:
        define zwdongle_1 ZWDongle /dev/cu.PL2303-000014FA@115200

    Set
    • addNode [on|off]
      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.
    • removeNode [on|off]
      Activate (or deactivate) exclusion mode. 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.

    Get
    • nodeList
      return the list of included nodeIds. Can be used to recreate fhem-nodes with the createNode command.
    • homeId
      return the six hex-digit homeId of the controller.
    • caps, ctrlCaps, version
      return different controller specific information. Needed by developers only.
    • nodeInfo
      return node specific information. Needed by developers only.
    • raw
      Send raw data to the controller. Developer only.

    Attributes
    • dummy
    • do_not_notify
    • loglevel
    • model

    Generated events:
    • ZW_ADD_NODE_TO_NETWORK [learnReady|nodeFound|controller|done|failed]
    • ZW_REMOVE_NODE_TO_NETWORK [learnReady|nodeFound|slave|controller|done|failed]
    • UNDEFINED ZWave_${type6}_$id ZWave $homeId $id $classes"

ZWave

    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.

    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.

      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.


    • Class SWITCH_BINARY
    • on
      switch the device on
    • off
      switch the device off
    • reportOn,reportOff
      activate/deactivate the reporting of device state changes to the association group.


    • Class SWITCH_MULTILEVEL
    • on, off, reportOn, reportOff
      the same as for SWITCH_BINARY.
    • dim value
      dim to the requested value (0..100)


    • 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.
    • configDefault cfgAddress
      Reset the configuration parameter for the cfgAddress parameter to its default value. See the device documentation to determine this value.


    • Class WAKE_UP
    • wakeupInterval value
      Set the wakeup interval of battery operated devices to the given value in seconds. Upon wakeup the device sends a wakeup notification.


    • 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.

    Get

      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 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 SENSOR_BINARY
    • sbStatus
      return the status of the node, as state:open or state:closed.


    • Class CONFIGURATION
    • config cfgAddress
      return the value of the configuration parameter cfgAddress. The value is device specific.


    • Class ALARM
    • alarm alarmId
      return the value for alarmId. The value is device specific.


    • Class BATTERY
    • battery
      return the charge of the battery in %, as battery:value %


    • Class WAKE_UP
    • wakeupInterval
      return the wakeup interval in seconds, in the form
      wakeupReport:interval seconds target id


    • Class ASSOCIATION
    • association groupId
      return the list of nodeIds in the association group groupId in the form:
      assocGroup_X:Max Y, Nodes id,id...


    • Class VERSION
    • version
      return the version information of this node in the form:
      Lib A Prot x.y App a.b


    • 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.

    Attributes
    • IODev
    • do_not_notify
    • ignore
    • dummy
    • showtime
    • loglevel
    • model
    • readingFnAttributes
    • 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).

    Generated events:

      Class BASIC
    • basicReport:XY


    • Class SWITCH_BINARY
    • state:on
    • state:off


    • Class SWITCH_MULTILEVEL
    • state:on
    • state:off
    • state:dim value


    • Class SENSOR_BINARY
    • state:open
    • state:closed


    • Class METER
    • power:val [kWh|kVAh|W|pulseCount]
    • gas:val [m3|feet3|pulseCount]
    • water:val [m3|feet3|USgallons|pulseCount]


    • Class CONFIGURATION
    • config_X:Y


    • Class ALARM
    • alarm_type_X:level Y


    • Class BATTERY
    • battery:chargelevel %


    • Class WAKE_UP
    • wakeup:notification
    • wakeupReport:interval:X target:Y


    • Class ASSOCIATION
    • assocGroup_X:Max Y Nodes A,B,...


    • Class VERSION
    • version:Lib A Prot x.y App a.b


    • Class MULTI_CHANNEL
    • endpoints:total X $dynamic $identical
    • mcCapability_X:class1 class2 ...

at

    Start an arbitrary fhem.pl command at a later time.

    Define
      define <name> at <timespec> <command>

      <timespec> format: [+][*{N}]<timedet>
        The optional + indicates that the specification is relative(i.e. it will be added to the current time).
        The optional * indicates that the command should be executed repeatedly.
        The optional {N} after the * indicates,that the command should be repeated N-times only.
        <timedet> is either HH:MM, HH:MM:SS or {perlfunc()}, where perlfunc must return a HH:MM or HH:MM:SS date.

      Examples:
          # absolute ones:
          define a1 at 17:00:00 set lamp on                            # fhem command
          define a2 at 17:00:00 { Log 1, "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
      N/A

    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.

    • 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 atr2 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

        It makes no sense to create more than one instance of this module. 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 weblink 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 weblink 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 weblink to an already defined device.

      Example:
          define autocreate autocreate
          attr autocreate autosave
          attr autocreate device_room %TYPE
          attr autocreate filelog test2/log/%NAME-%Y.log
          attr autocreate weblink
          attr autocreate weblink_room Plots
          
    Set
      N/A

    Get
      N/A

    Attributes
    • 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.

    • 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 a weblink associated with the device/filelog.

    • weblink_room
      "Put" the newly weblink in this room. The name can contain the wildcards %TYPE and %NAME, see the example above.

    • disable

    • 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

    createlog
      Use this command to manually add a FileLog and a weblink to an existing device. E.g. if a HomeMatic device is created automatically by something else then a pairing message, the model is unknown, so no plots will be generated. You can set the model/subtype attribute manually, and then call createlog to add the corresponding logs.

      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). Only one device to flash is displayed at a time.

      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 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>
        and
          <device> <eventname>_avg_month: <computed_average>
          <device> <eventname>_min_month: <minimum month value>
          <device> <eventname>_max_month: <maximum month value>
        at the beginning of the next day or month respectively.
        The current average, minimum, maximum and the cumulated values are stored in the device readings.

      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\.]+).*
          
    Set
      N/A

    Get
      N/A

    Attributes
    • disable
    Generated events:
    • <eventname>_avg_day: $avg_day
    • <eventname>_avg_month: $avg_month
    • <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.

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.

    Define
      define <name> dewpoint dewpoint <devicename-regex> [<temp_name> <hum_name> <new_name>]

        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
      
          
      define <name> dewpoint alarm <devicename-regex> <devicename-reference> <diff-temp>

        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
      
          
    Set
      N/A

    Get
      N/A

    Attributes
    • disable
    • 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
    • loglevel
    • 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
    • readingFnAttributes

eventTypes


    Define
      define <name> eventTypes <filename>

      Collect event types for all devices. This service is used by frontends. 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
      N/A

    Get
    • list [devicename]
      return the list of collected event types for all devices or for devicename if specified.

    Attributes
    • disable
    • loglevel

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.cgi. 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 and branch
    • Defined modules (only official FHEM Modules are counted)
    • Defined models per module

    Example:
          fhem> fheminfo
          Fhem info:
            Release  : 5.3
            Branch   : DEVELOPMENT
            OS       : linux
            Arch     : i686-linux-gnu-thread-multi-64int
            Perl     : v5.14.2
            uniqueID : 87c5cca38dc75a4f388ef87bdcbfbf6f
    
          Defined modules:
            ACU        : 1
            CUL        : 1
            CUL_FHTTK  : 12
            CUL_HM     : 66
            CUL_WS     : 3
            FHEM2FHEM  : 1
            FHEMWEB    : 3
            FHT        : 9
          [...]
            at         : 4
            autocreate : 1
            dummy      : 23
            notify     : 54
            structure  : 3
            telnet     : 2
            watchdog   : 9
            weblink    : 17
          
          Defined models per module:
            CUL        : CUN
            CUL_FHTTK  : FHT80TF
            CUL_HM     : HM-CC-TC,HM-CC-VD,HM-LC-DIM1T-CV,HM-LC-DIM1T-FM,HM-LC-SW1-PL,[...]
            CUL_WS     : S555TH
            FHT        : fht80b
            FS20       : fs20pira,fs20s16,fs20s4a,fs20sd,fs20st
            HMS        : hms100-mg,hms100-tf,hms100-wd
            KS300      : ks300
            OWSWITCH   : DS2413
        

    Attributes

    The following attributes are used only in conjunction with the send parameter. They are set on attr global.

    • uniqueID
      A randomly generated ID (16 pairs of hash values), e.g. 87c5cca38dc75a4f388ef87bdcbfbf6f which is assigned to the transmitted data to prevent duplicate entries.
      The uniqueID is stored automatically in a file named FhemUtils/uniqueID in FHEM's modules path.
      IMPORTANT NOTE:
      Every installation of FHEM should have to have his own unique ID.
      Please do not modify, move or delete this file! You should always backup this file (this is normally done by the update command automatically) and please restore this file to the same path (FhemUtils in FHEM's modules path), if you plan to reinstall your FHEM installation. This prevents duplicate entries for identical installations on the same hardware in the statistics.
      Otherwise, please use different unique IDs for each installation of FHEM on different hardware, e.g. one randomly generated unique ID for FRITZ!Box, another one for the first Raspberry Pi, another one for the second Raspberry Pi, etc.
      Thanks for your support!

    • 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.

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:
      • 1
        Exact date. Arguments: <MM-DD> <holiday-name>
        Exampe: 1 12-24 Christmas
      • 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)) }
      • 3
        Month dependent date. Arguments: <nth> <weekday> <month <holiday-name>.
        Examples:
          3 1 Mon 05 First Monday In May
          3 2 Mon 05 Second Monday In May
          3 -1 Mon 05 Last Monday In May
          3 0 Mon 05 Each Monday In May
      • 4
        Interval. Arguments: <MM-DD> <MM-DD> <holiday-name> .
        Example:
          4 06-01 06-30 Summer holiday
      • 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


      Return the holiday name of the specified date or the text none.


    Attributes
      N/A

notice

    notice [confirm [value]|list [<keyword>]|reset [yes]|view <id> [noheader|[de|en]]]

    View and confirmation of system messages.

    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:
        fhem> notice confirm update-20130128-001 foo:bar
        update-20130128-001 confirmed on 2013-01-29 20:58:57: foo:bar
        
    Sometimes it is necessary to reset all confirmations. This is be done by entering 'notice reset'.
    Example:
        fhem> notice reset
        This command delete all confirmations.
        If you really want to do this, call 'notice reset yes'
        

    For developers only:

    notice [condition <id>|get <keyword> <value>|position <id>]


    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:
        fhem> notice condition update-20130127-001
        configfile:./fhem.cfg|sendStatistics:never:!empty
        
    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:
        define b3lampV1 notify btn3 set lamp $EVENT
        define b3lampV2 notify btn3 { fhem "set lamp $EVENT" }
        define b3lampV3 notify btn3 "/usr/local/bin/setlamp "$EVENT""
        define b3lampV3 notify btn3 set lamp1 $EVENT;;set lamp2 $EVENT
        define wzMessLg notify wz:measured.* "/usr/local/bin/logfht $NAME "$EVENT""
        define LogUndef notify global:UNDEFINED.* "send-me-mail.sh "$EVENT""

      Notes:
      • <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 "inform" command in telnet or "Event Monitor" in FHEMWEB.
      • 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 triggering 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.
      • To use database logging, define a dblog instance and change the $dbconn parameter in the file.
      • Following special events will be generated for the device "global"
        • INITIALIZED after initialization is finished.
        • 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
      N/A

    Get
      N/A

    Attributes
    • disable
    • loglevel
    • 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.

sequence


    Define
      define <name> sequence <re1> <timeout1> <re2> [<timeout2> <re3> ...]

      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

    Set
      N/A

    Get
      N/A

    Attributes
    • disable
    • loglevel

structure


    Define
      define <name> structure <struct_type> <dev1> <dev2> ...

      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.

    Get
      get is not supported through a structure device.

    Attributes
    • 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.
      • 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. Each entry of one group is delimited by "pipe". The status represented by the structure is the first entry of each group. Example:
      • attr kitchen clientstate_behavior relative
      • attr kitchen clientstate_priority An|On|on Aus|Off|off
      • 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.
      To group more devices from different types of devices you can define a clientstate redefining on each device with the attribute <struct_type>_map. For example the reading "A" of device door is "open" or "closed" and the state of device lamp1 should redefine from "on" to "An" and "off" to "Aus". A special case is a device with more than 1 input port (eg. OWSWITCH). The last example shows the attribute only with a value of "A". The propagated value of the device depends only on port A with an unmodified state.
      Example:
      • define door OWSWITCH <ROMID>
      • define lamp1 dummy
      • attr lamp1 cmdlist on off
      • define kitchen structure struct_kitchen lamp1 door
      • attr kitchen clientstate_priority An|on OK|Aus|off
      • attr lamp1 struct_kitchen_map on:An off:Aus
      • 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 kitchen structure room lamp1 lamp2
        attr lamp1 structexclude kitchen
        attr lamp1 structexclude kitchen:stateFormat
    • readingFnAttributes

telnet


    Define
      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:
        define tPort telnet 7072 global
        attr tPort globalpassword mySecret
        attr tPort SSL
      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:
    • loglevel

    • 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:
      attr tPort password secret
      attr tPort password {use FritzBoxUtils;;FB_checkPw("localhost","$password") }
      or if you defined multiple users on the Fritzbox:
      attr tPort password {use FritzBoxUtils;;FB_checkPw("localhost","$user", "$password") }

    • globalpassword
      Just like the attribute password, but a password will only required for non-local connections.

    • 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:
        socat openssl:fhemhost:fhemport,verify=0 readline
        ncat --ssl fhemhost fhemport
        openssl s_client -connect fhemhost:fhemport

    • allowfrom
      Regexp of allowed ip-addresses or hostnames. If set, only connections from these addresses are allowed.

    • connectTimeout
      Wait at maximum this many seconds for the connection to be established. Default is 2.

    • connectInterval
      After closing a connection, or if a connection cannot be estblished, try to connect again after this many seconds. Default is 60.

update

    FHEM update / check for updates:
    update [development|stable] [<file|package>] [force]
    update [development|stable] check
    update housekeeping

    Third party package update / check for a package update:
    update thirdparty <url> <package> [force]
    update thirdparty <url> <package> check

    The installed fhem distribution and its installed extensions (just like the webGUI PGM2) are updated via this command from the online repository. The locally installed files will be checked against the online repository and will be updated in case the files online are in a newer version.

    The update function will process more advanced distribution information as well as control commands for updating, removing or renaming existing files. New file structures can also be set up via control command files. The update process will exclusively work with the file path which is given by the global attribute "modpath" except for the fhem.pl file. The user decides whether to use a stable, or a developer-rated version of fhem. stable is not yet implemented, so an update use always the developer-rated version.

    Furthermore, the use of packages is supported just like in a manual installation of fhem. On the moment this only refers to FHEM including PGM2 (FHEMWEB), others may follow up. By using the update in this way, only files which are acutally used will be updated.

    The update function supports the installation of third-party packages like modules or GUIs that are not part of the FHEM distribution.

    Notice for Developers of third-party packages:
    Further information can be obtained from the file 'docs/LIESMICH.update-thirdparty'.

    Examples:
    Check for new updates:
        fhem> update check
        
    FHEM update:
        fhem> update
        
    Force FHEM update (all files are updated!):
        fhem> update force
        
    Update a single file:
        fhem> update 98_foobar.pm
        
    Search for a filename:
        fhem> update backup
        'backup' not found. Did you mean:
        ==> 98_backup.pm
        nothing to do...
        
    Update / install a third-party package:
        fhem> update thirdparty http://domain.tld/path packagename
        
    Check a third-party package for new updates:
        fhem> update thirdparty http://domain.tld/path packagename check
        
    Attributes
    • backup_before_update

    • exclude_from_update

    • updatebranch

watchdog


    Define
      define <name> watchdog <regexp1> <timespec> <regexp2> <command>

      Start an arbitrary fhem.pl command if after <timespec> receiving an event matching <regexp1> no event matching <regexp2> is received.
      The syntax for <regexp1> and <regexp2> is the same as the regexp for notify.
      <timespec> is HH:MM[:SS]
      <command> is a usual fhem command like used int the at or notify

      Examples:
        # 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.

    Set
      N/A

    Get
      N/A

    Attributes
    • disable
    • loglevel
    • regexp1WontReactivate
      When a watchdog is active, a second event matching regexp1 will normally reset the timeout. Set this attribute to prevents this.

weblink

    Define
      define <name> weblink [link|fileplot|dbplot|image|iframe|htmlCode|cmdList] <argument>

      This is a placeholder used with webpgm2 to be able to integrate links into it, and to be able to put more than one gnuplot/SVG picture on one page. It has no set or get methods. Examples:
        define homepage weblink link http://www.fhem.de
        define webcam_picture weblink image http://w.x.y.z/current.jpg
        define interactive_webcam weblink iframe http://w.x.y.z/webcam.cgi
        define hr weblink htmlCode <hr>
        define w_Frlink weblink htmlCode { WeatherAsHtml("w_Frankfurt") }
        define MyPlot weblink fileplot <logdevice>:<gnuplot-file>:<logfile>
        define MyPlot weblink dbplot <logdevice>:<gnuplot-file>
        define systemCommands weblink cmdList pair:Pair:set+cul2+hmPairForSec+60 restart:Restart:shutdown+restart update:UpdateCheck:update+check

      Notes:
      • Normally you won't have to define fileplot weblinks manually, as FHEMWEB makes it easy for you, just plot a logfile (see logtype) and convert it to weblink. Now you can group these weblinks by putting them into rooms. If you convert the current logfile to a weblink, it will always refer to the current file, even if its name changes regularly (and not the one you originally specified).
      • For cmdList <argument> consist of a list of space separated icon:label:cmd triples.
    Set
    • copyGplotFile
      Only applicable to fileplot type weblinks.
      Copy the currently specified gplot file to a new file, which is named after the weblink (existing files will be overwritten), in order to be able to modify it locally without the problem of being overwritten by update. The weblink definition will be updated.

    Get
      N/A

    Attributes
    • htmlattr
      HTML attributes to be used for link, image and iframe type of links. E.g.:
        define yw weblink wl_im1 iframe http://weather.yahooapis.com/forecastrss?w=650272&u=c
        attr yw weblink htmlattr width="480" height="560"
    • fixedrange
    • plotsize
    • plotmode
    • 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 or SVG, you can also use the min, max, avg, cnt, sum, 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:
      • Fixed text for the right and left axis:
        • Fhem config:
          attr wl_1 label "Temperature"::"Humidity"
        • .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>
    • 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.
    • 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 specialities
      If the weblink type is set to fileplot, a weblink editor is displayed in the detail view of the weblink. 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 of the FS20 switch is on 0 if it 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

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.

      Examples:
        define myLG7k xxLG7000 /dev/ttyUSB1

    Set
      Not used, nothing to set directly.
    Get
      Not used, nothing to get directly.
    Attributes
    • loglevel
    • SetID (1, 2, ...; see your TV's Owner's Manual how to set it. Defaults to 1 if unset.)

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.
      { "Hello" }
      { 1+3*4 }
      { `ls /etc` }
      { Log 1, "Hello" }

  • 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:
      { fhem "set light on" }
      define n1 notify piri:on { fhem "set light on" }
    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:
      define MyMacro notify MyMacro { Log 1, "Hello"}
      trigger MyMacro
      define MacroWithArg notify MyMacro { Log 1, "Hello %"}
      trigger MyMacro MyArg

  • 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 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.
      define n2 notify piri:on { if($hour > 18 || $hour < 5) { fhem "set light on" } }
      define roll_en *07:45:00 { fhem "trigger SwitchAllRoll on" if(!$we) }
      define roll_en *08:30:00 { fhem "trigger SwitchAllRoll on" if($we) }

  • The following helper functions are defined in 99_Util.pm (which will be loaded automatically, as every module with prefix 99):
    • min(a,b), max(a,b)
    • time_str2num("YYYY-MM-DD HH:MM:SS") returns a numerical value, which makes computation of time differences easier
    • abstime2rel("HH:MM:SS") converts an absolute time to a relative one
  • To access the device states/attributes, use the following functions:
    • Value(<devicename>)
      returns the state of the device (the string you see in paranthesis in the output of the list command).

    • OldValue(<devicename>)
    • OldTimestamp(<devicename>)
      returns the old value/timestamp of the device.

    • ReadingsVal(<devicename>,<reading>,<defaultvalue>)
      Return the reading (the value in the Readings section of "list device")

    • AttrVal(<devicename>,<attribute>,<defaultvalue>)
      Return the attribute of the device

      { Value("wz") }
      { OldValue("wz") }
      { time_str2num(OldTimestamp("wz")) }
      { ReadingsVal("wz", "measured-temp", "20")+0 }
      { ReadingsTimestamp("wz", "measured-temp", 0)}
      { AttrVal("wz", "room", "none") }
  • By using the 99_SUNRISE_EL.pm module, you have access to the following functions:
      sunset($offset, $min, $max)
      sunrise($offset, $min, $max)
      isday()
    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.
      • 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.