Skripte auf Deutsch
Skripte auf Deutsch

Scripts

Scripts currently execute a sequence of  eib-commands with defined delays between them.
Scripts are executed by requesting /script/my-script-name.

Scripts should be located in /usr/local/etc/rleibd. Currently it is possible to extend the path using ../ but this may be blocked in the future for security reasons. If you want the scripts to be located some other place you should define this at compile time. The script directory and any script should not be writable by the user running rleibd (but of course readable).

A Script is executed as a pthread. So a virtually unlimited number of scripts can be executed concurrently and scripts can take a virtually unlimited time to run. Currently there is no possibility to stop a Script. You must consider this if you execute scripts with long delay times. The only possibility to stop a script is killing rleibd.

A script consists of lines in the following format:

url delay #comment

Comments are possible by placing a sharp (#). Every line starting with a sharp is also treated as a comment. Blank lines are ignored. Anything else is sent to the portserver. The script processor requests the <url> and pauses for <delay> milliseconds. With longer scripts you should consider the transmission time for each telegram to avoid transmit buffer overflow or excessive bus load. Since it is normally not necessary to send consecutive telegrams at maximum speed, 200 or more should be a good policy for the delay time. This allows five switch commands per second. Note: The size of the transmit buffer is defined in the eib kernel driver and currently is 20 Messages by default.

Remember the special value -1 for signaling purposes. /eib/grp/x.y.z?val=-1 inverts the current value, i.e. if your light is off it will turn on and if it is on it will turn off. Very useful for blinking the lights for certain events or at certain times (crond, atd!).

Future extensions