UNPKG

node-red-contrib-ocpp

Version:

A set of nodes to communicate via OCPP to a compatible charge box or central system

177 lines (156 loc) 6.85 kB
<style> .header { text-decoration: underline; font-weight: bold; margin-top: 5px; } .bordered { padding-left: 12px; padding-top: 4px; border: 1px solid lightgrey; box-sizing: border-box; } </style> <script type="text/javascript"> RED.nodes.registerType('CP Request SOAP', { category: 'OCPP', color: '#3FADB5', defaults: { name: {value: "", required: true}, remotecs: {value: "", type: "ocpp-remote-cs"}, ocppver: {value: "1.5s", required: true}, command: {value: "", required: false}, cmddata: {value: "", required: false}, log: {value: false, required: true }, pathlog: {value: "", required: false} }, inputs: 1, outputs: 1, icon: "file.jpg", label: function() { if (this.remotecs) return this.name||RED.nodes.node(this.remotecs).label(); else return this.name||"OCPP CP SOAP Request"; }, oneditprepare: function() { var cblist = [ { cb: "#node-input-log", cont: "#containerlog" }, ] function updateHideContainer(checkbox,container){ if ($(checkbox).is(':checked')){ $(container).show(); } else{ $(container).hide(); } } cblist.forEach(x => { updateHideContainer(x.cb,x.cont); $(x.cb).on('click', function(){ updateHideContainer(x.cb,x.cont); }); }); } }); </script> <script type="text/javascript"> </script> <script type="text/x-red" data-template-name="CP Request SOAP"> <div class="form-row"> <label for="node-input-name"><i class="icon-tag"></i> Name</label> <input type="text" id="node-input-name" placeholder="Charge Box Identity" /> </div> <div class="form-row"> <label for="node-input-remotecs"><i class="icon-tag"></i> Cetral System</label> <input type="text" id="node-input-remotecs" placeholder="Setup" /> </div> <div class="form-row"> <label for="node-input-ocppver"><i class="icon-cog"></i> OCPP Ver</label> <select id="node-input-ocppver"> <option value="1.5s">1.5 SOAP</option> <option value="1.6s">1.6 SOAP</option> </select> </div> <div class="form-row"> <label for="node-input-command"><i class="icon-cog"></i> Command</label> <select id="node-input-command"> <option value="">&lt;None&gt;</option> <option value="Authorize">Authorize</option> <option value="BootNotification">BootNotification</option> <option value="DataTransfer">DataTransfer</option> <option value="DiagnosticsStatusNotification">DiagnosticsStatusNotification</option> <option value="FIrmwareStatusNotification">FIrmwareStatusNotification</option> <option value="Heartbeat">Heartbeat</option> <option value="MeterValues">MeterValues</option> <option value="StartTransaction">StartTransaction</option> <option value="StatusNotification">StatusNotification</option> <option value="StopTransaction">StopTransaction</option> </select><br/> <p>* = 1.6 command only</p> </div> <div class="form-row"> <label for="node-input-cmddata"><i class="icon-cog"></i> Command Params</label> <textarea rows="4" cols="50" id="node-input-cmddata" placeholder="JSON formatted parameters"></textarea> </div> <div class="header">Logging</div> <div class="bordered"> <div class="checkbox"> <label> <input type="checkbox" value="" id="node-input-log" onclick="toggleEnabled(this)"/> logging enabled </label> </div> <div id="containerlog" class="form-row"> <label for="node-input-pathlog" > <i class="icon-globe"></i> Path </label> <input type="text" id="node-input-pathlog" placeholder="log file path and name" /> </div> </div> </script> <script type="text/x-red" data-help-name="CP Request SOAP"> <p>Send Central System (CS) OCPP JSON requests messages to EVSEs (CP)</p> <h3>Configuration Settings</h3> <dl> <dt>Name:</dt> <dd>The name shown on the workspace</dd> <dt>Central System:</dt> <dd>Choose, create, or modify a Central System Service(CS). NOTE: This needs to be a SOAP supported Central System (CS)</dd> <dt>Command:</i></dt> <dd>(Optional) Select an OCPP command to send if none is passed in via <code>msg.payload.command</code></dd> <dt>Command Params:</dt> <dd>(Optional) OCPP command data object to send if none is passed in via <code>msg.payload.data</code>. Must be JSON formatted</dd> <!--- <dt>logging enabled</dt> <dd>enables/disables logging for this node</dd> <dt>Path</dt> <dd>Path to file used for logging. Required if "logging enabled" is checked, otherwise logging will be disabled at runtime</dd> ---> </dl> <h3>Inputs</h3> <dl class="message-properties"> <dt><code>msg.payload.command</code> <i>optional</i> <span class="property-type">string</span></dt> <dd>OCPP "Central System" request command</dd> <dt><code>msg.payload.data</code> <i>optional</i> <span class="property-type">object</span></dt> <dd>Object containing parameters for the command</dd> </dl> <h3>Outputs</h3> <dl class="messge-properties"> <dt>ocpp <span class="property-type">object</dt> <dd><code>msg.ocpp</code> objcet containing ocpp related information <ul> <li><code>command</code>: the request command sent</li> <li><code>chargeBoxIdentity</code>: name identifying the charge box</li> <li><code>url</code>: URL of the targe EVSE request was sent to</li> <li><code>data</code>: object containing the parameters passed to the EVSE for the request (if any)</li> </ul> </dd> <dt>payload <span class="property-type">object</dt> <dd><code>msg.payload</code> object containing response data sent back from the EVSE. Contents vary depending on the request command. </dd> </dl> </script>