close
Lesson 4 Integrate Power BI
In Lesson 3 , we used sample code connect to NAS .In this lesson, you will learn how yo use Power BI visualize sensor data that NAS recive in real-time.
There are four parts:
A: Get your first Power BI account
B: Setup your streaming dataset API
C: Configure Node-RED’s nodes in IoT application
D: Add tile to display real-time data
Part A: Get your first Power BI account
- Sign up for a free PowerBI account at https://powerbi.microsoft.com/en-us/
After registering, the page will lead you to the below page. Click "My workspace", and then click "Skip for now".
Part B: Setup your streaming dataset API
- Create "Datasets"
- Click "Create" in the top-right corner
- Click "Streaming dataset"
Select "API", the source of your data, and click "Next".
- Define your values from stream (such as temp, max, min), and you will get a JSON result in the textbox. We will use this JSON code to push data to the QIoT Suite Lite application. Click "Create" to finish.
- Once you create your data stream, you get a REST API URL which IoT applications can call using POST requests to push your live data to the streaming data dataset you created.
Part C: Configure Node-RED’s nodes in your IoT application
- Create an IoT application in QIoT Suite.
- The following is your first Node-RED flow, and then you can start creating your own IoT flow. You can learn more about Node-RED at https://nodered.org/
- Before you start pushing live data to Power BI. We need a "function" node to convert IoT data to a streaming data dataset. Here you can replace payload to your JSON dataset.
- Enter the code as following:
msg.payload=[{
"temp":msg.payload.value,
"max":100,
"min":0
}]
return msg;
- We need an "http request" node to help us to push live data to Power BI. Drag and drop the "http request" node and connect it to the tail of the "function" node.
- Copy and paste the REST API URL from the Power BI console, and set the http method to POST. Click "Deploy".
- Your Node-RED flow will look like below.
Part D: Add tile to display real-time data
- Create "Dashboard"
- Click "Create" in the top-right corner
- Click "Dashboard"
- Enter the dashboard’s name, and click "Create".
- Click "Add tile" in the top-right corner
- Select "CUSTOM STREAMING DATA" and click the "Next".
- Select the datasets and click "Next".
Select a visualization type, and set the minimum and maximum value.
- You will now have a streaming dataset to work with. You can get a real time gauge that looks as following.
Visit the QNAP github for QIoT Suite Lite sample code:
https://github.com/qnap-dev/qnap-qiot-sdks
For more information about QIoT Suite Lite, visit
https://www.qnap.com/en/how-to/tutorial/qiot-suite-lite
全站熱搜
留言列表