node-red-contrib-dmx-for-ha 0.6.26 → 0.6.28

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.
@@ -313,7 +313,7 @@
313
313
  </div>
314
314
 
315
315
  <div style="margin-top:16px; padding-top:8px; border-top:1px solid #444; color:#666; font-size:0.8em; text-align:right;">
316
- node-red-contrib-dmx-for-ha &nbsp;v0.6.26
316
+ node-red-contrib-dmx-for-ha &nbsp;v0.6.28
317
317
  </div>
318
318
 
319
319
  </script>
@@ -317,7 +317,7 @@
317
317
  </div>
318
318
 
319
319
  <div style="margin-top:16px; padding-top:8px; border-top:1px solid #444; color:#666; font-size:0.8em; text-align:right;">
320
- node-red-contrib-dmx-for-ha &nbsp;v0.6.26
320
+ node-red-contrib-dmx-for-ha &nbsp;v0.6.28
321
321
  </div>
322
322
 
323
323
  </script>
@@ -169,6 +169,7 @@
169
169
  defaultState: { value: 'OFF' },
170
170
  // Advanced
171
171
  dmxLimiter: { value: '255' },
172
+ dmxFloor: { value: '' },
172
173
  minOutput: { value: '1' },
173
174
  brightBump: { value: '50' },
174
175
  ticksPerSec: { value: '31' },
@@ -544,6 +545,15 @@
544
545
  <span style="margin-left:8px; color:#999; font-size:0.85em;">Caps all DMX channel values (0–255)</span>
545
546
  </div>
546
547
 
548
+ <div class="form-row">
549
+ <label for="node-input-dmxFloor">
550
+ <i class="fa fa-arrow-up"></i> DMX floor
551
+ </label>
552
+ <input type="number" id="node-input-dmxFloor"
553
+ min="0" max="20" step="1" style="width:70px" placeholder="config default" />
554
+ <span style="margin-left:8px; color:#999; font-size:0.85em;">Override config floor for this fixture (blank = use config default)</span>
555
+ </div>
556
+
547
557
  <div class="form-row">
548
558
  <label for="node-input-minOutput">
549
559
  <i class="fa fa-sort-numeric-asc"></i> Min output when ON
@@ -584,7 +594,7 @@
584
594
  </div>
585
595
 
586
596
  <div style="margin-top:16px; padding-top:8px; border-top:1px solid #444; color:#666; font-size:0.8em; text-align:right;">
587
- node-red-contrib-dmx-for-ha &nbsp;v0.6.26
597
+ node-red-contrib-dmx-for-ha &nbsp;v0.6.28
588
598
  </div>
589
599
 
590
600
  </script>
@@ -164,7 +164,7 @@ module.exports = function (RED) {
164
164
  flashShort: cfg.flashShort,
165
165
  flashLong: cfg.flashLong,
166
166
  diskDelay: cfg.diskDelay,
167
- dmxFloor: cfg.dmxFloor !== undefined ? cfg.dmxFloor : 3,
167
+ dmxFloor: config.dmxFloor !== '' && config.dmxFloor !== undefined && config.dmxFloor !== null ? parseInt(config.dmxFloor) : (cfg.dmxFloor !== undefined ? cfg.dmxFloor : 3),
168
168
  };
169
169
 
170
170
  // ── Debug mode safeguards ─────────────────────────────────────────
