Konfiguration auf Deutsch
Konfiguration auf Deutsch

Configuration

is done via a single xml-file. eibdef.xml is the central definition file for your eib-installation. It must reside in /usr/local/etc/rleibd. At least it must have the definition of all groups. Have a look at the sample xml-file and you will understand how it works.
In the root element <eib> there are elements for each group you have. Required attributes for each <grp> are the group address, its type and a name.
<grp adr="4.2.3" type="OPENCLOSE" name="Window Livingroom">
</grp>

types

valid types for a <grp> are
ONOFF a switch
OPENCLOSE a window
UPDOWN a shutter
PERCENT a percent value (e.g. heating valve)
DEGREE a temperature value
BYTE something that returns a BYTE-value
 
Optional elements and their attributes are explained below.

optional par-elements

The <par>-element contains parameters that are constant or predefined at the start of rleibd. Within the <par>..</par>-element the following subelements can be used:

<phys>

contains information about physical properties of your system. The only attribute provided here is

<phys device="(path-to-your-eibdevice)"></phys>

which defaults to /dev/eib if omitted.

<log>

gives a detailled specification about what to appear in your logs and what should not.

<log par="1" write="0" controls="1" script="1" trigger="0" namedTrigger="1" reminder="1" shutter="0" invalidates="0" asker="0"></log>

The names of the attributes are self-explaining, the number is the log-level. 0 means no logging at all, higher numbers give more and more verbosity. In general, if you want to see what's going on set the log-level to 1, if you want to debug, set it to 9. Errors and other critical events will always be logged. Additional information about logging

For par to work log has to be the first line in the par-section!

<path>

contains optional information about your directory structure.

<path scriptRoot="path-to-your-script-root"></path>

<overshoot>

When setting the position of a shutter to 0% or 100% it may not be reached exactly due to stroketime-errors or repeatedly setting positions in between. Therefore the time moving to terminal positions can be extended by a few seconds to ensure reaching the position. The only attribute is time (in ms):

<overshoot time="5000"></overshoot>

results in a 5 seconds longer move-time when moving to terminal positions.
The maximum possible value here is 65 seconds.

<sendDelay>

In earlier versions a fixed delay of 200ms-delay was inserted after sending a telegram (e.g. on ask()). Now this time can be configured by instering a line like

<sendDelay default="500"></sendDelay>

The value is in milliseconds. Default is 200 and the maximum is 65535.

Optional group-elements

The following elements must reside within a <grp>...</grp> element.

<invalidates>

you can invalidate group values by adding an element. The portserver thus will ask on the bus next time this value is requested.

<invalidates> group [...] </invalidates>

e.g. you should invalidate the value of a dimmer when dim-up or dim-down protocols are received to update the absolute value. You can specify a list of groups here.

<stops>

this is intended for shutters. Specify which absolute-value shutter is stopped by this command. The <stops>-element thus resides in the group stopping the shutter and group is the group which executes the start-command of the corresponding shutter.

<stops> group </stops>

You may only specify a single group here. If you have groups that stop more than one shutter, use <controls>. Internally, this address sets also a stopped-by for the startgroup of this shutter. This is necessary to be able to stop a shutter when executing a movement to an absolute position.

<controls>

some group addresses control more than one physical device. You can specify a list here.

    <controls> group [...] </controls>

<trigger>

you can execute external commands on reception of a telegram.

<trigger cmd="somecommand %v" name="myname"> </trigger>

executes the somecommand-program with the received value as an argument. The value will be a real number without unit.
Named triggers can be inserted and removed while rleibd is running. The name parameter is optional. If you specify it, you must choose a unique name and you can later delete a trigger by specifying its name. Unnamed triggers cannot be deleted. Deleting a trigger will not stop its command if it is already running but it will not be called again thereafter.
You can have multiple triggers per group.

<reminder>

a reminder is used to execute an external command when a group is in a certain state for a certain time.

<reminder cmd="somecommand" low="low value" high="high value" time="time" repeat="repeat"> </reminder>

This means, if the group is between low and high (including) for time seconds it will execute the somecommand. Unless the state leaves the specified range the somecommand will be executed every repeat seconds thereafter. A repeat of "0" means do not repeat, wich is also the default.
To remind you to close the window, low and high should be 1 (if in your installation 1 means the window is open).
For example, you can specify time=600 and repeat=300 so when the window is open for more then 10 minutes you can execute a script that rings your door bell twice every 5 minutes until you finally close it.
You can also use this for very slow dims (sunsets) if you set high to 99 and low to 1 and use the somecommand to step down a bit. As long as the value is 100%, the lights will stay on. Now dim it a little bit and it will consecutively be dimmed down until the lights are finally off.
You can also use it simply as a timeout for any lighting. Since it is normally not necessary to have a light burning for more than 12 hours you can add a reminder that switches the light off then. You will never have the lights in your pantry burning while you relax on the bahamas...
You can have multiple reminders per group.
Internally, a reminder is a thread that is started when the value enters the range and killed when it leaves again.
Note that low defaults to the high value if ommitted and high defaults to 0 but it should be of course good policy to specify both.

