I’ve looked all around but cannot find any information regarding sending a command string from an openhab rule to the DSC Binding. I have looked through the items file as well as the binding itself on github, but cannot figure out how to pass a string command.
For instance, if I wanted to activate the PGM1 output on the board, I can press *71 on the keypad to fire the output. *4 turns on/off the chime feature, etc.
It seems like this could open up a lot of additional functionality.
I know the Vera plugin allows this as I did find information in their forums, however I would prefer to keep the panel controlled by openhab. Thus functionality should be possible when using the envisalink device.
I’d appreciate any guidance as I may be missing something obvious.
Currently this is not an available feature of the DSC Alarm binding. It would require additions to the binding in order to process the command, as the Envisalink utilizes a proprietary protocol to communicate with the DSC Alarm system. It would be great if there was a method to input the text command through the web interface, but that isn’t available at this point as far as I know. This is why it was never implemented, but I never thought about using rules to provide the input. I can look into what it will take to add this feature.
Thanks for the quick response Russell! It would be great if this functionality could be achieved.
I connected a relay to the PGM1 output to open/close a garage door and can operate it with the keypad. I made a “VIRTUAL” switch item that is monitored in a rule and thought that would be one way to pass the command.
The web interface page for the envisalink does allow the PGM button to be pressed but not a field for any command string.
I know that in the vera forums here they have some of this done, not sure if it would help on the envisalink command end or not.
Thanks for anything you might be able to offer. Much appreciation to all those who are able to enhance openhab in so many ways!
In the MiOS DSC Plugin, I exposed this as a UPnP Command (SendCommand) that allowed the users to send any byte sequence to the underlying interface module (EVL or IT-100)
There are differences in the way the IT-100 does this from the EVL, so keeping the hook generic let folks handle the quirks of the IT-100 mechanism for doing this.
For the EVL, you can send these using the
071 Command, followed by the string of key presses you want to send. For the IT-100, you have to send key-sequences char-by-char. The most common usage was to tweak the Panel’s PGMs.
For openHAB, the equivalent representation would be to expose it as a DSC Action Binding, so people can hook it into rules (etc).
The complete set of commands directly supported in the Vera/MiOS Plugin were/are:
SendCommand (description above)
and then a common-core, shared by all MiOS Alarm Plugs:
These were part of a standardization effort we embarked on for Vera/MiOS to ensure commonality across all Alarm plugin (Binding) implementations. You perform both Arming and Disarming via the set, and some require a PIN Parameter (so it doesn’t have to be hard-coded into the config)
Good to hear from you again, as always I appreciate your feedback. My first thought is to set up a separate string item type in the binding, which would receive the actual key presses from the sendCommand() in a rule, and then process it via the
071 command from the binding. It never crossed my mind to implement an Action Binding as you are suggesting. Sounds interesting. Not sure how they work but will look at some of the current ones to get an idea. Do they interface with the main binding or is it completely separate? Thanks.
Like anything, there’s a quick way, and a clean way, to get the Action Binding operational.
The quick way is to expose a method from your existing Binding, (aka the raw SendCommand equiv) and have the [new] DSC Action Binding invoke it when needed. This keeps your DSC Action Binding impl very thin, but there’s a little bit of initial dev on the main DSC Binding codebase to expose the required method via OSGi. You probably have this method internally somewhere, so you’d just adapt it, and declare it to have it exposed.
The clean way involves extracting the guts of the DSC Binding into another [eg.
org.openhab.io.*] Bundle that’s API-like in nature, and then writing two front-ends (the DSC Binding, and the DSC Action Binding) against it. It’s a more purist implementation, but this style requires a min of 2 JAR files to be deployed to get anything going (so it’s a little more work for the user)
For the MiOS Binding / MiOS Action Binding, I didn’t see any need to “API-ized” the innards, so I used the first style. It was fairly simple to do, and just required exposing a core call from the MiOS Binding that I use to send stuff to MiOS.
I’ve been looking at some of the existing actions and will definitely take the quick way. I’m with you I don’t think it is going to be necessary to split the code up into separate plug-ins to get this done. I appreciate your explanation, it helps to clear up some of the differences I’m seeing in the existing actions. Thank you.
I’m sorry I didn’t reply sooner but just wanted to say thank you to you both. You guys are great examples of what is making the openhab community so successful and I appreciate having guys like you to glean experience from.
Now that I’ve covered this topic, I’ve noticed I’m having another issue which I will start a separate thread on. I’m basically noticing messages in the log and debug where the binding is connecting and disconnecting repeatedly. I’ve looked all over for config errors but haven’t found anything yet.
This sounds like something I’d use too. I’m a on-call Firefighter and considering using a Rule that I can fire from a single button press for when my pager goes off (turn on lights, open garage door etc.) so I can get out of the house quickly. One of the nice-to-have items would be to disable the alarm chime for a couple of minutes if the call is at night to minimize disturbing the other people in the house.
agreed,disabling the chime with *4 would be convenient at certain times as well among other features. Hopeful this will be a relatively easy addition.
FYI, I have submitted a PR for this capability. Basically, it is a new action bundle that allows the sending of DSC Alarm commands from a rule. Hope this helps.
That’s great news! I would assume the new action bundle requires a newer main binding. I will look for it on the latest builds here
Hello Adam, Here are a couple of links you can use to download the .jar files:
DSC Alarm Action
DSC Alarm Binding
Let me know how it works. Thanks.
Thanks, is there a particular item to use in the rule?
I’m assuming it would be something like
dscSendCommand(item name, ###)
This particular command does not need an item to function. I modified the README.md file in the Examples section that may help. Also, here is one of the examples:
Add an item to your items file such as a switch:
Switch PollCommand "Send a poll command to the DSC Alarm System"
The following rule will trigger whenever the switch is turned ON:
Item PollCommand received command ON
Hope this helps.
Definitely, thank you. I must have missed the mod to the readme file, sorry. Can’t wait to test.
EDIT: Ok, I have tried to fire the program 1 output unsuccessfully.
rule “garage door activated”
Item GARAGE_TRIGGER changed
I had also tried the “071” with * 71 and 071, ie. sendDSCAlarmCommand(“071”,"*71"), (the forum seems to be removing the * inside quotations " " and other places sometimes), hoping it would replicate keypad entry but it seems to look for the partition number first. Hoping for a way to enter the user functions such as *4 which toggles chime, etc.
Going to keep trying as I may be missing something.
The “071” command requires a partition number so the data would look something like “171". Not sure if you need a hash tag symbol on the end, but if you do it would look like this, "171#”. The action command would look like this:
Thanks for the suggestion. I tried a few combinations including the partition number after the * but not before. Will try when I get back home and update.
Plugged in sendDSCAlarmCommand(“071”, “1*71”) just now…
WORKS A CHARM! no hash tag needed.
Excellent work Russell! Can’t thank you enough for the added functionality and development in this binding. Much appreciated.
You’re welcome. I’m glad it is working. I appreciate you testing it Adam.