UNPKG

node-red-contrib-uhppoted

Version:

A set of nodes for the UHPPOTE Wiegand Access Controller

127 lines (120 loc) 5.06 kB
<script type="text/html" data-template-name="uhppoted-get-event"> <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"> <label for="node-input-topic"><i class="fa fa-tag"></i>Topic</label> <input type="text" id="node-input-topic" placeholder="Message topic" /> </div> <div class="form-row"> <label for="node-input-config"><i class="fa fa-tag"></i>Configuration</label> <input id="node-input-config" /> </div> </script> <script type="text/html" data-help-name="uhppoted-get-event"> <p>Retrieves the event at the requested index from an access controller.</p> <h3>Inputs</h3> <dl class="message-properties"> <dt>payload<span class="property-type">object</span></dt> <dd>JSON object with the controller ID and event index for 'get-event'</dd> <dt class="optional">topic<span class="property-type">string</span></dt> <dd>identifying message topic for output</dd> </dl> <h3>Outputs</h3> <dl class="message-properties"> <dt>payload<span class="property-type">object</span></dt> <dd>JSON object with the retrieved event</dd> <dt>topic<span class="property-type">string</span></dt> <dd>message topic copied from input</dd> </dl> <h3>Details</h3> <p>The input <code>msg.payload</code> is a JSON object identifying the destination controller and the index of the event to be retrieved.</p> <p>The controller is identified by specifying either the (legacy) 'deviceId' or the composite 'controller' object which supports both UDP and TCP connections. Defaults to broadcast UDP if the address or protocol are not valid.</p> <dl class="message-properties"> <dt>deviceId<span class="property-type">uint32</span></dt> <dd>controller serial number</dd> <dt>controller.id<span class="property-type">uint32</span></dt> <dd>controller serial number</dd> <dt>controller.address<span class="property-type">string</span></dt> <dd>controller IPv4 address</dd> <dt>controller.protocol<span class="property-type">string</span></dt> <dd>controller connection protocol ('udp' or 'tcp')</dd> <dt>index<span class="property-type">uint32</span></dt> <dd>event index in the range 1 to 100000</dd> </dl> <h4>Example:</h4> <pre> { "deviceId": 405419896 "index": 54321 }</pre> <pre> { "controller": { "controller": 405419896, "address": "192.168.1.100", "protocol": "tcp" } "index": 54321 }</pre> <p>The output is a JSON object containing the event at the requested index.</p> <dl class="message-properties"> <dt>deviceId<span class="property-type">uint32</span></dt> <dd>controller serial number</dd> <dt>event.index<span class="property-type">uint32</span></dt> <dd>event record number</d> <dt>event.type.code<span class="property-type">uint8</span></dt> <dd>raw event type</dd> <dt>event.type.event<span class="property-type">string</span></dt> <dd>decoded event type</dd> <dt>event.granted<span class="property-type">boolean</span></dt> <dd>access granted/denied</dd> <dt>event.door<span class="property-type">uint8</span></dt> <dd>event door ID for swipe/door events</dd> <dt>event.direction.code<span class="property-type">uint8</span></dt> <dd>event door direction for swipe/door events</dd> <dt>event.direction.direction<span class="property-type">uint8</span></dt> <dd>decoded event door direction for swipe/door events</dd> <dt>event.card<span class="property-type">uint32</span></dt> <dd>card number for swipe/door events</dd> <dt>event.timestamp<span class="property-type">timestamp</span></dt> <dd>event timestamp, formatted as YYYY-mm-dd HH:mm:ss ('' for no timestamp)</dd> <dt>event.reason.code<span class="property-type">uint8</span></dt> <dd>raw event reason</dd> <dt>event.reason.reason<span class="property-type">string</span></dt> <dd>decoded event reason</dd> </dl> <h4>Example:</h4> <pre> { "deviceId": 405419896, "event": { "index": 70, "type": { "code": 1, "event": "card swipe" }, "granted": false, "door": 3, "direction": { "code": 1, "direction": "in" }, "card": 65538, "timestamp": "2020-08-19 10:03:48", "reason": { "code": 6, "reason": "no access rights" } } }</pre> <h3>References</h3> <ul> <li><a href="https://github.com/uhppoted">uhppoted</a>: GitHub umbrella project</li> <li><a href="https://github.com/uhppoted/node-red-contrib-uhppoted">node-red-contrib-uhppoted</a>: GitHub project</li> </ul> </script>