Jablotron Alarm Binding for OpenHAB

Hi,

I have prepared a new binding for the Jablotron Alarms.
Currently only JA-80 Oasis is supported, JA-100 is under development, but basic functions should be working.

The latest development version (2.5.11-SNAPSHOT) using the official API is here
https://www.dropbox.com/s/2aw2c4xbfv0plni/org.openhab.binding.jablotron-2.5.11-SNAPSHOT.jar?dl=1

Changelog:
11.11.2020
Fixed bug in updating JA100’s PGx sections

13.9.2020
Added support for the JA100 thermostat
Changes related to code review - binding has been merged to master!

22.4.2020
Improved detection of JA100 alarms

1.3.2020
Improved the binding stability

9.2.2020
The first version using the official Jablotron 1.6 API (work in progress)

24.6.2019
Migrated to the new bnd build system
JA-100 Added detection of alarm troubles

26.2.2019
JA-100 improvements for controlling sections

14.2.2019
JA-100 fixed bug in case you have only one section

10.2.2019
Improved the performance of sending commands (JA100, JA80)

3.2.2019
Added option for setting binding language (bridge config)

29.1.2019
Fixed logging severity for JA100
Added automatic setting to EN language

28.1.2019
Reintroduced the event channels for JA100

27.1.2019
Thing configuration simplification
code cleanup
JA100 improvements and fixes

20.12.2018
Bumped to the 2.5.0-SNAPSHOT version
Added support for the JA-100 temperature sensors
LastCheckTime channel added for JA100 alarms
Sections and PGMs channels are dynamic for JA100 (exactly according to your setup)

28.9.2018
Added enconding of login parameters (fixes bridge initialization for users with special characters in password)

4.6.2018
Bumped to the next version 2.4.0-SNAPSHOT
Fixed URL for JA100 section control

the documentation is here:

and the source code is here:

2 Likes

So to make this binding working:

  1. download the latest version from
    https://www.dropbox.com/s/eljzcirbsaiqy4n/org.openhab.binding.jablotron-2.5.9-SNAPSHOT.jar?dl=1
  2. copy the jar to addons directory
  3. in OpenHAB Paper UI manually add a new thing Jablotron bridge provided by this binding
  4. configure the bridge so it can log to Jablonet cloud (email/password) and discover alarms

Useful icons are downloadable from here:
https://www.dropbox.com/s/zmp7vviqf1cl2ve/jablotron.zip?dl=1
alarm alarm-armed alarm-disarmed alarm-partial jablotron

This is an example, how it might look like (JA80 Oasis)

Hello,

I’ve been testing your binding with a JA-100 system but still get the following errors.

2018-05-06 20:17:41.695 [ERROR] [lotron.handler.JablotronJa100Handler] - Error during alarm status update
java.lang.IllegalStateException: Not a JSON Object: [{“stav”:0,“nazev”:“uvwxy”,“stateName”:“PGM_1”,“ts”:1525611252,“time”:“dnes - 14:54”,“active”:1}]
at com.google.gson.JsonElement.getAsJsonObject(JsonElement.java:90) ~[?:?]
at org.openhab.binding.jablotron.model.ja100.Ja100StatusResponse.getPgmStatus(Ja100StatusResponse.java:153) ~[?:?]
at org.openhab.binding.jablotron.handler.JablotronJa100Handler.readAlarmStatus(JablotronJa100Handler.java:234) ~[?:?]
at org.openhab.binding.jablotron.handler.JablotronJa100Handler.updateAlarmStatus(JablotronJa100Handler.java:501) ~[?:?]
at org.openhab.binding.jablotron.handler.JablotronAlarmHandler.lambda$1(JablotronAlarmHandler.java:204) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]

and

2018-05-06 20:17:45.509 [ERROR] [lotron.handler.JablotronAlarmHandler] - Cannot get Jablotron login cookie
java.lang.NullPointerException: null
at org.openhab.binding.jablotron.handler.JablotronAlarmHandler.login(JablotronAlarmHandler.java:141) ~[?:?]
at org.openhab.binding.jablotron.handler.JablotronAlarmHandler.relogin(JablotronAlarmHandler.java:105) ~[?:?]
at org.openhab.binding.jablotron.handler.JablotronJa100Handler.updateAlarmStatus(JablotronJa100Handler.java:450) ~[?:?]
at org.openhab.binding.jablotron.handler.JablotronAlarmHandler.lambda$1(JablotronAlarmHandler.java:204) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]

