Comcast Xfinity X-1

Bump! Any recent developments?

Any chance you could share your postman collection with me? I just moved to HA to manage my home & would like to try this againā€¦

I am very close. I called the initial pairing to get the token and stored that in a variable to use it in the pairing confirm step & successfully paired to get the arToken, but this is where my success stops. I canā€™t figure out how to send a button or a voice command, even though I have the arToken and can see in easy pair that my UUID is paired. I hope I can sort this out with the help of your collectionā€¦

thank you for your previous help with the UUID. I couldnā€™t make sense of it & of course it needs to be a new one for the ā€œdeviceā€ Iā€™m pairing.

Here is a postman collection that should work. Just replace the clientDeviceId GUID in the Authorize call with one of your own choosing.

{
	"info": {
		"_postman_id": "d166bb50-1c24-41cf-aaa6-b0ee54891244",
		"name": "Comcast",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "5593788"
	},
	"item": [
		{
			"name": "Authorize",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"pm.test(\"Status code is 200\", function () {\r",
							"    pm.response.to.have.status(200);\r",
							"});\r",
							"pm.test(\"Get auth token\", function () {\r",
							"    var jsonData = pm.response.json();\r",
							"    pm.globals.set(\"token\", jsonData.token);\r",
							"    pm.globals.set(\"pairingCode\", jsonData.pairingCode);\r",
							"});\r",
							""
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\"partner\":\"comcast\",\"clientDeviceId\":\"9e0ed919-a606-46d0-8a1d-2521e64010a0\"}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://accrem.apps.cloud.comcast.net/api/v1/pairing/start",
					"protocol": "https",
					"host": [
						"accrem",
						"apps",
						"cloud",
						"comcast",
						"net"
					],
					"path": [
						"api",
						"v1",
						"pairing",
						"start"
					]
				}
			},
			"response": []
		},
		{
			"name": "Poll for pairing",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"pm.test(\"Status code is 200\", function () {\r",
							"    pm.response.to.have.status(200);\r",
							"});\r",
							"pm.test(\"Get auth token\", function () {\r",
							"    var jsonData = pm.response.json();\r",
							"    if (jsonData.status === \"CONFIRMED\") {\r",
							"        pm.globals.set(\"token\", jsonData.token);\r",
							"        pm.globals.set(\"exp\", jsonData.exp);\r",
							"        pm.globals.set(\"arToken\", jsonData.arToken);\r",
							"    }\r",
							"});\r",
							""
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{token}}",
						"type": "text"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\"partner\":\"comcast\",\"clientDeviceId\":\"9e0ed919-a606-46d0-8a1d-2521e64010a0\"}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://accrem.apps.cloud.comcast.net/api/v1/pairing/confirm",
					"protocol": "https",
					"host": [
						"accrem",
						"apps",
						"cloud",
						"comcast",
						"net"
					],
					"path": [
						"api",
						"v1",
						"pairing",
						"confirm"
					]
				}
			},
			"response": []
		},
		{
			"name": "Get Devices",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"pm.test(\"Status code is 200\", function () {\r",
							"    pm.response.to.have.status(200);\r",
							"});\r",
							"pm.test(\"Get first device\", function () {\r",
							"    var jsonData = pm.response.json();\r",
							"    pm.globals.set(\"deviceId\", jsonData.devices[0].id);\r",
							"    pm.globals.set(\"deviceName\", jsonData.devices[0].name);\r",
							"});\r",
							""
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{arToken}}",
						"type": "text"
					}
				],
				"url": {
					"raw": "https://accrem.apps.cloud.comcast.net/api/v1/devices",
					"protocol": "https",
					"host": [
						"accrem",
						"apps",
						"cloud",
						"comcast",
						"net"
					],
					"path": [
						"api",
						"v1",
						"devices"
					]
				}
			},
			"response": []
		},
		{
			"name": "Refresh token",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"pm.test(\"Status code is 200\", function () {\r",
							"    pm.response.to.have.status(200);\r",
							"});\r",
							"pm.test(\"Get token\", function () {\r",
							"    var jsonData = pm.response.json();\r",
							"    pm.globals.set(\"arToken\", jsonData.arToken);\r",
							"});\r",
							""
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{arToken}}",
						"type": "text"
					}
				],
				"url": {
					"raw": "https://accrem.apps.cloud.comcast.net/api/v1/auth/token/refresh",
					"protocol": "https",
					"host": [
						"accrem",
						"apps",
						"cloud",
						"comcast",
						"net"
					],
					"path": [
						"api",
						"v1",
						"auth",
						"token",
						"refresh"
					]
				}
			},
			"response": []
		},
		{
			"name": "Process Key",
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{arToken}}",
						"type": "text"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\r\n    \"vcode\":\"ENTER\"\r\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://accrem.apps.cloud.comcast.net/api/v1/processKey",
					"protocol": "https",
					"host": [
						"accrem",
						"apps",
						"cloud",
						"comcast",
						"net"
					],
					"path": [
						"api",
						"v1",
						"processKey"
					]
				}
			},
			"response": []
		},
		{
			"name": "Process Text",
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{arToken}}",
						"type": "text"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\r\n    \"cmd\":\"ESPN\"\r\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://accrem.apps.cloud.comcast.net/api/v1/text",
					"protocol": "https",
					"host": [
						"accrem",
						"apps",
						"cloud",
						"comcast",
						"net"
					],
					"path": [
						"api",
						"v1",
						"text"
					]
				}
			},
			"response": []
		}
	]
}
1 Like

Hi all -

Hoping for some help getting the xfinity authorization tokens refreshed using automations and rest posts in home assistant. Iā€™ve successfully got the pairing completed using RestER and have successfully integrated commands using the arToken in Home Assistant. Doing the pairing though - Iā€™m out of ideas on why this doesnā€™t work. Tried all the rest sensor formats and every value template I can think of. What am I missing?

  - resource: https://accrem.apps.cloud.comcast.net/api/v1/pairing/start
    method: POST
    headers:
      Content-Type: application/json
    payload: '{"partner":"comcast","clientDeviceId":"3b7c0ff0-935f-47bd-a7f6-5c09d6627952"}'
    sensor:
      - name: "Xfinity Pairing"
        unique_id: xfinity_adpative_remote_pairing
        value_template: '{{ value_json["token"] }}'

Control4 has a local IP integration. Has anyone with both HA & C4 tried to reverse engineer the integration?