UNPKG

node-red-node-ademco

Version:

A Node-RED node to Parse Ademco Panel Messages.

123 lines (106 loc) 5.4 kB
<script type="text/x-red" data-template-name="AdemcoListener"> <div class="form-row node-input-report"> <label for="node-input-report"><i class="fa fa-list-ul"></i> Report</label> <select id="node-input-report" style="width:125px !important"> <option value="all">All Data</option> <option value="state">State Changes</option> </select> </div> <div class="form-row"> <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> <input type="text" id="node-input-name" placeholder="Name"> </div> </script> <script type="text/x-red" data-help-name="AdemcoListener"> <p>Parses the panel messages from the NuTech AD2USB via a serial port input node, converts it into a JavaScript object and either reports partition state changes or converts each message into a payload.</p> <p>The Output Payload consists of a Single Partion state object:</p> <pre> partitionState ={ partitionNumber : 1, // Indicates the Partition ID messageLine1 : "", // Alpha panel Message Line 1 messageLine2 : "", // Alpha panel Message Line 2 lastUpdated : null, // DateTime the message was parsed systemState : AlarmStateEnum.NOT_READY, // StateMachinable value, see System State object lastTransitionDate : null, // Prior State Change DateTime lastSystemState : AlarmStateEnum.NOT_READY, // Prior StateMachinable value, see System State object panels : [], // List of Panel IDs this message is ment for zoneFaults : [], // List of faulted Zones (Not Working) partitionReady : false, // Indicates the Partition is ready to arm (No Faults) partitionArmedAway : false, // Indicates the Partition is Armed Away ( Motion Detection == Instant Alarm ) partitionArmedStay : false, // Indicates the Partition is Armed Stay ( Motion Detection Zones disabled ) backlight : false, // Panel Backlight should be lit programmingMode : false, // Indicates System is in Programming Mode beepCount : 0, // Indicates Panel should beep x times zoneBypass : false, // Indicates one or more zones bypassed on partition linePower : false, // Indicates System is on AC Power chimeEnabled : false, // Indicates Panel should chime when Zones are faulted in Disarmed State alarmOccurred : false, // Indicates an alarm has been triggered (Could be Silent Alarm!) alarmSounding : false, // Indicates the Alarm Siren is triggered batteryLow : false, // Indicates the Backup Battery is Low/not charging delayOff : false, // Indicates the System is Armed Instant ( AKA Night Mode ) fireAlarm : false, // Indicates the Fire Zones have been triggered zoneFaulted : false, // Indicates one or more Zones are faulted perimeterOnly : false, // Indicates non-motion zones are armed stateChange : false // Indicates the Primary Arming state has changed }; var AlarmStateEnum = { DISARMED : 0, // Partition is in an unknown state or initialized NOT_READY : 1, // Partition is Disarmed but but not ready to arm (One or more Faults) READY : 2, // Partition is Disarmed but ready to arm (No Faults) ARMED_AWAY : 3, // Partition is Armed Away, Motion Detection active ARMED_STAY : 4, // Partition is Armed Stat, Motion Detection not active ARMED_INSTANT : 5, // Partition is Armed Instant, Motion Detection not active (No Entry Delay) ALARM : 6, // Partition is in a Faulted Alarm State FIRE_ALARM : 7 // Partition is in a Faulted Fire Alarm State }; </pre> <p>To order a AD2USB Module for your Ademco Alarm Panel http://www.alarmdecoder.com/catalog/advanced_search_result.php?keywords=AD2USB&search_in_description=1&x=0&y=0 </p> <p>And the Protocol/Strings exported from the Panel http://www.alarmdecoder.com/wiki/index.php/Protocol </p> </script> <script type="text/javascript"> RED.nodes.registerType('AdemcoListener',{ category: 'advanced', color:"#FF8080", defaults: { report: {value: "all",required:true}, name: {value:""} }, inputs:1, outputs:1, icon: "ademco.png", label: function() { return this.name ? this.name : "AdemcoListener"; } }); </script> <script type="text/x-red" data-template-name="AdemcoStatus"> <div class="form-row"> <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> <input type="text" id="node-input-name" placeholder="Name"> </div> <div class="form-row node-input-partition"> <label for="node-input-partition"><i class="fa fa-list-ul"></i> Partition</label> <select id="node-input-partition" style="width:125px !important"> <option value="1">Partition 1</option> <option value="2">Partition 2</option> </select> </div> </script> <script type="text/javascript"> RED.nodes.registerType('AdemcoStatus',{ category: 'advanced', color:"#FF8080", defaults: { name: {value:""}, partition: {value: "1",required:true} }, inputs:1, outputs:1, icon: "ademco.png", label: function() { return this.name ? this.name : "AdemcoStatus"; } }); </script>