Matter Extension WebSockets API url?

I want to be able to make WebSocket API calls to the Matter extension from Postman as per GitHub - home-assistant-libs/python-matter-server: Python server to interact with Matter

I am able to make Home Assistant WebSocket API calls from Postman to ws://homeassistant.local:8123/api/websocket. I can Connect then send an Auth message:

message body

{

  "type": "auth",

  "access_token": "{{LongLivedtoken}}"

}

reply

{"type":"auth_ok","ha_version":"2024.10.1"}

I’m not clear what url to use for WebSocket APIs to the Matter extension. I have seen a couple of forum questions implying that by default it should be ws://homeassistant.local:5580/ws

When I try to Connect to that url from Postman I get the following error

Could not connect to ws://homeassistant.local:5580/ws

09:06:29

Error: connect ECONNREFUSED 192.168.1.158:5580

Handshake Details

Request Method: GET

Request Headers

Sec-WebSocket-Version: 13

Sec-WebSocket-Key: lv5RhS5/yvfjqze5wt8Hfw==

Connection: Upgrade

Upgrade: websocket

Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits

Host: homeassistant.local:5580

I am running, Home Assistant Core 2024.10.1 , Home Assistant Operating System 10.5, Matter (BETA) Extension, on a Raspberry Pi 3, 64 bit Ubuntu.

I’ve been at this for a minute, it’s not the easiest to find.

You’ll need to make calls to the “matter” endpoint, like so:

# pip install websocket-client
import websocket
connection_uri = "ws://127.0.0.1:8123/api/websocket"
auth = {"type": "auth", "access_token": access_token}
matterNodeDiagnostics = {"type": "matter/node_diagnostics","device_id": device_id,"id":id}
msg = []
ws.connect(connection_uri,timeout=10)
msg.append(ws.recv())
ws.send(json.dumps(auth_token))
msg.append(ws.recv())
ws.send(json.dumps(get_matter_node_diagnostics))
msg.append(ws.recv())
ws.close()

The endpoints are the functions starting w/ “websocket_” found in the component code here: