Using Serial interface for communication with alarm


I am trying to communicate between OH (on RPi) with Alarm Jablotron 100 through Serial interface.

I have basic configuration like this:
String alarmMessage {serial="/dev/ttyUSB2000@9600"}

Switch alarmSekcePlastDomu “Zajištění / odjištění pláště domu” //{serial="/dev/ttyUSB2000@9600,ON(SET 2\n),OFF(UNSET 2\n)"}
Switch alarmSekceVnitrekDomu “Zajištění / odjištění vnitřku domu” //{serial="/dev/ttyUSB2000@9600,ON(SET 1\n),OFF(UNSET 1\n)"}

My problem is that

  • when I switch ON e.g. alarmSekcePlastDomu it blinks (in HabPanel) to ON for a short while (1 sec) and then usually goes OFF again (but alarm is in ON state).

The reason I see is here (part of Serial spec): the item will update its state to ON or OFF whenever data becomes available on the serial interface

Communication between OH a Alarm is like this:
OH: SET 2\n

So what I probably need is some kind of mapping the alarm response “STATE 2 ARMED” to ON state of the switch and also “STATE 2 READY” to OFF state (similar for the second Switch).

Please can anyone help me how to do it?


Maybe someting for you Jablotron Alarm Binding for OpenHAB 2.x


thanks I saw this one, but it is (nowadays) for the older version.

I have moved a bit:
Switch alarmSekcePlastDomu “Zajištění / odjištění pláště domu” {serial="/dev/ttyUSB2000@9600,REGEX(s/STATE 2 READY/OFF/),REGEX(s/STATE 2 ARMED/ON/),ON(SET 2\n),OFF(UNSET 2\n)"}

this almost works - alarm is in correct state and U (Habpanel) still blinks from ON to OFF, but when a hit Refresh, HABPanel shows correct state…


and there is one more reason not to use it (for me) - the bindings communicates with cloud which communicates with alarm. I have direct communication line between OH and alarm (485 module in alarm), which gives me more info.