Hello!

How can I use the binding? You can not install it officially !?

Stefan

hello,
please redownload the latest snapshot.
https://www.dropbox.com/s/ctuzuxnf8lz5a6s/org.openhab.binding.jablotron-2.3.0-SNAPSHOT.jar?dl=1

JA100 support still needs some testing, JA80 is stable but I do not have JA100 alarm so I would be happy if someone else could test it.

thanks.
Ondrej

Hello,

I tested your new binding, but still with the same result.
2018-05-16 21:52:26.025 [INFO ] [otron.handler.JablotronBridgeHandler] - Response: {…}
2018-05-16 21:52:26.032 [INFO ] [.discovery.JablotronDiscoveryService] - Detected a JA100 alarm with service id: xxxxxx
2018-05-16 21:52:26.065 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing ‘jablotron:ja100:xyz:xxxxxx’ to inbox.
2018-05-16 21:52:43.766 [INFO ] [lotron.handler.JablotronAlarmHandler] - Jablotron ja100 service: xxxxxx successfully initialized
2018-05-16 21:52:49.563 [INFO ] [lotron.handler.JablotronJa100Handler] - getStatus response:
The response is something like
getStatus response:
{“status”:200
,“termostaty”:[…]
,“elektromery”:[…]
,“sekce”:{… }
,“pgm”:[{“stav”:0,“nazev”:“xxxx”,“stateName”:“PGM_1”,“ts”:1526490517,“time”:“dnes - 19:08”,“active”:1}]
, moduly":{…}
, …
end

It seems to be the “pgm” line that generates the error…

2018-05-16 21:52:50.713 [ERROR] [lotron.handler.JablotronJa100Handler] - Error during alarm status update
java.lang.IllegalStateException: Not a JSON Object: [{“stav”:0,“nazev”:“xxxx”,“stateName”:“PGM_1”,“ts”:1526490517,“time”:“dnes - 19:08”,“active”:1}]
at com.google.gson.JsonElement.getAsJsonObject(JsonElement.java:90) ~[?:?]
at org.openhab.binding.jablotron.model.ja100.Ja100StatusResponse.getPgmStatus(Ja100StatusResponse.java:153) ~[?:?]
at org.openhab.binding.jablotron.handler.JablotronJa100Handler.readAlarmStatus(JablotronJa100Handler.java:239) ~[?:?]
at org.openhab.binding.jablotron.handler.JablotronJa100Handler.updateAlarmStatus(JablotronJa100Handler.java:519) ~[?:?]
at org.openhab.binding.jablotron.handler.JablotronAlarmHandler.lambda$1(JablotronAlarmHandler.java:251) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?]
at java.util.concurrent.FutureTask.runAndReset(Unknown Source) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
at java.lang.Thread.run(Unknown Source) [?:?]

Hi,

it seem’s that Jablotron API returns another response format when there’s multiple sections/pgms and different when there’s only one.
Please try this one and see if we can move further…
https://www.dropbox.com/s/ctuzuxnf8lz5a6s/org.openhab.binding.jablotron-2.3.0-SNAPSHOT.jar?dl=1
thanks.
Ondrej

Hello,

with this version it seems to be better!
No exceptions while doing the “getStatus response”.

Next step: I try to “switch” a pgm.
The next thing I see is that the “jablotron alarm” thing goes offline.
In the log I finally get a
[INFO ] [lotron.handler.JablotronAlarmHandler] - Control response:
In essence it says
-Stránka nenalezena: which translates to "Page not found’
-Zkontrolujte prosím zadanou adresu: which translates to: “Check the given address”