@@ -250,6 +250,10 @@ module.exports = function (RED) {
250
250
  const _lastSent = {};
251
251
 
252
252
  function sendDmxChannels(channels) {
253
+ // Enforce DMX floor — no value between 1 and (floor-1) ever reaches controller
254
+ if (S.dmxFloor > 0) {
255
+ channels = channels.map(([ch, val]) => [ch, (val > 0 && val < S.dmxFloor) ? S.dmxFloor : val]);
256
+ }
253
257
  if (dmxProfile.batched) {
254
258
  // ── Batched mode (etherten_v2) ─────────────────────────────
255
259
  // Collect all changed channels → publish ONE message per tick
@@ -351,18 +355,11 @@ module.exports = function (RED) {
351
355
  p.warmWhite !== undefined ? p.warmWhite : 0
352
356
  );
353
357
  sendDmxChannels(channels);
354
- const br = p.brightness !== undefined ? p.brightness : 255;
355
358
  pubState({
356
359
  state: p.state || 'OFF',
357
360
  color_mode: S.colorMode,
358
361
  brightness: p.brightness,
359
- color: {
360
- r: scaleToDmx(p.red !== undefined ? p.red : 255, br),
361
- g: scaleToDmx(p.green !== undefined ? p.green : 255, br),
362
- b: scaleToDmx(p.blue !== undefined ? p.blue : 255, br),
363
- w: scaleToDmx(p.white !== undefined ? p.white : 255, br),
364
- ww: p.warmWhite
365
- }
362
+ color: { r: p.red, g: p.green, b: p.blue, w: p.white, ww: p.warmWhite }
366
363
  });
367
364
  if (p.state === 'ON') {
368
365
  setStatus('green', 'dot', `${fixtureId} ON bright:${p.brightness}`);
@@ -498,12 +495,7 @@ module.exports = function (RED) {
498
495
  }
499
496
 
500
497
  saveState('ON', brightness, r, g, b, w, ww);
501
- // Report floored DMX values back to HA so sub-floor bleed is never stored in state
502
- const rPub = scaleToDmx(r, brightness);
503
- const gPub = scaleToDmx(g, brightness);
504
- const bPub = scaleToDmx(b, brightness);
505
- const wPub = scaleToDmx(w, brightness);
506
- pubState({ state: 'ON', color_mode: S.colorMode, brightness, color: { r: rPub, g: gPub, b: bPub, w: wPub, ww } });
498
+ pubState({ state: 'ON', color_mode: S.colorMode, brightness, color: { r, g, b, w, ww } });
507
499
  setStatus('green', 'dot', `${fixtureId} ON bright:${brightness}`);
508
500
  }
509
501
 
@@ -810,12 +802,7 @@ module.exports = function (RED) {
810
802
  } else {
811
803
  sendDmxChannels(buildColorChannels(0, r, g, b, w, ww));
812
804
  }
813
- // Report floored values so HA never stores sub-floor values in state
814
- const rPub = state === 'ON' ? scaleToDmx(r, brightness) : r;
815
- const gPub = state === 'ON' ? scaleToDmx(g, brightness) : g;
816
- const bPub = state === 'ON' ? scaleToDmx(b, brightness) : b;
817
- const wPub = state === 'ON' ? scaleToDmx(w, brightness) : w;
818
- pubState({ state, color_mode: S.colorMode, brightness, color: { r: rPub, g: gPub, b: bPub, w: wPub, ww } });
805
+ pubState({ state, color_mode: S.colorMode, brightness, color: { r, g, b, w, ww } });
819
806
  if (state === 'ON') {
820
807
  setStatus('green', 'dot', `${fixtureId} ON bright:${brightness}`);
821
808
  } else {
@@ -318,7 +318,7 @@
318
318
  </div>
319
319
 
320
320
  <div style="margin-top:16px; padding-top:8px; border-top:1px solid #444; color:#666; font-size:0.8em; text-align:right;">
321
- node-red-contrib-dmx-for-ha &nbsp;v0.6.26
321
+ node-red-contrib-dmx-for-ha &nbsp;v0.6.28
322
322
  </div>
323
323
 
324
324
  </script>
@@ -301,7 +301,7 @@
301
301
  </div>
302
302
 
303
303
  <div style="margin-top:16px; padding-top:8px; border-top:1px solid #444; color:#666; font-size:0.8em; text-align:right;">
304
- node-red-contrib-dmx-for-ha &nbsp;v0.6.26
304
+ node-red-contrib-dmx-for-ha &nbsp;v0.6.28
305
305
  </div>
306
306
 
307
307
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-dmx-for-ha",
3
- "version": "0.6.26",
3
+ "version": "0.6.28",
4
4
  "description": "DMX lighting control for Home Assistant via Node-RED and MQTT. Place a node, fill in the settings, deploy. Full HA device registry integration with RGBW/RGBWW/CCT/brightness colour modes, transitions, effects, and group control.",
5
5
  "keywords": [
6
6
  "node-red",