UNPKG

@gravypower/node-red-franklinwh

Version:

Node-RED node to control FranklinWH gateway

135 lines (126 loc) 4.69 kB
<script type="text/javascript"> RED.nodes.registerType('franklinwh-get-tou',{ category: 'FranklinWH', color: '#3399ff', defaults: { name: {value:""}, server: {type:"franklinwh-config", required:true} }, inputs:1, outputs:1, icon: "font-awesome/fa-clock-o", label: function() { return this.name||"get tou"; } }); </script> <script type="text/html" data-template-name="franklinwh-get-tou"> <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-tou"> <p>Retrieves Time of Use (TOU) settings from the FranklinWH system. TOU settings determine how the system operates during different times of the day to optimize energy usage and costs.</p> <h3>Inputs</h3> <dl class="message-properties"> <dt>payload <span class="property-type">any</span> </dt> <dd>Any input will trigger the TOU settings request.</dd> </dl> <h3>Outputs</h3> <dl class="message-properties"> <dt>payload <span class="property-type">object</span> </dt> <dd> An object containing Time of Use settings: <ul> <li><code>timestamp</code> - ISO timestamp of the data retrieval</li> <li><code>enabled</code> - Whether TOU is currently enabled</li> <li><code>schedules</code> - Array of TOU schedules: <ul> <li><code>id</code> - Schedule identifier</li> <li><code>name</code> - Schedule name</li> <li><code>periods</code> - Array of time periods: <ul> <li><code>startTime</code> - Period start time (HH:MM)</li> <li><code>endTime</code> - Period end time (HH:MM)</li> <li><code>type</code> - Rate period type (peak/off-peak/shoulder)</li> <li><code>rate</code> - Energy rate for this period</li> </ul> </li> <li><code>days</code> - Days this schedule applies to</li> </ul> </li> <li><code>activeSchedule</code> - Currently active schedule ID</li> <li><code>mode</code> - Current TOU operation mode</li> </ul> </dd> </dl> <h3>Status</h3> <ul> <li><b>Blue dot</b>: Requesting TOU settings</li> <li><b>Green dot</b>: Successfully retrieved settings</li> <li><b>Red ring</b>: Error occurred or missing configuration</li> </ul> <h3>Example Output</h3> <p><pre> { "timestamp": "2024-07-10T15:30:00.000Z", "enabled": true, "schedules": [ { "id": "weekday", "name": "Weekday Schedule", "periods": [ { "startTime": "00:00", "endTime": "06:00", "type": "off-peak", "rate": 0.12 }, { "startTime": "06:00", "endTime": "17:00", "type": "shoulder", "rate": 0.15 }, { "startTime": "17:00", "endTime": "21:00", "type": "peak", "rate": 0.32 }, { "startTime": "21:00", "endTime": "24:00", "type": "off-peak", "rate": 0.12 } ], "days": ["MON", "TUE", "WED", "THU", "FRI"] } ], "activeSchedule": "weekday", "mode": "cost-optimization" } </pre></p> <h3>Notes</h3> <ul> <li>Times are in 24-hour format (HH:MM)</li> <li>Rates are in currency per kWh</li> <li>Days are three-letter abbreviations (MON, TUE, etc.)</li> <li>Multiple schedules can exist for different days</li> </ul> <h3>References</h3> <ul> <li><a href="https://www.franklinwh.com/support" target="_blank">FranklinWH Documentation</a></li> </ul> </script>