The following log lines say…
[lotron.handler.JablotronAlarmHandler] - sendUserCode exception
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:224) ~[?:?]
at com.google.gson.Gson.fromJson(Gson.java:887) ~[?:?]
at com.google.gson.Gson.fromJson(Gson.java:852) ~[?:?]
at com.google.gson.Gson.fromJson(Gson.java:801) ~[?:?]
at com.google.gson.Gson.fromJson(Gson.java:773) ~[?:?]
at org.openhab.binding.jablotron.handler.JablotronAlarmHandler.sendUserCode(JablotronAlarmHandler.java:128) ~[?:?]
at org.openhab.binding.jablotron.handler.JablotronJa100Handler.controlSection(JablotronJa100Handler.java:610) ~[?:?]
at org.openhab.binding.jablotron.handler.JablotronJa100Handler.lambda$0(JablotronJa100Handler.java:113) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:385) ~[?:?]
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:213) ~[?:?]
… 14 more
2018-05-25 21:20:47.029 [WARN ] [lotron.handler.JablotronJa100Handler] - null response/status received

Looking forward to a next iteration :-).

Hello! I own a Jablotron JA-100. Is it also possible to control this alarm system with Openhab?

Thanks for the answer.
best regards
Stefan

Hi @Stefan_Sa and @stex,

apparently the control of JA-100 is not working because I am unable to guess the right url address for control command. (unfortunatelly I own an OASIS alarm and the control is different so it returns a 404 error)
Could someone of you please:

  1. use Chrome to log in to Jablonet web (https://www.jablonet.net/) and click your JA-100 widget (one of them if you have more than one)
  2. press F12 on your keyboard
  3. try to control one of your sections and send me the URL and possible payload of the request
    (network tab of the debug window)

I need similar data as attached


to see the request URL and Form Data (you can use any invalid code or scramble it, the code itself is not required)

Thanks
Ondrej

Hi @Stefan_Sa and @stex ,

maybe I’ve found the correct url for JA100 section control. (thanks google :-))
Could you please this version?
https://www.dropbox.com/s/3os8ayycrnsett4/org.openhab.binding.jablotron-2.4.0-SNAPSHOT.jar?dl=1

Thanks.
Ondrej

Hello Ondrej,

looks like the latest version is still not completely right.
(Still gives the “Not Found” exception)
So I did what you asked and am able to give you the next printscreen.
If you need something else, please ask…

image

Hello,

thanks for testing and this screenshot. This is exactly I was waiting for.
I need more debug info about the URL the binding is trying to invoke. I am almost sure, I use the right url and I do not understand why are you getting “not found”

Please redownload this version
https://www.dropbox.com/s/3os8ayycrnsett4/org.openhab.binding.jablotron-2.4.0-SNAPSHOT.jar?dl=1
try to send usercode with OH2 and look inside the openhab.log for lines like: “Sending POST to url address” …

thanks
Ondrej

Hello,

Before I can test your new version, it seems I have to tackle another problem first…
I removed version 2.3.0 from my addons folder and added the new 2.4.0 version.

But when I start openhab I get following exception…Still looking for 2.3.0…
Please help me fix this.
Thank you.

2018-06-12 21:09:59.863 [ERROR] [org.openhab.binding.jablotron ] - FrameworkEvent ERROR - org.openhab.binding.jablotron
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.jablotron [206]
Another singleton bundle selected: osgi.identity; type=“osgi.bundle”; version:Version=“2.3.0.201805211932”; osgi.identity=“org.openhab.binding.jablotron”; singleton:=“true”

at org.eclipse.osgi.container.Module.start(Module.java:444) [?:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1620) [?:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1599) [?:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1571) [?:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1514) [?:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) [?:?]
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) [?:?]

2018-06-12 21:09:59.874 [ERROR] [org.openhab.binding.jablotron ] - FrameworkEvent ERROR - org.openhab.binding.jablotron
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.jablotron [207]
Another singleton bundle selected: osgi.identity; type=“osgi.bundle”; version:Version=“2.3.0.201805211932”; osgi.identity=“org.openhab.binding.jablotron”; singleton:=“true”

at org.eclipse.osgi.container.Module.start(Module.java:444) [?:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1620) [?:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1599) [?:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1571) [?:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1514) [?:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) [?:?]
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) [?:?]

Well,
I finally got it working after clearing all possible dirs.

After clicking the switch thats linked to the pgm, it works.
Unfortunately, after this action the switch becomes kind of disabled and is unable to be triggered again…

The log says this…

