Elk M1 Home Security/Automation Plugin

Xlobby plugin development

Postby loch on Tue Aug 29, 2006 11:52 pm

Currently the plugin does not have images associated with light on/off. That is something I can add very easily though. I am a little busy right now, but should be able to get to it within a day or two.

My configuration does not have much lighting, so I was not able to test out all the different lighting commands and status. Let me know if you run into any problems.

On your question about key presses, the API with the elk involves sending the whole password at once. In order to implement what you are asking for would be a little difficult. I think it would be easier, especially for me, if you were to try and use xlobby variables.
loch
 
Posts: 16
Joined: Fri Dec 23, 2005 1:23 pm

Postby loch on Fri Sep 01, 2006 12:14 pm

I have added plc status images to the plugin.

The plc status reported from the elk can be off, on or a brightness level. Currently I am returning an image for off and the same image if the plc is on or set to any brightness level.

To get the status image use text something like the following:
plugin>elkm1>plcStatusImg>A>1

The image used is in the plugins/xelk/images directory. I just included my generic LED indicatior light for on/off. I am guessing you will want to replace these images with something more appropriate.

The updated plugin can be downloaded here:
http://www.xlobby.com/files/loch/files/xelk.plcImg.zip

Andrew
loch
 
Posts: 16
Joined: Fri Dec 23, 2005 1:23 pm

Postby mike-r on Sat Sep 02, 2006 8:06 pm

I installed the plugin and the virtual serial port software to connect to the Elk M1XEP as described by smarty. I can get things like status fine, but if I try an event, like arm away, nothing happens? I assume it is something I am doing wrong, but I can't think of anything else to try.

One more thing... smarty said"With HWVSP running (COM9), get back into Elk RP and configure a direction connection in for COM9 (the port you just made virtually). Configure the plugin to COM9 and your done. " But really you can't have both ElkRP and the plugin connect over the comm port at the same time can you? I assume he meant go into ElkRP and connect over the comm port to make sure it is working, then exit ElkRP and connect with the plug-in.

Mike
mike-r
 
Posts: 2
Joined: Sat Sep 02, 2006 7:47 pm

Postby smarty on Mon Sep 04, 2006 6:28 pm

If you can get "things like status", you are connected (super...the hard part is over!!!)

To arm and dis-arm via button presses, you will have to set up events. These events will then be assigned to button presses in the xlobby screen editor (pause/break key).

From with F2 set-up, go to events section. From there, I created a folder called "Elk". Within this folder I then created all the commands that the plugin is capable of (see the Elk plugin documentation document).

For example (armstay command):
-Create "arm area #1 (stay)". This is to be a command within the Elk folder you just created.
-under plugin, select "elkm1" (using drop down menu).
-under command, select "armstay" (using drop down menu).
-under varaiables enter "1 3456", recall that "1" is the area, and "3456" is the password for that area. Seperate them by one space.

Now, assign this to a button press and it should arm area 1.

Hope this helps.

Smarty



Something like:
smarty
 
Posts: 179
Joined: Thu Jul 27, 2006 12:04 am
Location: San Antonio, TX USA

Zone Status Images

Postby smarty on Sun Sep 10, 2006 1:20 am

Andrew,
Is it possible to somehow configure different images for each zone, and then the proper status for each image?

Here is the idea.... I would like to assign an image of zone #1 to say "bedroom". I would have 4 different "bedroom.png" files (violated, bypass, normal and trouble).

With this, I would then be able to lay out a house floor plan and graphically see the status of each room/image.

Somehow the plugin wold have to let the user would assign images to zones (and then be able to properly determine status of that zone). Is this something that could be incorporated into your plug-in?

Steve
smarty
 
Posts: 179
Joined: Thu Jul 27, 2006 12:04 am
Location: San Antonio, TX USA

Postby loch on Mon Sep 11, 2006 12:08 pm

I think there are a couple of solutions to what you want.

1. The plugin could look for a zone specific image in the plugins/xelk/images directory, and if present return it, otherwise return the default. So for example when you asked for:
plugin>elkm1>zoneStatusImg>2
The plugin would see if there was an image file named zone2Normal.png and if so return it, otherwise return zoneNormal.png.

2. I could look into the plugin generating some kind of message/event to xlobby. This could be an OS sendmsg command which you would need to write a trigger for, the plugin updating a variable, or the plugin directly calling an existing event. I am not sure which of these are possible or best so would take a little research.

I think 1 would be the easiest solution, but 2 may be more flexible.

Which do you prefer?
Andrew
loch
 
Posts: 16
Joined: Fri Dec 23, 2005 1:23 pm

Postby smarty on Mon Sep 11, 2006 1:38 pm

