Elk M1 (and M1 M1EZ8) Alarm Panel Plugin

The plugin finally reached beta stage.

You can find installation and usage instructions (plus additional info) here:
http://code.mios.com/trac/mios_elk-alarm-panel/wiki/WikiStart

Post here any bugs you find or any feature requests, or send them to my e-mail address:
florin@my.mios.com

Also, if you have any questions, post them here.

Does it work via a ELK-M1XEP. It is the Elk serial to ethernet converter.

I don’t know, I haven’t tried it with M1XEP because we didn’t have one, but it would be interesting to know.

It works via M1XEP.

I used guessed’s plugin [url=http://code.mios.com/trac/mios_ipserial/wiki/Installation-UI4]http://code.mios.com/trac/mios_ipserial/wiki/Installation-UI4[/url] to connect via port 2101 (Non-encrypted) and it picked up the M1 no problem.

As I am still in the middle of building the system (at a snails pace) I have not fully tested but can arm and disarm.

Cheers and thanks for the plugin

John

Keep in mind that the plugin is still beta. If you find any bugs or if you require any features, let me know.

@mcvflorin, you may want to add the bits directly to your plugin so that they don’t have to go through the intermediary IPSerial Plugin.

ie. Let them associate directly with IP:Port, or do a Serial-device Attach.

The DSC & the Onkyo Receiver plugins both do this, to simplify the setup for users… and to reduce the need for extra plugins floating around.

@guessed
Thanks for the suggestion, I modified the plugin as you said.

Just noticed if check sum is 0 then the calculated checksum becomes 256: -

local calculatedChecksum = calculateChecksum (length .. msgType .. data .. misc) --if calculatedChecksum == 256 then calculatedChecksum = 0 end if (calculatedChecksum ~= tonumber (checksum, 16)) then log ("(checkMessage) ERROR: The calculated checksum is incorrect.") log ("(checkMessage) ERROR: The calculated checksum is " .. calculatedChecksum) log ("(checkMessage) ERROR: The actual checksum is " .. checksum) return nil end

50 07/02/11 20:13:50.018 luup_log:215: (checkMessage) ERROR: The calculated checksum is incorrect. <0x402> 50 07/02/11 20:13:50.019 luup_log:215: (checkMessage) ERROR: The calculated checksum is 256 <0x402> 50 07/02/11 20:13:50.020 luup_log:215: (checkMessage) ERROR: The actual checksum is 00 <0x402>

Thanks

John

Good catch zoot1612, I updated the plugin to handle the case when the ASCII sum is a multiple of 256.

Is it possible with this plugin to use the Vera2 and the lighting control interface for the ELK. Here is what would be ideal:

  1. Ability to disable the ARM/DISARM functions from the plugin. Personally I don’t feel comfortable with ZWAVE having this ability.

  2. Use the Vera2 as the lighting control interface for lighting rules which I setup on the M1G. Right now I am using a Leviton serial interface which isn’t that reliable. Is this possible with this plugin?

  1. I understand your concerns, however, arming or disarming the panel requires the PIN code (the requirement is at the panel level, not at the plugin level, which means that it’s not possible to arm/disarm without the code even if the plugin is somehow hacked). If a PIN code is not entered in the PIN code box, or stored in memory, you can consider this functionality as disabled.

  2. There are no commands for controlling lights, only for getting their status, and it’s not implemented in the plugin. Unless more people require this, I won’t implement this feature in the near future.

I have only just skimmed through the wiki at this point, but I will install the plugin tomorrow after I get some shut-eye.
Being quite familiar with the Elk M1G and a couple of other applications that can work with it, I would like to make a couple of requests right away, if I may be so bold. :wink:
The following features would be excellent additions:

  1. A tab with the statuses of the zones (this would include the temperature probes that may be placed in the first 16(?) zone slots),
  2. A tab with the statuses and control buttons for the outputs (relays),
  3. A tab that lists and gives us the option to trigger tasks.

Light control would be nice, but I’m sure we can do that by other means. I guess the main purpose would be to flash the lights in the event of an alarm, or activate a certain scene when the system is disarmed. Can we use these Elk events in our programs on the Vera 2 with this plugin?

Thanks for your consideration and your great work!

@Quixote
All those features are supported in the API. I added them as feature requests and I’ll come back to them when I finish my current assignments.

@cipherwarrior
I believe it’s possible to control lights through tasks, so I’ll add a tab to display the lights’ status.

Thanks! Looking forward to it!

Hi Mcvflorin,
Just wondering what the status is on your current workload. Are you close to readdressing the Elk plugin?
Thanks!

-D

Hi Quixote,
Nope, not close yet. I might get to work on it in 2-3 weeks.

Hi Mcvflorin

Feature
Is it possible to change the following in the startup for the ELK: -

local ipAddress, ipPort = string.match (luup.devices[lul_device].ip, "^(.*):(%d+)")
debug (string.format ("(Elk Plugin Startup) ipAddress=%s, ipPort=%s", tostring (ipAddress), tostring (ipPort)))
	if (ipAddress and ipAddress ~= "") then
		if (not ipPort) then
			ipPort = 5000
		end

with

local ipAddress, ipPort = string.match (luup.devices[lul_device].ip, "(%d+.%d+.%d+.%d+):?(%d*)")
	if (ipAddress and ipAddress ~= "") then
		if (ipPort==nil) or (ipPort == "") then
			ipPort = 2101
		end
debug (string.format ("(Elk Plugin Startup) ipAddress=%s, ipPort=%s", tostring (ipAddress), tostring (ipPort)))

If the ip address is entered without the port the first instance does not work, for me anyway.

Thanks

John

John,
The second format isn’t correct, it needs to be of the more generic form. The one you’ve listed only works for IPv4 addresses (no IPv6) and won’t work for anything that’s resolved using DNS Names instead of raw addresses.

In it’s original form both the IP and Port are mandatory. Something akin to the following can be used to get around that:

        local ipAddress, trash, ipPort = string.match(luup.devices[lul_device].ip, "^([%w%.%-]+)(:?(%d-))$")

UPDATE: corrected to be closer to what’s needed…

Fortunately*, Vera’s version of OpenWrt doesn’t even have IPv6 compiled in, so supporting IPv6 in a plugin is kind of moot.

  • Warning: may contain sarcasm.

doh, didn’t even think of IPV6 or that someone else may use DNS. Living in my little world apologies to all who look further :wink: