node-red-contrib-dmx-for-ha 0.2.0 → 0.2.2
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/nodes/ha-mqtt-button.html +4 -0
- package/nodes/ha-mqtt-button.js +10 -3
- package/nodes/ha-mqtt-dmx-group.html +4 -0
- package/nodes/ha-mqtt-dmx-group.js +16 -2
- package/nodes/ha-mqtt-dmx.html +4 -0
- package/nodes/ha-mqtt-dmx.js +9 -2
- package/nodes/ha-mqtt-pir.html +4 -0
- package/nodes/ha-mqtt-pir.js +9 -2
- package/nodes/ha-mqtt-relay.html +4 -0
- package/nodes/ha-mqtt-relay.js +9 -2
- package/package.json +1 -1
|
@@ -273,6 +273,10 @@
|
|
|
273
273
|
<span style="margin-left:8px; color:#999; font-size:0.85em;">HA auto-clears binary_sensor after this delay</span>
|
|
274
274
|
</div>
|
|
275
275
|
|
|
276
|
+
<div style="margin-top:16px; padding-top:8px; border-top:1px solid #444; color:#666; font-size:0.8em; text-align:right;">
|
|
277
|
+
node-red-contrib-dmx-for-ha v0.2.2
|
|
278
|
+
</div>
|
|
279
|
+
|
|
276
280
|
</script>
|
|
277
281
|
|
|
278
282
|
|
package/nodes/ha-mqtt-button.js
CHANGED
|
@@ -49,6 +49,13 @@ module.exports = function (RED) {
|
|
|
49
49
|
broker.on('connect', function () {
|
|
50
50
|
_tryDiscover();
|
|
51
51
|
});
|
|
52
|
+
broker.on('close', function () {
|
|
53
|
+
setStatus('red', 'ring', 'Broker disconnected');
|
|
54
|
+
});
|
|
55
|
+
broker.on('error', function (err) {
|
|
56
|
+
node.warn('MQTT broker error: ' + (err.message || err));
|
|
57
|
+
setStatus('red', 'dot', 'Broker error — check config');
|
|
58
|
+
});
|
|
52
59
|
// Fallback — if connect event already fired before listener registered
|
|
53
60
|
setTimeout(function () {
|
|
54
61
|
_tryDiscover();
|
|
@@ -113,14 +120,14 @@ module.exports = function (RED) {
|
|
|
113
120
|
name: `${S.buttonPosition} button ${S.situation} the ${cfg.zone} ${S.area} ${S.subLocation}`,
|
|
114
121
|
stat_t: statTopic,
|
|
115
122
|
off_delay: S.holdTime,
|
|
116
|
-
enabled_by_default:
|
|
123
|
+
enabled_by_default: true,
|
|
117
124
|
icon: S.haIcon,
|
|
118
125
|
device: {
|
|
119
126
|
identifiers: `binary_sensor-${fixtureId}`,
|
|
120
127
|
name: `(${fixtureId}) - Wall Button ${S.situation} the ${cfg.zone} - ${S.area} - ${S.subLocation}`,
|
|
121
128
|
model: `Wall button located ${S.situation} the ${cfg.zone} - ${S.area}`,
|
|
122
129
|
model_id: `referenced on plan as: (${fixtureId}`,
|
|
123
|
-
suggested_area: `${cfg.zone} ${S.area} ${S.subLocation}
|
|
130
|
+
suggested_area: discoveryMode !== 'hidden' ? `${cfg.zone} ${S.area} ${S.subLocation}` : undefined,
|
|
124
131
|
hw_version: `Wall button — ${S.ledColor} LED. Publishes "${S.buttonPayload}" on topic: ${S.subscribeTopic}`,
|
|
125
132
|
serial_number: `(${fixtureId}) Payload: ${S.buttonPayload}`,
|
|
126
133
|
sw_version: 'ha-mqtt-button: 0.1.0',
|
|
@@ -135,7 +142,7 @@ module.exports = function (RED) {
|
|
|
135
142
|
name: `${S.buttonPosition} (UI) ${S.situation} the ${cfg.zone} ${S.area} ${S.subLocation}`,
|
|
136
143
|
cmd_t: uiBtnCmdTopic,
|
|
137
144
|
payload_press: 'PRESS',
|
|
138
|
-
enabled_by_default:
|
|
145
|
+
enabled_by_default: true,
|
|
139
146
|
icon: S.haIcon,
|
|
140
147
|
device: { identifiers: `binary_sensor-${fixtureId}` },
|
|
141
148
|
};
|
|
@@ -301,6 +301,10 @@
|
|
|
301
301
|
<span style="margin-left:8px; color:#999; font-size:0.85em;">0 = disable loop detection</span>
|
|
302
302
|
</div>
|
|
303
303
|
|
|
304
|
+
<div style="margin-top:16px; padding-top:8px; border-top:1px solid #444; color:#666; font-size:0.8em; text-align:right;">
|
|
305
|
+
node-red-contrib-dmx-for-ha v0.2.2
|
|
306
|
+
</div>
|
|
307
|
+
|
|
304
308
|
</script>
|
|
305
309
|
|
|
306
310
|
|
|
@@ -52,6 +52,13 @@ module.exports = function (RED) {
|
|
|
52
52
|
broker.on('connect', function () {
|
|
53
53
|
_tryDiscover();
|
|
54
54
|
});
|
|
55
|
+
broker.on('close', function () {
|
|
56
|
+
setStatus('red', 'ring', 'Broker disconnected');
|
|
57
|
+
});
|
|
58
|
+
broker.on('error', function (err) {
|
|
59
|
+
node.warn('MQTT broker error: ' + (err.message || err));
|
|
60
|
+
setStatus('red', 'dot', 'Broker error — check config');
|
|
61
|
+
});
|
|
55
62
|
// Fallback — if connect event already fired before listener registered
|
|
56
63
|
setTimeout(function () {
|
|
57
64
|
_tryDiscover();
|
|
@@ -197,7 +204,7 @@ module.exports = function (RED) {
|
|
|
197
204
|
schema: 'json',
|
|
198
205
|
object_id: objectId,
|
|
199
206
|
optimistic: false,
|
|
200
|
-
enabled_by_default:
|
|
207
|
+
enabled_by_default: true,
|
|
201
208
|
icon: S.haIcon,
|
|
202
209
|
supported_color_modes: [S.colorMode],
|
|
203
210
|
brightness: true,
|
|
@@ -216,7 +223,7 @@ module.exports = function (RED) {
|
|
|
216
223
|
name: `(${groupId}) - ${S.deviceType} Group ${S.situation} the ${cfg.zone} - ${S.area} - ${S.subLocation}`,
|
|
217
224
|
model: `${S.colorMode} ${S.deviceType} Group located ${S.situation} the ${cfg.zone} - ${S.area}`,
|
|
218
225
|
model_id: `referenced on plan as: (${groupId}`,
|
|
219
|
-
suggested_area: `${cfg.zone} ${S.area} ${S.subLocation}
|
|
226
|
+
suggested_area: discoveryMode !== 'hidden' ? `${cfg.zone} ${S.area} ${S.subLocation}` : undefined,
|
|
220
227
|
hw_version: 'Virtual fixture — exists as a DMX Group Node in Node-RED',
|
|
221
228
|
sw_version: 'ha-mqtt-dmx-group: 0.1.0',
|
|
222
229
|
manufacturer: 'DeSwaggy — Discord: @deswaggy',
|
|
@@ -233,6 +240,9 @@ module.exports = function (RED) {
|
|
|
233
240
|
saveGroupState(payload);
|
|
234
241
|
pubState({ state: payload.state, color_mode: S.colorMode, brightness: payload.brightness });
|
|
235
242
|
forwardToChildren(payload, null);
|
|
243
|
+
const _lbl = payload.effect ? `effect:${payload.effect}` : `${payload.state}`;
|
|
244
|
+
setStatus('green', 'dot', `${groupId} → ${_lbl}`);
|
|
245
|
+
setTimeout(() => setStatus('yellow', 'ring', `${groupId} ready`), 3000);
|
|
236
246
|
}, node.id);
|
|
237
247
|
|
|
238
248
|
setStatus('green', 'ring', `${groupId} discovery sent`);
|
|
@@ -277,6 +287,8 @@ module.exports = function (RED) {
|
|
|
277
287
|
saveGroupState(msg.payload);
|
|
278
288
|
pubState({ state: msg.payload.state, color_mode: S.colorMode, brightness: msg.payload.brightness });
|
|
279
289
|
forwardToChildren(msg.payload, msg.dmx_trace);
|
|
290
|
+
setStatus('green', 'dot', `${groupId} → cascade:${msg.payload.state}`);
|
|
291
|
+
setTimeout(() => setStatus('yellow', 'ring', `${groupId} ready`), 3000);
|
|
280
292
|
}
|
|
281
293
|
} else {
|
|
282
294
|
const devReq = typeof msg.device === 'string'
|
|
@@ -293,6 +305,8 @@ module.exports = function (RED) {
|
|
|
293
305
|
saveGroupState(msg.payload);
|
|
294
306
|
pubState({ state: msg.payload.state, color_mode: S.colorMode, brightness: msg.payload.brightness });
|
|
295
307
|
forwardToChildren(msg.payload, null);
|
|
308
|
+
setStatus('green', 'dot', `${groupId} → ${msg.payload.state}`);
|
|
309
|
+
setTimeout(() => setStatus('yellow', 'ring', `${groupId} ready`), 3000);
|
|
296
310
|
} else {
|
|
297
311
|
node.warn(`${groupId} — unrecognised message received and dropped. See node documentation.`);
|
|
298
312
|
}
|
package/nodes/ha-mqtt-dmx.html
CHANGED
|
@@ -538,6 +538,10 @@
|
|
|
538
538
|
<span style="margin-left:8px; color:#999; font-size:0.85em;">Default 31</span>
|
|
539
539
|
</div>
|
|
540
540
|
|
|
541
|
+
<div style="margin-top:16px; padding-top:8px; border-top:1px solid #444; color:#666; font-size:0.8em; text-align:right;">
|
|
542
|
+
node-red-contrib-dmx-for-ha v0.2.2
|
|
543
|
+
</div>
|
|
544
|
+
|
|
541
545
|
</script>
|
|
542
546
|
|
|
543
547
|
</script>
|
package/nodes/ha-mqtt-dmx.js
CHANGED
|
@@ -59,6 +59,13 @@ module.exports = function (RED) {
|
|
|
59
59
|
broker.on('connect', function () {
|
|
60
60
|
_tryDiscover();
|
|
61
61
|
});
|
|
62
|
+
broker.on('close', function () {
|
|
63
|
+
setStatus('red', 'ring', 'Broker disconnected');
|
|
64
|
+
});
|
|
65
|
+
broker.on('error', function (err) {
|
|
66
|
+
node.warn('MQTT broker error: ' + (err.message || err));
|
|
67
|
+
setStatus('red', 'dot', 'Broker error — check config');
|
|
68
|
+
});
|
|
62
69
|
// Fallback — if connect event already fired before listener registered
|
|
63
70
|
setTimeout(function () {
|
|
64
71
|
_tryDiscover();
|
|
@@ -455,7 +462,7 @@ module.exports = function (RED) {
|
|
|
455
462
|
schema: 'json',
|
|
456
463
|
object_id: objectId,
|
|
457
464
|
optimistic: false,
|
|
458
|
-
enabled_by_default:
|
|
465
|
+
enabled_by_default: true,
|
|
459
466
|
icon: S.haIcon,
|
|
460
467
|
supported_color_modes: [S.colorMode],
|
|
461
468
|
brightness: true,
|
|
@@ -474,7 +481,7 @@ module.exports = function (RED) {
|
|
|
474
481
|
name: `(${fixtureId}) - ${S.deviceType} ${S.situation} the ${cfg.zone} - ${S.area} - ${S.subLocation}`,
|
|
475
482
|
model: `${S.colorMode} ${S.deviceType} located ${S.situation} the ${cfg.zone} - ${S.area}`,
|
|
476
483
|
model_id: `referenced on plan as: (${fixtureId}`,
|
|
477
|
-
suggested_area: `${cfg.zone} ${S.area} ${S.subLocation}
|
|
484
|
+
suggested_area: discoveryMode !== 'hidden' ? `${cfg.zone} ${S.area} ${S.subLocation}` : undefined,
|
|
478
485
|
hw_version: `DMX Controller in ${cfg.zone}. MQTT: ${dmxTopic}`,
|
|
479
486
|
serial_number: fixtureId,
|
|
480
487
|
sw_version: 'ha-mqtt-dmx: 0.1.0',
|
package/nodes/ha-mqtt-pir.html
CHANGED
|
@@ -278,6 +278,10 @@
|
|
|
278
278
|
<span style="margin-left:8px; color:#999; font-size:0.85em;">Offline delay after boot before PIR activates</span>
|
|
279
279
|
</div>
|
|
280
280
|
|
|
281
|
+
<div style="margin-top:16px; padding-top:8px; border-top:1px solid #444; color:#666; font-size:0.8em; text-align:right;">
|
|
282
|
+
node-red-contrib-dmx-for-ha v0.2.2
|
|
283
|
+
</div>
|
|
284
|
+
|
|
281
285
|
</script>
|
|
282
286
|
|
|
283
287
|
|
package/nodes/ha-mqtt-pir.js
CHANGED
|
@@ -49,6 +49,13 @@ module.exports = function (RED) {
|
|
|
49
49
|
broker.on('connect', function () {
|
|
50
50
|
_tryDiscover();
|
|
51
51
|
});
|
|
52
|
+
broker.on('close', function () {
|
|
53
|
+
setStatus('red', 'ring', 'Broker disconnected');
|
|
54
|
+
});
|
|
55
|
+
broker.on('error', function (err) {
|
|
56
|
+
node.warn('MQTT broker error: ' + (err.message || err));
|
|
57
|
+
setStatus('red', 'dot', 'Broker error — check config');
|
|
58
|
+
});
|
|
52
59
|
// Fallback — if connect event already fired before listener registered
|
|
53
60
|
setTimeout(function () {
|
|
54
61
|
_tryDiscover();
|
|
@@ -154,14 +161,14 @@ module.exports = function (RED) {
|
|
|
154
161
|
payload_not_available: 'offline',
|
|
155
162
|
off_delay: S.holdTime,
|
|
156
163
|
device_class: 'motion',
|
|
157
|
-
enabled_by_default:
|
|
164
|
+
enabled_by_default: true,
|
|
158
165
|
icon: S.haIcon,
|
|
159
166
|
device: {
|
|
160
167
|
identifiers: `binary_sensor-${fixtureId}`,
|
|
161
168
|
name: `(${fixtureId}) - ${S.pirType} PIR ${S.situation} the ${cfg.zone} - ${S.area} - ${S.subLocation}`,
|
|
162
169
|
model: `${S.pirType} PIR located ${S.situation} the ${cfg.zone} - ${S.area}`,
|
|
163
170
|
model_id: `referenced on plan as: (${fixtureId}`,
|
|
164
|
-
suggested_area: `${cfg.zone} ${S.area} ${S.subLocation}
|
|
171
|
+
suggested_area: discoveryMode !== 'hidden' ? `${cfg.zone} ${S.area} ${S.subLocation}` : undefined,
|
|
165
172
|
hw_version: `${S.pirType} PIR — ${S.cableColor} Cat5 cable. Publishes "${S.pirPayload}" on topic: ${S.subscribeTopic}`,
|
|
166
173
|
serial_number: `(${fixtureId}) Payload: ${S.pirPayload}`,
|
|
167
174
|
sw_version: `ha-mqtt-pir: ${RED.version ? RED.version() : '0.1.0'}`,
|
package/nodes/ha-mqtt-relay.html
CHANGED
|
@@ -275,6 +275,10 @@
|
|
|
275
275
|
<label for="node-input-showEffects" style="width:auto">Show effects in HA</label>
|
|
276
276
|
</div>
|
|
277
277
|
|
|
278
|
+
<div style="margin-top:16px; padding-top:8px; border-top:1px solid #444; color:#666; font-size:0.8em; text-align:right;">
|
|
279
|
+
node-red-contrib-dmx-for-ha v0.2.2
|
|
280
|
+
</div>
|
|
281
|
+
|
|
278
282
|
</script>
|
|
279
283
|
|
|
280
284
|
|
package/nodes/ha-mqtt-relay.js
CHANGED
|
@@ -52,6 +52,13 @@ module.exports = function (RED) {
|
|
|
52
52
|
broker.on('connect', function () {
|
|
53
53
|
_tryDiscover();
|
|
54
54
|
});
|
|
55
|
+
broker.on('close', function () {
|
|
56
|
+
setStatus('red', 'ring', 'Broker disconnected');
|
|
57
|
+
});
|
|
58
|
+
broker.on('error', function (err) {
|
|
59
|
+
node.warn('MQTT broker error: ' + (err.message || err));
|
|
60
|
+
setStatus('red', 'dot', 'Broker error — check config');
|
|
61
|
+
});
|
|
55
62
|
// Fallback — if connect event already fired before listener registered
|
|
56
63
|
setTimeout(function () {
|
|
57
64
|
_tryDiscover();
|
|
@@ -228,7 +235,7 @@ module.exports = function (RED) {
|
|
|
228
235
|
cmd_t: cmdTopic,
|
|
229
236
|
stat_t: statTopic,
|
|
230
237
|
optimistic: false,
|
|
231
|
-
enabled_by_default:
|
|
238
|
+
enabled_by_default: true,
|
|
232
239
|
icon: S.haIcon,
|
|
233
240
|
supported_color_modes: ['onoff'],
|
|
234
241
|
brightness: false,
|
|
@@ -241,7 +248,7 @@ module.exports = function (RED) {
|
|
|
241
248
|
name: `(${fixtureId}) - ${S.deviceType} ${S.situation} the ${cfg.zone} - ${S.area} - ${S.subLocation}`,
|
|
242
249
|
model: `${S.deviceType} located ${S.situation} the ${cfg.zone} - ${S.area}`,
|
|
243
250
|
model_id: `referenced on plan as: (${fixtureId}`,
|
|
244
|
-
suggested_area: `${cfg.zone} ${S.area} ${S.subLocation}
|
|
251
|
+
suggested_area: discoveryMode !== 'hidden' ? `${cfg.zone} ${S.area} ${S.subLocation}` : undefined,
|
|
245
252
|
hw_version: `Relay Controller in ${cfg.zone}. Topic: ${relayTopic}`,
|
|
246
253
|
serial_number: fixtureId,
|
|
247
254
|
sw_version: 'ha-mqtt-relay: 0.1.0',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-dmx-for-ha",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
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",
|