You may be interested in using Node-RED for your remotes. I found it much more manageable.
Export of my IKEA remote flow
[
{
"id": "5776030b.f25b1c",
"type": "tab",
"label": "Living Room IKEA Remote",
"disabled": false,
"info": ""
},
{
"id": "a59e8daa.6009e",
"type": "server-events",
"z": "5776030b.f25b1c",
"name": "Zigbee Events",
"server": "20295610.6b9eba",
"event_type": "zha_event",
"x": 110,
"y": 60,
"wires": [
[
"b8f2a675.531d78"
]
]
},
{
"id": "b8f2a675.531d78",
"type": "switch",
"z": "5776030b.f25b1c",
"name": "MAC Address Router",
"property": "payload.event.device_ieee",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "d0:cf:5e:ff:fe:2e:00:a0",
"vt": "str"
},
{
"t": "eq",
"v": "d0:cf:5e:ff:fe:2d:ed:f9",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 180,
"y": 120,
"wires": [
[
"666d4dea.1371e4"
],
[
"666d4dea.1371e4"
]
]
},
{
"id": "3dc6b81c.414ec8",
"type": "function",
"z": "5776030b.f25b1c",
"name": "Calc AV Receiver VOL-",
"func": "var hass = global.get('homeassistant').homeAssistant;\nvar receiver = hass.states['media_player.living_room_receiver'];\n\nif (receiver.state == 'on') {\n msg.new_volume = Math.max(0, (receiver.attributes.volume_level * 100 - 2.5) / 100);\n}\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 510,
"y": 180,
"wires": [
[
"6b15007d.e69a9"
]
]
},
{
"id": "6b15007d.e69a9",
"type": "api-call-service",
"z": "5776030b.f25b1c",
"name": "Set AV volume_level",
"server": "20295610.6b9eba",
"service_domain": "media_player",
"service": "volume_set",
"data": "{\"entity_id\":\"media_player.living_room_receiver\",\"volume_level\":\"{{new_volume}}\"}",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"x": 820,
"y": 120,
"wires": [
[]
]
},
{
"id": "f9c4eb5e.352ba8",
"type": "function",
"z": "5776030b.f25b1c",
"name": "Calc AV Receiver VOL+",
"func": "var hass = global.get('homeassistant').homeAssistant;\nvar receiver = hass.states['media_player.living_room_receiver'];\n\nif (receiver.state == 'on') {\n msg.new_volume = Math.min(1, (receiver.attributes.volume_level * 100 + 2.5) / 100);\n}\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 510,
"y": 120,
"wires": [
[
"6b15007d.e69a9"
]
]
},
{
"id": "666d4dea.1371e4",
"type": "switch",
"z": "5776030b.f25b1c",
"name": "IKEA Remote",
"property": "payload.event.command",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "toggle",
"vt": "str"
},
{
"t": "eq",
"v": "step_with_on_off",
"vt": "str"
},
{
"t": "eq",
"v": "step",
"vt": "str"
},
{
"t": "eq",
"v": "move_with_on_off",
"vt": "str"
},
{
"t": "eq",
"v": "move",
"vt": "str"
},
{
"t": "eq",
"v": "stop",
"vt": "str"
},
{
"t": "eq",
"v": "press",
"vt": "str"
},
{
"t": "eq",
"v": "hold",
"vt": "str"
},
{
"t": "eq",
"v": "release",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 9,
"x": 200,
"y": 240,
"wires": [
[
"bf297790.b3a3e8"
],
[
"f9c4eb5e.352ba8"
],
[
"3dc6b81c.414ec8"
],
[
"50ef099f.3cd2b8"
],
[
"42119cb2.f07ae4"
],
[
"c5122e98.0a20f"
],
[
"616b552c.f2292c"
],
[
"93295d29.7a197"
],
[]
],
"outputLabels": [
"pwr",
"up",
"down",
"up (hold)",
"down (hold)",
"",
"",
"",
""
],
"info": "Couch buttons"
},
{
"id": "50ef099f.3cd2b8",
"type": "function",
"z": "5776030b.f25b1c",
"name": "Calc AV Receiver VOL+",
"func": "var hass = global.get('homeassistant').homeAssistant;\nvar receiver = hass.states['media_player.living_room_receiver'];\n\nif (receiver.state == 'on') {\n msg.new_volume = Math.min(1, (receiver.attributes.volume_level * 100 + 2) / 100);\n}\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 510,
"y": 240,
"wires": [
[
"6b15007d.e69a9",
"de1af9d1.5332e8"
]
]
},
{
"id": "de1af9d1.5332e8",
"type": "stoptimer",
"z": "5776030b.f25b1c",
"duration": "750",
"units": "Millisecond",
"payloadtype": "num",
"payloadval": "0",
"name": "",
"x": 820,
"y": 300,
"wires": [
[
"666d4dea.1371e4"
],
[]
]
},
{
"id": "c5122e98.0a20f",
"type": "change",
"z": "5776030b.f25b1c",
"name": "Set payload = STOP",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "STOP",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 500,
"y": 360,
"wires": [
[
"de1af9d1.5332e8"
]
]
},
{
"id": "42119cb2.f07ae4",
"type": "function",
"z": "5776030b.f25b1c",
"name": "Calc AV Receiver VOL-",
"func": "var hass = global.get('homeassistant').homeAssistant;\nvar receiver = hass.states['media_player.living_room_receiver'];\n\nif (receiver.state == 'on') {\n msg.new_volume = Math.max(0, (receiver.attributes.volume_level * 100 - 2) / 100);\n}\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 510,
"y": 300,
"wires": [
[
"6b15007d.e69a9",
"de1af9d1.5332e8"
]
]
},
{
"id": "616b552c.f2292c",
"type": "switch",
"z": "5776030b.f25b1c",
"name": "Press L or R?",
"property": "payload.event.args[0]",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "1",
"vt": "str"
},
{
"t": "eq",
"v": "0",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 480,
"y": 420,
"wires": [
[
"daa85624.d50f48"
],
[
"f5e78758.739f28"
]
],
"outputLabels": [
"left",
"right"
],
"info": "Couch buttons"
},
{
"id": "daa85624.d50f48",
"type": "change",
"z": "5776030b.f25b1c",
"name": "payload = xbox_mode",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "xbox_mode",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 820,
"y": 420,
"wires": [
[
"a7c71711.69dcc8"
]
]
},
{
"id": "f5e78758.739f28",
"type": "change",
"z": "5776030b.f25b1c",
"name": "payload = chromecast_mode",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "chromecast_mode",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 840,
"y": 480,
"wires": [
[
"a7c71711.69dcc8"
]
]
},
{
"id": "a7c71711.69dcc8",
"type": "ha-fire-event",
"z": "5776030b.f25b1c",
"name": "Fire event",
"server": "20295610.6b9eba",
"event": "{{payload}}",
"data": "",
"mergecontext": "",
"x": 1100,
"y": 420,
"wires": [
[]
]
},
{
"id": "bf297790.b3a3e8",
"type": "api-call-service",
"z": "5776030b.f25b1c",
"name": "Play/Pause TV",
"server": "20295610.6b9eba",
"service_domain": "media_player",
"service": "media_play_pause",
"data": "{\"entity_id\":\"media_player.living_room_tv\"}",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"mustacheAltTags": false,
"x": 480,
"y": 60,
"wires": [
[]
]
},
{
"id": "93295d29.7a197",
"type": "switch",
"z": "5776030b.f25b1c",
"name": "Hold L or R?",
"property": "payload.event.args[0]",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "1",
"vt": "str"
},
{
"t": "eq",
"v": "0",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 470,
"y": 480,
"wires": [
[
"740d36d1.596e08"
],
[
"740d36d1.596e08"
]
],
"outputLabels": [
"left",
"right"
],
"info": "Couch buttons"
},
{
"id": "740d36d1.596e08",
"type": "api-call-service",
"z": "5776030b.f25b1c",
"name": "Toggle TV power",
"server": "20295610.6b9eba",
"service_domain": "media_player",
"service": "toggle",
"data": "{\"entity_id\":\"media_player.living_room_tv\"}",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"mustacheAltTags": false,
"x": 810,
"y": 540,
"wires": [
[]
]
},
{
"id": "20295610.6b9eba",
"type": "server",
"z": "",
"name": "Home Assistant",
"legacy": false,
"hassio": false,
"rejectUnauthorizedCerts": false,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true
}
]