Overview

Skill Level: Intermediate

Recipe expects usage skills on IBM Watson IoT Platform and Cloudant NoSQL DB Service on IBM Bluemix

Recipe describes about the steps needed to visualize the device data stored in Cloudant NoSQL DB as Historical Data Storage on the Watson IoT Platform Dashboard using Line Chart Cards.

Step-by-step

  1. Introduction

    This recipe is continuation of recipes on Cloudant NoSQL DB as Historian Data Storage for IBM Watson IoT.

    To know about:

    • Device Data Stograge details in Cloudant NoSQL DB
    • Configuring Cloudant NoSQL DB as Historical Data Storage for IBM Watson IoT Platform

    Refer to the recipe – Configure Cloudant NoSQL DB as Historian Data Storage for IBM Watson IoT

    To know about:

    • How Cloudant NoSQL DB stores device data in different databases
    • Different Map Views available for users to query the device data stored in Cloudant NoSQL DB
    • Sample query statements using cURL
    • Sample query code in Python
    • How to retrieve device data from multiple Cloudant NoSQL databases

    Refer to next recipe on this series – Query and Process Watson IoT Device Data from Cloudant NoSQL DB

    In the Part-III of this series, we are going to describe about the steps required to visualize the device data stored in Cloudant NoSQL DB as Historical Data Storage on the Watson IoT Platform Dashboard using Line Chart Cards

  2. Before Proceeding Further

    Before going to use Line Chart Cards from Watson IoT Platform Dashboard, we need to have the following steps done:

    • Configure Cloudant NoSQL DB as Watson IoT Platform Historian Data Storage.

      The IoT Recipe discussed here, makes use of the Create Toolchain button to help deploy the necessary services on to Bluemix. Click on the Create Toolchain button provided below, provide a custom name to your application and choose to click on Create button, to quickly deploy the Watson IoT Platform, Node.js runtime ( and Node-RED application on top of it) and Cloudant NoSQL DB, as part of the Bluemix starter app. Post successful deployment, you shall have all three of the above mentioned services, up & running in your Bluemix environment.

      Toolchain-8

      Note: If you are a User using the United Kingdom Region in your Bluemix environment, then please make use of the steps mentioned in the IoT Recipe Deploy Internet of Things Platform Starter service on Bluemix to deploy the setup. Alternatively, you can also try using the Deploy to Bluemix button, to deploy the setup under your United Kingdom Region, provided your Jazzhub account is validated. Users of US South Region can ignore this step.

            deploy

    • Send some device data on to IBM Watson IoT Platform following the steps described in the recipe – Visualizing Data in Watson IoT Platform.
    • Connect to IBM Watson IoT Platform and keep sending device events in real time till we finish the step of linking between Line Chart Cards and Cloudant NoSQL DB Instance to visualize device data on dashboard.
  3. Line Chart Cards to display Historian data

    We can link between line chart cards and the device data stored in Cloudant NoSQL DB as Historian Data to be displayed on Watson IoT Platform dashboard using Boards.

    Open the Bluemix Dashboard and click on the Application service that you have currently deployed (using the Create Toolchain button), if you have already moved away from it. You should see the Watson IoT Platform listed under the Connections. Click on the WIoTP service and choose the click on Launch button to launch the WIoTP Dashboard.

    To know complete details about how to use Boards and different types of cards supported, refer to recipe – Configuring Boards & Cards in the new Watson IoT Dashboard.

    In this section, we describe the steps required to fetch data from Cloudant NoSQL DB configured as Historian Data Storage for Watson IoT Platform and display using Line Chart Cards. To proceed, we should have our device(s) connected on Watson IoT Platform for which we have already configured Cloudant NoSQL DB to be used as Historian Data Storage and keep sending device data in real time till we complete the linking between Cloudant NoSQL DB and Line Chart Card:

    • From Watson IoT Platform Navigation window, select Boards and click on Create New Board:
       create_new_board1
    • Fill in the information about new board and click next:
       create_new_board_info1
    • Add any members to access the card and click create:
       create_new_board_mems1
    • Click on newly created board and select Add New Card:
       add_new_card1
    • Select Line Chart from the list of the displayed card types:
       add_new_card_line_chart1
    • From the displayed devices list, select the required one (In our, we are selecting piCam-1) and click Next:
       add_new_card_source1
    • Click on Connect New Data Set and fill in the required details, value type, min and max for value, Click on Next:
       add_new_card_data_set1
    • Card Preview window gets displayed. Select Settings and we should see configured Cloudant Instance should appear with in couple of seconds. Change the Window Size to required time say 24 Hours and click on Next:
       add_new_card_preview1
    • In the Card Information Window, provide the appropriate title to get displayed and select required colour scheme, click on Submit:
       add_new_card_info1
    • Now, we should be able to see the device data for the selected device sent to Cloudant NoSQL DB on Line Chart card:
       add_new_card_display1

     

    Following the above given steps, we can add separate line chart cards for each of the device to fetch the device data from Cloudant NoSQL DB and display using Line Chart cards on Watson IoT Platform dashboard. We can also update the settings for the created boards and line chart cards whenever needed.

     

  4. Conclusion & Next Steps

    In this recipe, we have show cased the steps to:

    • Link between Cloudant NoSQL DB and Line Chart Card
    • Visualize the device data stored in Cloudant NoSQL DB on Watson IoT dashboard

     

    Here are the links to other recipes of this series:

Join The Discussion