node-red-contrib-dmx-for-ha 0.6.16 → 0.6.18

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.
package/README.md CHANGED
@@ -228,7 +228,9 @@ Typical workflow: Remove → update node settings → Deploy → node auto-disco
228
228
 
229
229
  ## System control topic
230
230
 
231
- All nodes subscribe to a system control topic for **bulk add/remove during commissioning**. No wiring needed — publish one MQTT message and all matching nodes respond.
231
+ All nodes subscribe to a system control topic for **bulk add/remove during commissioning**. No wiring needed — publish one MQTT message and all matching nodes respond instantly.
232
+
233
+ This is one of the most useful commissioning features in the package. On large installations with hundreds of entities, the ability to wipe and rediscover a specific zone or type in one click saves hours of manual work.
232
234
 
233
235
  **Topic:** `{siteId}/system/control` (e.g. `MW3D/system/control`)
234
236
 
@@ -242,18 +244,66 @@ All nodes subscribe to a system control topic for **bulk add/remove during commi
242
244
  | Field | Values | Description |
243
245
  |---|---|---|
244
246
  | `cmd` | `add`, `remove` | Add or remove HA discovery |
245
- | `zone` | `all`, `Master`, `BnB` | Matches config node zone |
246
- | `type` | `all`, `dmx`, `button`, `pir`, `relay` | Node type filter |
247
+ | `zone` | `all`, or any zone name e.g. `Master`, `BnB` | Matches config node Zone field — case insensitive |
248
+ | `type` | `all`, `dmx`, `group`, `button`, `pir`, `relay` | Node type filter |
249
+
250
+ **Type reference:**
251
+
252
+ | Type | Node | Description |
253
+ |---|---|---|
254
+ | `dmx` | ha-mqtt-dmx | Individual DMX fixtures |
255
+ | `group` | ha-mqtt-dmx-group | DMX group nodes |
256
+ | `button` | ha-mqtt-button | Wall button inputs |
257
+ | `pir` | ha-mqtt-pir | PIR / motion sensors |
258
+ | `relay` | ha-mqtt-relay | Relay / power outputs |
259
+ | `all` | all of the above | Everything in the zone |
260
+
261
+ **Commissioning workflow — roll out one type at a time:**
262
+ ```
263
+ Day 1 — DMX lights:
264
+ ADD Master DMX → all lights appear in HA
265
+ Test each light
266
+ REMOVE Master DMX → wipe and fix any wrong names/channels
267
+ ADD Master DMX → rediscover clean
268
+
269
+ Day 2 — Buttons:
270
+ ADD Master Button → all buttons appear in HA
271
+ Test each button
272
+ etc.
273
+ ```
274
+
275
+ **How to send the command:**
276
+
277
+ Option A — from anywhere on the network (MQTT Explorer, HA automation, script):
278
+ ```
279
+ Topic: MW3D/system/control
280
+ Payload: {"cmd":"add","zone":"all","type":"all"}
281
+ ```
282
+
283
+ Option B — from Node-RED using the included System Control flow:
284
+
285
+ Import `system_control_flow.json` into Node-RED. Connect the MQTT out node to your broker. You get a dedicated tab with one-click buttons for every zone and type combination:
286
+
287
+ ```
288
+ 🗑 REMOVE ALL ✅ ADD ALL
289
+
290
+ 🗑 REMOVE Master DMX ✅ ADD Master DMX
291
+ 🗑 REMOVE Master Group ✅ ADD Master Group
292
+ 🗑 REMOVE Master Button ✅ ADD Master Button
293
+ 🗑 REMOVE Master PIR ✅ ADD Master PIR
294
+ 🗑 REMOVE Master Relay ✅ ADD Master Relay
295
+
296
+ 🗑 REMOVE BnB DMX ✅ ADD BnB DMX
297
+ ... etc.
298
+ ```
247
299
 
248
- **Commissioning workflow:**
300
+ Option C — wire an inject node directly to any ha-mqtt node input:
249
301
  ```
250
- 1. ADD Master DMX test all lights
251
- 2. REMOVE Master DMX fix wrong names/channels
252
- 3. ADD Master DMX → verify clean
253
- 4. Move to next type: Button → PIR → Relay
302
+ msg.device = "add" add that node only
303
+ msg.device = "remove" → remove that node only
254
304
  ```
255
305
 
256
- A **System Control flow** ships with the package (`system_control_flow.json`). Import it into Node-RED, connect the MQTT out node to your broker, and you have one-click bulk control per zone and type.
306
+ > **Tip:** The system control topic is zone and type filtered — sending `REMOVE BnB DMX` only affects BnB DMX fixtures. Master lights, buttons, relays are completely unaffected. This makes it safe to use on a live installation with clients present.
257
307
 
258
308
  ---
259
309
 
