So for the remote arm/disarm, my first question is, how do you access your OH remotely? myOpenHab? MQTT? My assistance to help you configuring your arm/disarm remotely will depend on your answer.
Also, enable this on your AD config:
send_commands_and_compromise_security = true
Do not set to TRUE if you’re OH is insecure.
How do you want to arm/disarm, by sending your PIN, or through a remote keyfob? I have done both. Initially, I was sending the PIN (hardcoded) in a item/rule to AD. This is ‘ok’ in a sense, as long as NO one else has access to your OH configuration files since your PIN will be there.
What I did is I purchased a keyfob from amazon (here). With an ESP8266, I simply trigger the keyfob buttons. The keyfob will then securely send the arm/disarm/panic commands to Vista20P as if you actually physically pressed the keyfob buttons.
If you want to arm/disarm through code, add an item like this:
Number alarmPanelCommandMacroAway "" (gAlarmPanel) {alarmdecoder="SEND#1=POUND2", autoupdate="false"}
Number alarmPanelCommandMacroStay "" (gAlarmPanel) {alarmdecoder="SEND#1=POUND3", autoupdate="false"}
Number alarmPanelCommandMacroOff "" (gAlarmPanel) {alarmdecoder="SEND#1=<YOURPIN>1", autoupdate="false"}
Explanation:
For Vista panels, Arm Away is by doing this on a keypad: # 2
Arm Stay is # 3
So what the items will do is, you are basically mapping the input to a keystroke.
Example:
Number alarmPanelCommandMacroStay "" (gAlarmPanel) {alarmdecoder="SEND#1=POUND3", autoupdate="false"}
Notice SEND#1=POUND3
Which maps 1 to #3
so if you want to ARM Stay your alarm, in your code, just do:
alarmPanelCommandMacroStay.sendCommand(1)
Disarming example:
Example, your PIN code is 6789. For Vista20P, you disarm the system by PIN then 1 like this: 67891
So to disarm your system, create a new item or just keep adding mapping:
Number alarmPanelCommands "" (gAlarmPanel) {alarmdecoder="SEND#1=POUND3,2=POUND2,3=67891", autoupdate="false"}
As you can see above, I have defined 3 Numbers mapped differently.
So, they will:
alarmPanelCommands.sendCommand(1) // will send #3 .. arm stay
alarmPanelCommands.sendCommand(2) // will send #2 .. arm away
alarmPanelCommands.sendCommand(3) // will send 67891 .. disarm
I also forgot in the previous post… I wrote an example use case for LRR:
https://docs.openhab.org/addons/bindings/alarmdecoder1/readme.html#example-lrr-usage