@bldgblocks/node-red-contrib-control 0.1.37 → 0.1.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -63,6 +63,10 @@
63
63
  <input type="text" id="node-input-isHeating" style="width: auto; vertical-align: middle;">
64
64
  <input type="hidden" id="node-input-isHeatingType">
65
65
  </div>
66
+ <div class="form-row">
67
+ <label for="node-input-startupDelay" title="Seconds to suppress heating/cooling calls after deploy (0 = disabled)"><i class="fa fa-hourglass-start"></i> Startup Delay</label>
68
+ <input type="number" id="node-input-startupDelay" placeholder="30" min="0" step="1">
69
+ </div>
66
70
  </script>
67
71
 
68
72
  <script type="text/javascript">
@@ -94,7 +98,8 @@
94
98
  ignoreAnticipatorCycles: { value: "1" },
95
99
  ignoreAnticipatorCyclesType: { value: "num" },
96
100
  isHeating: { value: false },
97
- isHeatingType: { value: "bool" }
101
+ isHeatingType: { value: "bool" },
102
+ startupDelay: { value: 30 }
98
103
  },
99
104
  inputs: 1,
100
105
  outputs: 3,
@@ -223,100 +228,50 @@
223
228
  </script>
224
229
 
225
230
  <script type="text/markdown" data-help-name="tstat-block">
226
- Thermostat controller for heating/cooling with single, split, or specified setpoint operation, hysteresis, and anticipation to prevent or allow overshoot for testing.
231
+ Thermostat controller for heating/cooling with single, split, or specified setpoint operation, hysteresis, and anticipation.
227
232
 
228
233
  ### Inputs
229
- : context (string) : Configures node (`"algorithm"`, `"setpoint"`, `"heatingSetpoint"`, `"coolingSetpoint"`, `"coolingOn"`, `"coolingOff"`, `"heatingOff"`, `"heatingOn"`, `"diff"`, `"anticipator"`, `"ignoreAnticipatorCycles"`, `"isHeating"`, `"status"`).
230
- : payload (number | boolean | string) : Number for temperature or config values, boolean for `isHeating`, string for `algorithm` (`"single"`, `"split"`, `"specified"`).
234
+ : payload (number) : Temperature reading.
235
+ : isHeating (boolean) : Optional. Overrides the configured heating mode (typically wired from a changeover node).
231
236
 
232
237
  ### Outputs
233
- All output messages include a `msg.status` object containing runtime information
234
- : isHeating (boolean) : `true` for heating mode, `false` for cooling mode. Includes `msg.context = "isHeating"`.
235
- : above (boolean) : `true` if input exceeds cooling on threshold.
236
- : below (boolean) : `true` if input is below heating on threshold.
237
- : status (object) : Contains detailed runtime information including:
238
- - `algorithm`: Current algorithm in use
239
- - `input`: Current temperature input value
240
- - `isHeating`: Current heating mode
241
- - `above/below`: Current output states
242
- - Algorithm-specific setpoints and values
243
- - `modeChanged`: If mode recently changed
244
- - `cyclesSinceModeChange`: Count since last mode change
245
- - `effectiveAnticipator`: Current anticipator value after mode change adjustments
238
+ : isHeating (boolean) : Output 1. Current heating mode. Includes `msg.context = "isHeating"`.
239
+ : above (boolean) : Output 2. `true` when cooling call is active (temperature exceeded cooling threshold).
240
+ : below (boolean) : Output 3. `true` when heating call is active (temperature dropped below heating threshold).
246
241
 
247
- ### Status Monitoring
248
- All outputs include comprehensive status information in `msg.status`. Example:
249
- ```json
250
- {
251
- "status": {
252
- "algorithm": "single",
253
- "input": 68.5,
254
- "isHeating": true,
255
- "above": false,
256
- "below": true,
257
- "setpoint": 70,
258
- "diff": 2,
259
- "anticipator": 0.5,
260
- "modeChanged": false,
261
- "cyclesSinceModeChange": 3,
262
- "effectiveAnticipator": 0.5
263
- }
264
- }
265
- ```
242
+ All outputs include a `msg.status` object with runtime diagnostics: `algorithm`, `input`, `isHeating`, `above`, `below`, `activeSetpoint`, `onThreshold`, `offThreshold`, `diff`, `anticipator`, `effectiveAnticipator`, `modeChanged`, `cyclesSinceModeChange`.
266
243
 
267
244
  ### Algorithms
268
- - **Single Setpoint**:
269
- - Uses `setpoint`, `diff`, and `anticipator`.
270
- - Sets `above` if `input > setpoint + diff/2`, clears when `input < setpoint + anticipator`.
271
- - Sets `below` if `input < setpoint - diff/2`, clears when `input > setpoint - anticipator`.
272
- - For positive `anticipator`, stops early to prevent overshoot. For negative `anticipator` (testing only), delays turn-off to overshoot setpoint.
273
- - Example: `setpoint=70`, `diff=2`, `anticipator=-0.5`, `above` if `input > 71`, clears at `< 69.5` (overshoots); `below` if `input < 69`, clears at `> 70.5` (overshoots).
274
-
275
- - **Split Setpoint**:
276
- - Uses `heatingSetpoint`, `coolingSetpoint`, `diff`, and `anticipator`.
277
- - For `isHeating = true`:
278
- - Sets `below` if `input < heatingSetpoint - diff/2`, clears when `input > heatingSetpoint - anticipator`.
279
- - `above` is `false`.
280
- - For `isHeating = false`:
281
- - Sets `above` if `input > coolingSetpoint + diff/2`, clears when `input < coolingSetpoint + anticipator`.
282
- - `below` is `false`.
283
- - Ensures `heatingSetpoint < coolingSetpoint`.
284
- - For negative `anticipator`, delays turn-off (e.g., heating off above `heatingSetpoint`).
285
- - Example: `heatingSetpoint=68`, `coolingSetpoint=74`, `diff=2`, `anticipator=-0.5`, heating mode sets `below` if `input < 67`, clears at `> 68.5`; cooling mode sets `above` if `input > 75`, clears at `< 73.5`.
286
245
 