@@ -22,6 +22,7 @@ module.exports = function (RED) {
22
22
  if (!broker) { node.error('Button: no MQTT broker in config'); return; }
23
23
 
24
24
  broker.register(node);
25
+ if (broker.client && broker.client.setMaxListeners) broker.client.setMaxListeners(0);
25
26
 
26
27
  // ── Auto-discovery based on Discovery Mode ────────────────────
27
28
  const discoveryMode = config.discoveryMode || 'enabled';
@@ -315,6 +316,7 @@ module.exports = function (RED) {
315
316
 
316
317
  // ── Cleanup ───────────────────────────────────────────────
317
318
  node.on('close', function (done) {
319
+ unregisterFixtureId();
318
320
  broker.unsubscribe(S._activeBtnTopic || S.subscribeTopic, node.id);
319
321
  broker.unsubscribe(uiBtnCmdTopic, node.id);
320
322
  broker.deregister(node, done);
@@ -25,6 +25,7 @@ module.exports = function (RED) {
25
25
  if (!broker) { node.error('DMX Group: no MQTT broker in config'); return; }
26
26
 
27
27
  broker.register(node);
28
+ if (broker.client && broker.client.setMaxListeners) broker.client.setMaxListeners(0);
28
29
 
29
30
  // ── Auto-discovery based on Discovery Mode ────────────────────
30
31
  const discoveryMode = config.discoveryMode || 'enabled';
@@ -79,7 +80,7 @@ module.exports = function (RED) {
79
80
  const zone = (msg.zone || 'all').toLowerCase();
80
81
  if (zone !== 'all' && zone !== cfg.zone.toLowerCase()) return;
81
82
  const type = (msg.type || 'all').toLowerCase();
82
- if (type !== 'all' && type !== 'dmx') return;
83
+ if (type !== 'all' && type !== 'group') return;
83
84
  if (msg.cmd === 'remove') {
84
85
  _discovered = false;
85
86
  handleDeviceRemove(null);
@@ -417,6 +418,7 @@ module.exports = function (RED) {
417
418
 
418
419
  // ── Cleanup ───────────────────────────────────────────────
419
420
  node.on('close', function (done) {
421
+ unregisterFixtureId();
420
422
  if (diskTimer) clearTimeout(diskTimer);
421
423
  broker.unsubscribe(cmdTopic, node.id);
422
424
  broker.deregister(node, done);
@@ -32,6 +32,7 @@ module.exports = function (RED) {
32
32
  if (!broker) { node.error('DMX: no MQTT broker in config'); return; }
33
33
 
34
34
  broker.register(node);
35
+ if (broker.client && broker.client.setMaxListeners) broker.client.setMaxListeners(0);
35
36
 
36
37
  // ── Auto-discovery based on Discovery Mode ────────────────────
37
38
  const discoveryMode = config.discoveryMode || 'enabled';
@@ -864,6 +865,7 @@ module.exports = function (RED) {
864
865
 
865
866
  // ── Cleanup ───────────────────────────────────────────────
866
867
  node.on('close', function (done) {
868
+ unregisterFixtureId();
867
869
  clearChannelRegistry();
868
870
  stopEffect();
869
871
  if (diskTimer) clearTimeout(diskTimer);
@@ -22,6 +22,7 @@ module.exports = function (RED) {
22
22
  if (!broker) { node.error('PIR: no MQTT broker in config'); return; }
23
23
 
24
24
  broker.register(node);
25
+ if (broker.client && broker.client.setMaxListeners) broker.client.setMaxListeners(0);
25
26
 
26
27
  // ── Auto-discovery based on Discovery Mode ────────────────────
27
28
  const discoveryMode = config.discoveryMode || 'enabled';
@@ -349,6 +350,7 @@ module.exports = function (RED) {
349
350
 
350
351
  // ── Cleanup ───────────────────────────────────────────────
351
352
  node.on('close', function (done) {
353
+ unregisterFixtureId();
352
354
  cancelWarmup();
353
355
  broker.unsubscribe(S._activePirTopic || S.subscribeTopic, node.id);
354
356
  broker.deregister(node, done);
@@ -25,6 +25,7 @@ module.exports = function (RED) {
25
25
  if (!broker) { node.error('Relay: no MQTT broker in config'); return; }
26
26
 
27
27
  broker.register(node);
28
+ if (broker.client && broker.client.setMaxListeners) broker.client.setMaxListeners(0);
28
29
 
29
30
  // ── Auto-discovery based on Discovery Mode ────────────────────
30
31
  const discoveryMode = config.discoveryMode || 'enabled';
@@ -453,6 +454,7 @@ module.exports = function (RED) {
453
454
 
454
455
  // ── Cleanup ───────────────────────────────────────────────
455
456
  node.on('close', function (done) {
457
+ unregisterFixtureId();
456
458
  stopEffect();
457
459
  if (diskTimer) clearTimeout(diskTimer);
458
460
  broker.unsubscribe(cmdTopic, node.id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-dmx-for-ha",
3
- "version": "0.6.16",
3
+ "version": "0.6.18",
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",