Overview

Skill Level: Any Skill Level

Ingredients

Watson IoT Bluemix account

Raspberry Pi

Centralite Jilia Pi

Centralite Zigbee sensors

Step-by-step

  1. Lesson #1 Toggle the Green LED on the Raspberry Pi / Jilia Pi Hat

    1. Use the Search field to find the Jilia node
    2. Drag a Jilia node from the palette onto the Node-RED flow
    3. Clear the Search field and expand the input palette
    4. Drag an Inject node onto the flow
    5. Connect the nodes by drawing a wire between the two nodes
    6. Double Click on the Jilia Node
    7. Name it Jilia Green LED Blink
    8. Select the Green LED
    9. Input Action will be to toggle the state
    10. Press OK
    11. Double Click on the Inject node (see screenshot below)

    12. Change the Payload from timestamp to boolean

    13. Repeat on an Interval

    14. Every 1 seconds

    15. Name the Node Trigger Green LED

    16. Press Ok

    17. Press the red Deploy button in the upper right corner

    18. Congratulations You’ve made the Green LED Blink!

      Extra credit : blink the Red or Blue LEDs. Blink them in various interval or delay patterns.

  2. Lesson #2 u2013 Read Sensor data from the Smart Power Plug

    1. If you can, plug the Centralite Power Plug into the power strip and then plug your laptop into the Power Plug. You’ll get meaningful Voltage / Current / Active Power readings
    2. Drag an Inject node from the input category of the Palette onto the flow
    3. Drag a Debug node from the output category of the Palette onto the flow
    4. Drag a new Jilia node onto the flow
    5. Wire them together
    6. Modify the input node (Double Click) and change the Payload to a Boolean

    7. Repeat on an Interval of 3 seconds

    8. Name the node Trigger Power Adapter Output and press Ok

    9. Double click on the Jilia node and name the node Jilia Power Adapter

    10. Select the Light device

    11. Set the Input Action to Trigger Output (every 3 seconds the Inject node will send a True)

    12. Output Monitor set to State

    13. Press Ok

    14. Press the Red Deploy button

    15. Turn to the Debug tab on the right sidebar. Power readings should be output

  3. Lession #3 u2013 Query Zigbee Sensor Data via a Websocket

    1. Open a new browser tab and visit http://browser.centralite.com
    2. Enter the IP address of the Raspberry Pi and the :1337 port
    3. Press the Connect button
    4. If you have already paired your Centralite Lamp power plug zigbee sensor, click on the word light
    5. Scroll to the bottom and find the title: activePower section

    6. Copy the complete href ws:// URL to the clipboard. You will paste this string in step 13.

    7. Return to the Node-RED tab in your browser

    8. Drag a Websocket input node to the palette

    9. Drag a Debug output node to the palette
    10. Doubleclick to open and modify the websocket node

    11. Change the Type from Listen on to Connect to

    12. Click on the Pencil to Edit

    13. Paste the URL ws:// from Step #6 into the field

    14. Wire it up to a Debug node
    15. Press the Red Deploy button
    16. Turn to the Debug Tab
    17. Congratulations! You are now reading sensor data from the Centralite lamp power plug.
  4. Lesson #4 u2013 Send Sensor Data to the Watson IoT Platform

    1. Let’s send the Active Power sensor data to the Watson IoT Platform
    2. Search on Watson IoT and drag an output node to your flow
    3. In Lesson #4 we will send the data to the Quickstart

    4. Visit the Quickstart landing page and enter unique sensor identifier
      https://quickstart.internetofthings.ibmcloud.com/#/device/58b7b208.3ff764/sensor/
    5. By default, Quickstart will plot the first numeric data series. In our example, the timestamp data is of limited interest and plots a linear graph.

      Click on the third Datapoint data and Quickstart will plot the ActivePower graph.

  5. Lesson #5 u2013 Create a Watson IoT Starter Applications in Bluemix

    1. Login into https://console.ng.bluemix.net/?direct=classic
    2. Click on Catalog in the top menu
    3. Search for Internet of Things
    4. In the Boilerplates section, click on the Internet of Things Platform Starter

    5. Give your application a name and press the Create button

    6. In a minute, your app will be running in Bluemix

    7. Let’s build a Node-RED flow in the IBM Cloud
    8. Let’s create this Node-RED flow:
    9. IBM IoT Device in wired to Quickstart and my unique ID
    10. Parse out the ActivePower data from the MQTT payload
    11. Switch Node on safe / dangerous power consumption.
    12. Print out messages
    13. We can see data appear in the logs.

  6. Lession #6 u2013 Send MQTT Alerts back down to the Raspberry Pi and blink the Red LED

    1. The Node-RED flow on Bluemix cloud accepts the sensor data, extracts the activepower data and determines how many Watts of power consumption it should alert on. It outputs a Safe / Danger message and sends a command back down to the Raspberry Pi to blink the Red LED on the Jilia Pi Hat.
    2. On the local Raspberry Pi, the Node-RED flow receives the Power Consumption alerts
    3. Receive the Alert from the Watson IoT Platform.

    4. A switch node evaluates the data returned from the Watson IoT Platform

    5. Extract the On/Off message

    6. Congratulations, the red LED on the Jilia Pi blinks a warning sent from the Watson IoT Platform application.

1 comment on"Watson IoT control of Centralite Jilia Pi"

  1. StanfordDad June 28, 2016

    Where can I get of Julia Pi?

Join The Discussion