Envisalink 2DS - TPI C# Framework (first try)

Information and support for EnvisaLink modules.

Moderators: EyezOnRich, GrandWizard

martin
Posts: 6
Joined: Wed Jul 04, 2012 8:18 am

Re: Envisalink 2DS - TPI C# Framework (first try)

Post by martin »

turnerj42 wrote:Hey Martin,
Wondering how complicated it would be to make this code send an email any time a zone is faulted? And then closed. Just wanting to set up zone follower type behaviour without loading down the eyez-on's servers so I think this program is on the right track but I am useless with this level of programming. THe running a service is quite the touch as well. Impressed!
Thanks

Thats quite easy, the ZoneHandler example included pretty much does the trick (almost).
Created a quick ZoneFollower; Get the .zip file and extract the .dll file to your plugin-directory (and remove the plugin.dll, thats for testing/demostration) and restart the service, if the mail function worked before, this one should mail you when someone opens and/or closes a section.

Note; wireless IR-detectors, goes into sleep mode when trigger to often, and will not send any events during their "sleep".

Quick look at the code; Included tamper, alarm and fault as well.

Code: Select all

public override void EventOccured(IResponse response, IReciever r)
{
	if (response.Command == ResponseCommand.ZoneOpen)
	{
		_mailSender.SendMail("Alarm - ZoneOpen", response.Date + "\r\nZone opened: " + response.Data.Substring(1));
	}
	else if (response.Command == ResponseCommand.ZoneRestored)
	{
		_mailSender.SendMail("Alarm - ZoneRestored", response.Date + "\r\nZone restored (closed): " + response.Data.Substring(1));
	}
	else if (response.Command == ResponseCommand.ZoneAlarm)
	{
		_mailSender.SendMail("Alarm - ZoneAlarm", response.Date + "\r\nAlarm at zone: " + response.Data.Substring(1));
	}
	else if (response.Command == ResponseCommand.ZoneTamper)
	{
		_mailSender.SendMail("Alarm - ZoneTamper", response.Date + "\r\nTamper at zone: " + response.Data.Substring(1));
	}
	else if (response.Command == ResponseCommand.ZoneFault)
	{
		_mailSender.SendMail("Alarm - ZoneFault", response.Date + "\r\nFault at zone: " + response.Data.Substring(1));
	}
}
Attachments
ZoneFollower.zip
Dll + sourcecode for ZoneFollower plugin
(3.39 KiB) Downloaded 487 times
tinkerfailure
Posts: 3
Joined: Thu Oct 11, 2012 6:04 am
Contact:

Re: Envisalink 2DS - TPI C# Framework (first try)

Post by tinkerfailure »

Cheers Martin,

Not had chance to try it yet. I'll let you know how I get on.

Chris
luk2009
Posts: 10
Joined: Mon May 13, 2013 7:59 pm

Re: Envisalink 2DS - TPI C# Framework (first try)

Post by luk2009 »

Hi

I want to make an application in delphi for envisalink data.

I want to use the indy. I would like to know your opinions

thank you
kingfetty
Posts: 1
Joined: Fri Mar 28, 2014 1:33 am

Re: Envisalink 2DS - TPI C# Framework (first try)

Post by kingfetty »

There is an error in your SimpleDSC upload.

Common\Commands\ResponseClass.cs

GetNumberOfBytes function

Line:

Code: Select all

 var intValueAsString =  attribs.Length >= 1 ? attribs[1].CommandValue : "0";
Should be:

Code: Select all

var intValueAsString =  attribs.Length >= 1 ? attribs[0].NumBytes.ToString() : "0";
EVL4user
Posts: 1
Joined: Fri Apr 06, 2018 7:40 pm

Re: Envisalink 2DS - TPI C# Framework (first try)

Post by EVL4user »

Hi guys,

Did anybody got this code working in C#? I noticed that mistake for GetNumberOfBytes function but whenever I try to SendKeystrokeString or "arm" or "disarm" or anything else - nothing happens.
These lines of code:

var request = new TpiRequest(RequestCommand.SendKeystrokeString, "1234");
or
var request = new TpiRequest(RequestCommand.PartitionArmControl, "1234");

do nothing so I can not arm or disarm system from C# code.
Does anybody know why? (I am using EVL-4 and from web/mobile EyezOn app I can disarm or arm system, just when I run C# code I can not do anything )
Post Reply