I’m trying to do a disarm with code. I have tried every combination I can think of and it won’t work. Format in the wiki is:
sendDSCAlarmCommand(String command, String data)
‘040’ Partition Disarm Control - With User Code 5-7 Characters - [Partition # (1-8)][User Code (4-6)] Envisalink, IT100
I have tried many variations similar to sendDSCAlarmCommand(“040”, “10000”) where 1 is partition and 0000 is the user code. I get some variation of the following:
2015-12-28 20:48:29.130 [ERROR] [dscalarm.internal.protocol.API] - sendCommand(): Partition number must be a single character string from 1 to 8, it was: 10000
2015-12-28 20:48:29.131 [ERROR] [dscalarm.internal.protocol.API] - sendCommand(): Command Not Sent - Invalid!
If I omit the 0000 it doesn’t error but obviously doesn’t disarm. Other variations including spaces or additional , “0000” yields no results. I’m obviously doing something wrong.
Additionally, in openHAB designer, sendDSCAlarmCommand cannot be resolved. I am able to use the command, however, to send pgm commands via 071 so I know the action jar is “working”.
The sendDSCAlarmCommand() is dependent on the internal API function sendCommand() which will not always produce the results you might expect. The ‘040’ command, as it is implemented in the internal command, uses the default user code or the user code that is provided in the openhab.cfg file. So, the actual command would be sendDSCAlarmCommand(“040”, “1”), where the second parameter is the partition number only. You might try using the
071 command to send the user code to disarm the system, maybe something like this: sendDSCAlarmCommand(“071”, “0000”). I assume this would work since all it takes at the keypad is the input of a user code to disarm the system. You may have to play around with it. Hope this helps.
Unfortunately I had already tried using 071. I’m not sure how I overlooked the usercode in the .cfg file. I added a user pin and I can now disarm with 040. I think I can get by with this one code for now at least.
It would be nice to be able to send additional codes. I used to do that with the vera dsc plugin.
A new issue pops up though. If you restart openHAB runtime, it disables the alarm. I’m not sure why but part of the openHAB startup process I guess. I haven’t done a trace yet but standard info logging shows nothing.
Not sure what you mean by “disables the alarm”, but when you restart the openHAB runtime the binding initializes and resets all the values to a default, and then issues a
001 command to get a status report from the DSC Alarm system. This is because the binding has no idea what the status of the system is on startup.
Poor choice of wording on my part. I meant disarm not disable.
If the alarm is armed (stay in my case currently), when openHAB starts, the alarm disarms.
Strange. I can try some testing on my system and see if I get the same results. Could be a bug in the binding. It maybe a while before I get back to you. Thanks for the info.
You might want to look at your rule that is intended to send the disarm - rules are often inadvertently fired at startup, when undefined values may crop up.
You may be right. I had a testing rule that may have triggered when persistence updated the value for the switch. I deleted that rule and it doesn’t appear to do it anymore.
I tested my system and didn’t get the same result, but I see the issue was with the rule firing at startup. Glad you were able to resolve it.