Page 1 of 1

How to Use Chatbot with QBoat Sunny

Posted: Wed Jul 24, 2019 11:09 am
by Stevenmwshyu
Easy-to-read version : ... oat-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:
QBoat Sunny
QIoT Suite Lite
MediaTek LinkIt 7697
Relay and Power Plug (Reference: Web Controlled Socket by Arduino by Laisan)
AP Wireless Router
Facebook Account
Files used: Download Here
Create and Setup QIoT
Open QIoT Suite > IoT Applications > Import > select chatbot-light.json

Open the uploaded QIoT Application.

Navigate to the Rule tab.

Create and Setup our Chatbot via Chatfuel
Register or sign-in to Chatfuel using your Facebook account.
Click Create from Template.

Select Blank Bot.

Click Connect.

Select the page you’d like Chatbot to operate on.

Navigate to Automate and add a block.

Rename the block and add a text element which you want to show in Facebook Messenger.

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.

In the new tab, copy this portion of the URL.

Head back to Chatfuel and click Add Button (Optional).

Rename the button, then click URL and enter the URL.
URL: <dashboard URL (copied from before)>/Option?Switch=on

Follow Steps 10-11 to make another button for off.
URL: <dashboard URL (copied from before)>/Option?Switch=off

Head to Set Up AI and type light or any activating keywords you’d like to use.

Click Add Block and select QIoT (the block we created earlier).

Head back to Automate tab.

Connect LinkIt 7697

Connect the Relay and Power Plug to LinkIt 7697.
VCC to 5V
Signal to P3
Download and Install the Arduino IDE here
Open HTTPRelay.ino to Arduino IDE and change network SSID and password accordingly.

Upload HTTPRelay.ino to LinkIt 7697 via Arduino IDE.

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
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

Repeat with LightOff node.
URL: http://<your-ip>/OFF1
Click Save.

Test If It Works
Head back to Chatfuel and click Test your bot

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: ... ot_control