This page last changed on Mar 24, 2015 by drewscm.

I have a DSC security that I have working with OR, has anyone done a virtual keypad for entering the code? Would anyone be willing to share their code?

Thanks

Has nobody done a keypad, or been interested in one?

Posted by drewscm at Mar 27, 2015 02:21

Hi Scott - I am using the DSC functionality mostly for movement detectors that trigger lights - I rarely use my alarm for its real purpose. IMHO the standard OR interface does not lend itself to data entry. I have a wake up alarm function where you can set a time but the only way I was able to input hours/minutes was using a slider to select which is not ideal. I have not come across a solution for keypad entry in OR or I would have used that for the wakeup alarm.

What are you looking to achieve? There may be workarounds.

Posted by jules_bike at Mar 30, 2015 09:46

Looking to use the Keypad to input security code for the alarm. My plan is to have a tablet mounted in the wall near the back door, with Open Remote UI and keep the secuirty keypad in the closet as a backup. I have noticed their is much in the way of input.

Posted by drewscm at Mar 31, 2015 03:20

I can think of a two workarounds that might work both would mean having the security code hard coded into OR and then a separate layer of security which triggers OR.

1. Using drools you could probably find a way to checks the order that you press buttons on an OR panel with a virtual keypad and in memory commands. You could then have any type of code (alpha numeric etc) which then would trigger OR to send a set/unset command.

2. Similarly you could try an app like Tasker which runs on Android and could do something similar perhaps even linked to the tablet screen unlock (face recognition etc...). I've tested Tasker alongside OR and you can get it to trigger OR commands using http.

Posted by jules_bike at Apr 01, 2015 08:13

