Hi Josh,
I use a 3:1 configuration. To automate that, I used a Raspberry Pi Pico with some CircuitPython that waits for commands on the USB serial port and then switches to the associated input. It also reports the current setting every now and then (I think I have it set to every 5 seconds). The box with the controller and the relay board also has a pushbutton that lets my cycle through the three relay configurations, plus "all relays off". When I push the button, then after less than five seconds, the NodeRed dashboard will update. TheThe NodeRed workflow is pretty straight forward:
[
{
"id": "b09908b927c79022",
"type": "tab",
"label": "Antenna Switch",
"disabled": false,
"info": "",
"env": []
},
{
"id": "3af7477f0ef053ba",
"type": "inject",
"z": "b09908b927c79022",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "10",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "q;",
"payloadType": "str",
"x": 110,
"y": 360,
"wires": [
[
"e1a9400b6bd80728"
]
]
},
{
"id": "4d9ccf959ab4d7d7",
"type": "json",
"z": "b09908b927c79022",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 610,
"y": 360,
"wires": [
[
"1c3e2b3f842cf5cf"
]
]
},
{
"id": "1c3e2b3f842cf5cf",
"type": "function",
"z": "b09908b927c79022",
"name": "Parse JSON",
"func": "// parse the msg.payload structure\nvar p1, p2, p3;\nif (typeof msg.payload.ant1 != \"undefined\") {\n p1 = { payload: msg.payload.ant1, background: msg.payload.ant1 ? \"green\" : \"gray\"};\n p2 = { payload: msg.payload.ant2, background: msg.payload.ant2 ? \"green\" : \"gray\" };\n p3 = { payload: msg.payload.ant3, background: msg.payload.ant3 ? \"green\" : \"gray\" };\n}\nelse {\n p1 = { payload: false, background: \"gray\" };\n p2 = { payload: false, background: \"gray\" };\n p3 = { payload: false, background: \"gray\" };\n}\nreturn [ p1, p2, p3 ];",
"outputs": 3,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 510,
"y": 460,
"wires": [
[
"b910401caecdbf58"
],
[
"291af4c06fc1e9b8"
],
[
"1fad30b61d2b44a8"
]
]
},
{
"id": "e1a9400b6bd80728",
"type": "serial request",
"z": "b09908b927c79022",
"name": "Antenna Switch",
"serial": "cb68cbd735914470",
"x": 360,
"y": 360,
"wires": [
[
"4d9ccf959ab4d7d7"
]
]
},
{
"id": "b910401caecdbf58",
"type": "ui_button",
"z": "b09908b927c79022",
"name": "",
"group": "8cabfa32056e8eec",
"order": 5,
"width": 0,
"height": 0,
"passthru": false,
"label": "KX3",
"tooltip": "",
"color": "",
"bgcolor": "{{msg.background}}",
"className": "",
"icon": "",
"payload": "s1;",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 170,
"y": 540,
"wires": [
[
"e1a9400b6bd80728"
]
]
},
{
"id": "291af4c06fc1e9b8",
"type": "ui_button",
"z": "b09908b927c79022",
"name": "",
"group": "8cabfa32056e8eec",
"order": 5,
"width": 0,
"height": 0,
"passthru": false,
"label": "HL2",
"tooltip": "",
"color": "",
"bgcolor": "{{msg.background}}",
"className": "",
"icon": "",
"payload": "s2;",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 170,
"y": 580,
"wires": [
[
"e1a9400b6bd80728"
]
]
},
{
"id": "1fad30b61d2b44a8",
"type": "ui_button",
"z": "b09908b927c79022",
"name": "",
"group": "8cabfa32056e8eec",
"order": 5,
"width": 0,
"height": 0,
"passthru": false,
"label": "AUX",
"tooltip": "",
"color": "",
"bgcolor": "{{msg.background}}",
"className": "",
"icon": "",
"payload": "s3;",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 170,
"y": 620,
"wires": [
[
"e1a9400b6bd80728"
]
]
},
{
"id": "9c26c67a97c08bce",
"type": "ui_button",
"z": "b09908b927c79022",
"name": "",
"group": "8cabfa32056e8eec",
"order": 10,
"width": 0,
"height": 0,
"passthru": false,
"label": "All Off",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "s0;",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 190,
"y": 660,
"wires": [
[
"e1a9400b6bd80728"
]
]
},
{
"id": "cb68cbd735914470",
"type": "serial-port",
"serialport": "/dev/serial/by-id/usb-Raspberry_Pi_Pico_E660C06213844935-if02",
"serialbaud": "115200",
"databits": "8",
"parity": "none",
"stopbits": "1",
"waitfor": "",
"dtr": "none",
"rts": "none",
"cts": "none",
"dsr": "none",
"newline": "}",
"bin": "false",
"out": "char",
"addchar": "",
"responsetimeout": "100"
},
{
"id": "8cabfa32056e8eec",
"type": "ui_group",
"name": "Input",
"tab": "6da4b2b7c2781bb8",
"order": 1,
"disp": true,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "6da4b2b7c2781bb8",
"type": "ui_tab",
"name": "K5KHK",
"icon": "dashboard",
"order": 2,
"disabled": false,
"hidden": false
}
]