After months of research and experimentation, I’m thrilled to share my success in integrating my INIM alarm system with OpenHAB! For those unfamiliar, INIM is an Italian brand offering advanced home automation and security solutions. Their systems are highly customizable, but integrating them with third-party platforms like OpenHAB can be a bit of a challenge.
The Challenge
My journey began with a desire to fully automate my home security system. I had an INIM Smartliving control panel with the Smartlan/G expansion card, which provides Ethernet connectivity. While INIM offers their own software (Smartleague) for configuring the system, I wanted seamless integration with OpenHAB to leverage its powerful automation capabilities.
The first hurdle was understanding how to communicate with the INIM system programmatically. INIM uses HTTP POST requests and JSON responses, which are standard in web communication but require specific handling. I spent hours researching online forums and documentation to find a viable solution.
The Solution
After some digging, I discovered that the INIM system exposes its API through HTTP POST requests. The key was to retrieve a secret token (tk) from the system, which is required for authentication. I used Wireshark to capture network traffic and identify the necessary POST requests and parameters.
Once I had the token, I wrote a bash script to send the required HTTP POST commands to the INIM system. This script uses curl to handle the requests and processes the JSON responses using OpenHAB’s built-in JSONPATH transformation functionality.
The Setup
Here’s a high-level overview of the steps I took:
-
Retrieve the Secret Token (tk):
- Use Wireshark to monitor network traffic while interacting with the INIM system.
- Identify the POST requests and extract the
tkvalue.
-
Create a Bash Script:
bash
#!/bin/bash
curl -s -X POST -H “Content-Type:application/x-www-form-urlencoded” -d “tk=” -d “mod=do_sce” -d “par=0” -d “qindex=0” ‘http:///cgi-bin/web.cgi’- This script sends commands to arm/disarm the system and retrieve status information.
-
Integrate with OpenHAB:
- Use OpenHAB’s
executeCommandLinefunction to run the bash script. - Parse the JSON response using JSONPATH to update OpenHAB items with the system status.
- Use OpenHAB’s
-
Create Rules and Scenes:
- Set up rules to trigger actions based on the alarm system’s status (e.g., send notifications, adjust lighting).
- Create scenes to arm/disarm the system with a single button press.
The Results
The integration has been a game-changer for my home automation setup. I can now:
- Arm and disarm my alarm system directly from the OpenHAB dashboard.
- Receive real-time status updates on individual zones.
- Create automated routines that interact with the alarm system (e.g., disarm the system when I arrive home).
Challenges Overcome
- Token Retrieval: Initially, I struggled with capturing the correct token using Wireshark. Trial and error were key here.
- Scripting: Writing the bash script and ensuring it communicated properly with the INIM system was a learning curve.
- JSON Parsing: Getting OpenHAB to correctly parse and act on the JSON responses took some tweaking.
Final Thoughts
This integration has been a labor of love, but the payoff has been well worth the effort. I’m now fully integrated with my INIM system, and it feels like a natural extension of my OpenHAB setup. I’m hopeful that this guide will help others looking to achieve the same level of integration.
A huge thank you to the OpenHAB and INIM communities for their resources and support. If anyone has questions or needs assistance with their own integration, feel free to reach out!
Happy automating! ![]()