I've been thinking of using a html page with a input field where you can enter your pin code and then send it to controller. I have my alarm panel connected to my Vera and for testing purpose i tried to run a scene at first. I have been trying to so something like this. I added this as a webview. For now the works in the phone's browser but it does not work in openremote(i am not sure why pressing the button does nothing). Also it only works in while running the controller in Windows, it does not work on Synology(i don't know why again). Maybe someone can help....

<!DOCTYPE html>
<html>

<head>
<style>
  body {background-color:black}
  h3   {color:blue}
</style>
</head>

<body>
<h3>Pin code:</h3>
<input type="text" id="pin" value=""><br />
<button onclick="liteon()">Arm</button>
</body>


<script>
function liteon()
{
var param = document.getElementById('pin').value;
var xmlhttp;
  xmlhttp=new XMLHttpRequest();
xmlhttp.open("GET","http://veraip:3480/data_request?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum="+param,true);
xmlhttp.send();
}
</script>
</html>
Posted by ckbsmart at Apr 02, 2015 16:27

Hi yes I've tried doing something similar to enter a value through an embedded webform and it never worked. I think the webview functionality is really meant for display not input.

Posted by jules_bike at Apr 05, 2015 16:55

Jules

Do you use the DSC for any outputs? Is it possible to trigger the PGM's from the envisalink through openremote?

Posted by drewscm at Apr 10, 2015 15:09

I just use the zone_state function to tracked open and restored zones. I am not sure about PGM functions - Phil Taylor is the one to ask - did you look at the tutorial -

DSC tutorial

Posted by jules_bike at Apr 13, 2015 07:59

Yea I looked at the tutorial and there is not a command to trigger PGM's. I know if is possible through the envisalink because it can be done through the eyezon website when I connect to the envisalin. I will have to do some digging, I ordered an output expansion board by accident so I'd like to get some use out of it.

Im assuming you have seperate partitions setup in your system, one for alarm sensors and another for sensors ie occupancy, that you read but aren't part of your alarm?

Posted by drewscm at Apr 13, 2015 19:55

I set them all up in the same partition some are just for occupancy others are for both. You can do some clever things with the wireless door sensors - I have one which is on the loft door that turns on the loft light when the door is open.

Posted by jules_bike at Apr 13, 2015 20:25

Hi Jules,

I am using OR to turn on the lights in our bedroom every morning. However, sometimes it is nice to sleep in late so it would be good to be able to change the "alarm" setting within the OR App. As I understood from your post, you have been able to change time settings by using a slider... Can you explain how you did this?
As you said, this is not ideal, do you have other ways to implement this?
I am currently controlling my lights with rules in OR, which is connected to my KNX system.
Thanx

Posted by istian at Apr 14, 2015 22:46

Hi - yes I have a in memory virtual commands for alarm on/off and two others for minutes and hours which in turn have range sensors with 0 - 59 and 0 - 2 as min and max values. Finally in the designer you create sliders for both hours and minutes and a switch for alarm on/off.

Then in rules I have

rule "Alarm On"
when
Event(source=="GVALARMSTATUS", value=="on")
Event(source=="GVALARMHOURS_STATUS", $htime:value)
Event(source =="hour", value==$htime)
Event(source =="GVALARMMINUTES_STATUS", $mtime:value)
Event(source =="minute", value==$mtime)
eval(true)
then
execute.command("GVALARMMUSIC_ON");
end

also my rule header is as follows:
package org.openremote.controller.protocol
import org.openremote.controller.model.event.*;
global org.openremote.controller.statuscache.CommandFacade execute;
global org.openremote.controller.statuscache.SwitchFacade switches;
global org.openremote.controller.statuscache.LevelFacade levels;
import java.util.concurrent.TimeUnit;
import java.io.*;

Hope this makes sense!

Posted by jules_bike at Apr 15, 2015 16:39

I setup virtual commands for my keypad in order to disarm my alarm. Currently once I hit the correct keys the system disarms, but it doesn't matter what order I press them. so I have come up with a few questions hopefully someone can help me out with on rules. I would think this would be useful to others as well.

How do I setup the rule to read a certain sequence of keys?

Is there anyway to have it where once four keys are pressed, if they are not correct it triggers fault command and once three faults have been entered it triggers panic command?

What is the best way to clear the keys that have been turned on? I was thinking a few second timer.

rule "Security Keypad" when

Event( source == "Virkey1status", value == "on" )
Event( source == "Virkey2status", value == "on" )
Event( source == "Virkey3status", value == "on" )
Event( source == "Virkey4status", value == "on" )

then

execute.command( "Disarm" );

end

Posted by drewscm at May 15, 2015 17:49

I've created a simple design with a keypad - YouTube video. The design is on dropbox and you can import it directly into professional designer, or copy manually if you are using the free designer.

The rules are copied here:

package org.openremote.controller.protocol;

import org.openremote.controller.model.event.*;
global org.openremote.controller.statuscache.CommandFacade execute;

rule "Init"
then
  execute.command("VCODE","-");
  execute.command("VKEY","-");
end

rule "Key pressed"
timer(int: 300ms) // debounce
when
  $code:Event(source=="VCODE")
  Event($s:source matches "VKEY\\d+", value=="ON")
then
  execute.command($s, "off");
  if($code.getValue().toString().equals("-")){
    execute.command("VCODE", $s.substring(4,5));
  }else{
    execute.command("VCODE", $code.getValue().toString() + $s.substring(4,5));
  }
end

rule "Code clear"
timer(int: 5s) // clear code after 5 seconds
when
  Event(source=="VCODE", value!="-")
then
  execute.command("VKEY", "-");
  execute.command("VCODE", "-");
end

rule "Last key"
when
  Event($s:source matches "VKEY\\d", value=="ON")
then
  execute.command("VKEY", $s.substring(4,5));
end
Posted by aktur at May 17, 2015 20:26

Michal

I have the keypad working just like your video... Any tips on how to take it a step farther and limit the length to 4 numbers "1234", If VCODE equals Passcode then execute "DISARM" else register missed code, if 3 missed codes execute "TRIGGER_ALARM"

Thanks for you help!

Posted by drewscm at May 20, 2015 04:09

Well, this is getting more demanding. Mind to think about support from the com site? Anyway here it is - YouTube video. I've put this design on dropbox too.

Posted by aktur at May 20, 2015 16:12

THANK YOU WITH ALL MY HEART !

Posted by ckbsmart at May 20, 2015 21:29

In order to use the provided code and send it to VERA i thought of doing the following things:

-write a http command setAlarmOff

-<command id="5362" protocol="http">

<property name="workload" value="${param}"/>

<property name="method" value="POST"/>

<property name="url" value="http://myip:3480/data_request?id=lu_action&output_format=json&DeviceNum=XX&serviceId=urn:micasaverde-com:serviceId:AlarmPartition2&action=RequestArmMode&State=Disarmed&PINCode=${param}"/>

<property name="name" value="SetAlarmOff"/>
  • make a custom sensor SetAlarmOff Sensor
-<sensor id="246043" type="custom" name="SetAlarmOff Sensor">

<include ref="5362" type="command"/>

</sensor>

-add the following lines to the rules

rule "Disarm"
when
  Event(source=="VPASSCODE", $passcode: value)
  Event(source=="VCODE", value==$passcode)
  Event(source=="TRIGGER_ALARM", value=="off")
then
  int code = Integer.parseInt($passcode.toString());
  execute.command("SetAlarmOff Sensor", code) ;
  execute.command("DISARM", "ON");
  execute.command("VTRY", "0");
  execute.command("VCODE", "-");
end

Is this correct? Because it's not working for me...and it stopped the keypad from working

Thanks for eveything

Posted by ckbsmart at May 21, 2015 12:00

In the execute.command() you need to put the command name, which is "SetAlarmOff" in your case. Sensor names you put in "when" block within Event(). As I'm using sensor and command names the same, because I'm lazy, they can be confusing.

Posted by aktur at May 21, 2015 14:47

I am not sure my http POST command is correct. If i write

"http://myip:3480/data_request?id=lu_action&output_format=json&DeviceNum=XX&serviceId=urn:micasaverde-com:serviceId:AlarmPartition2&action=RequestArmMode&State=Disarmed&PINCode=xxxx"
in the browser it's working, but when i make the http post request with the workload $param i get nothing...i also tryed with http GET and the link
 http://myip:3480/data_request?id=lu_action&output_format=json&DeviceNum=XX&serviceId=urn:micasaverde-com:serviceId:AlarmPartition2&action=RequestArmMode&State=Disarmed&PINCode=${param}
.. no luck with that either

Posted by ckbsmart at May 21, 2015 19:16

1. Don't send command to sensor.
2. Don't send integer. Use string instead.

Look in log files what is going wrong.

Posted by aktur at May 21, 2015 20:17

With sending string it worked.

Thank you very much !

Posted by ckbsmart at May 21, 2015 20:45

I got the PGM integrated. I run wireshark and found how the GUI interacts with the device over the IP network.
The easiest way is creating a command:
Protocol HTTP
Method GET
URL: http://your Envisalink3 IP/2?A=1&P=2&p=1
username: your envisalink3 usename
password: your envisalink3 password
All other parameters are blank

The P=2 in the URL is equivalent to entering *72 in the keypad. If you want to trigger the PGM1 use P=1

Posted by hnicanor at Feb 24, 2016 06:12

Thanks for sharing the info I went away from that direction, gives another optionnow

Posted by drewscm at Feb 24, 2016 12:25
Document generated by Confluence on Jun 05, 2016 09:33