Template
Posted: Tue 17 Jun 2014, 16:29
This is program template written in Javascript that can be used to send SIA-events from the SPC panel by Notify My Android. You need to have a NMA account and a API-key from http://www.notifymyandroid.com.
To be able to run the program you need to install NodeJS and some NodeJS addon modules.
Install NodeJS
Check the installation with: node -v
Install required addon modules
Install spc-notify-nma
Modify the settings in config.json according your environment and NMA API-key.
In spc-notify-nma.js, function manageSiaEvent() you have to add all SIA-event types you want to be managed by the program. Look in the SPC documentation for definitions of the SIA-event types.
Run the program with: ./spc-notify-nma.js
To be able to run the program you need to install NodeJS and some NodeJS addon modules.
Install NodeJS
Code: Select all
sudo apt-get update
sudo wget http://node-arm.herokuapp.com/node_latest_armhf.deb
sudo dpkg -i node_latest_armhf.deb
Install required addon modules
Code: Select all
cd <INSTALL_DIR>
sudo npm install websocket
sudo npm install nma
Code: Select all
cd <INSTALL_DIR>
tar xzvf spc-notify-nma.tar.gz
cd spc-notify-nma
In spc-notify-nma.js, function manageSiaEvent() you have to add all SIA-event types you want to be managed by the program. Look in the SPC documentation for definitions of the SIA-event types.
Run the program with: ./spc-notify-nma.js