Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aerobless/bcf360047f3ac63439a015608b3bb34c to your computer and use it in GitHub Desktop.
Save aerobless/bcf360047f3ac63439a015608b3bb34c to your computer and use it in GitHub Desktop.
A Node-RED flow to emulate an Apple TV remote for a samsung TV via Logitech Harmony IR commands
[
{
"id": "398bef58.0823b",
"type": "server-events",
"z": "7d4c9938.2a0338",
"name": "Apple TV Remote",
"server": "78fe396.483dac8",
"event_type": "homekit_tv_remote_key_pressed",
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"waitForRunning": true,
"x": 140,
"y": 1120,
"wires": [
[
"2ee572cf.c3ab0e"
]
]
},
{
"id": "5faa8fc8.def59",
"type": "api-call-service",
"z": "7d4c9938.2a0338",
"name": "Arrow Left",
"server": "78fe396.483dac8",
"version": 1,
"debugenabled": false,
"service_domain": "remote",
"service": "send_command",
"entityId": "remote.harmony_hub",
"data": "{\"device\":\"Samsung TV\",\"command\":[\"DirectionLeft\"]}",
"dataType": "json",
"mergecontext": "",
"output_location": "payload",
"output_location_type": "msg",
"mustacheAltTags": false,
"x": 770,
"y": 1000,
"wires": [
[]
]
},
{
"id": "15f6fb28.5325e5",
"type": "switch",
"z": "7d4c9938.2a0338",
"name": "Cmd Interpreter",
"property": "payload.event.key_name",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "arrow_left",
"vt": "str"
},
{
"t": "eq",
"v": "arrow_right",
"vt": "str"
},
{
"t": "eq",
"v": "arrow_up",
"vt": "str"
},
{
"t": "eq",
"v": "arrow_down",
"vt": "str"
},
{
"t": "eq",
"v": "back",
"vt": "str"
},
{
"t": "eq",
"v": "information",
"vt": "str"
},
{
"t": "eq",
"v": "select",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 7,
"x": 500,
"y": 1120,
"wires": [
[
"5faa8fc8.def59"
],
[
"8d53a9b9.0092a8"
],
[
"31ccec9c.f8bf24"
],
[
"54457a1a.1d8364"
],
[
"15b52dd8.16eab2"
],
[
"afc9e035.0f08b"
],
[
"c6b13a5c.b54578"
]
]
},
{
"id": "2ee572cf.c3ab0e",
"type": "switch",
"z": "7d4c9938.2a0338",
"name": "is Samsung TV?",
"property": "payload.entity_id",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "media_player.samsung_tv",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 320,
"y": 1120,
"wires": [
[
"15f6fb28.5325e5"
]
]
},
{
"id": "8d53a9b9.0092a8",
"type": "api-call-service",
"z": "7d4c9938.2a0338",
"name": "Arrow Right",
"server": "78fe396.483dac8",
"version": 1,
"debugenabled": false,
"service_domain": "remote",
"service": "send_command",
"entityId": "remote.harmony_hub",
"data": "{\"device\":\"Samsung TV\",\"command\":[\"DirectionRight\"]}",
"dataType": "json",
"mergecontext": "",
"output_location": "payload",
"output_location_type": "msg",
"mustacheAltTags": false,
"x": 770,
"y": 1040,
"wires": [
[]
]
},
{
"id": "31ccec9c.f8bf24",
"type": "api-call-service",
"z": "7d4c9938.2a0338",
"name": "Arrow Up",
"server": "78fe396.483dac8",
"version": 1,
"debugenabled": false,
"service_domain": "remote",
"service": "send_command",
"entityId": "remote.harmony_hub",
"data": "{\"device\":\"Samsung TV\",\"command\":[\"DirectionUp\"]}",
"dataType": "json",
"mergecontext": "",
"output_location": "payload",
"output_location_type": "msg",
"mustacheAltTags": false,
"x": 760,
"y": 1080,
"wires": [
[]
]
},
{
"id": "54457a1a.1d8364",
"type": "api-call-service",
"z": "7d4c9938.2a0338",
"name": "Arrow Down",
"server": "78fe396.483dac8",
"version": 1,
"debugenabled": false,
"service_domain": "remote",
"service": "send_command",
"entityId": "remote.harmony_hub",
"data": "{\"device\":\"Samsung TV\",\"command\":[\"DirectionDown\"]}",
"dataType": "json",
"mergecontext": "",
"output_location": "payload",
"output_location_type": "msg",
"mustacheAltTags": false,
"x": 770,
"y": 1120,
"wires": [
[]
]
},
{
"id": "c6b13a5c.b54578",
"type": "api-call-service",
"z": "7d4c9938.2a0338",
"name": "Select",
"server": "78fe396.483dac8",
"version": 1,
"debugenabled": false,
"service_domain": "remote",
"service": "send_command",
"entityId": "remote.harmony_hub",
"data": "{\"device\":\"Samsung TV\",\"command\":[\"Select\"]}",
"dataType": "json",
"mergecontext": "",
"output_location": "payload",
"output_location_type": "msg",
"mustacheAltTags": false,
"x": 750,
"y": 1240,
"wires": [
[]
]
},
{
"id": "afc9e035.0f08b",
"type": "api-call-service",
"z": "7d4c9938.2a0338",
"name": "Smart Hub",
"server": "78fe396.483dac8",
"version": 1,
"debugenabled": false,
"service_domain": "remote",
"service": "send_command",
"entityId": "remote.harmony_hub",
"data": "{\"device\":\"Samsung TV\",\"command\":[\"SmartHub\"]}",
"dataType": "json",
"mergecontext": "",
"output_location": "payload",
"output_location_type": "msg",
"mustacheAltTags": false,
"x": 770,
"y": 1200,
"wires": [
[]
]
},
{
"id": "15b52dd8.16eab2",
"type": "api-call-service",
"z": "7d4c9938.2a0338",
"name": "Back",
"server": "78fe396.483dac8",
"version": 1,
"debugenabled": false,
"service_domain": "remote",
"service": "send_command",
"entityId": "remote.harmony_hub",
"data": "{\"device\":\"Samsung TV\",\"command\":[\"Return\"]}",
"dataType": "json",
"mergecontext": "",
"output_location": "payload",
"output_location_type": "msg",
"mustacheAltTags": false,
"x": 750,
"y": 1160,
"wires": [
[]
]
},
{
"id": "78fe396.483dac8",
"type": "server",
"name": "Home Assistant",
"legacy": false,
"addon": true,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true,
"cacheJson": true
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment