Based on https://github.com/harperreed/node-ifttt-mqtt-bridge
Fullfillment for DialogFlow intent, breaks down the entites to topic and message and sends to the MQTT broker.
- Create a project at Firebase.com
- firebase init
Install Firebase tools:
$ npm install -g firebase-tools
Instantiate your project:
$ firebase init functions
Don't overwrite existing package.json and index.js
You will have to configure a handful of firebase config vars.
firebase functions:config:set mqtt.server.port=12345
firebase functions:config:set mqtt.server.host=mqtt://mxx.cloudmqtt.com
firebase functions:config:set mqtt.server.user=username
firebase functions:config:set mqtt.server.password=password
firebase functions:config:set access.api_key=secretapikey
You should generate a unique access.api_key, then add it to dialogflow fulfillment as header "api_key"
After you configure your vars, you can then deploy:
$ firebase deploy
Once you deploy you will get a URL: https://us-central1-mqtttest.cloudfunctions.net/post
You can use this url as dialogflow webhook:
- Fork the repo
- Make a pull request
- Profit