Skip to content
This repository was archived by the owner on May 14, 2019. It is now read-only.

First Installation

Rick Jongbloed edited this page Jun 8, 2018 · 30 revisions

Installation

Prerequisits

The following should be installed, configured, tested and working before continuing with installing ideAlarm:

* Make sure the item ZZZ_Test_Reload_Finished is created_ (see https://github.com/OH-Jython-Scripters/mylib/blob/master/lib/python/mylib/utils.py)

Check that the currently logged in user has the environment variable $OPENHAB_CONF set

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 mapping files

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

Define Item Groups (needed for persistence)

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

Create Items for each alarm zone you intend to use

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 ideAlarm library directory and files

  • 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

Create the config file

Example linux commands for doing all of the above:

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

Edit the config file to suit your system

  • 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 safely ignore that.
  • Save the file.

Create a custom library script

  • Download the custom template and save it by the name $OPENHAB_CONF/automation/lib/python/idealarm/custom.py
  • Change file owner to openhab and group information to openhab

Example linux commands for doing all of the above:

sudo wget -nc -O $OPENHAB_CONF/automation/lib/python/idealarm/custom.py https://raw.githubusercontent.com/OH-Jython-Scripters/ideAlarm/master/automation/lib/python/idealarm/custom_template.py
sudo chown openhab:openhab $OPENHAB_CONF/automation/lib/python/idealarm/custom.py

Download the 001_ideAlarm.py script

  • Download the 001_ideAlarm.py and save it by the name $OPENHAB_CONF/automation/jsr223/001_ideAlarm.py
  • Change file owner to openhab and group information to openhab

Example linux commands for doing all of the above:

sudo wget -O $OPENHAB_CONF/automation/jsr223/001_ideAlarm.py https://raw.githubusercontent.com/OH-Jython-Scripters/ideAlarm/master/automation/jsr223/001_ideAlarm.py
sudo chown openhab:openhab $OPENHAB_CONF/automation/jsr223/001_ideAlarm.py
Clone this wiki locally