I think option #1 sticks to the main intent of the plugin most closely. It would provide a default option, AND the ability to customize if a person decided they wanted to apply a bit more effort.

I vote for option #1.
smarty
 
Posts: 179
Joined: Thu Jul 27, 2006 12:04 am
Location: San Antonio, TX USA

Postby loch on Mon Sep 11, 2006 5:02 pm

Ok, I will work on implementing the first option. I will also add the ability to return different images for outputs and lighting.

I need to fix a bug foolio found where lighting status is incorrect if you turn a light on/off from outside the plugin.

In addition I will add support to read/write custom values.

All this may take me up to a week to get to.

I will post the update when I am done.

Andrew
loch
 
Posts: 16
Joined: Fri Dec 23, 2005 1:23 pm

Postby smarty on Mon Sep 18, 2006 1:28 pm

.......how's it looking......... :?
smarty
 
Posts: 179
Joined: Thu Jul 27, 2006 12:04 am
Location: San Antonio, TX USA

Postby loch on Mon Sep 18, 2006 9:37 pm

Sorry, work is really busy for me right now and I have not had a chance to work on this much.

I have the different image support in and the fix for PLC status. I am in the middle of adding support for setting/getting custom values. After that then I need to test it out.

Hopefully in the next few days I should have something for you.

Andrew
loch
 
Posts: 16
Joined: Fri Dec 23, 2005 1:23 pm

Postby loch on Fri Sep 22, 2006 1:14 pm

Ok, I have made all the changes and done a little testing with it. The plugin appears to be working properly.

I updated the first post of this thread to point to the latest plugin zip file.

Here is what is in this version.

1. Fixed PLC status on startup and if a light is turned on/off through some other means then the plugin.

2. Added support for individual zone, output and PLC images.

3. Added support for getting and setting custom values.


The individual images are based off of the index you are trying to receive.
Place the individual images into the xlobby/plugins/xelk/images directory.

For example let’s say you have a special image for zone 5. When plugin>elkm1>zoneStatusImg>5 is requested the plugin first looks for the file zone5Normal.png, zone5Violated.png, zone5Trouble.png or zone5Bypass.png. If it does not exist then it returns zoneNormal.png, zoneViolated.png, zoneTrouble.png or zoneBypass.png.

For outputs you would have an image outputXOn.png and outputXOff.png. Replace the X with the output number. For PLC the image would be plcXYOn.png and plcXYOff.png. Replace XY with the code and unit code. For example plcA2On.png and plcA2Off.png.

A custom value can be retried with plugin>elkm1>customValue>”x”. All time of day formats are returned in 24 hour format.

To set a custom value use:
customValue – Set the customValue to a new setting. Two variables, “customValueNumber” “newValue”. If the custom value which is being set is a time of day value then the time entered must be in 24 hour format, that is “16:00” for 4:00 PM. So to set custom value 10 to 10:30 PM you would have
customValue 10 22:30


If you have any problems let me know.
Andrew
loch
 
Posts: 16
Joined: Fri Dec 23, 2005 1:23 pm

Postby smarty on Fri Sep 22, 2006 5:12 pm

Thanks!! Testing this weekend.
smarty
 
Posts: 179
Joined: Thu Jul 27, 2006 12:04 am
Location: San Antonio, TX USA

Postby foolio on Mon Sep 25, 2006 5:14 pm

The updated plugin is great. The lights update correctly now. I haven't had a chance to test out custom variables.

thanks again for your time and effort.
foolio
 
Posts: 21
Joined: Mon Aug 28, 2006 8:02 pm

Postby dbinaz on Sun Dec 03, 2006 6:22 am

Where/how did you create your floor plan?
dbinaz
 
Posts: 1
Joined: Sun Dec 03, 2006 6:21 am

Postby smarty on Sun Dec 03, 2006 4:42 pm

My floor plan was created by scanning my blue-prints (JPG) and using photoshop to clean them up (new house construction). See this link (this is how I did it - tedious) http://www.xlobby.com/forum/viewtopic.php?t=4721&highlight=photoshop

There was a couple of key points to this.
1) Resize the overall floor plan to fit the Xlobby screen optimally, mine was near 800 X 600.

2) When making the individual "room" buttons, the area of the button is still the size above (800 x 600), but the only visible area is the room. So, the room is just an overlay of the whole floorplan (only the room area is opaque, the rest is transparaent). The "layers" functionality in Photoshop helps you with this.

3) You then need to make different colored copies of each room and name them accordingly for Xlobby to show zone status changes.

Hope this helps.


Loch,
Any chance you could/would update your plugin for say upto 3-5 Tstats? I believe the plugin supports only 1 right now.
smarty
 
Posts: 179
Joined: Thu Jul 27, 2006 12:04 am
Location: San Antonio, TX USA

PreviousNext