Elk M1 Home Security/Automation Plugin

Xlobby plugin development

Postby loch on Mon Dec 04, 2006 2:19 pm

It should be easy to update for more thermostats, I just won't be able to test it out since I only have one.

I should be able to get this done within a week. I will let you know when it is done.

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

Postby smarty on Mon Dec 04, 2006 2:52 pm

Andrew,
Thanks :D !

I would be more than happy to test it out. I have 3 Tstats presently hooked up to my Elk (with one in XLobby - but ready to set up the other two).

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

Postby loch on Wed Dec 13, 2006 2:11 pm

I am taking the opportunity to make a few other changes so this is taking a little longer then expected.

Hopefully have it done by Monday.
Andrew
loch
 
Posts: 16
Joined: Fri Dec 23, 2005 1:23 pm

Postby smarty on Thu Dec 14, 2006 2:36 am

No problem..... :)
smarty
 
Posts: 179
Joined: Thu Jul 27, 2006 12:04 am
Location: San Antonio, TX USA

Postby loch on Mon Dec 18, 2006 1:04 pm

I put an updated dll here:
http://www.xlobby.com/files/loch/files/xelk.1.2.zip
Unzip this file and place the .dll in the plugins\xelk directory.


New additions to the plugin

1. Support for multiple thermostats
2. Support for querying counter values.
3. Human readable logging
4. Outputs send windows messages which can be used for triggers in xlobby.


Multiple Thermostats:
The variables for thermostats already requires the thermostat instance being queried. Thermostat commands being sent now require a thermostat instance.


Counter values:
The ELK protocol does not allow viewing/modifying the counter values. Through the rules interface though the system can be configured to send a text string at a certain interval to the serial port. First you must configure a text string for each counter you want to monitor on the ElkRP. Go to the texts section of ElkRP and create a new text. Type in “counter 1 = “ then insert the counter variable through the selection box. Terminate the string with a Carriage Return/Line Feed. The resulting text should look something like:
counter 1 = % CTR1 %^M^J
Now go to the rules section in ElkRP and create a rule which sends a text string to the serial port at a selected interval. I choose every minute, but it probably does not need to be that often.
The Rule should look something like:
57 WHENEVER EVERY 1 MINUTE
THEN SEND THE FOLLOWING TEXT:
"counter 1 = % CTR1 %^M^J" THROUGH PORT 0

The counter value is retrieved by Xlobby with the following variable:
plugin>elkm1>counter>”x”


Human readable logging:
Added a new set of buttons to the plugin configuration to support logging events from the Elk in an easy to read format. To configure the logging pull up xlobby setup menu by using “F2”. Go to the Plugins setup section, select elkm1 and click on the Configure button. The Elk M1 Plugin configuration menu will now be displayed. Put a check mark next to what events are desired to be logged. The plugin supports logging changes to alarm status, zones, outputs, thermostats, temperatures, tasks, counters, custom values and lighting. Selecting the Elk Protocol button will also log the raw stream between the Elk M1 and the plugin. The log file will be in xlobby/plugins/xelk.


Windows SendMessage:
The plugin now sends windows messages to xlobby when an output changes state. This can be used to setup xlobby to trigger an event. I have been experimenting with this to set the state of toggle buttons.

The wparam for outputs is 10006. The lparam will be based on output number and state. The format will be xxy. Where xx will be the output number and y will be state, 0 = off, 1 = on. So for instance if you want to create a trigger for output 17 turning on then you would create a trigger associated with an event in the Events editor of xlobby. On the Sendmessage tab the wparam entry would contain 10006 and the lparam would be 171.

Let me know if you encounter any problems.
Andrew
loch
 
Posts: 16
Joined: Fri Dec 23, 2005 1:23 pm

Postby smarty on Fri Dec 22, 2006 1:41 am

Andrew,
I am just starting to test out your updated plugin. The additions look SUPER; Thanks!!!!!

The only question I have now is concerning thermostats; specifically the "Hold" function/mode.

If the "Hold" mode is selected for a given Tstat, there is no way to tell this from: "plugin>elkm1>thermostats>”x”>mode".

This text "retrieves the current thermostat mode(Heat, Cool, Off, Auto, Emergency Heat)" but not "hold". Was this by design? Maybe I am thinking about this improperly???
smarty
 
