Inim Alarm

I have an older version of the SmartLan-G. The restful commands for the scenarios that I have discovered are:

alles_aan:
  url: 'http://192.168.1.92:5050/cgi-bin/web.cgi?user=username&pass=passcode&code=codenumber'
  method: post
  content_type: 'application/x-www-form-urlencoded'
  payload: '&mod=do_sce&par=1'

I have five scenarios and the par parameter ranges from 0-4. I have no session or access token. Just user, password and code.

I have created scripts to execute these restful commands. And in Lovelace I have five png pics that can be pressed:


type: picture-elements
title: INIM alarm
elements:
  - image: /local/alarm/alarm_alles_uit.png
    type: image
    entity: script.alarm_alles_uit
    style:
      top: 10%
      left: 50%
    tap_action:
      action: call-service
      service: script.turn_on
      service_data:
        entity_id: script.alarm_alles_uit
    state_image:
      'on': /local/alarm/alarm_alles_uit_on.png
      'off': /local/alarm/alarm_alles_uit.png

I spent some time figuring out how to make the state_image work. The key was to add the script as an entity to the image. Now if you call the script, the script entity is “on” for the time the script runs. I added a brief delay of “00:00:00:100” = one hundred milliseconds to show the “on” image.

I have the SmartLAN/SI programming manual that contains the exact steps to connect to the board with a windows laptop. Let me know if you want it.

@fmmsfz, @flamegrilled, @Sam_Van_Herzele, @asp, @iShortOne, @Denny_d, @lupick, @caimale, @Freggel
I have managed to get all the INIM commands and sensors working and showing in the frontend by using @Stewie3112 post above. See the manual with the full description in my post below.

Great to see that you managed to get it working without token, anyway after various months and reboots it never changed (the safety of this alarm web control is ridiculous).
I just have to manually force reboot the smartlan g every 40-50 days because it just stops answering to curl calls, rubbish hardware…

Yes I agree. I reset the SmartLAN-G every night by interrupting the LAN card’s power supply for a few seconds. Since INIM is now fully integrated into my Home Assistant, the automation to achieve this is a breeze.

INIM API documented
@fmmsfz, @flamegrilled, @Sam_Van_Herzele, @asp, @iShortOne, @Denny_d, @lupick, @caimale, @Freggel

I have followed up on @Stewie3112 's work and have fully documented INIM’s API.
It includes setting arming scenarios, a sensor for the current scenario, switching and sensing outputs such as siren, blinking and flashing lights and other relay outputs, sensing individual partitions and zones and doing relevant switching commands on these. And lastly it includes downloading and showing an alarm history report in the frontend with a popup window with the number of lines set by slider.
I have described the way I have done the integration with Home Assistant. It is done through Home Assistant restful commands for the command part. I use NodeRed for the sensors which is great if a proper integration is not available.

But this is maybe only for the INIM diehards. Perhaps somebody with the right skills can make this into a proper integration?

I have documented my findings in the attached manual.

A snapshot of my alarm page follows below:

So far the functionality works like a charm. Much better than the INIM app. And I have taken advantage of the integration in HA by programming a few automations which are hard to do in the INIM system.

Drop me a line if you need any help.

4 Likes

that’s an impressive amount of work XD

just one question, how do you reset that crap lan card daily? have you found an api command or you just disconnect power through a relay?

There is no API command to reset the LAN card. I use a relay connected to one of the INIM outputs, defined that output as relay and then switch that output through the API

Thanks, as I guessed

Hi read your message only now.
I have a SmarltanSi without web server so I can connect to it oly by android app through port 5004 .
I tried to run the command to this port, but I don-t know where is my fault I have no response from the alarm. Maybe a wrong way to post api request (never did it before)
Or maybe I am missing the access token and qindex?
I will try to sniff the packet through android and we’ll see

Anyway GREAT WORK and thank you to both you and Stewie3112

Thank you for your reply I forgot to check this thread and I come here after many months because now I have time for this project.

I installed android studio loaded alienmobile application and configured my local address for smartlan.si
The app works and I can connect to the central but is seems to me that the app doesn’t send requests with HTTP protocol because I can’t find any HTTP packet only TCP. Maybe is due to the missing web server. Any idea?

Maybe I 'll have to switch to smartlan G

Hi, the SI card does not have a local webserver. The port you use is for programming the system, could be TCP. Your installer should give you the installer code. Or ask him to create a second installer user with different installer code of your choice.
I am not familiar with the android App. I use iPhone, but never tried Wireshark on that. The local webserver access is unencrypted and much easier.

Thank you for answering me , my installer is available for giving me access to the central but maybe will be wiser change the smart lan module to the G version.
I think the 150 euro worthwhile the much simpler approach I’ll have following your steps.

hello, great guide!
I was able to enter the commands for activating the scenarios, I cannot read the status of the active scenario and the sensors.
could you give me some more tips?
thank you

The status of the active scenario can be obtained by setting “mod” to “sce” and “par” to “now”. The response you get is a json file with the following info:

{
    "lb": "Alles uit       ", "id": "2"
}

You can find out which scenario is set by matching the “lb” to your defined scenarios like "Alles uit. ". Please ensure you include all the trailing spaces, because these are needed for a proper match. Alternatively, if you know the scenario id’s you can match the “id” to your respective scenario numbers.

I have implemented this in NodeRed, but can be done with a Restful sensor straight from HA. My NodeRed code is included in the documentation. I used NodeRed because I find it easier to navigate to the proper data in the data calls.

This example is in the doc. Also the way to read the other sensors is in the doc.

could you post a configuration example using Restful sensor? it returns me error.
thank you very much

The docs say create a restful sensor as follows:

# Example configuration.yaml entry
sensor:
  - platform: rest
    resource: http://IP_ADDRESS/ENDPOINT
    method: POST

for the resource you would take:

http://192.168.1.92:5050/cgi-bin/web.cgi?mod=sce&par=now&user=youruser&pass=yourpass&code=yourcode

Please try it in the “Postman” application. It is much easier to debug your statement than in HA.
The reply would be a json file with the following structure:

{
    "lb": "Alles uit       ",
    "id": "2"
}

You would need to get the sensor data from this json file. I am not the right person to ask how to do this. I think it is cumbersome and much easier in NodeRed. But there are plenty of examples around how to get data from a json file, using templating.

great, works perfectly!
now I also try with zones and areas
thank you very much

Hello everyone! As some of you mentioned the SI card does not have a local webserver, and that’s my case unfortunately. I started integrating everything yesterday using http requests to the APIs of inimcloud.com. I noticed that once you set a valid session cookie it stays valid for a really long period. The only problem I’m having is to force the server to update the doors and windows sensors’ states. What happens is that if I open a window its state only update in the http responses when I connect with my smartphone using the app Inim Home. I guess there’s some way to force this update as the app does. If anyone wants to give it a try and help me you are welcome!