Hello,
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
ALARM:EXIT 2 ON
STATE 2 ARMED
OK
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?
Thanks,
Jirka