How to Use Chatbot with QBoat Sunny

In this tutorial, we will be using Chatfuel to control a light bulb by interacting with our chatbot in Facebook Messenger.

What You’ll Need:

Create and Setup QIoT

  1. Open QIoT Suite > IoT Applications > Import > select chatbot-light.json
  2. Open the uploaded QIoT Application.
  3. Navigate to the Rule tab.

Create and Setup our Chatbot via Chatfuel

  1. Register or sign-in to Chatfuel using your Facebook account.
  2. Click Create from Template.
  3. Select Blank Bot.
  4. Click Connect.
  5. Select the page you’d like Chatbot to operate on.
  6. Navigate to Automate and add a block.
  7. Rename the block and add a text element which you want to show in Facebook Messenger.
  8. In QIoT Suite, go into the Dashboard tab and click on the icon shown below. This will open a new tab to show your current dashboard layout for your QIoT Application.
  9. In the new tab, copy this portion of the URL.
  10. Head back to Chatfuel and click Add Button (Optional).
  11. Rename the button, then click URL and enter the URL.
    URL: <dashboard URL (copied from before)>/Option?Switch=on
  12. Follow Steps 10-11 to make another button for off.
    URL: <dashboard URL (copied from before)>/Option?Switch=off
  13. Head to Set Up AI and type light or any activating keywords you’d like to use.
  14. Click Add Block and select QIoT (the block we created earlier).
  15. Head back to Automate tab.

Connect LinkIt 7697

  1. Connect the Relay and Power Plug to LinkIt 7697.
    • GND to GND
    • VCC to 5V
    • Signal to P3
  2. Download and Install the Arduino IDE here
  3. Open HTTPRelay.ino to Arduino IDE and change network SSID and password accordingly.
  4. Upload HTTPRelay.ino to LinkIt 7697 via Arduino IDE.
  5. Open the Serial Monitor (Ctrl + Shift + M). The serial monitor will show LinkIt’s IP address. Copy this IP address.

Connecting QIoT Suite to LinkIt

  1. Head back to QIoT Suite and double-click on LightOn node, then replace the URL with your the URL you copied from Arduino IDE, then hit Done.
    URL: http://<your-ip>/ON_1
  2. Repeat with LightOff node.
    URL: http://<your-ip>/OFF1
  3. Click Save.

Test If It Works

  1. Head back to Chatfuel and click Test your bot
  2. Enter light and select on to turn on the lightbulb, off to turn it off. Of course, this will appear on your own Facebook Messenger.

Additional References:

Original Github: https://github.com/blackmesataiwan/qboat_chatbot_control

Related posts

Leave a Reply