Optional group-attributes

ask

Indicates that this group shall be included in the asker queue. The groups value thus will be asked at regular time intervals. Be careful to set the ask-tag only for groups where only a single device will respond else undefined (although mostly harmless) behavior of your eib-installation will result.

nomismatch

mismatches of this group's value (the value stored in memory and the value received on the bus) will not be logged. This is useful for temperature sensors since they will not transmit every small change but if asked they may reply with a value slightly different to the last value sent. Provided to reduce syslog size.

logvalues

every setValue() of this group will be logged. Note that setValues caused by the asker thread will be suppressed.

stroketime

is only valid for shutters. It specifies the time necessary for a full stroke (from open to closed). You have to take this time for every shutter in your house. This timespan enables rleibd to compute the actual position in percent and to move the shutter to any position you want to. The value is in milliseconds.

Full Example

<?xml version="1.0"?>
<eib>
    <par>
        <phys device="/dev/eib"> </phys>
    </par>
    <grp adr="1.2.3" type="OPENCLOSE" name="Main door" ask="1" logvalues="1">
        <trigger cmd="/usr/bin/rrdtool update /usr/local/etc/rrdtool/maindoor.rrd N:%v"> </trigger>
        <reminder cmd="/usr/local/bin/ringbell" high="1" time="600"> </reminder>
    </grp>
    <grp adr="1.1.6" type="UPDOWN" name="Shutter living room south" stroketime="21500">
    </grp>
    <grp adr="1.1.7" type="UPDOWN" name="Shutter living room south stop">
        <stops> 1.1.6 </stops>
    </grp>
    <grp adr="1.1.8" type="UPDOWN" name="Shutter living room west" stroketime="21500">
    </grp>
    <grp adr="1.1.9" type="UPDOWN" name="Shutter living room west stop">
        <stops> 1.1.8 </stops>
    </grp>
    <grp adr="1.1.14" type="UPDOWN" name="Shutters living room">
        <controls> 1.1.6  1.1.8 </controls>
    </grp>
    <grp adr="1.1.15" type="UPDOWN" name="Shutters living room stop">
        <controls> 1.1.7  1.1.9 </controls>
    </grp>
</eib>

Explanation:
The group 1.2.3 is of  type OPENCLOSE and will be called Main door. It shall be included in the asker-thread. Value updates will be logged (so you can see when burglars opened your door an carried out all the furniture...) and it triggers an external command to generate a rrdtool-database for later processing. It also uses a reminder if it is open for more than 10 minutes that rings the bell to call you close me!.
We have two shutters defined for the living room which both need 21.5 seconds to complete action and two pseudogroups starting and stopping both with only one switch.
Note that the first line <?xml... in the xml-file is mandatory.

somecommand

in the definitioins above, external commands are called somecommand. This can be the full path to any executable file. It will be executed under the context of the user running rleibd.
This also introduces a serious danger if your system is remotely accessable in any way. Please be sure to read and understand the secutity-page!
Since this command frequently has to execute just one eib-command and it normally does not make much sense to execute a comment, every command starting with a sharp (#) is not to be executed in a shell but is sent directly to the portserver (without the sharp, of course). So a cmd=#/eib/grp/1.2.3?val=0 will set the group 1.2.3 to 0. This not only saves resources but will dramatically reduce the number of script-files in your script-directory.
If the command starts with an exclamation mark it is considered to be a script-file. The exclamation mark is removed and the reminder is searched in your script-direcory. You cannot pass arguments (%v) to scripts. But as a side effect, you can name the script myscript.1.eib and it will only executed if the value is 1 if you insert it as !myscript.%25v.eib. But this is only a side effect and you should not make extensive use of it since it is not guaranteed to work in further versions...

Checking the actual configuration

To retrieve the actual configuration, rleibd generates a XML-file on the request of

/def/eibdef.xml

wich contains all actually defined values.
This is not a real file. It is generated on-the-fly by rleibd based on the actual contents of its configuration memory. Modern browsers will display it as a tree-structure but of course you can save it on your computer by setting a link on it and clicking it with the right button of your mouse.
This is not only useful for debugging purposes but it also reflects the presence of triggers etc. that can be inserted into the running system and deleted again. Have a look on the script triggerlist.html in the example-directory, which generates a list of triggers and reminders based on this data.