Envisalink - TPI Documentation

Information and support for EnvisaLink modules.

Moderators: EyezOnRich, GrandWizard

bdesmond
Posts: 2
Joined: Mon Jan 04, 2016 7:42 pm

Re: Envisalink - TPI Documentation

Post by bdesmond »

I have an Envisalink 3 connected to a Vista-20P panel (v9.18).

I'm having trouble mapping my understanding of the Zone State Change data format to the data I'm seeing from the API. For example, when I fault Zone 7, I get this data back:

%02,0300000000000000$
%01,4000000000000000$
%00,01,0008,07,00,FAULT 07 BASEMENT MOTION $

How does 4000000000000000 map to zone 7?

Likewise, when I fault Zone 6, I see this:

%02,0300000000000000$
%01,6000000000000000$
%00,01,0008,06,00,FAULT 06 BASEMENT MOTION $

Is there something I'm missing?

Thanks!
K-Man
Posts: 145
Joined: Fri Jun 01, 2012 1:08 pm

Re: Envisalink - TPI Documentation

Post by K-Man »

@bedesmond

Please remember that the TPI is meant for software developers (Computer Scientists hopefully, but that is just my bias) and is probably beyond the average hobbyist.

Regardless, that field is called a "Little Endian, Byte Oriented Bit Field". It is presented in hexidecimal format which might further confuse novices to the art as well.

So for your example:
%01,4000000000000000$
%00,01,0008,07,00,FAULT 07 BASEMENT MOTION $

...the first hexidecimal byte is 40. In binary this 01000000. Counting from the right, the "1" is in the 7th position so that means zone 7 is open.

in your second example

%01,6000000000000000$
%00,01,0008,06,00,FAULT 06 BASEMENT MOTION $

...the first hexidecimal byte is 60. In binary this is 01100000. Counting from the right this means that zone 6 AND 7 are open.

I task you with creating the best app ever!!!

K
bdesmond
Posts: 2
Joined: Mon Jan 04, 2016 7:42 pm

Re: Envisalink - TPI Documentation

Post by bdesmond »

In my professional experience, SDKs that are readily accessible to developers enable ecosystems to grow around the devices they support. When you have a broad ecosystem, you drive product sales.

In the spirit of saving the next guy from being scolded for asking a question that's beneath others, here's a sample implementation for the Honeywell/Ademco board that unpacks the message and tracks what zones are open/closed. It's built in TypeScript, and it has some calls to tracing code that isn't included, but should be readily portable. The base class parses the message generically so you can then do something with it. Constructive feedback is always welcome.

Code: Select all

interface NumberKeyedHashTable<T> {
    [key: number]: T;
}

abstract class EvlMessageBase {
    public Command: number = -1;
    public Fields: Array<string> = new Array<string>();

    constructor() {
    }

    protected Parse(data: string): void {
        Log(LogLevel.High, "Attempting to parse EvlMessage: " + data);
        var currentData: string = "";
        var currentPosition: number = 0;

        for (var i: number = 0; i <= data.length; i++) {
            if (data.charAt(i) == "$") {
                Log(LogLevel.High, "Position '" + currentPosition + "' is '" + currentData + "'. End of data reached.");
                this.Fields[currentPosition] = currentData;
                break;
            }
            else if (data.charAt(i) == "%") {
                currentData = "";
                currentPosition = 0;
            }
            else if (data.charAt(i) != ",")
            {
                currentData += data.charAt(i);
            }
            else {
                if (this.Command == -1) {
                    // parse as base 16
                    this.Command = parseInt(currentData, 16);
                    Log(LogLevel.High, "Parsed command: " + currentData);
                }
                else {
                    Trace("Position '" + currentPosition + "' is '" + currentData + "'");
                    this.Fields[currentPosition] = currentData;
                    currentPosition++;
                }

                currentData = "";
            }
        }
    }
}

class EvlZoneStateChange extends EvlMessageBase {
    ZoneTable: NumberKeyedHashTable<boolean> = {};
        
