Overview

Skill Level: Any Skill Level

Beginner-Intermediate

This recipe is a continuation of AV04 and extends the previous application to issue email notifications under given sensor conditions.

Please visit our website for the latest BCM4343W recipes:
http://cloudconnectkits.org/product/avnet-bcm4

Step-by-step

  1. Please complete Part 1 of this tutorial

    • This recipe is a continuation of the Avnet to Alexa Smart Home Demo (AV04), so make sure that you have part 1 completed first.
  2. Configure your Node RED Code

    • In Node RED, configure the node “Output to dashboard” as follows, where XXXX is the four digits of your device ID:

    113

  3. Register your Device

    • Go to your bluemix console and scroll down to select the appropriate iotf service.

       

      https://new-console.ng.bluemix.net/#all-items

    U01-1

    • Click on “Launch” to access your Bluemix Services dashboard:

    U02-1

    • Hover your mouse over the icons to the left to open up the pop-out menu, then select “Devices”. Click “Add Device” in the top right corner of the screen.

    U03-1

    • Click on “Create device type”, then click “Create device type” again.

    62

    • Enter “ZentriDevice” for the Name and add an optional description and click next to skip through rest of the windows until you reach the last page – Metadata. Click “Create” and you should now see a “ZentriDevice” device type.

    72

    • Click “Next” and enter in your “zentri_XXXX” device ID from earlier. Skip through the remaining windows and click the “X” when finished.

    92

  4. Create a Device Schema

    • You will now need to create a device schema – Select the “Manage Schemas” tab on the top menu from the devices page to create a device schema.

    manage-schemas

    • Click “Add Schema” In the top right corner, select “ZentriDevice” for your device type and press “next”.

    123

    • Click “Add Property” and select the “From Connected Tab”, which will automatically import published properties.

    133

    • Tell Alexa to “start publishing” to see properties appear on the menu. Select all by checking the box next to property.

    142

    • Click “Finish”. You should now see a schema listed as “ZentriDevice” back in the Schemas menu:

    154

     

  5. Create a Rule

    • Hover your cursor over the icons to the left of the page again to open the pop-up menu again. Select “Rules” and then click on “Create Cloud Rule”.

    163

    • Enter a name for your rule, an optional description and select the “ZentriDevice” schema in the “Applies to:” box.

    173

    • Click next and you should see an “IF/THEN” Diagram. Under the IF condition, click the “New Condition” box and “Select Property” to choose the property for the IF condition. Click on the triangle icon next to “d” to open up a drop-down list of additional nested properties select the “light_level” property.

    184

     

    19-real

    • Leave the operator as “>” and enter an arbitrary value for the “Value:” box as we are comparing whether the light is on or off. For this example, the value 200 is used. Click “OK”

    202

    • Now select the “New action” box to create a response to the IF condition. Click on “Add Action” to open up a new menu for editing. Give your action a unique name and description, then select “send email” for “Type”. Press “Next” when complete.

    212

    • Now to configure your email, edit the subject line if you wish, and select “Specific People” under the “To” header. Enter the email address(es) you wish the notification to be sent to. In addition, you can also include emails for CC.

    222

    • When complete, press finish and click on “save” and “activate” on the top right corner of the main rule menu to start your email notification application.

    232

  6. Test your Email Alerts

    • Hover your cursor over the left pop-out bar and select “Boards”. Then click on the “Rule-Centric Analytics” board.

    242

    • You will now see several “cards” that display rule-related information. Try asking Alexa to “start publishing” and shine a light on the light sensor to trigger the email to see how these cards react.

    252

    • Check your email to see the notification.

    263

  7. Extend this Application!

    • Once you have successfully built this application, feel free to experiment with different IF conditions and THEN actions. There are many other actions that can be implemented with rules, such as triggering a Node-RED flow, IFTTT, etc.

    272

Join The Discussion