node-red-contrib-uhppoted
Version:
A set of nodes for the UHPPOTE Wiegand Access Controller
129 lines (122 loc) • 5.09 kB
HTML
<script type="text/html" data-template-name="uhppoted-put-card">
<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-put-card">
<p>Adds or updates a card record on 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 card details for 'put-card'</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 succeeded/failed result</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
along with the card information to be added or updated.</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>card.number<span class="property-type">uint32</span></dt>
<dd>card number</dd>
<dt>card.valid.from<span class="property-type">date</span></dt>
<dd>card active 'from' date (yyyy-MM-dd)</dd>
<dt>card.valid.to<span class="property-type">date</span></dt>
<dd>card active 'to' date (yyyy-MM-dd)</dd>
<dt>card.door.1<span class="property-type">boolean|uint8</span></dt>
<dd>access door 1 granted if true, managed by a time profile if uint8 in the range [2..254]</dd>
<dt>card.door.2<span class="property-type">boolean|uint8</span></dt>
<dd>access door 2 granted if true, managed by a time profile if uint8 in the range [2..254]</dd>
<dt>card.door.3<span class="property-type">boolean|uint8</span></dt>
<dd>access door 3 granted if true, managed by a time profile if uint8 in the range [2..254]</dd>
<dt>card.door.4<span class="property-type">boolean|uint8</span></dt>
<dd>access door 4 granted if true, managed by a time profile if uint8 in the range [2..254]</dd>
<dt>card.PIN<span class="property-type">uint32 in the range [0..999999]</span></dt>
<dd>card keypad PIN (optional)</dd>
</dl>
<h4>Example:</h4>
<pre>
{
"deviceId": 405419896
"card": {
"number": 61532836,
"valid": {
"from": "2021-01-01",
"to": "2021-12-31"
},
"doors": {
"1": true,
"2": false,
"3": 29,
"4": true
},
PIN: 7531
}
}</pre>
<pre>
{
"controller": {
"controller": 405419896,
"address": "192.168.1.100",
"protocol": "tcp"
},
"card": {
"number": 61532836,
"valid": {
"from": "2021-01-01",
"to": "2021-12-31"
},
"doors": {
"1": true,
"2": false,
"3": 29,
"4": true
},
PIN: 7531
}
}</pre>
<p>The output is a JSON object containing the success/failure result for the add/update.</p>
<dl class="message-properties">
<dt>deviceId<span class="property-type">uint32</span></dt>
<dd>controller serial number</dd>
<dt>stored<span class="property-type">boolean</span></dt>
<dd>true if the card was added or updated</dd>
</dl>
<h4>Example:</h4>
<pre>
{
"deviceId": 405419896,
"stored": true
}</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>