Skip to content

Instantly share code, notes, and snippets.

@deek042
Last active February 19, 2022 00:25
Show Gist options
  • Save deek042/8af8c0b3248fc64d257b3ebadfe0a673 to your computer and use it in GitHub Desktop.
Save deek042/8af8c0b3248fc64d257b3ebadfe0a673 to your computer and use it in GitHub Desktop.
Roku Remote Control

This is a pretty simple Roku Remote Control that I made for Node-red. Just need to change the IP address to your Roku's. I've added a drop-down menu for multiple TVs, drop-down for inputs, keyword search and some icons.

2022-02-18 (5)

[
{
"id": "5fed5dca.adb674",
"type": "tab",
"label": "Roku",
"disabled": false,
"info": ""
},
{
"id": "3d16f5129bc83a2d",
"type": "ui_button",
"z": "5fed5dca.adb674",
"name": "",
"group": "52d9622270c1df34",
"order": 8,
"width": "2",
"height": "1",
"passthru": false,
"label": "UP",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "arrow_upwards",
"payload": "/keypress/Up",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 290,
"y": 300,
"wires": [
[
"2731cac39719b231"
]
]
},
{
"id": "f2dad4ac2f43386b",
"type": "ui_button",
"z": "5fed5dca.adb674",
"name": "",
"group": "52d9622270c1df34",
"order": 10,
"width": "2",
"height": "1",
"passthru": false,
"label": "LEFT",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "arrow_back",
"payload": "/keypress/Left",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 70,
"y": 360,
"wires": [
[
"e05d41fa5dea73ae"
]
]
},
{
"id": "554e09f6c068b8db",
"type": "ui_button",
"z": "5fed5dca.adb674",
"name": "",
"group": "52d9622270c1df34",
"order": 11,
"width": "2",
"height": "1",
"passthru": false,
"label": "SELECT",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "keyboard_return",
"payload": "/keypress/Select",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 300,
"y": 360,
"wires": [
[
"b7489c4f1bae404e"
]
]
},
{
"id": "898a49a7300129f0",
"type": "ui_button",
"z": "5fed5dca.adb674",
"name": "",
"group": "52d9622270c1df34",
"order": 12,
"width": "2",
"height": "1",
"passthru": false,
"label": "RIGHT",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "arrow_forward",
"payload": "/keypress/Right",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 500,
"y": 360,
"wires": [
[
"dcd28ff135f6784f"
]
]
},
{
"id": "e4d723d11e84c552",
"type": "ui_button",
"z": "5fed5dca.adb674",
"name": "",
"group": "52d9622270c1df34",
"order": 14,
"width": "2",
"height": "1",
"passthru": false,
"label": "DOWN",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "arrow_downward",
"payload": "/keypress/Down",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 300,
"y": 420,
"wires": [
[
"243af427af7b1af7"
]
]
},
{
"id": "1ed63b0465793a07",
"type": "ui_button",
"z": "5fed5dca.adb674",
"name": "",
"group": "52d9622270c1df34",
"order": 20,
"width": "2",
"height": "1",
"passthru": false,
"label": "MUTE",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "volume_off",
"payload": "/keypress/VolumeMute",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 290,
"y": 540,
"wires": [
[
"917f3a73d113798a"
]
]
},
{
"id": "4217c220ac388df8",
"type": "ui_button",
"z": "5fed5dca.adb674",
"name": "",
"group": "52d9622270c1df34",
"order": 4,
"width": "2",
"height": "1",
"passthru": false,
"label": "BACK",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "reply",
"payload": "/keypress/Back",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 70,
"y": 240,
"wires": [
[
"7507a251f0cac5c8"
]
]
},
{
"id": "b3246dc7311e93fe",
"type": "ui_button",
"z": "5fed5dca.adb674",
"name": "",
"group": "52d9622270c1df34",
"order": 6,
"width": "2",
"height": "1",
"passthru": false,
"label": "HOME",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "home",
"payload": "/keypress/Home",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 490,
"y": 240,
"wires": [
[
"548d79ac070d270a"
]
]
},
{
"id": "547dd602c1e4d6ea",
"type": "ui_button",
"z": "5fed5dca.adb674",
"name": "",
"group": "52d9622270c1df34",
"order": 19,
"width": "2",
"height": "1",
"passthru": false,
"label": "VOL +",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "volume_up",
"payload": "/keypress/VolumeUp",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 70,
"y": 540,
"wires": [
[
"caf03c9573c588cc"
]
]
},
{
"id": "cecfd3eb220d7d0a",
"type": "ui_button",
"z": "5fed5dca.adb674",
"name": "",
"group": "52d9622270c1df34",
"order": 22,
"width": "2",
"height": "1",
"passthru": false,
"label": "VOL -",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "volume_down",
"payload": "/keypress/VolumeDown",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 70,
"y": 600,
"wires": [
[
"d76baec55403a990"
]
]
},
{
"id": "5aff0de0078e5479",
"type": "ui_button",
"z": "5fed5dca.adb674",
"name": "",
"group": "52d9622270c1df34",
"order": 1,
"width": "2",
"height": "1",
"passthru": false,
"label": "OFF",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "radio_button_unchecked",
"payload": "/keypress/PowerOff",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 70,
"y": 180,
"wires": [
[
"d97209f96bb11289"
]
]
},
{
"id": "12a40aa42195fef8",
"type": "ui_button",
"z": "5fed5dca.adb674",
"name": "",
"group": "52d9622270c1df34",
"order": 24,
"width": "2",
"height": "1",
"passthru": false,
"label": "CH -",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "/keypress/ChannelDown",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 490,
"y": 600,
"wires": [
[
"e96390b4bcb5adcd"
]
]
},
{
"id": "05a9dcad2977728a",
"type": "ui_button",
"z": "5fed5dca.adb674",
"name": "",
"group": "52d9622270c1df34",
"order": 21,
"width": "2",
"height": "1",
"passthru": false,
"label": "CH +",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "/keypress/ChannelUp",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 490,
"y": 540,
"wires": [
[
"4141ac8713c012b6"
]
]
},
{
"id": "2742d25d82b687cb",
"type": "ui_button",
"z": "5fed5dca.adb674",
"name": "",
"group": "52d9622270c1df34",
"order": 17,
"width": "2",
"height": "1",
"passthru": false,
"label": "PLAY/PAUSE",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "play_arrow",
"payload": "/keypress/play",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 320,
"y": 480,
"wires": [
[
"58e4544077992cb4"
]
]
},
{
"id": "2610625642abe48e",
"type": "ui_button",
"z": "5fed5dca.adb674",
"name": "",
"group": "52d9622270c1df34",
"order": 3,
"width": "2",
"height": "1",
"passthru": false,
"label": "ON",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "radio_button_checked",
"payload": "/keypress/PowerOn",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 490,
"y": 180,
"wires": [
[
"47927ec65ab270ac"
]
]
},
{
"id": "917f3a73d113798a",
"type": "link out",
"z": "5fed5dca.adb674",
"name": "",
"mode": "link",
"links": [
"202cebd34dc11e6b",
"3a7c4e736bd384ba"
],
"x": 395,
"y": 540,
"wires": []
},
{
"id": "caf03c9573c588cc",
"type": "link out",
"z": "5fed5dca.adb674",
"name": "",
"mode": "link",
"links": [
"202cebd34dc11e6b",
"3a7c4e736bd384ba"
],
"x": 195,
"y": 540,
"wires": []
},
{
"id": "d76baec55403a990",
"type": "link out",
"z": "5fed5dca.adb674",
"name": "",
"mode": "link",
"links": [
"202cebd34dc11e6b",
"3a7c4e736bd384ba"
],
"x": 195,
"y": 600,
"wires": []
},
{
"id": "e96390b4bcb5adcd",
"type": "link out",
"z": "5fed5dca.adb674",
"name": "",
"mode": "link",
"links": [
"202cebd34dc11e6b",
"3a7c4e736bd384ba"
],
"x": 615,
"y": 600,
"wires": []
},
{
"id": "4141ac8713c012b6",
"type": "link out",
"z": "5fed5dca.adb674",
"name": "",
"mode": "link",
"links": [
"202cebd34dc11e6b",
"3a7c4e736bd384ba"
],
"x": 615,
"y": 540,
"wires": []
},
{
"id": "d97209f96bb11289",
"type": "link out",
"z": "5fed5dca.adb674",
"name": "",
"mode": "link",
"links": [
"202cebd34dc11e6b",
"3a7c4e736bd384ba"
],
"x": 195,
"y": 180,
"wires": []
},
{
"id": "e05d41fa5dea73ae",
"type": "link out",
"z": "5fed5dca.adb674",
"name": "",
"mode": "link",
"links": [
"202cebd34dc11e6b",
"3a7c4e736bd384ba"
],
"x": 195,
"y": 360,
"wires": []
},
{
"id": "7507a251f0cac5c8",
"type": "link out",
"z": "5fed5dca.adb674",
"name": "",
"mode": "link",
"links": [
"202cebd34dc11e6b",
"3a7c4e736bd384ba"
],
"x": 195,
"y": 240,
"wires": []
},
{
"id": "548d79ac070d270a",
"type": "link out",
"z": "5fed5dca.adb674",
"name": "",
"mode": "link",
"links": [
"202cebd34dc11e6b",
"3a7c4e736bd384ba"
],
"x": 615,
"y": 240,
"wires": []
},
{
"id": "dcd28ff135f6784f",
"type": "link out",
"z": "5fed5dca.adb674",
"name": "",
"mode": "link",
"links": [
"202cebd34dc11e6b",
"3a7c4e736bd384ba"
],
"x": 615,
"y": 360,
"wires": []
},
{
"id": "58e4544077992cb4",
"type": "link out",
"z": "5fed5dca.adb674",
"name": "",
"mode": "link",
"links": [
"202cebd34dc11e6b",
"3a7c4e736bd384ba"
],
"x": 395,
"y": 480,
"wires": []
},
{
"id": "243af427af7b1af7",
"type": "link out",
"z": "5fed5dca.adb674",
"name": "",
"mode": "link",
"links": [
"202cebd34dc11e6b",
"3a7c4e736bd384ba"
],
"x": 395,
"y": 420,
"wires": []
},
{
"id": "b7489c4f1bae404e",
"type": "link out",
"z": "5fed5dca.adb674",
"name": "",
"mode": "link",
"links": [
"202cebd34dc11e6b",
"3a7c4e736bd384ba"
],
"x": 395,
"y": 360,
"wires": []
},
{
"id": "2731cac39719b231",
"type": "link out",
"z": "5fed5dca.adb674",
"name": "",
"mode": "link",
"links": [
"202cebd34dc11e6b",
"3a7c4e736bd384ba"
],
"x": 395,
"y": 300,
"wires": []
},
{
"id": "47927ec65ab270ac",
"type": "link out",
"z": "5fed5dca.adb674",
"name": "",
"mode": "link",
"links": [
"202cebd34dc11e6b",
"3a7c4e736bd384ba"
],
"x": 615,
"y": 180,
"wires": []
},
{
"id": "b836956a23ef8390",
"type": "change",
"z": "5fed5dca.adb674",
"name": "button choice",
"rules": [
{
"t": "set",
"p": "roku_endpoint",
"pt": "msg",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 180,
"y": 40,
"wires": [
[
"b27a37d9c6d916f6"
]
]
},
{
"id": "cea9ec5bfbf6eb76",
"type": "function",
"z": "5fed5dca.adb674",
"name": "make post",
"func": "var ips = msg.roku_ip;\nif(!Array.isArray(ips)){\n ips = [ips];\n}\nvar endpoint = msg.roku_endpoint;\nvar port = msg.roku_port;\nips.forEach(function(ip) {\n var request = \"http://\" + ip + \":\" + port + endpoint;\n node.send({\"url\": request})\n});",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 550,
"y": 40,
"wires": [
[
"344d7463e4bdfa2c",
"35d560f42cd20972"
]
]
},
{
"id": "3a7c4e736bd384ba",
"type": "link in",
"z": "5fed5dca.adb674",
"name": "",
"links": [
"917f3a73d113798a",
"caf03c9573c588cc",
"d76baec55403a990",
"e96390b4bcb5adcd",
"b5d8587f3c9c2ccf",
"4141ac8713c012b6",
"d97209f96bb11289",
"3f9d964dd51fdbb2",
"5885b6cc861a934a",
"211974820b502474",
"d24a1802f6a9c129",
"627f45c557ab5491",
"7be6975755b2c311",
"13949d6d80d0a7f0",
"e05d41fa5dea73ae",
"7507a251f0cac5c8",
"548d79ac070d270a",
"dcd28ff135f6784f",
"58e4544077992cb4",
"243af427af7b1af7",
"b7489c4f1bae404e",
"2731cac39719b231",
"47927ec65ab270ac",
"7e3c7f4a1e7a4328",
"7fd29c47f943e1f0",
"5a677c27a32a1c18",
"1ef1e434ff663a42",
"137d4fee635fbd0d",
"e8f9170b43416b3d"
],
"x": 55,
"y": 40,
"wires": [
[
"b836956a23ef8390"
]
]
},
{
"id": "b27a37d9c6d916f6",
"type": "change",
"z": "5fed5dca.adb674",
"name": "location-port",
"rules": [
{
"t": "set",
"p": "roku_ip",
"pt": "msg",
"to": "rokuip",
"tot": "flow"
},
{
"t": "set",
"p": "roku_port",
"pt": "msg",
"to": "8060",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 370,
"y": 40,
"wires": [
[
"cea9ec5bfbf6eb76"
]
]
},
{
"id": "5f8b901a2b9318d4",
"type": "ui_button",
"z": "5fed5dca.adb674",
"name": "",
"group": "52d9622270c1df34",
"order": 16,
"width": "2",
"height": "1",
"passthru": false,
"label": "REV",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "fast_rewind",
"payload": "/keypress/Rev",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 70,
"y": 480,
"wires": [
[
"7fd29c47f943e1f0"
]
]
},
{
"id": "7fd29c47f943e1f0",
"type": "link out",
"z": "5fed5dca.adb674",
"name": "",
"mode": "link",
"links": [
"202cebd34dc11e6b",
"3a7c4e736bd384ba"
],
"x": 195,
"y": 480,
"wires": []
},
{
"id": "706c94ad40919af0",
"type": "ui_button",
"z": "5fed5dca.adb674",
"name": "",
"group": "52d9622270c1df34",
"order": 18,
"width": "2",
"height": "1",
"passthru": false,
"label": "FWD",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "fast_forward",
"payload": "/keypress/Fwd",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 490,
"y": 480,
"wires": [
[
"5a677c27a32a1c18"
]
]
},
{
"id": "5a677c27a32a1c18",
"type": "link out",
"z": "5fed5dca.adb674",
"name": "",
"mode": "link",
"links": [
"202cebd34dc11e6b",
"3a7c4e736bd384ba"
],
"x": 615,
"y": 480,
"wires": []
},
{
"id": "1c6ede08c70d6bb1",
"type": "comment",
"z": "5fed5dca.adb674",
"name": "Roku ECP website",
"info": "[https://developer.roku.com/en-gb/docs/developer-program/debugging/external-control-api.md]()",
"x": 1110,
"y": 320,
"wires": []
},
{
"id": "07c499534e92ea33",
"type": "change",
"z": "5fed5dca.adb674",
"name": "",
"rules": [
{
"t": "set",
"p": "rokuip",
"pt": "flow",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 800,
"y": 260,
"wires": [
[]
]
},
{
"id": "eb10354f099a4d78",
"type": "ui_dropdown",
"z": "5fed5dca.adb674",
"name": "",
"label": "",
"tooltip": "",
"place": "",
"group": "52d9622270c1df34",
"order": 13,
"width": "2",
"height": "1",
"passthru": true,
"multiple": false,
"options": [
{
"label": "Living Room",
"value": "192.168.0.34",
"type": "str"
},
{
"label": "Master Bedroom",
"value": "192.168.0.55",
"type": "str"
}
],
"payload": "",
"topic": "topic",
"topicType": "msg",
"className": "",
"x": 960,
"y": 200,
"wires": [
[
"07c499534e92ea33"
]
]
},
{
"id": "86c163b4535a59f7",
"type": "comment",
"z": "5fed5dca.adb674",
"name": "CHANGE/ADD IP HERE ===>",
"info": "",
"x": 760,
"y": 200,
"wires": []
},
{
"id": "02216e20d8e7673a",
"type": "ui_text_input",
"z": "5fed5dca.adb674",
"name": "",
"label": "Channel",
"tooltip": "",
"group": "52d9622270c1df34",
"order": 5,
"width": "2",
"height": "1",
"passthru": false,
"mode": "number",
"delay": "0",
"topic": "topic",
"sendOnBlur": false,
"className": "",
"topicType": "msg",
"x": 780,
"y": 380,
"wires": [
[
"dfc1064c56ec9438"
]
]
},
{
"id": "dfc1064c56ec9438",
"type": "change",
"z": "5fed5dca.adb674",
"name": "Channel",
"rules": [
{
"t": "set",
"p": "roku_channel",
"pt": "msg",
"to": "payload",
"tot": "msg"
},
{
"t": "set",
"p": "roku_endpoint",
"pt": "msg",
"to": "/launch/tvinput.dtv?ch=",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 780,
"y": 420,
"wires": [
[
"b5dd1f1b15c63ef2"
]
]
},
{
"id": "b5dd1f1b15c63ef2",
"type": "link out",
"z": "5fed5dca.adb674",
"name": "",
"mode": "link",
"links": [
"e31a8cb5581e6022"
],
"x": 935,
"y": 420,
"wires": []
},
{
"id": "e31a8cb5581e6022",
"type": "link in",
"z": "5fed5dca.adb674",
"name": "",
"links": [
"b5dd1f1b15c63ef2",
"32505f8d34e1e6a3"
],
"x": 55,
"y": 80,
"wires": [
[
"3ef0d43b445b1ae6"
]
]
},
{
"id": "3ca89099e120b9bf",
"type": "ui_dropdown",
"z": "5fed5dca.adb674",
"name": "",
"label": "",
"tooltip": "",
"place": "",
"group": "52d9622270c1df34",
"order": 9,
"width": "2",
"height": "1",
"passthru": false,
"multiple": false,
"options": [
{
"label": "Live TV",
"value": "/keypress/InputTuner",
"type": "str"
},
{
"label": "Netflix",
"value": "/launch/12",
"type": "str"
},
{
"label": "Hulu",
"value": "/launch/2285",
"type": "str"
},
{
"label": "Plex",
"value": "/launch/13535",
"type": "str"
},
{
"label": "Youtube",
"value": "/launch/837",
"type": "str"
},
{
"label": "Prime",
"value": "/launch/13",
"type": "str"
},
{
"label": "Philo",
"value": "/launch/196460",
"type": "str"
},
{
"label": "HDMI 1",
"value": "/keypress/InputHDMI1",
"type": "str"
},
{
"label": "HDMI 2",
"value": "/keypress/InputHDMI2",
"type": "str"
},
{
"label": "HDMI 3",
"value": "/keypress/InputHDMI3",
"type": "str"
},
{
"label": "HDMI 4",
"value": "/keypress/InputHDMI4",
"type": "str"
},
{
"label": "AV 1",
"value": "/keypress/InputAV1",
"type": "str"
}
],
"payload": "",
"topic": "topic",
"topicType": "msg",
"className": "",
"x": 780,
"y": 320,
"wires": [
[
"1ef1e434ff663a42"
]
]
},
{
"id": "1ef1e434ff663a42",
"type": "link out",
"z": "5fed5dca.adb674",
"name": "",
"mode": "link",
"links": [
"202cebd34dc11e6b",
"3a7c4e736bd384ba"
],
"x": 935,
"y": 320,
"wires": []
},
{
"id": "e154be24fcdcaf27",
"type": "ui_text_input",
"z": "5fed5dca.adb674",
"name": "",
"label": "Keyword Search",
"tooltip": "",
"group": "52d9622270c1df34",
"order": 25,
"width": "6",
"height": "1",
"passthru": false,
"mode": "text",
"delay": "0",
"topic": "topic",
"sendOnBlur": false,
"className": "",
"topicType": "msg",
"x": 800,
"y": 480,
"wires": [
[
"ee090dce1f604c18"
]
]
},
{
"id": "ee090dce1f604c18",
"type": "change",
"z": "5fed5dca.adb674",
"name": "Search",
"rules": [
{
"t": "set",
"p": "roku_keyword",
"pt": "msg",
"to": "payload",
"tot": "msg"
},
{
"t": "set",
"p": "roku_endpoint",
"pt": "msg",
"to": "/search/browse?keyword=",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 780,
"y": 520,
"wires": [
[
"5217b123642414b1"
]
]
},
{
"id": "5217b123642414b1",
"type": "link out",
"z": "5fed5dca.adb674",
"name": "",
"mode": "link",
"links": [
"e92ebcccbf4769e4"
],
"x": 935,
"y": 520,
"wires": []
},
{
"id": "3d395f36cee01272",
"type": "function",
"z": "5fed5dca.adb674",
"name": "make post",
"func": "var ips = msg.roku_ip;\nif(!Array.isArray(ips)){\n ips = [ips];\n}\nvar channel = msg.roku_channel;\nvar endpoint = msg.roku_endpoint;\nvar port = msg.roku_port;\nips.forEach(function(ip) {\n var request = \"http://\" + ip + \":\" + port + endpoint + channel;\n node.send({\"url\": request})\n});",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 550,
"y": 80,
"wires": [
[
"344d7463e4bdfa2c",
"485a6b300468290c"
]
]
},
{
"id": "344d7463e4bdfa2c",
"type": "http request",
"z": "5fed5dca.adb674",
"name": "send post",
"method": "POST",
"ret": "txt",
"paytoqs": "ignore",
"url": "",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"senderr": false,
"x": 780,
"y": 160,
"wires": [
[]
]
},
{
"id": "3ef0d43b445b1ae6",
"type": "change",
"z": "5fed5dca.adb674",
"name": "location-port",
"rules": [
{
"t": "set",
"p": "roku_ip",
"pt": "msg",
"to": "rokuip",
"tot": "flow"
},
{
"t": "set",
"p": "roku_port",
"pt": "msg",
"to": "8060",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 370,
"y": 80,
"wires": [
[
"3d395f36cee01272"
]
]
},
{
"id": "879f5d666b770f70",
"type": "function",
"z": "5fed5dca.adb674",
"name": "make post",
"func": "var ips = msg.roku_ip;\nif(!Array.isArray(ips)){\n ips = [ips];\n}\nvar keyword = msg.roku_keyword;\nvar endpoint = msg.roku_endpoint;\nvar port = msg.roku_port;\nips.forEach(function(ip) {\n var request = \"http://\" + ip + \":\" + port + endpoint + keyword;\n node.send({\"url\": request})\n});",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 550,
"y": 120,
"wires": [
[
"344d7463e4bdfa2c",
"ba14cd0c7c831369"
]
]
},
{
"id": "a3d61aef79bfc247",
"type": "change",
"z": "5fed5dca.adb674",
"name": "location-port",
"rules": [
{
"t": "set",
"p": "roku_ip",
"pt": "msg",
"to": "rokuip",
"tot": "flow"
},
{
"t": "set",
"p": "roku_port",
"pt": "msg",
"to": "8060",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 370,
"y": 120,
"wires": [
[
"879f5d666b770f70"
]
]
},
{
"id": "e92ebcccbf4769e4",
"type": "link in",
"z": "5fed5dca.adb674",
"name": "",
"links": [
"5217b123642414b1"
],
"x": 55,
"y": 120,
"wires": [
[
"a3d61aef79bfc247"
]
]
},
{
"id": "14c0d45cecd6a559",
"type": "ui_dropdown",
"z": "5fed5dca.adb674",
"name": "",
"label": "",
"tooltip": "",
"place": "",
"group": "52d9622270c1df34",
"order": 15,
"width": "2",
"height": "1",
"passthru": false,
"multiple": false,
"options": [
{
"label": "KMTV/CBS",
"value": "3.1",
"type": "str"
},
{
"label": "WOWT/NBC",
"value": "6.1",
"type": "str"
},
{
"label": "KETV/ABC",
"value": "7.1",
"type": "str"
},
{
"label": "Power Nation",
"value": 246,
"type": "num"
},
{
"label": "Comedy Central",
"value": 307,
"type": "num"
},
{
"label": "Johnny Carson",
"value": 345,
"type": "num"
}
],
"payload": "",
"topic": "topic",
"topicType": "msg",
"className": "",
"x": 780,
"y": 580,
"wires": [
[
"01f7d7e28289f8aa"
]
]
},
{
"id": "32505f8d34e1e6a3",
"type": "link out",
"z": "5fed5dca.adb674",
"name": "",
"mode": "link",
"links": [
"e31a8cb5581e6022"
],
"x": 935,
"y": 620,
"wires": []
},
{
"id": "01f7d7e28289f8aa",
"type": "change",
"z": "5fed5dca.adb674",
"name": "Channel",
"rules": [
{
"t": "set",
"p": "roku_channel",
"pt": "msg",
"to": "payload",
"tot": "msg"
},
{
"t": "set",
"p": "roku_endpoint",
"pt": "msg",
"to": "/launch/tvinput.dtv?ch=",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 780,
"y": 620,
"wires": [
[
"32505f8d34e1e6a3"
]
]
},
{
"id": "6811e31d31bf85ba",
"type": "link in",
"z": "5fed5dca.adb674",
"name": "LAST IN",
"links": [
"c7ab04f257593279"
],
"x": 655,
"y": 160,
"wires": [
[
"344d7463e4bdfa2c"
]
]
},
{
"id": "35d560f42cd20972",
"type": "change",
"z": "5fed5dca.adb674",
"name": "",
"rules": [
{
"t": "set",
"p": "lastbutton",
"pt": "flow",
"to": "url",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 790,
"y": 40,
"wires": [
[
"b63f746f3b10ba4b"
]
]
},
{
"id": "ba14cd0c7c831369",
"type": "change",
"z": "5fed5dca.adb674",
"name": "",
"rules": [
{
"t": "set",
"p": "lastkeyword",
"pt": "flow",
"to": "url",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 800,
"y": 120,
"wires": [
[
"b63f746f3b10ba4b"
]
]
},
{
"id": "485a6b300468290c",
"type": "change",
"z": "5fed5dca.adb674",
"name": "",
"rules": [
{
"t": "set",
"p": "lastchannel",
"pt": "flow",
"to": "url",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 790,
"y": 80,
"wires": [
[
"b63f746f3b10ba4b"
]
]
},
{
"id": "b63f746f3b10ba4b",
"type": "link out",
"z": "5fed5dca.adb674",
"name": "",
"mode": "link",
"links": [
"67e2f3c116edb10c",
"34491efb8ca21632",
"6f56674adf10c05d"
],
"x": 965,
"y": 40,
"wires": []
},
{
"id": "5858ab7e6f9cb8e8",
"type": "ui_dropdown",
"z": "5fed5dca.adb674",
"name": "",
"label": "",
"tooltip": "",
"place": "Last",
"group": "52d9622270c1df34",
"order": 7,
"width": "2",
"height": "1",
"passthru": false,
"multiple": false,
"options": [
{
"label": "last button",
"value": 1,
"type": "num"
},
{
"label": "last channel",
"value": 2,
"type": "num"
},
{
"label": "last search",
"value": 3,
"type": "num"
}
],
"payload": "",
"topic": "topic",
"topicType": "msg",
"className": "",
"x": 200,
"y": 700,
"wires": [
[
"448e19d8fecfc9a1"
]
]
},
{
"id": "448e19d8fecfc9a1",
"type": "switch",
"z": "5fed5dca.adb674",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "1",
"vt": "num"
},
{
"t": "eq",
"v": "2",
"vt": "num"
},
{
"t": "eq",
"v": "3",
"vt": "num"
}
],
"checkall": "true",
"repair": false,
"outputs": 3,
"x": 340,
"y": 700,
"wires": [
[
"60bf1181d7828681"
],
[
"15ed9b951d2712b9"
],
[
"7997935209e3c923"
]
]
},
{
"id": "9e2dfd5aa5a71103",
"type": "http request",
"z": "5fed5dca.adb674",
"name": "",
"method": "POST",
"ret": "txt",
"paytoqs": "ignore",
"url": "",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"senderr": false,
"x": 720,
"y": 700,
"wires": [
[]
]
},
{
"id": "60bf1181d7828681",
"type": "change",
"z": "5fed5dca.adb674",
"name": "lastbutton",
"rules": [
{
"t": "set",
"p": "url",
"pt": "msg",
"to": "lastbutton",
"tot": "flow"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 490,
"y": 660,
"wires": [
[
"9e2dfd5aa5a71103"
]
]
},
{
"id": "15ed9b951d2712b9",
"type": "change",
"z": "5fed5dca.adb674",
"name": "lastchannel",
"rules": [
{
"t": "set",
"p": "url",
"pt": "msg",
"to": "lastchannel",
"tot": "flow"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 500,
"y": 700,
"wires": [
[
"9e2dfd5aa5a71103"
]
]
},
{
"id": "7997935209e3c923",
"type": "change",
"z": "5fed5dca.adb674",
"name": "lastkeyword",
"rules": [
{
"t": "set",
"p": "url",
"pt": "msg",
"to": "lastkeyword",
"tot": "flow"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 500,
"y": 740,
"wires": [
[
"9e2dfd5aa5a71103"
]
]
},
{
"id": "0a07041a38e5c227",
"type": "ui_spacer",
"z": "5fed5dca.adb674",
"name": "spacer",
"group": "52d9622270c1df34",
"order": 23,
"width": "2",
"height": "1"
},
{
"id": "6442c8f236808781",
"type": "ui_spacer",
"z": "5fed5dca.adb674",
"name": "spacer",
"group": "52d9622270c1df34",
"order": 1,
"width": "2",
"height": "1"
},
{
"id": "52d9622270c1df34",
"type": "ui_group",
"name": "Roku",
"tab": "1b12d932d779c0e7",
"order": 2,
"disp": false,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "1b12d932d779c0e7",
"type": "ui_tab",
"name": "Roku Remote",
"icon": "dashboard",
"order": 1,
"disabled": false,
"hidden": false
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment