This program implements an interface for negotiation with PIMA Hunter Pro alarms.
It was built based on PIMA™'s General Specification for Home Automation &
Building Management protocol Ver. 1.15.
PIMA™ is a trademark of PIMA Electronic Systems Ltd, http://www.pima-alarms.com.
This program was built with no affiliation of PIMA Electronic Systems Ltd.
SA-232, LCL-11A and Serial-to-USB cable), or net4pro ethernet connection.
Diagram by PIMA™ ©:
PL2303TA USB-to-TTL cable, like this one.
NEXT5 (General parameters)ENTRNEXT till you get to the right P (extended menus)#ENTREND to exitNEXT3 (Communication)ENTRNEXT (Serial port)ENTRL (for serial connection) or first N (for net4pro) by #ENTREND to exitopenssl req -x509 -newkey rsa:2048 -nodes -keyout key.pem -out cert.pem -days 365
pip3 install crcmod paho-mqtt pyserial
chmod a+x pima_server.py
./pima_server.py --ssl_cert cert.pem --ssl_key key.pem --port 7777 --key my_random_key --login 000000 --mqtt_host localhost
--ssl_cert - Path to the SSL certificate file. If not set, will run a non-encrypted web server.--ssl_key - Path to the SSL private key file. If not set, will get the key from the certificate file.--port or -p - Port for the web server.--key or -k - An arbitrary string key to authenticate the server calls.uuid -v4.--login or -l - The technician login code to the alarm.--zones or -z - Number of zones supported by the alarm, one of 32, 96 or 144. Default is 32.--serialport - Serial port, e.g. /dev/serial0. Needed if connected directly through GPIO serial.--pima_host - Pima alarm hostname or IP address. Must be set if connected by ethernet.--pima_port - Pima alarm port. Must be set if connected by ethernet.--mqtt_host - The MQTT broker hostname or IP address. Must be set to enable MQTT.--mqtt_port - The MQTT broker port. Default is 1883.--mqtt_client_id - The MQTT client ID. If not set, a random client ID will be generated.--mqtt_user - <user:password> for the MQTT channel. If not set, no authentication is used.--mqtt_topic - The MQTT root topic. Default is "pima_alarm". The server will listen on topic
<{mqtt_topic}/command> and publish to <{mqtt_topic}/status>.--log_level - The minimal log level to send to syslog. Default is WARNING.curl -ik 'http://localhost:7777/pima?key=my_random_key&command=status'
curl -ik 'http://localhost:7777/pima?key=my_random_key&command=arm&mode=home1&partitions=1'
key - The key specified on the web server startup.command - Either status or arm.arm is specified:
mode - Either full_arm, home1, home2 or disarm.partitions Comma separated list of partitions. Default is 1.sudo mkdir /usr/lib/pima
sudo mv pima_server.py pima.py key.pem cert.pem /usr/lib/pima
sudo chown root:root /usr/lib/pima/*
sudo pip3 install crcmod paho-mqtt pyserial
/lib/systemd/system/pima.service:
[Unit]
Description=PIMA alarm server
After=network.target
[Service]
ExecStart=/usr/bin/python3 -u pima_server.py --ssl_cert cert.pem --ssl_key key.pem --port 7777 --key my_random_key --login 000000 --mqtt_host localhost
WorkingDirectory=/usr/lib/pima
StandardOutput=inherit
StandardError=inherit
Restart=always
[Install]
WantedBy=multi-user.target
/etc/systemd/system/:
sudo ln -s /lib/systemd/system/pima.service /etc/systemd/system/multi-user.target.wants/pima.service
sudo systemctl enable pima.service
sudo systemctl start pima.service
Content type
Image
Digest
Size
350.4 MB
Last updated
over 5 years ago
docker pull deiger/pima