MessageDecoder.pm


NAME

Insteon::MessageDecoder - Static class for decoding Insteon PLM messages


SYNOPSIS

    use Insteon::MessageDecoder;
    my $decodedMessage = Insteon::MessageDecoder::plm_decode($plm_string);


DESCRIPTION

Insteon::MessageDecoder will decode Insteon PLM messages. Functions are provided to decode the PLM envelope, X10 commands, Insteon flags, and Insteon Cmd1/Cmd2 bytes. User data (D1-D14) of extended messages is not decoded but will be displayed.


EXAMPLE

    use Insteon::MessageDecoder;
    my $plm_string;
    
    $plm_string = '02621f058c1f2e000100000000000000000000000000';
    print( "PLM Message: $plm_string\n");
    print( Insteon::MessageDecoder::plm_decode($plm_string)."\n");
    
    $plm_string = '02511f058c1edc30112e000101000020201cfe3f0001000000';
    print( "PLM Message: $plm_string\n");
    print( Insteon::MessageDecoder::plm_decode($plm_string)."\n");


LIMITATIONS

The message decoder is not perfect. It does not keep message state and several of the Insteon ACK message formats can "only" be decoded relative to the most recent command sent to the ACKing device. Some ACK messages will be incorrectly decoded as part of another Insteon message. For example in the ACK for a "Light Status Request", cmd1 is the ALDB serial number. This serial number will be interpreted as another Insteon message where the serial number matches the cmd1 value. Be aware of this and you should still be able to intrepret the decided messages.

Extended messages are not decoded and only display the D1-D14 hex data. You will need to manually decode the extended data. Patches for decoding one or more extended messages are welcome.


BUGS

There are probably many bugs. The decoder was designed by transcribing Insteon documentation, Jonathan Dale's excellent command reference, and reviewing many message board discussions. The decoder has not been tested with all devices (of all firmware revs) or all PLM combinations (of all firmware revs). There are bugs; please report them in the misterhouse GitHub issues list.


METHODS

plm_decode(plm_string)

Returns a string containing a decoded PLM data packet

plm_x10_decode(x10_string)

Returns a string containing a decoded PLM X10 data packet

insteon_message_flags_decode(flags_string)

Returns a string containing decoded Insteon message flags

insteon_decode(command_string)

Returns a string containing a decoded Insteon message. Input string should be the Insteon message starting with the message flag byte.


SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Insteon::MessageDecoder


SEE ALSO

http://www.insteon.net/pdf/INSTEON_Command_Tables_20070925a.pdf

PLM command details can be found in the 2412S Developers Guide. This document is not supplied by SmartHome but may be available through an internet search.


AUTHOR

Michael Stovenour


LICENSE AND COPYRIGHT

Copyright 2012 Michael Stovenour

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

 MessageDecoder.pm