get dependencies
npm install
Add to the end of the ~/.profile
export PATH=$PATH:/opt/nodejs/bin
export PATH=$PATH:/usr/local/lib/node_modules
npm start
Connect Rpi/Device and Alexa, and get devices discovered by Alexa. Alexa usually scan for 20 seconds to discover devices, and with in that time it able to discover 10-12 devices, in case you want to have more devices you need to rediscover for more devices.
- Make sure RPi/Device is connected to same local network as Alexa through wifi or ethernet
- Garage: Rpi physical pin 7 (GPIO 04) ------ Relay---- Garage Controller pins
- Light: Rpi physical pin 11 (GPIO 17)--------Relay --- light/Lamp
- Alexa need to be connected to local Wifi, make sure its on same network as Rpi Devices are connected to. This would allow Alexa to discover Rpi/Device on same network.
- Tell Alexa to "Alexa Discover Devices"
Run these set of commands only first time, this will setup service to auto start on reboot.
npm install -g pm2
cd <to service folder>
pm2 start server.js --name HomeAutomationAlexa
pm2 startup
To check status for the service
pm2 list
To stop service
pm2 stop HomeAutomationAlexa
To manually start again
pm2 start server.js --name HomeAutomationAlexa