-
Notifications
You must be signed in to change notification settings - Fork 2
Configuration File
- Naming
- Syntax
- Common Settings
- Configuration of the alarm zones
- Check that the configuration file is valid Python
The configuration file shall be named $OPENHAB_CONF/automation/lib/python/idealarm/config.py
The syntax for the configuration file is Python 2.7
Initially you might want to start in Test Mode. Doing that will prevent audible alarm output. However, you must remember to disable Test Mode again when you've finished testing. Write a note or something!
change ALARM_TEST_MODE = False
to ALARM_TEST_MODE = True
Interval for how often (in integer minutes) ideAlarm shall nag you about doors etc that you've forgot to close. Default value is 6.
You can specify a logging level for ideAlarm. Read more about openHAB logging.
The example config file has defined a single alarm zone. If you need multiple alarm zones, you might want to have a look at The double zones example config file.
The benefit of having multiple alarm zones is that you can arm them differently. That is, you might want to arm your home as 'Armed Home' while you want the tenants area 'Disarmed' and the garden shed armed as 'Armed Away'. However don’t over-complicate things by creating unnecessary alarm zones as it's very easy to add more zones afterwards.
Below is an example of an alarm zone. (It's not the complete configuration file)
{
'name': 'My Home',
'armingModeItem': 'Z1_Arming_Mode',
'statusItem': 'Z1_Status',
'alertDevices': ['Siren_Indoors', 'Siren_Gardenshed'],
'sensors': [
{'name': 'Door_1_Lock', 'sensorClass': 'A', 'nag': True, 'nagTimeoutMins': 4, 'armWarn': True, 'enabled': True},
{'name': 'Door_3_Lock', 'sensorClass': 'A', 'nag': True, 'nagTimeoutMins': 4, 'armWarn': True, 'enabled': True},
{'name': 'MD_Bathroom_1', 'sensorClass': 'B', 'nag': False, 'nagTimeoutMins': 4, 'armWarn': False, 'enabled': True},
{'name': 'Door_5_Lock', 'sensorClass': 'A', 'nag': True, 'nagTimeoutMins': 10, 'armWarn': True, 'enabled': d5Enabled}
],
'armAwayToggleSwitch': 'Toggle_Z1_Armed_Away',
'armHomeToggleSwitch': 'Toggle_Z1_Armed_Home',
'mainZone': True,
'canArmWithTrippedSensors': False
}
- name: (Required) Give your alarm zone a descriptive name.
- armingModeItem: (Required) The openHAB item that you created for this zone. Holds the zones arming mode.
- statusItem: (Required) The openHAB item that you created for this zone. Holds the zones event status.
-
alertDevices: (List items are optional) A Python list containing the named openHAB switch items that shall be automatically switched on during an alert situation. Typically you put your siren item names here but it can actually be any kind of openHAB item that can be switched "On" and "Off". If you have no alert devices or you'd like to control them using custom logic you should supply an empty list
[]
- sensors: See Sensors in the configuration file.
- armAwayToggleSwitch: (Required) openHAB switch item to toggle alarm status between Disarmed and Armed away.
- armHomeToggleSwitch: (Required) openHAB switch item to toggle alarm status between Disarmed and Armed home.
-
mainZone: (Required) Set this to
True
if this is your main zone. Otherwise set this toFalse
. (The main will be the default zone). You don't need to have a main zone but if you define one, it's important that you define only a single zone as your main zone. - canArmWithTrippedSensors: (Required) Set this to true if you want to be able to arm this zone even if sensors are tripped when arming. If set to false, arming attempts with tripped sensors won't be possible and will cause an error.
- name: String. The key value for each defined sensor. This must be the name of an openHAB item.
-
sensorClass: String. Must be set to either
A
orB
. Sensors defined asA
will trigger in any arming mode, e.g. when the zone's arming mode isArmed Home
orArmed Away
. Sensors defined asB
will only trigger when the zone's arming mode isArmed Away
. - nag: Boolean. Determines if the sensor shall be included in the nagging feature.
- nagTimeoutMins: Integer. The number of minutes after which a sensor will be regarded as timed out and therefore will be nagged about. Nagging will only occur for sensors in disarmed zones and also for sensors with sensorClass set to B` when the zone is armed home. Nagging will not occur for disabled sensors. Also, nagging will only occur for sensors that has armWarn set to true.
-
armWarn: Boolean. Can be set to
False
if you wish to exclude the sensor from being checked when arming a zone with tripped sensors. This setting will also affect if the sensor will be nagged about. Default value isTrue
. -
enabled: Boolean or Function. Set to
True
in normal circumstances. It can be set toFalse
to temporary exclude the sensor from the alarm zone. While set toFalse
, it won't trigger alarms and armWarning and nagging will not occur. Default value isTrue
. This can alternatively be defined as a function. By using a function you can for example make a sensor enabled only when it's dark or depending on the state of other openHAB items.
After editing your configuration file, always check that it's valid:
- Copy and paste your configuration file into the form on PythonBuddy to verify that the Python syntax. The two org.eclipse.smarthome imports will fail but you can ignore that.