Posts: 179
Joined: Thu Jul 27, 2006 12:04 am
Location: San Antonio, TX USA

Postby loch on Fri Dec 22, 2006 1:20 pm

It looks like the hold support is lacking in the plugin. I guess I rarely if ever use that feature so haven't noticed.

There is currently no way to query the state of hold. Also the Hold command toggles the hold state.

I just updated the plugin to fix these issues.
The updated dll can be downloaded at the same spot as the last update:
http://www.xlobby.com/files/loch/files/xelk.1.2.zip


I added two new commands:

tstatHoldOn – Set the thermostat to set the thermostat to hold the current temperature. One variable, “tstatNumber”.

tstatHoldOff – Set the thermostat to release the thermostat from hold. One variable, “tstatNumber”.

I also added a new variable to query the hold state:
plugin>elkm1>thermostats>”x”>hold - Retrieve the current thermostat hold setting (Off, On)

I will be away for a few days, so if you have any other issues or questions it might take me a little while to respond.

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

Postby smarty on Thu Jan 04, 2007 2:26 pm

Andrew,
It looks like all is NOW working with this plugin (as far as I can tell). Great Job!

Question for anyone: What is the best way (even a decent way) of displaying the Elk text log in Xlobby? I can easily create a new screen, but how would I display the text?
smarty
 
Posts: 179
Joined: Thu Jul 27, 2006 12:04 am
Location: San Antonio, TX USA

Re: Elk M1 Home Security/Automation Plugin

Postby smarty on Thu Apr 24, 2008 2:10 pm

Andrew,
Are you still out there?

Seems like this plug-in mostly works (it runs tasks, is able to change outputs etc), but I am having some zone status problems where it does not report back the right zone status.

Is anyone else seeing this?
smarty
 
Posts: 179
Joined: Thu Jul 27, 2006 12:04 am
Location: San Antonio, TX USA

Re: Elk M1 Home Security/Automation Plugin

Postby loch on Thu Apr 24, 2008 3:54 pm

I am still here. I moved a year ago and don't have the ELK running at the new house yet.

Zone status was working fine for me a year ago, but I was only monitoring 8 zones and a 2 wire smoke detector. Are you seeing all zones reporting incorrectly or only certain ones? Was it working before, and then it stopped working?

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

Re: Elk M1 Home Security/Automation Plugin

Postby smarty on Thu Apr 24, 2008 11:40 pm

Andrew,
This is what I see: It appears that zoneStatus, armStatus, and alarmStatus text doesn't update when an M1 system change occurs. This seems to be across all zones (1-64 tested, but I have 112 zones).

For example, I have an Xlobby button event that arms my M1. If I press the arm button once, my M1 arms, but my armStatus text doesn't update. If I push the arm button again, THEN text will then update. If I arm my M1 via the keypad, the Xlobby plugin NEVER seems to see the armStatus change.

Other functions, such as tstat control, arming and dis-arming, running of tasks....ie, all events that the plugin sends to the Elk system appear to work OK (and their corresponding text updates).

Of course, all the above items DID work in the past. I am not sure when they "broke". The wife and I justed moved into our "dream" house about 5 months ago, and I am now just getting around to setting Xlobby up. All the past work was done on the benchtop (in support of the new house). Over the course of the 17 months of construction (ouch!!!), the Elk system and Xlobby were upgraded a couple of times. I guess one of those upgrades broke the plug-in.

BTW, where did you move to (if I can ask)?

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

Re: Elk M1 Home Security/Automation Plugin

Postby loch on Fri Apr 25, 2008 12:08 pm

Steve,

At this point I am not sure if I can easily help as my ELK is currently sitting in a box waiting for the time to be revived.
I can try taking a look at your log file to see if anything sticks out.

Bring up the ELK M1 Plugin Configuration screen from the xlobby setup menu. Click on the ELK protocol logging, Alarm Status and Zone.
Next restart xlobby and arm/disarm and trip some zones. Then quit xlobby again and email me the log file. The log file should be in plugins\xelk\elk.log

I have not moved out of the Austin area, I just moved North a little bit to Cedar Park to get a little more property and privacy. I had the house rewired to provide a number of automation features, but just haven't had any time to work on it yet.

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

Previous