Jablatron Alarm System Integration support

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"