webby-grove-demo
v0.0.2
Published
Messenger Bot plugin to control LED by potentio Meter
Downloads
10
Readme
webby-grove-demo
This project's goal is to validate and demostrate we can control devices by Webby via some messengers.
Now tested on Telegram and Facebook messenger.
Usage
Rotate rotery angle sensor to control LED's light level
Check status
led
> LED is off
- Change state
led on
> LED is on(255)
led off
> LED is off
- Set value
> led 800
> set LED level to 200
> led
> LED is on(200)
Prerequisite
- Mainboard: Respberry Pi 2 or 3
- GrovePi+ extension board to connect Grove modules
- Grove sensors: Green LED
(They are also avaialble via Grove starter kit)
Setup Hardware
Connect GrovePi+ and Respberry Pi together. Plug Rotery angle sensor in pin A2, Plug Green LED in pin D5 on GrovePi+ board.
Setup Software
You need to make GrovePi works first by following this instructions.
Then you need clone webby_template which provide the basic setup of chatbot framework.
$ git clone https://github.com/gasolin/webby_template.git demo
$ cd demo
Then you have to get this project and install a messenger adapter from npm. (Let's take telegram adapter for example. I've test it with Facebook messenger as well, so you can try on it in the same manner)
$ npm install --save hubot-telegram webby-grove-demo
$ npm install
Edit external-scripts.json
and add "webby-grove-demo"
string in it
Edit node_modules/hubot-telegram/src/telegram.coffee and replace hubot
to webbybot
at the first line.
Then you need create a telegram bot and put the token in .bashrc
file
export TELEGRAM_TOKEN=222333444:AAbbccDdeeffgghijklm
Refresh the bash environment with
. ~/.bashrc
Then you can host your bot on telegram and control the sensors.
$ ./bin/webby -a telegram