21:39:21.138 [INFO ] [lotron.handler.JablotronAlarmHandler] - Sending POST to url address: https://www.jablonet.net/app/ja100/ajax/ovladani2.php to control section: PGM_1
2018-06-22 21:39:27.589 [INFO ] [lotron.handler.JablotronAlarmHandler] - Control response: {“ts”:xxxx,“id”:“PGM_1”,“authorization”:200,“result”:1,“responseCode”:200}
21:39:27.589 [WARN ] [lotron.handler.JablotronJa100Handler] - null response/status received
21:40:22.235 [ERROR] [lotron.handler.JablotronAlarmHandler] - Cannot initialize Jablotron service: xyz
----> the jablotron alarm gets the offline state
21:40:22.235 [ERROR] [lotron.handler.JablotronAlarmHandler] - Got response code: 302
21:40:22.388 [INFO ] [lotron.handler.JablotronJa100Handler] - getStatus response:
21:40:32.064 [INFO ] [lotron.handler.JablotronAlarmHandler] - Jablotron ja100 service:xyz successfully initialized
------> the jablotron alarm is back online
------> the switch is in a disabled state…

I find another strange logline in the events.log
After the switch action you suddenly try to start an oasis service…
21:38:27.285 [ome.event.ItemCommandEvent] - Item ‘JablotronJA100Alarm_JA100PGM_1StatusChannel’ received command ON
21:38:27.290 [vent.ItemStateChangedEvent] - JablotronJA100Alarm_JA100PGM_1StatusChannel changed from NULL to ON
21:38:33.373 [vent.ItemStateChangedEvent] - JablotronJA100Alarm_JA100PGM_1StatusChannel changed from ON to OFF
21:38:35.781 [hingStatusInfoChangedEvent] - ‘jablotron:ja100:5c26acd3:338709’ changed from ONLINE to OFFLINE
21:39:00.424 [ome.event.ItemCommandEvent] - Item ‘JablotronJA100Alarm_JA100PGM_1StatusChannel’ received command ON
21:39:00.427 [vent.ItemStateChangedEvent] - JablotronJA100Alarm_JA100PGM_1StatusChannel changed from OFF to ON
21:39:10.674 [hingStatusInfoChangedEvent] - ‘jablotron:ja100:5c26acd3:338709’ changed from OFFLINE to ONLINE
21:39:21.138 [vent.ItemStateChangedEvent] - JablotronJA100Alarm_JA100PGM_1StatusChannel changed from ON to OFF
21:39:27.736 [hingStatusInfoChangedEvent] - ‘jablotron:ja100:5c26acd3:338709’ changed from ONLINE to OFFLINE
21:40:22.239 [hingStatusInfoChangedEvent] - ‘jablotron:ja100:5c26acd3:338709’ changed from OFFLINE to OFFLINE (CONFIGURATION_ERROR): Cannot initialize OASIS service
21:40:32.069 [hingStatusInfoChangedEvent] - ‘jablotron:ja100:5c26acd3:338709’ changed from OFFLINE (CONFIGURATION_ERROR): Cannot initialize OASIS service to ONLINE

Hi,

thanks for the logs again. I have identified the problem - the JA100 response is different from the OASIS one so I’ve updated the control response handling.
Please try this version and let me know if it helps.
https://www.dropbox.com/s/3os8ayycrnsett4/org.openhab.binding.jablotron-2.4.0-SNAPSHOT.jar?dl=1
Thanks.

Ondrej

Ahoj,
rád se přidám.

Hi

Did someone get this plugin working with the JA-100?
I am having a JA-100 and have installed the plugin, but it is saying UNINITIALIZED - BRIDGE_UNINITIALIZED, I think I have setup the correct URL :slight_smile:

I have a working plugin with JA-100 the url is https://www.jablonet.net/app/ja100?service=xxxxxxx
the xxxxxx must be replaced by your own id number.
You can find that by logging in with the jablotron web zelf service and look at the history url.

Hi,
if the bridge remains uninitialized I guess you might be using some special characters in your password???
Once you add a bridge which gets initialized it should autodetect your JA-100 and you do not have to edit the url by yourself.
Having the initialized bridge is crucial for your JA-100 to be working…
Thanks.
Ondrej