In this post i will finish IOT Home automation using Google assistant, Dialog Flow and firebase which i started in previous post. Till now we are done with Hardware Setup, Connecting Arduino NodeMcu with Firebase & Setting Up/Configuring Dialog Flow agent. So, let’s complete left out part i.e. Configuring Firebase Tools for Webhook and Integrating Google Assistant with Dialog Flow.
Code Below Follows the Video to help:
Setting Up IOT Firebase Tools:
- Install Node.js and npm environment.
- Install firebase tools using npm.
npm install -g firebase-tools
3. Start Firebase sdk for firebase functions :
4. Go to firebase project directory and type command
5. above command will create directory which includes whole project files here we just need to focus on index.js file .
var admin = require(‘firebase-admin‘); const functions = require(‘firebase-functions’); |
|
admin.initializeApp(functions.config().firebase); | |
var database = admin.database(); | |
// // Create and Deploy Your First Cloud Functions | |
// // https://firebase.google.com/docs/functions/write-firebase-functions | |
// | |
exports.hello = functions.https.onRequest((request, response) => { | |
let params = request.body.result.parameters; | |
database.ref().set(params); | |
response.send({ | |
speech: “Light controlled successfully“ | |
}); | |
}); |
6. Once done with writing code just need to deploy code to firebase functions.
firebase deploy
Integrating Google Assistant with Dialog-flow in IOT:
Now, we are done with creating our chat bot which can control our lights, using firebase functions. Let’s integrate our chatbot with google assistant. So, that we can easily control lights using our android device.
Tip: Here i will suggest to use account which you are using in android device. So, account google account should be same for : dialog flow, firebase, android.
- Firstly, Navigate to integrations panel and select Google Assistant
- Secondly, In Explicit invocation select Intent you created (Light Control)
- Thirdly, Leave Implicit invocation blank
- Fourthly, Now, click on Test button
- Fifthly, You will be redirected to Actions on google, by default simulator opened
- Navigate to Invocations tab (3rd from top) and put Display name : Light Control
- Now do general settings as directed in video tutorial and test your app on simulator.
Code is not Working!!
Code is not Working!! too…
Is the code given typescript or javascript?
given code is javascript
code is working fine i have recently tried
Code is Working, thank you ^^
Great post. Thanks for sharing it. Get the proper home automation courses of the IOT to learn the new technology in the proper way.
how to display humidity data from firebase to google assistant …
This video is really informative on IOT technology. As, the IOT technology is emerging to provide the Smart home automation services in home to improve security in home.
How to Build an App for the Google Assistant on Android Studio , please help me!
I tried yours Project.
BUT in actions on google test simulator
How do I solve the problem as follows?
Invocation Error
You cannot use standard Google Assistant features in the Simulator. If you want to try them, use Google Assistant on your phone or other compatible devices.
Thanks for the tips guys. They were all great. I have been having issues with being fat both mentally and physically. Thanks to you guys i have been showing improvements. Do post more. CutTheWood
Error: could not handle the request
I had a power cut and had to re-set everything, but solved this by putting in 3xAAA batteries.
Would I recommend the lamp? Yes, it works well. £30 is still hefty for an Alarm but I think it's worth it considering how expensive competitors are.
Complete Security Alarms System
It’s my first time to visit this site & I’m really surprised to see such impressive stuff out there.locksmith Alpharetta
I want to ask a question, how to get data form firebase database and speech that?
Could you provide me with a API v2 compatible index.js?
ok sure
me as well
i can't choose V1 API? help me?
Can you provide me with an API-V2 compatible index.js too?
can you make v2 api version for index.js
Nice article, Which you have shared here about the home automation. Your article is very informative and useful to know more about the Google Assistant, Dialogflow and Firebase. If anyone looking for the Home Automation Services in Sydney, Nsautomate is the best choice.
Please share dialogue flow V2 index.js beacuse V1 IS NOT WORKING ANYMORE
Amazing things you've for the most part conferred to us. Essentially proceed with composed work this kind of posts.The time which was wasted in going for instructive cost now it tends to be used for studies.Thanks poe security camera system
IoT is the trending advanced technology in this technological world. While many physical objects and sensors which we mention in the context of the Internet of Things use IP and IoT Platform, not all of them do so. Your blog helps peoples to understand IoT technology.
If your looking for Online Illinois license plate sticker renewals then you have need to come to the right place.We offer the fastest Illinois license plate sticker renewals in the state. Jed Fernandez
Gangaur Realtech is a professionally managed organisation specializing in real estate services where integrated services are provided by professionals to its clients seeking increased value by owning, occupying or investing in real estate. Accessories
Very nice blog and articles. I am realy very happy to visit your blog. Now I am found which I actually want. I check your blog everyday and try to learn something from your blog. Thank you and waiting for your new post. coordinates address api
A complete sententious blog, intended to impress people.
visual automation testing
A blog that mushroomed from visual edification.
alpinestars leather trousers