MQTT widget that connects IoT sensors to the 3d model

Hi there,
As part of our digital twin journey, we must create a widget to click on elements and obtain the MQTT data from a cloud position. I am familiar with creating widgets but unsure how to connect them with the MQTT data. Any advice is appreciated!