Giter VIP home page Giter VIP logo

alexa-fireplace's Introduction

Introduction

Alexa Fireplace is a project to control a fireplace via Alexa Skills Kit (ASK). The code in this repository provides the lambda function for interacting with ASK as well as a server capable of providing OAuth2 and controlling a fireplace flame and blower fan via a GPIO two-channel relay. The Server and GPIO controls were built on a Raspberry Pi 3 on Raspbian 8. I have not tested this on other boards or Operating Systems.

Once you have this up and running in your home, you can say "Hey Alexa, turn on the fireplace" and your fireplace will turn on. Likewise, you can say "Hey Alexa, turn off the fireplace" and Alexa will turn off your fireplace.

Getting Started

Before beginning, you'll want to make sure you have a couple of prerequisites:

  1. A domain name with an SSL certificate, or the ability to obtain one via Let's Encrypt (see below)
  2. A Raspberry Pi Running Raspbian 8
  3. Male to Female Jumper cables
  4. A two-channel Relay Controller
  5. Electrical components and tools to wire your fireplace

Create your Application on Amazon Developer Services

  1. Create an account or login

Configure your Raspberry Pi Running Raspbian 8

Configure your Lambda Function in AWS

Configuring your System

  1. Install Dependencies a. $ sudo apt-get install nginx uwsgi python3-dev python3-virtualenv python3-pip
  2. Install Python Packages a. $ pip install -r requirements.txt
  3. Link the project to /var/www/ a. $ sudo ln -s pwd /var/www/alexa-fireplace
  4. Configure nginx a. $ sudo ln -s `pwd`/alexa-fireplace-nginx.conf /etc/nginx/sites-enabled/alexa-fireplace-nginx.conf b. $ sudo systemctl enable nginx
  5. Configure uwsgi a. $ sudo ln -s `pwd`/emperor.ini /etc/uwsgi/emperor.ini b. $ sudo ln -s `pwd`/alexa-fireplace-uwsgi.ini /etc/uwsgi/vassals/alexa-fireplace-uwsgi.ini c. $ sudo systemctl enable uwsgi
  6. Add www-data to group gpio a. sudo adduser www-data gpio

Setting up your Free SSL Certificate

Note that before doing this you should have your server running via NGINX and Uwsgi.

  1. Go to Let's Encrypt (and donate if you want!)
  2. Follow the instructions there to determine how to configure the cert for your system.
  3. For Raspbian 8 Jessie b. Add the line: deb http://ftp.debian.org/debian jessie-backports main to /etc/apt/sources.list c. $ sudo apt-get update
  4. Install CertBot a. $ sudo apt-get install certbot -t jessie-backports
  5. Create the Certificate a. $ certbot certonly --webroot -w /var/www/alexa-fireplace -d b. CertBot will need permissions to write to this directory. The Nginx config is already configured to server the CertBot http://{{ HOSTNAME }}/.well-known directory for verification by CertBot.

alexa-fireplace's People

Contributors

benjigoldberg avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.