If you can program in Python, you can use GitHub - NickWaterton/Pixelblaze-Async: An MQTT interface and async Client for Pixelblaze devices
Using this library, you can enable preview frames for your pattern.
If you then override
_handle_binary_data() you can access the bytes in the preview frames.
These have the first two bytes as
(5,4), followed by r,g,b values as bytes.
Read the documentation for how to use it (you don’t need to use MQTT), and the examples for how to use the library.
If you want to use the websocket in SWIFT, the Python code should give you a good starting point for how it works.
Let me know if you need help.