    constructor(data: string) {
        super();
        
        this.Parse(data);

        if (this.Command != 1) {
            System.LogError("Commmand " + this.Command + " not supported by EvlZoneStateChange");
            throw "Commmand " + this.Command + " not supported by EvlZoneStateChange";
        }        

        var binaryFields: string[] = [];
        var zero: string = "00000000";

        // first, convert the bytes to a binary string
        for (var i: number = 0; i < this.Fields[0].length; i += 2) {
            Trace("Processing byte " + this.Fields[0].substring(i, i + 2));   
            binaryFields[i / 2] = parseInt(this.Fields[0].substring(i, i + 2), 16).toString(2);

            Trace("Field " + (i / 2).toString() + " is parsed to " + binaryFields[i / 2]);
            
            // JS doesn't give us all eight bits if there's trailing zeroes, so this trick pads it for us
            binaryFields[i / 2] = zero.substring(0, zero.length - binaryFields[i / 2].length) + binaryFields[i / 2];
            Trace("Field " + (i / 2).toString() + " is padded to " + binaryFields[i / 2]);
        }

        // next, flip the order of the bytes because we get it big endian and we want it little endian
        var bitField: string = "";
        var delimitedBitField: string = "";
        for (var i: number = 0; i < binaryFields.length; i++) {
            for (var j: number = binaryFields[i].length; j >= 0; j--) {
                bitField += binaryFields[i].charAt(j);
                delimitedBitField += binaryFields[i].charAt(j);

                if (j == 0)
                    delimitedBitField += " "
            } 
        }

        Trace("Adjusted zone state bit field: " + delimitedBitField);

        // loop through and see if the bit is set for the first 64 zones
        // it's an 8 byte mask so only 64 zones are supported on a larger panel
        for (var i: number = 0; i < 64; i++) {
            if (bitField.charAt(i) == "1")
                this.ZoneTable[i + 1] = true;
            else
                this.ZoneTable[i + 1] = false;
        }
    }
}
GrandWizard
Posts: 2327
Joined: Tue Nov 16, 2010 4:08 pm

Re: Envisalink - TPI Documentation

Post by GrandWizard »

In my professional experience, SDKs that are readily accessible to developers enable ecosystems to grow around the devices they support. When you have a broad ecosystem, you drive product sales.

In the spirit of saving the next guy from being scolded for asking a question that's beneath others, here's a sample implementation for .....
Wow, am I reading the same post? I think K-man's answer was quite friendly and helpful.
encojosh
Posts: 1
Joined: Mon Feb 22, 2016 10:34 am

Re: Envisalink - TPI Documentation

Post by encojosh »

Is there any way to get to obtain the LCD text for DSC systems? I would like to use this as a replacement for the DSC IT-100 virtual keypad to serial interface. This has all of the features except the LCD text. The Envisalink registers as a keypad on the bus, correct?
235301
Posts: 3
Joined: Sat Mar 05, 2016 1:35 pm

Re: Envisalink - TPI Documentation

Post by 235301 »

I have an Envisalink4 and a Vista 20P system. I would like to be able to open a socket to the EV4 from an external application and listen for a special key to be pressed on one of the panels. Is this possible?
thanatos0801
Posts: 11
Joined: Mon Apr 04, 2016 2:32 pm

Re: Envisalink - TPI Documentation

Post by thanatos0801 »

It would be amazingly useful if we could have an option in the TPI to configure a list of either Google GCM push tokens or an Apple push tokens and have the Envisalink send push notices to those push tokens upon state changes. Right now, the only way to realistically process events in real time when the app isn't in the foreground is to have some "helper desktop app" that acts as a middle man and can push state changes.
gldixon
Posts: 1
Joined: Sun May 29, 2016 8:51 am

Re: Envisalink - TPI Documentation

Post by gldixon »

Hi. I'm trying to manage my EVL (connected to Honeywell Vista 128) from an ISY944 through it's network module using TPI. However nothing in the manual seems to function. Using TCP, if I try and send any hex commands such as a login and password (per the manual) I get an 'N/A' back. ISY pops a dialog 'TCP client read respond failed [Net Module Rule: 2]'

If however I send only the password without hex conversion, I get a 'Login:' then an 'OK' back from EVL which indicates it worked. If I send the password then on the next line send '303030' sometimes EVL actually returns a line of status.

What am I doing wrong?
GrandWizard
Posts: 2327
Joined: Tue Nov 16, 2010 4:08 pm

Re: Envisalink - TPI Documentation

Post by GrandWizard »

You are reading the wrong version of the TPI. You have a Honewell panel so you need to look at the Honeywell TPI. The DSC version is completely different.
Xero
Posts: 2
Joined: Mon Jun 20, 2016 3:13 am

Re: Envisalink - TPI Documentation

Post by Xero »

I can't seem to find any documentation on code "616" which is being sent from my panel.

The raw code I get is, for example:
61600002000000000009F
or...
6160000220000000000A1

And I am assuming this is code 616 with the data 0000200000000000

I suspect it has something to do with zone bypassing, as I was testing some stuff related to that and started getting exceptions due to this unhandled code. Is there any documentation as to what this is? I was almost hoping maybe it's an output of the bypassed zones, which might actually be useful to me....

I also suspect this must be a new feature? I don't recall having my code throw exceptions after bypassing zones until now.
Post Reply