avm-motion-trigger.conf

NAME | FORMAT | DESCRIPTION | AUTHOR

NAME         top

avm-motion-trigger.conf − the configuration file for the AVM Motion Trigger daemon

FORMAT         top

The configuration file is managed by libconfig. All formatting rules from their standard match to ours.
The configuration contains parameters of the form:

name = value;

Any line starting with # or // are comments. All parameters which are described to be strings needs to wraped by double quotes. (name = "string";)
All parameters which are described to be integers needs no such wrapping. Just specify the value. (name = 0;)

DESCRIPTION         top

The avmctl (1) and the avm-motion-triggerd (1) binaries can consume this configuration file. The configuration contains multiple sections:

AVM FRITZ!Box credentials
These parameters specify the credentials which should be used to login to a FRITZ!Box and start a new session.

hostname

The hostname/ip[:port] of the fritzbox without protocol scheme or URI paths, by default fritz.box. This value is a string.

username

The username of the fritzbox which is able to perform smart home management. According to the documentation from AVM this setting can be empty, by default empty. This value is a string.

password

The plaintext password of the fritzbox, by default 0000. This value is a string.

Device configuration

ain

The Actor Identification Number of the AVM Smart Switch to control. The format of the AIN is FF:FF:FF:FF:FF:FF. This value is a string. This parameter will specify be the default actor for avmctl.

actor_command

The specified command will be send to the actor in case a motion was detected. Available commands are: ‘on‘, ‘off‘, ‘toggle‘. Defaults to ‘on‘. This parameter is ignored by avmctl. This value is a string.

turn_device_off_after

Turn off the device after n seconds (eg. 10 minutes). Specifying 0 will disable automatic turn off. Defaults to 0. This parameter is ignored by avmctl. This value is an integer.

Sensor thresholds

light_sensor_thold

The daemon takes care of a detected PIR motion if the level of the ambient light is below the specified threshold. 0 will disable the light sensor check. With a 10-bit ADC (eg. MCP3008) the range is 0-1023. This parameter is ignored by avmctl. This value is an integer.

motion_sensor_locktime

If you set the turn_device_off_after parameter to 0 you probably want to build a toggle-by-motion setup. In this case it is advisable to specify a time range which prevent jitter triggering. So no action is performed for n seconds after a motion was detected. Defaults to 30 seconds. This parameter is ignored by avmctl. This value is an integer.

too_bright_timeout

With this parameter you are able to enforce a sleeping interval (in seconds) if the current ambient light level is greater than the configured threshold. A bright environment won’t be dark in 10 milliseconds, so you could save power and put the daemon to sleep for a while. No new motion will be detected while this timeout. 0 will disable this timeout. Defaults to 30 seconds. This parameter is ignored by avmctl. This value is an integer.

backup_action_timeout

If an error occurs while performing an action on the configured actor, the daemon always tries to rescue the situation with a so called backup request. With this parameter you can control the time window between the first and the backup request (in seconds). 0 will disable this timeout. Defaults to 1 second. This parameter is ignored by avmctl. This value is an integer.

failed_backup_action_timeout

If even the backup request fails then we can’t do much more about it. With this parameter you can put the daemon to sleep for a specified interval (in seconds). 0 will disable this timeout. Defaults to 30 seconds. This parameter is ignored by avmctl. This value is an integer.

desired_actor_state

With this configuration parameter you can specify in which state the configured actor should be when the daemon is going to send an action to it. So the current state of the actor will be queried if a motion was detected and the light sensor check passed (if configured). If the desired actor state differs from the current actor state, the action will be canceled. This parameter accepts the following values: on, off, and unkown. Defaults to unknown. This parameter is ignored by avmctl. This value is a string.

desired_actor_state_missmatch_timeout

With this parameter you can set a timeout (in seconds) if the desired actor state check is configured and the states differs. 0 will disable this timeout. Defaults to 30 seconds. This parameter is ignored by avmctl. This value is an integer.

Sensor ports

motion_sensor_gpio

Specify a GPIO pin for the PIR motion sensor. The daemon assumes a state change from LOW to HIGH represents a recognized motion. The GPIO pin mapping can be found on bcm2835.h or on http://www.airspayce.com/mikem/bcm2835/. This parameter is ignored by avmctl. This value is an integer.

light_sensor_device

The daemon assumes to read the light level from a MCP3008 which is connected to the SPI bus. With this setting you can choose the Linux kernel SPI device the daemon should use. Defaults to /dev/spidev0.0. This parameter is ignored by avmctl. This value is a string.

light_sensor_channel

The daemon assumes to read the light level from a MCP3008 which is connected to the SPI bus. With this setting you can configure which channel of the chip will be read out. This parameter is ignored by avmctl. This value is an integer.

Custom hooks

motion_pre_hook

When a motion is triggered the daemon can kick off a custom user defined script. If a motion is detected and all configured tests are passed the custom motion hook will be executed before the AVM logic will be performed. The custom hook will be executed in a non-blocking manner. If the hook is not configured, it won’t be executed. This parameter is ignored by avmctl. This value is a string.

motion_post_hook

This hook is triggered right after all configured tests are passed as the previous hook. The difference of this hook is that it is executed after the AVM logic was performed. The custom hook will be executed in a non-blocking manner. If the hook is not configured, it won’t be executed. This parameter is ignored by avmctl. This value is a string.

turn_off_pre_hook

This hook is executed right after the turn off timeout was passed (when configured), before the AVM logic was performed. If the hook is not configured, it won’t be executed. This parameter is ignored by avmctl. This value is a string.

turn_off_post_hook

This hook is executed right after the turn off timeout was passed (when configured), before the AVM logic was performed. If the hook is not configured, it won’t be executed. This parameter is ignored by avmctl. This value is a string.

AUTHOR         top

Hermann Mayer <jack@jity.de>