-
Notifications
You must be signed in to change notification settings - Fork 1
First Installation
The following should be installed, configured, tested and working before continuing with installing ideAlarm:
- openHAB version 2.2 or later
- Jython scripting for openHAB 2.x
- openHAB expire binding
- openHAB persistence setup and working
- mylib
For this instruction to work, the currently logged in user must have the environment variable $OPENHAB_CONF set to the value of your openHAB configuration directory. If it's not set, do not continue further. Below is a linux example command that you can use to check this condition. It should return the name of the directory.
echo $OPENHAB_CONF
Download the mapping files in the language of your choise and save them on your system where you keep your mappings files (in the transform folder) Example linux commands for downloading the English mapping files followed by changing file owner and group information.
sudo wget -O $OPENHAB_CONF/transform/en_armingmode.map https://raw.githubusercontent.com/OH-Jython-Scripters/ideAlarm/master/transform/en_armingmode.map
sudo chown openhab:openhab $OPENHAB_CONF/transform/en_zonestatus.map
sudo wget -O $OPENHAB_CONF/transform/en_zonestatus.map https://github.com/OH-Jython-Scripters/ideAlarm/blob/master/transform/en_zonestatus.map
sudo chown openhab:openhab $OPENHAB_CONF/transform/en_zonestatus.map
Below is an example how you can define some groups to help organize your ideAlarm Items. The important thing here is not the names of the groups but rather that you have defined your persistence so that the group G_Persist will be persisted on change and on system start up.
Group G_Persist // Persist on change and system start up
Group G_AlarmArmingMode (G_Persist)
Group G_AlarmStatus (G_Persist)
Group G_VirtualDevice (G_Persist)
Group G_Timer
For each alarm zone that you wish to define, create the following items through text .items files located in the $OPENHAB_CONF/items folder. You are advised to keep the naming convention suggested at least until everything is set up and works well. Your first zone's items get item names starting with 'Z1'. Prepend your second zone items with 'Z2' etc.
Number Z1_Arming_Mode "Z1 Arming Mode: [MAP(en_armingmode.map):%s]" <alarm> (G_AlarmArmingMode)
Number Z1_Status "Z1 Status: [MAP(en_zonestatus.map):%s]" <alarm> (G_AlarmStatus)
Switch Toggle_Z1_Armed_Away "Toggle Z1 Armed Away" <switch> (G_VirtualDevice) {expire="1s,command=OFF"}
Switch Toggle_Z1_Armed_Home "Toggle Z1 Armed Home" <switch> (G_VirtualDevice) {expire="1s,command=OFF"}
Number Z1_Open_Sections "Z1 open sections [%.0f]" <door> (G_VirtualDevice)
Switch Z1_Entry_Timer "Z1 entry timer [%s]" <time> (G_Timer) {expire="15s,command=OFF"}
Switch Z1_Exit_Timer "Z1 exit timer [%s]" <time> (G_Timer) {expire="2m,command=OFF"}
Switch Z1_Nag_Timer "Z1 nag timer [%s]" <time> (G_Timer) {expire="4m,command=OFF"}
Switch Z1_Alert_Max_Timer "Z1 alert maximum time [%s]" <time> (G_Timer) {expire="20s,command=OFF"}
- Create the directory $OPENHAB_CONF/automation/lib/python/idealarm
- Set the directory permissions to 775.
- Set the directory group to openhab and owner to openhab.
- Download The library init file and save it by the name $OPENHAB_CONF/automation/lib/python/idealarm/init.py
- Change file owner to openhab and group information to openhab
Example linux commands for doing all of the above:
sudo mkdir $OPENHAB_CONF/automation/lib/python/idealarm
sudo chmod 775 $OPENHAB_CONF/automation/lib/python/idealarm
sudo chown openhab:openhab $OPENHAB_CONF/automation/lib/python/idealarm
sudo wget -O $OPENHAB_CONF/automation/lib/python/idealarm/__init__.py https://raw.githubusercontent.com/OH-Jython-Scripters/ideAlarm/master/automation/lib/python/idealarm/__init__.py
sudo chown openhab:openhab $OPENHAB_CONF/automation/lib/python/idealarm/__init__.py
- Download The example two zones config file or as an alternative The single zones config file and save it by the name $OPENHAB_CONF/automation/lib/python/idealarm/config.py
Example linux commands for downloading the two zones example configuration file followed by changing file owner and group information:
sudo wget -nc -O $OPENHAB_CONF/automation/lib/python/idealarm/config.py https://raw.githubusercontent.com/OH-Jython-Scripters/ideAlarm/master/automation/lib/python/idealarm/2_zones_example_config.py
sudo chown openhab:openhab $OPENHAB_CONF/automation/lib/python/idealarm/config.py
- Make your changes to the configuration file. See configuration
- 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.
- Save the file.