@marcel-domke/node-red-contrib-reolink
Version:
A unofficial Node-RED node for receiving real-time data and controlling your Reolink camera.
86 lines (78 loc) • 4.17 kB
HTML
<!--
Copyright 2025 Marcel Domke
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Node Definition -->
<script type="text/javascript">
RED.nodes.registerType('reolink-ai-event', {
category: 'Reolink',
color: '#70889e',
defaults: {
name: { value: "" },
topic: { value: "" },
interval: { value: 2.0, required: true },
server: { value: "", type: "reolink-device", required: true }
},
inputs: 0,
outputs: 1,
icon: "font-awesome/fa-bullhorn",
label: function () {
return this.name || "Reolink AI Event";
},
paletteLabel: function () {
return "AI Event";
}
});
</script>
<!-- Edit Template -->
<script type="text/html" data-template-name="reolink-ai-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="Node 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="">
</div>
<div class="form-row">
<label for="node-input-interval"><i class="fa fa-clock-o"></i> Interval [s]</label>
<input type="number" id="node-input-interval" min="0.1" step="0.1" placeholder="Default: 2">
<br> Decreasing this will result in faster updates but will increase network bandwidth usage and load.
</div>
<div class="form-row">
<label for="node-input-server"><i class="fa fa-wrench"></i> Device</label>
<select id="node-input-server"></select>
</div>
</script>
<!-- Help Text -->
<script type="text/html" data-help-name="reolink-ai-event">
<p>The <b>Reolink AI Event</b> node allows you to retrieve AI events from a Reolink device.</p>
<h3>Outputs</h3>
<dl class="message-properties">
<dt>payload[0].value</dt>
<dd>An object containing the AI states:</dd>
<ul>
<li><code>channel</code>: The AI channel ID (usually 0 for a single camera).</li>
<li><code>dog_cat.alarm_state</code>: The alarm state for dog or cat detection. A value of 0 indicates no alarm, and 1 indicates an alarm.</li>
<li><code>dog_cat.support</code>: Indicates whether dog/cat detection is supported (1 means supported, 0 means not supported).</li>
<li><code>face.alarm_state</code>: The alarm state for face detection. A value of 0 indicates no alarm, and 1 indicates an alarm.</li>
<li><code>face.support</code>: Indicates whether face detection is supported (1 means supported, 0 means not supported).</li>
<li><code>people.alarm_state</code>: The alarm state for person detection. A value of 0 indicates no alarm, and 1 indicates an alarm.</li>
<li><code>people.support</code>: Indicates whether person detection is supported (1 means supported, 0 means not supported).</li>
<li><code>vehicle.alarm_state</code>: The alarm state for vehicle detection. A value of 0 indicates no alarm, and 1 indicates an alarm.</li>
<li><code>vehicle.support</code>: Indicates whether vehicle detection is supported (1 means supported, 0 means not supported).</li>
</ul>
<dt>topic</dt>
<dd>The configured topic, or the server name if not set.</dd>
</dl>
<h3>Details</h3>
<p>This node periodically queries the Reolink device for motion detection and AI states, emitting the results as the message payload.</p>
</script>