287
- - **Specified Setpoint**:
288
- - Uses `coolingOn`, `coolingOff`, `heatingOff`, `heatingOn`, and `anticipator`.
289
- - For `isHeating = false`:
290
- - Sets `above` if `input > coolingOn`, clears when `input < coolingOff + anticipator`.
291
- - `below` is `false`.
292
- - For `isHeating = true`:
293
- - Sets `below` if `input < heatingOn`, clears when `input > heatingOff - anticipator`.
294
- - `above` is `false`.
295
- - Validates `coolingOn >= coolingOff >= heatingOff >= heatingOn`.
296
- - For negative `anticipator`, delays turn-off (e.g., heating off above `heatingOff`).
297
- - Example: `coolingOn=74`, `coolingOff=72`, `heatingOff=68`, `heatingOn=66`, `anticipator=-0.5`, cooling mode sets `above` if `input > 74`, clears at `< 71.5`; heating mode sets `below` if `input < 66`, clears at `> 68.5`.
246
+ **Single** — One setpoint with differential hysteresis.
247
+ - Heating: call ON when `temp < setpoint - diff/2`, OFF when `temp > setpoint - anticipator`
248
+ - Cooling: call ON when `temp > setpoint + diff/2`, OFF when `temp < setpoint + anticipator`
298
249
 
299
- ### Details
300
- Compares a numeric temperature input (`msg.payload`) against setpoints to control heating or cooling.
250
+ **Split** — Separate heating/cooling setpoints with differential.
251
+ - Heating: call ON when `temp < heatingSetpoint - diff/2`, OFF when `temp > heatingSetpoint - anticipator`
252
+ - Cooling: call ON when `temp > coolingSetpoint + diff/2`, OFF when `temp < coolingSetpoint + anticipator`
301
253
 
302
- The `differential` (`diff`) applies to the `single` and `split` setpoint algorithms, providing hysteresis.
254
+ **Specified** Explicit on/off trigger temperatures.
255
+ - Heating: call ON when `temp < heatingOn`, OFF when `temp > heatingOff - anticipator`
256
+ - Cooling: call ON when `temp > coolingOn`, OFF when `temp < coolingOff + anticipator`
303
257
 
304
- The `anticipator` adjusts turn-off points: positive values stop early to prevent overshoot (subtracts for heating, adds for cooling);
305
- negative values (allowed for testing, >= -2) delay turn-off to overshoot setpoint.
258
+ ### Anticipator
259
+ Positive values stop early to prevent overshoot. Negative values (≥ -2, testing only) delay turn-off to allow overshoot.
306
260
 
307
- The `isHeating` flag (typically from a changeover node) sets output 1 and selects the active setpoint(s).
261
+ The `ignoreAnticipatorCycles` setting disables the anticipator for N cycles after a mode change to reduce short-cycling.
308
262
 
309
- The `ignoreAnticipatorCycles` setting allows ignoring the anticipator for a specified number of cycles after a mode change to reduce short-cycling.
263
+ ### Startup Delay
264
+ Configurable delay (default 30s, 0 = disabled) suppresses `above`/`below` calls after deployment. Prevents false calls before upstream mode selection has initialized. During delay, `isHeating` passes through normally and internal state is tracked. Status shows `[startup]` during suppression.
310
265
 
311
- All numeric inputs (`setpoint`, `heatingSetpoint`, `coolingSetpoint`, `coolingOn`, `coolingOff`, `heatingOff`, `heatingOn`, `diff`, `anticipator`,
312
- `ignoreAnticipatorCycles`) support `num`, `msg`, `flow`, or `global` types via `typedInput`.
266
+ ### Configuration
267
+ All numeric inputs support `num`, `msg`, `flow`, or `global` types via typed inputs. The `isHeating` flag supports `bool`, `msg`, `flow`, or `global`. Algorithm supports dropdown, `msg`, `flow`, or `global`.
313
268
 
314
269
  ### Status
315
- - Green (dot): Configuration updates (e.g., `setpoint: 70.0`, `anticipator: 0.5`, `isHeating: true`).
316
- - Blue (dot): Outputs when state changes (e.g., `in: 65.00, out: heating, above: false, below: true`).
317
- - Blue (ring): Outputs when state unchanged (e.g., `in: 66.00, out: heating, above: false, below: true`).
318
- - Red (ring): Errors (e.g., `missing input`, `invalid coolingOff`, `invalid diff, using 2`).
319
- - Yellow (ring): Warnings (e.g., `unknown context`).
270
+ - Green (dot): Configuration update
271
+ - Blue (dot): State changed
272
+ - Blue (ring): State unchanged
273
+ - Red (ring): Error
274
+ - Yellow (ring): Warning / startup delay
320
275
 
321
276
  ### References
322
277
  - [Node-RED Documentation](https://nodered.org/docs/)