UNPKG

@nagisa~/node-red-dsmr

Version:

A node to give some structure to a stream of DSMR data

102 lines (89 loc) 3.94 kB
<script type="text/javascript"> (function () { 'use strict'; RED.nodes.registerType("dsmr", { category: 'parser', color: 'rgb(222, 189, 92)', defaults: { name: { value: "" }, property: { value: "payload", required: true, // @ts-ignore label: RED._("node-red:common.label.property"), // @ts-ignore validate: RED.validators.typedInput({ type: 'msg', allowBlank: true }) }, maximumTelegram: { value: 10240 }, }, inputs: 1, outputs: 1, icon: "font-awesome/fa-bolt", label: function () { return this.name || "dsmr"; }, oneditprepare: function () { if (this.property === undefined) { $("#node-input-property").val("payload"); } $("#node-input-property").typedInput({ default: 'msg', types: ['msg'] }); } }); })(); </script> <script type="text/html" data-help-name="dsmr"> <p>Consumes a stream of DSMR data such as what might be obtained from an electricity meter over its P1 port, frames it and gives the data a little bit of structure.</p> <h3>Inputs</h3> <dl class="message-properties"> <dt>payload <span class="property-type">string | array | Uint8Array</span> </dt> <dd>bytes of the DSMR stream (a single message needs not to represent a full DSMR telegram.)</dd> </dl> <h3>Outputs</h3> <ol class="node-ports"> <li>output <dl class="message-properties"> <dt>payload <span class="property-type">object</span></dt> <dd>objects representing data from one full DSMR telegram. Each message input may result in 0, 1 or more output messages.</dd> </dl> </li> </ol> <h3>Details</h3> <p>Unlike many other implementations of DSMR parsers, this one does not attempt to prescribe meaning to any specific COSEM object, nor does it attempt to figure out the type of specific values. This is best achieved by piping the output of this node to the follow up function node and transforming the data in whatever way is appropriate to your use-case.</p> <p>Instead the output payload will be replaced with an object along the lines of <pre><code>{ "vendor": "ABC", "identifier": "USUALLY_SN", "0-0:1.0.0": ["240218021712W"], "1-0:1.8.0": ["00001234.567*kWh"], ... }</code></pre></p> <p>The value for each COSEM object may have more than a single element. This is especially relevant for readings sourced from M-BUS devices or objects representing logs.</p> <p>It is up to the user to apply meaning to the OBIS keys. Your utility should have documentation on their website explaining the data model of their DSMR telegrams. Obtain it in order to apply meaning to the OBIS codes you get in the payloads after processing.</p> <h3>References</h3> <p>If you're interested in the specifics of the format, refer to the <a href="https://www.netbeheernederland.nl/_upload/Files/Slimme_meter_15_a727fce1f1.pdf">P1 Companion Standard</a>.</p> </script> <script type="text/html" data-template-name="dsmr"> <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-property"><i class="fa fa-ellipsis-h"></i> Property</label> <input type="text" id="node-input-property" style="width: calc(100% - 105px)"/> </div> <div class="form-row"> <label for="node-input-maximum-telegram"><i class="fa fa-arrows-alt"></i> Maximum Buffer Size</label> <input type="text" id="node-input-maximum-telegram" placeholder="10240"> </div> </script>