UNPKG

@gravypower/node-red-franklinwh

Version:

Node-RED node to control FranklinWH gateway

98 lines (88 loc) 3.3 kB
<script type="text/javascript"> RED.nodes.registerType('franklinwh-get-switches',{ category: 'FranklinWH', color: '#3399ff', defaults: { name: {value:""}, server: {type:"franklinwh-config", required:true} }, inputs:1, outputs:1, icon: "font-awesome/fa-toggle-on", label: function() { return this.name||"get switches"; } }); </script> <script type="text/html" data-template-name="franklinwh-get-switches"> <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-server"><i class="fa fa-globe"></i> Server</label> <input type="text" id="node-input-server"> </div> </script> <script type="text/html" data-help-name="franklinwh-get-switches"> <p>Retrieves the current status of all FranklinWH system switches and their positions.</p> <h3>Inputs</h3> <dl class="message-properties"> <dt>payload <span class="property-type">any</span> </dt> <dd>Any input will trigger a switch status request.</dd> </dl> <h3>Outputs</h3> <dl class="message-properties"> <dt>payload <span class="property-type">object</span> </dt> <dd> An object containing: <ul> <li><code>switches</code> - object containing switch states: <ul> <li><code>gridConnect</code> - Grid connection switch (true/false)</li> <li><code>backupPower</code> - Backup power switch (true/false)</li> <li><code>generator</code> - Generator switch if installed (true/false)</li> <li><code>solarInput</code> - Solar input switch (true/false)</li> <li><code>batteryConnect</code> - Battery connection switch (true/false)</li> </ul> </li> <li><code>timestamp</code> - ISO timestamp when the switch states were retrieved</li> </ul> </dd> </dl> <h3>Details</h3> <p>This node retrieves the real-time status of all switches in your FranklinWH system. These switches control various aspects of power flow and system operation.</p> <h3>Switch States</h3> <ul> <li><b>true</b>: Switch is closed/connected/enabled</li> <li><b>false</b>: Switch is open/disconnected/disabled</li> </ul> <h3>Status</h3> <ul> <li><b>Blue dot</b>: Requesting switch states</li> <li><b>Green dot</b>: Successfully retrieved switch states</li> <li><b>Red ring</b>: Error occurred or missing configuration</li> </ul> <h3>Examples</h3> <p><pre> { "switches": { "gridConnect": true, "backupPower": false, "generator": null, "solarInput": true, "batteryConnect": true }, "timestamp": "2024-07-10T15:30:00.000Z" } </pre></p> <h3>References</h3> <ul> <li><a href="https://www.franklinwh.com/support" target="_blank">FranklinWH Documentation</a></li> </ul> </script>