Hi all,
I have an INIM alarm system for which unfortunately there does not yet exist a binding. Nevertheless, there is an API interface possible through http POST. Unfortunately my knowledge about POST/GET and cURL and the likes is very limited, so hoping for some help here.
On the web I found that the alarm status can be read and written through http POST. There is a google chrome extension “Talented API tester” that I can use to test POST/GET commands. Via this method, I have succesfully been able to read and write the alarm status. Below a screenshot on how I do this:
So input as following:
Base URL: http://cgi-bin/web.cgi
Content-type: application/x-www-form-urlencoded
Body:
- “tk”: my secret code, which i have blackened out
- “mod”: zone or cmd or do_sce (depends on what I want to read or control from the alarm)
- “par”: sce or now (depends on what I want to read or control from the alarm)
- “qindex”: Not sure what it is, but always 0
This method works perfectly. I get a JSON response as following:
{"zone": [
{"lb": "01 fire basement", "tl": "0", "st": "1", "mm": "0", ...},
{"lb": "02 entrance door", "tl": "1", "st": "1", "mm": "0", ...},
{"lb": "03 storage door", "tl": "1", "st": "1", "mm": "0", ...},
...
]
}
“st” is the status of the contact. A value of 1 means the door is closed. A status of 2 means the door is open. This way I can also read when the alarm is sounding, when there is a fire alarm , when a door is opened, etc…
My question is: How can I get these values in Openhab? I would first need to execute a POST command, probably through a rule, to retrieve the JSON response. Then I would need to store the “st” response in an item.
I someone could help me, or at least give me some clues on where to start, that would be greatly appreciated.
Even better would of course be to have a binding developed for this INIM alarm system. Unfortunately I’m not an IT programmer or specialist. I’d be happy to provide input or do some testing. In any case, I’m grateful for the Openhab community here which is doing an excellent job here! I have Openhab running for several years now, currently at 25 bindings and still integrating more and more each year