Jablatron Alarm System Integration support

Hi all,

I’m wondering if it would be possible to support integration for the Jablatron Alarm system.
https://www.jablotron.com/en/

I don’t know if there is an API, but I did find an URL integration project, which might help :

Link

This uses the self service portal of the account to remotely arm/disarm or check the alarm status.

If anyone would pick this up, I would be glad to support in helping/testing.

Thanks for the help !

Tom

Hi @rattatosk
Great thinking, thanks for the link. Also looking myself for a plugin for HA.
Afaik there’s no API available. But there are multiple ways getting the data:

Did some testing and it seems like the way you could access the Jablotron Web Service is still the same. I’ve attached some python code to try it yourself. Although you could extend this with more functionality like arming and disarming it, the question is how you would keep track of the latest state of the system. The system is not triggering a script, so you should make a loop with a specific request interval retreiving new data every nth second. I’m not sure if Jablotron has a specific rate limit.

Code:

import json
import requests, pickle

username   = "[email protected]"
password   = "yourpassword"
cookiefile = "jabcookie"

class jablotron():

    def _save_cookies(requests_cookiejar, filename):
        with open(filename, 'wb') as f:
            pickle.dump(requests_cookiejar, f)

    def _load_cookies(filename):
        with open(filename, 'rb') as f:
            return pickle.load(f)

    url1 = 'https://www.jablonet.net/ajax/login.php'
    payload1 = {'login':  username,
              'heslo': password,
              'aStatus': '200',
              'loginType': 'Login'}
    data1 = requests.post(url1, data=payload1)
    _save_cookies(data1.cookies, cookiefile)

    json = json.loads(data1.text)
    reload = json['reload']
    status = json['status']
    
    if status == 200:
        service_id = reload.split('?service=')[1]
        
        url2 = 'https://www.jablonet.net/app/ja100?service=' + service_id
        data2 = requests.get(url2, cookies=_load_cookies(cookiefile))


        url3 = 'https://www.jablonet.net/app/ja100/ajax/stav.php'
        data3 = requests.get(url3, cookies=_load_cookies(cookiefile))
        print(data3.text)
        
    else:
        print "No valid page, probably got redirected because of wrong password"

Hi @plaksnor
I know this is a fairly old topic, but I just tested the code, and it seems like nothing has changed in terms of the Web service.
I am mainly interested in the Log/History, which is found by replacing the URL3 with https://www.jablonet.net/app/ja100f/ajax/historie.php.

I haven’t worked a lot with Python and HA.
How do you run this code in HA, and where is the “answer” saved?

Thanks

Hi @Rasm6162
At the moment I’m not using these kind of HTTP request methods. I’m using the HA custom component for Jablotron 100+ alarm systems: GitHub - kukulich/home-assistant-jablotron100: Home Assistant custom component for JABLOTRON 100+ alarm system

If you want to run Python code in HA, there are several options. Just some examples:

  1. Novice: Use the Python Scripts integration as described here: Python Scripts - Home Assistant and here: Pyscript: Python Scripting for Home Assistant — hacs-pyscript 1.5.0 documentation
  2. Novice: Use the Command line integration as described here, which covers some Python examples:
    Command Line - Home Assistant
  3. Advanced: Create your own HA integration as described here: Creating your first integration | Home Assistant Developer Docs

And regarding where the “answer” (I guess you mean response) is saved: the way the response will be stored depends on the method you choose.
For example, the results of your script or command-line in method 1 or 2 is the state of your sensor. If you choose for a more advanced approach (3rd option), you need to define/initialize them yourself. This can be quite a challenge if you haven’t worked a lot with Python and HA.

1 Like