Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ A collection of nodes for controlling Q-Sys.

| Version | Description |
|---------|-------------------------------------------------|
| 1.0.5 | Added socket keepalive and timeout handling |
| 1.0.4 | Added error catch before parsing JSON PR#9 |
| 1.0.3 | Added `controlType` to **qsys-controlSet** node |
| 1.0.2 | Updated dependencies |
Expand Down
217 changes: 217 additions & 0 deletions examples/test_mixer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
[
{
"id": "test_mixer_flow",
"type": "tab",
"label": "Q-SYS Test - Mixer4x2",
"disabled": false,
"info": "Test flow for Mixer4x2 controls on Q-SYS Core at 192.168.1.191"
},
{
"id": "mixer_gain_node",
"type": "qsys-ControlSet",
"z": "test_mixer_flow",
"name": "Mixer Gain Ch1",
"topic": "",
"server": "qsys_core_config",
"controlId": "Mixer4x2.gain.1",
"changeGroup": "0",
"x": 320,
"y": 80,
"wires": [
[
"debug_gain"
]
]
},
{
"id": "debug_gain",
"type": "debug",
"z": "test_mixer_flow",
"name": "Gain Feedback",
"active": true,
"tosidebar": true,
"console": true,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 540,
"y": 80,
"wires": []
},
{
"id": "inject_0db",
"type": "inject",
"z": "test_mixer_flow",
"name": "0 dB",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "0",
"payloadType": "num",
"x": 110,
"y": 40,
"wires": [
[
"mixer_gain_node"
]
]
},
{
"id": "inject_minus10db",
"type": "inject",
"z": "test_mixer_flow",
"name": "-10 dB",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "-10",
"payloadType": "num",
"x": 110,
"y": 80,
"wires": [
[
"mixer_gain_node"
]
]
},
{
"id": "inject_minus20db",
"type": "inject",
"z": "test_mixer_flow",
"name": "-20 dB",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "-20",
"payloadType": "num",
"x": 110,
"y": 120,
"wires": [
[
"mixer_gain_node"
]
]
},
{
"id": "mixer_mute_node",
"type": "qsys-ControlSet",
"z": "test_mixer_flow",
"name": "Mixer Mute Ch1",
"topic": "",
"server": "qsys_core_config",
"controlId": "Mixer4x2.mute.1",
"changeGroup": "0",
"x": 320,
"y": 220,
"wires": [
[
"debug_mute"
]
]
},
{
"id": "debug_mute",
"type": "debug",
"z": "test_mixer_flow",
"name": "Mute Feedback",
"active": true,
"tosidebar": true,
"console": true,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 540,
"y": 220,
"wires": []
},
{
"id": "inject_unmute",
"type": "inject",
"z": "test_mixer_flow",
"name": "Unmute (0)",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "0",
"payloadType": "num",
"x": 120,
"y": 200,
"wires": [
[
"mixer_mute_node"
]
]
},
{
"id": "inject_mute",
"type": "inject",
"z": "test_mixer_flow",
"name": "Mute (1)",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "1",
"payloadType": "num",
"x": 110,
"y": 240,
"wires": [
[
"mixer_mute_node"
]
]
},
{
"id": "qsys_core_config",
"type": "qsys-core",
"host": "192.168.1.191",
"port": "1710",
"isRedundant": "false",
"redundantHost": "",
"authentication": "false",
"pollTime1": "0.25",
"pollTime2": "0.5",
"pollTime3": "0.75",
"pollTime4": "1",
"logConnection": "true",
"logCommunications": "false"
}
]
14 changes: 9 additions & 5 deletions lib/qsys-ControlSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,23 @@ module.exports = function (RED) {
this.server = RED.nodes.getNode(config.server);

/*****************************************************************************
* Socket Event handlers
* Server Event handlers - listen to connection state changes
*****************************************************************************/

this.server.socket.on('ready', () => {
this.server.on('connected', () => {
this.status({ fill: 'green', shape: 'dot', text: 'connected' });
});

this.server.socket.on('error', (err) => {
this.server.on('connecting', () => {
this.status({ fill: 'yellow', shape: 'ring', text: 'connecting...' });
});

this.server.on('error', () => {
this.status({ fill: 'red', shape: 'ring', text: 'error' });
});

this.server.socket.on('timeout', () => {
this.status({ fill: 'red', shape: 'dot', text: 'error' });
this.server.on('disconnected', () => {
this.status({ fill: 'red', shape: 'dot', text: 'disconnected' });
});

/*****************************************************************************
Expand Down
14 changes: 9 additions & 5 deletions lib/qsys-Presets.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,23 @@ module.exports = function (RED) {
this.server = RED.nodes.getNode(config.server);

/*****************************************************************************
* Socket Event handlers
* Server Event handlers - listen to connection state changes
*****************************************************************************/

this.server.socket.on('ready', () => {
this.server.on('connected', () => {
this.status({ fill: 'green', shape: 'dot', text: 'connected' });
});

this.server.socket.on('error', (err) => {
this.server.on('connecting', () => {
this.status({ fill: 'yellow', shape: 'ring', text: 'connecting...' });
});

this.server.on('error', () => {
this.status({ fill: 'red', shape: 'ring', text: 'error' });
});

this.server.socket.on('timeout', () => {
this.status({ fill: 'red', shape: 'dot', text: 'error' });
this.server.on('disconnected', () => {
this.status({ fill: 'red', shape: 'dot', text: 'disconnected' });
});

/*****************************************************************************
Expand Down
8 changes: 7 additions & 1 deletion lib/qsys-core.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@

<script type="text/html" data-help-name="qsys-core">
<p>Manages connection to <strong>Q-Sys Core</strong></p>
<h3>Debug and Error Handling</h3>
<p>Use Node-RED's built-in catch and status nodes to monitor the node:</p>
<ul>
<li>Add a catch node to handle connection and runtime errors</li>
<li>Add a status node to monitor connection state changes</li>
</ul>
<h3>Edit Dialog Properties</h3>
<ol>
<li>
Expand Down Expand Up @@ -119,7 +125,7 @@ <h3>Edit Dialog Properties</h3>
</ol>
</script>

<script type="text/javascript">
<script>
RED.nodes.registerType('qsys-core', {
category: 'config',
defaults: {
Expand Down
Loading