@smappee/node-red-contrib-smappee
Version:
Smappee Node-RED contains Smappee nodes and example flows
61 lines (57 loc) • 2.48 kB
HTML
<script type="text/x-red" data-template-name="realtime">
<div class="form-row">
<label for="node-input-device"><i class="fa fa-globe"></i> <span>Smappee</span></label>
<input type="text" id="node-input-device">
</div>
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> <span>Name</span></label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
</script>
<script type="text/x-red" data-help-name="realtime">
<p>Returns real-time power values for a Smappee device as JSON.</p>
<h3>Outputs</h3>
<p>Real-time messages are returned every second through <b>msg.payload</b> values:</p>
<dl class="message-properties">
<dt>totalPower <span class="property-type">number</span></dt>
<dd>Consumption power in watt (W).</dd>
<dt>totalExportEnergy <span class="property-type">number</span></dt>
<dd>Production energy in joule (J).</dd>
<dt>totalImportEnergy <span class="property-type">number</span></dt>
<dd>Consumption energy in joule (J).</dd>
<dt>utcTimeStamp <span class="property-type">number</span></dt>
<dd>Timestamp value for the current date and time on the device.</dd>
<dt>firmwareVersion <span class="property-type">string</span></dt>
<dd>Firmware version running on the device.</dd>
<dt>channelPowers <span class="property-type">array</span></dt>
<dd>Power values for each channel.</dd>
<dt>voltages <span class="property-type">array</span></dt>
<dd>Voltages in volt (V) per phase.</dd>
</dl>
<h3>Details</h3>
<p>Requires a
<a href="https://www.smappee.com/be_en/plus-energy-monitor">Smappee Plus</a> or
<a href="https://www.smappee.com/be_en/pro-energy-monitor">Smappee Pro</a> device
running with the latest firmware that supports Node-RED.</p>
<p><b>Note:</b> Please contact <a href="mailto:support@smappee.com">support@smappee.com</a> if you are having issues.</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('realtime', {
category: 'smappee device',
color: '#99c031',
defaults: {
name: {value: ''},
device: {value: '', required: true, type: 'device-config'},
},
inputs: 0,
outputs: 1,
icon: 'arrow-in.png',
label: function() {
const device = RED.nodes.node(this.device);
return this.name || 'realtime' + (device ? ':' + device.host : '');
},
labelStyle: function() {
return this.name ? 'node_label_italic' : '';
},
});
</script>