To visualize your sensor data on the Digital Twin platform, you need to develop a Python script to fetch data from your data sources (APIs, Excel, or CSV files) and publish it to the MQTT broker. This script will run periodically, sending sensor data to your Digital Twin platform. The script will act as a publisher, sending all the collected data to the DT through MQTT, which will function as a subscriber.
Key Steps for Publishing Data
1. Data Source Integration:
Depending on your data sources, the script can be tailored to fetch data from APIs, Excel, or CSV files. The following examples demonstrate how to develop your script, but adjustments might be necessary based on the specific data sources you are using.
2. Fetch Data from API:
For instance, the City of Melbourne provides numerous sensors around the CBD. These sensors’ data can be accessed via API. Ensure your script reads the API data effectively and handles multiple APIs for different sensors if necessary
3. Script Development:
Below is a general structure of a Python script that fetches data from a CSV file and publishes it to the MQTT broker. Adjust the script according to your specific data format and requirements



