node-red-contrib-uhppoted
Version:
A set of nodes for the UHPPOTE Wiegand Access Controller
179 lines (172 loc) • 7.38 kB
HTML
<script type="text/html" data-template-name="uhppoted-get-status">
<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-status">
<p>Retrieves the current device status for a single UHPPOTE 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 for 'get-status'</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 controller current device status</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.</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>
</dl>
<h4>Example:</h4>
<pre>
{
"deviceId": 405419896
}</pre>
<pre>
{
"controller": {
"controller": 405419896,
"address": "192.168.1.100",
"protocol": "tcp"
}
}</pre>
<p>The output <code>msg.payload</code> is a JSON object containing the current
device state retrieved from the UHPPOTE controller with serial number matching
the request:</p>
<dl class="message-properties">
<dt>state.serialNumber<span class="property-type">uint32</span></dt>
<dd>controller serial number</dd>
<dt>state.event.index<span class="property-type">uint32</span></dt>
<dd>event record number (0 for no event)</d>
<dt>state.event.type.code<span class="property-type">uint8</span></dt>
<dd>raw event type (0 for no event)</dd>
<dt>state.event.type.event<span class="property-type">string</span></dt>
<dd>decoded event type</dd>
<dt>state.event.granted<span class="property-type">boolean</span></dt>
<dd>access granted/denied</dd>
<dt>state.event.door<span class="property-type">uint8</span></dt>
<dd>event door ID for swipe/door events (0 for unknown)</dd>
<dt>state.event.direction.code<span class="property-type">uint8</span></dt>
<dd>event door direction for swipe/door events (0 for unknown)</dd>
<dt>state.event.direction.direction<span class="property-type">uint8</span></dt>
<dd>decoded event door direction for swipe/door events</dd>
<dt>state.event.card<span class="property-type">uint32</span></dt>
<dd>card number for swipe/door events</dd>
<dt>state.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>state.event.reason.code<span class="property-type">uint8</span></dt>
<dd>raw event reason</dd>
<dt>state.event.reason.reason<span class="property-type">string</span></dt>
<dd>decoded event reason</dd>
<dt>state.doors<span class="property-type">boolean array</span></dt>
<dd>array of door states (<code>locked/unlocked</code>) corresponding to controller doors 1 to 4</dd>
<dt>state.buttons<span class="property-type">boolean array</span></dt>
<dd>array of buttons states (<code>pressed/released</code>) corresponding to the buttons for controller doors 1 to 4</dd>
<dt>state.system.status<span class="property-type">uint8</span></dt>
<dd>system status code (0: ok, <>0: error)</dd>
<dt>state.system.date<span class="property-type">date</span></dt>
<dd>current system date, formatted as YYYY-mm-dd</dd>
<dt>state.system.time<span class="property-type">time</span></dt>
<dd>current system time, formatted as HH-mm-ss</dd>
<dt>state.specialInfo<span class="property-type">uint8</span></dt>
<dd>Manufacturer specific information message code</dd>
<dt>state.relays.code<span class="property-type">uint8</span></dt>
<dd>Bit array corresonding to the door relay state (0: locked, 1: unlocked)</dd>
<dt>state.relays.locked<span class="property-type">uint8 array</span></dt>
<dd>Decoded bit array with the door relay state (<code>locked/unlocked</code>) corresponding to controller doors 1 to 4</dd>
<dt>state.inputs.code<span class="property-type">uint8</span></dt>
<dd>Bit array corresonding to the inputs state (bit.0: force locked, bit.1: fire alarm)</dd>
<dt>state.inputs.forceLocked<span class="property-type">boolean</span></dt>
<dd>Controller is <code>force locked</code>, decoded from bit.0</dd>
<dt>state.inputs.fireAlarm<span class="property-type">boolean</span></dt>
<dd>Fire alarm input is set, decoded from bit.1</dd>
</dl>
<h4>Example:</h4>
<pre>
{ "state": {
"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"
}
},
"doors": [
false,
false,
false,
false
],
"buttons": [
false,
false,
false,
false
],
"system": {
"status": 0,
"date": "2020-08-19",
"time": "10:03:48"
},
"specialInfo": 0,
"relays": {
"code": 0,
"locked": {
"1": 0,
"2": 0,
"3": 0,
"4": 0
}
},
"inputs": {
"code": 0,
"forceLock": 0,
"fireAlarm": 0
}
}
}</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/uhppoted-lib-node-red">uhppoted-lib-node-red</a>: GitHub project</li>
</ul>
</script>