@marcel-domke/node-red-contrib-reolink
Version:
A unofficial Node-RED node for receiving real-time data and controlling your Reolink camera.
90 lines (80 loc) • 3.86 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-ir-light', {
category: 'Reolink',
color: '#c0c0ff',
defaults: {
name: { value: "" },
topic: { value: "" },
interval: { value: 2.0, required: true },
server: { value: "", type: "reolink-device", required: true }
},
inputs: 1,
outputs: 1,
icon: "font-awesome/fa-lightbulb-o",
label: function () {
return this.name || "Reolink IR Light";
},
paletteLabel: function () {
return "IR Light";
}
});
</script>
<!-- Edit Template -->
<script type="text/html" data-template-name="reolink-ir-light">
<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-ir-light">
<p>The <b>Reolink IR Light</b> node allows you to control and monitor the mode of the IR (infrared) LED light on a Reolink device.</p>
<h3>Inputs</h3>
<dl class="message-properties">
<dt>payload</dt>
<dd>A boolean value to control the mode of the IR LED light:</dd>
<ul>
<li><code>"Auto"</code>: Switches the IR lights mode to AUTO (IR lights will automatically turn on in dim light and turn off when there is sufficient lighting).</li>
<li><code>"Off"</code>: Switches the IR light to always OFF.</li>
</ul>
</dl>
<p>When an input message with a boolean payload (true or false) is received, the node will send the corresponding command to the Reolink device to turn the IR LED light ON or OFF.</p>
<h3>Outputs</h3>
<dl class="message-properties">
<dt>payload</dt>
<dd>A boolean value indicating the mode of the IR LED light:</dd>
<ul>
<li><code>"Auto"</code>: The IR lights mode is AUTO (IR lights will automatically turn on in dim light and turn off when there is sufficient lighting).</li>
<li><code>"Off"</code>: The IR LED light is always OFF.</li>
</ul>
<dt>topic</dt>
<dd>The configured topic, or the server name if not set.</dd>
</dl>
<p>The node periodically queries the Reolink device for the current mode of the IR LED light. If the mode changes, it emits the updated mode ("Auto" or "Off") as the message payload.</p>
</script>