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



power_bi_index





  • After a sequence of registration, the page will lead you to below page,you can press “My workspace”, and “skip for now” button appear. You could click “skip for now “ to start create dataset.


    start


Part B: Setup your streaming dataset API




  • Create “Datasets”



    • Click “Create” in scrren upper right corner

    • And then click “Streming dataset”




create_datastream


  • Select “API”, and click “Next”.




API


  • Define your values from stream(e.g., temp,max,min), and you will get a result of JSON in textbox. QIot Suite’s application will post this data format to Power BI. Click the “Create” button to finish create streaming dataset.




edit_streaming_dataset


  • Once you successfully create your data stream, you get REST API URL which QIoT suite application can call using POST request to push your live data to streaming data dataset you created.




push_url

Part C: Configure Node-RED’s nodes in IoT application




  • Create IoT application in QIoT suite.




  • The following one is your first node-red flow, and then you can start to create your own IoT flow. more node-red information can be found in “Node-Red”.




Node-Red


  • Before you start to push live data to Power BI.




  • We need a “function” node to convert IoT data to streaming data dataset. Here you can replace msg.payload to your JSON dataset.




msg.payload

  • Function code as following:
    msg.payload=[{
    "temp":msg.payload.value,
    "max":100,
    "min":0
    }]
    return msg;



  • We need a “http request” node to help us to push live data to Power BI. Just drop and drag “http request” node and connect to tail of “function“ node.




http request


  • Copy and paste REST API URL that you got from Power BI console, and set http method to POST. Finally, don’t forget to press “Deploy” button to save changes.




Deploy


  • Finally, your node-red flow will look like below one.





Finally node-red

Part D: Add tile to display real-time data




  • Create “Dashboard”



    • Click “Create” in scrren upper right corner

    • And then click “Dashboard”

    • Enter dashboard’s name,and click “Create” to complete create dashboard.




create_dashboard

dashboard_name

  • Click “Add tile” in screen upper right corner


add_tile


  • Select “CUSTOM STREAMING DATA” and then select the “Next” button.




CUSTOM STREAMING DATA


  • Select datasets and then click the “Next” button.




datasets

  • Select visualization type (e.g.,gauge),and set value,min,and max value.
    value


  • You have a streaming dataset to work with, you can get a real time gauge that looks like as following.




streaming dataset

Please visit QNAP github for QIoT Suite Lite sample code


"QNAP-Github"

arrow
arrow
    全站熱搜

    tttt 發表在 痞客邦 留言(0) 人氣()