Sign inSign up

eladbar/pima2mqtt

By eladbar

•Updated almost 6 years ago

Image
0

2.3K

eladbar/pima2mqtt repository overview

⁠PIMA2MQTT

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.

⁠Prerequisites

  1. PIMA Hunter Pro alarm™, with 32, 96 or 144 zones.
  2. PIMA Home Automation kit™ (SA-232, LCL-11A and Serial-to-USB cable), or net4pro ethernet connection. Diagram by PIMA™ ©: Diagram by PIMA™ ©
    • According to various users, the alarm can be alternatively connected using a PL2303TA USB-to-TTL cable, like this one⁠.
    • Yet another option is to connect directly to Raspberry pi, as specified here: Diagram by @maorcc
  3. Raspberry Pi or similar, connected to the alarm through the Home Automation kit.
    • Tested on Raspbian⁠. Other operating systems may use different path structure for the serial ports.
  4. Alarm technician login code. Unfortunately, it is not possible to connect to the alarm using a user login code.

⁠Enabling the alarm serial port or network connection

  1. Enable extended menus:
    • Primary login code
    • NEXT
    • Technician login code
    • 5 (General parameters)
    • ENTR
    • NEXT till you get to the right P (extended menus)
    • Toggle by #
    • ENTR
    • END to exit
  2. Enable the serial port:
    • Primary login code
    • NEXT
    • Technician login code
    • 3 (Communication)
    • ENTR
    • 8 x NEXT (Serial port)
    • ENTR
    • Toggle the first L (for serial connection) or first N (for net4pro) by #
    • ENTR
    • END to exit

⁠How to run

⁠MQTT

⁠Publishes
⁠Status: pima_alarm/status
{
  "partitions": {
    "1": "home1"
  },
  "open zones": [],
  "alarmed zone": [],
  "bypassed zones": [],
  "failed zones": [],
  "failures": []
}
⁠Last Will and Testament: pima_alarm/LWT
  • online
  • offline
⁠Subscribes
⁠pima_alarm/arm

Each of the following commands can receive which partitions to execute the command, By default partitions: [ "1" ]

Arm

{
  "mode": "full_arm"
}

Arm Home1

{
  "mode": "home1"
}

Arm Home2

{
  "mode": "home2"
}

Disarm

{
  "mode": "disarm"
}

⁠Web Server endpoints

Each request to the server must include in the URL (query string) the api_key, e.g. /pima/status?api_key=test

⁠GET /pima/status

Returns status

⁠Http Codes
CodeReasonDescription
200OKSet arm state changed successfully
401Unauthorized requestapi_key doesn't match to the defined key
⁠POST /pima/arm
⁠Body
NameTypeRequiredDefaultDescription
modestrTrueNoneWhich command to run, supported options - arm, disarm, home1, home2
partitionsarray of intFalse[ "1" ]Which partition to use, accept array of int

Returns status

⁠Http Codes
CodeReasonDescription
200OKSet arm state changed successfully
400Invalid request dataEmpty payload sent within the request
401Unauthorized requestapi_key doesn't match to the defined key
403More details belowThe request contained valid data and was understood by the server, but the server is refusing action, more details available in the error message and logs
501Invalid arm mode, must be one of full_arm, home1, home2, disarmreceived mode is not supported
⁠Status Code 403 available errors
MessageDescription
No ServerServer is unreachable, check if serial port / IP:Port are correct
Invalid arm mode [mode]provided mode is not supported

⁠Next steps

  1. Groovy⁠ Device Type Handlers⁠ for SmartThings⁠ integration.
  2. Support further functionality, e.g. change user codes.

Tag summary

Content type

Image

Digest

Size

88 MB

Last updated

almost 6 years ago

docker pull eladbar/pima2mqtt