Build a chatbot using Dialogflow, Webhooks, and IFTTT to control your smart light bulb. For this project, I'll be integrating it with telegram.
1.1 Go to https://dialogflow.cloud.google.com/ and sign in using your Google account
Go to the dropdown menu on the top-lefthand corner and select "Create new agent"
- We'll be needing 3 intents for this project
- Click "CREATE INTENT" and change the title to "lights"
- Training Phrases : "/lights"
- Responses: Click on "+" and select Telegram.
- "ADD RESPONSES", select "Quick Replies"
- Quick replies title: "On/Off lights?"
- Button titles: "On", "Off"
- Save and go back to Intents page
- Hover over the "lights" intent and select "Add follow-up intent"
- Ensure that you add "lights-followup" as the input and output context
- Change the title to "lights - on"
- Training Phrases: "On"
- Quick replies title: "Switching on the lights..."
- Button titles: "Off"
- Fulfillment: "Enable webhook call for this intent"
- Repeat the steps for "lights - off"
- Telegram Integrations
- Go to Integrations page
- Enable Telegram; Get a Telegram access token from BotFather and insert it in the ‘Telegram Token’ field.
- You should be able to start your Telegram bot
1.1 Sign in to https://ifttt.com/
- click on the "+" and select "Webhooks" as the service. Select "Receive a web request".
- Event Name: "lights_on"
- click on the "+" and select "Yeelight" (or other supported brands) as the action. Select "Toggle lights on/off". Select your light's name and choose "On".
1.4 You will notice that there are other options for your light settings. You can explore them on your own!
1.2 Browse to https://heroku.com/deploy?template=https://github.com/jpruden92/ifttt-dialogflow-webhook
1.4 Click on "View" and you should see the URL of your fulfillment: https://<app_name>.herokuapp.com/fulfillment
- Copy the Fulfillment URL and paste it under Dialogflow's Fulfillment > Webhook > URL*
- Basic Auth(Default): Username and password is "test"
1.5 IFTTT Events URL: Browse to https://ifttt.com/maker_webhooks/settings and copy the URL
- Ensure that your Dialogflow intent and IFTTT are correct.
- Type "/start" and "/lights"
Special thanks to SoumyadeepPal for creating the IFTTT - Dialogflow connector (https://elements.heroku.com/buttons/soumyadeeppal/ifttt-dialogflow-webhook)