node-red-smithtek-hysteresis
Version:
Adds hysteresis function to node-red
60 lines (55 loc) • 2.05 kB
HTML
<script type="text/javascript">
RED.nodes.registerType('smithtek_node_red_threshold_formatter', {
category: 'Smithtek hysteresis',
color: '#B9B6B8',
defaults: {
name: {
value: '',
},
ThresholdType: {
value: 'upper',
},
},
inputs: 1,
outputs: 1,
icon: 'smithtek.png',
paletteLabel: 'smithtek threshold formatter',
label: function () {
return this.name || 'smithtek threshold formatter';
},
labelStyle: function () {
return this.name ? 'node_label_italic' : '';
},
});
</script>
<script
type="text/x-red"
data-template-name="smithtek_node_red_threshold_formatter"
>
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label style="width: 140px !important;"><h5><strong>Threshold Settings</strong></h5></label>
</div>
<div class="form-row">
<label style="width: 140px !important" for="node-input-ThresholdType"><i class="fa fa-wrench"></i> Threshold Type</label>
<select id="node-input-ThresholdType" style="width: 280px">
<option value="upper">Upper Threshold</option>
<option value="lower">Lower Threshold</option>
</select>
</div>
</script>
<script
type="text/x-red"
data-help-name="smithtek_node_red_threshold_formatter"
>
<p>A node to format the input <code>msg.payload</code> to the upper/lower threshold value for the hysteresis controler
<p><strong>Smithtek Threshold Formatter</strong><br/>
This node will output upper and lower threshold AKA high and low setpoint:
<code><pre>{payload:{high: value}}</pre></code>
Or for lower threshold:
<code><pre>{payload:{low: value}}</pre></code>
</p>
</script>