Skip to content

Your home automation assistant built with Node.js and AngularJS

License

Notifications You must be signed in to change notification settings

alain33/Gladys

 
 

Repository files navigation

Gladys Project

Alt

The Project

Gladys is an home automation assistant to help you in your everyday life.

Yes, like a kind of JARVIS!

When you see this kind of project, you say "Uhh, I'm sure this doesn't work, it's based on speech recognition, even Siri isn't capable of being JARVIS". But the goal of Gladys project is completely different. We believe that speech recognition is not working fine today, so we've tried a different approach : If instead of having an assistant waiting for your orders, we have an assistant analyzing all your environment ( analyzing your calendar, reading your emails ) and predicting your needs. Because in fact, with all the APIs which exists, we can gather all the information we want to optimize our life.

With this system, it's not the user who ask something to his assistant : it's the assistant which tells informations to the user, at the right moment.

Website : http://gladysproject.com

Specifications

Gladys is 100% written in Node.js, with the sails.js framework on the server-side, and AngularJS client-side.

Alt

Prerequisites

  • Node.js ( >= v4.2.2, not compatible with v5 for now )
  • MySQL
  • Command Line Tools
  •  Mac OS X: Xcode (or OS X 10.9 Mavericks: xcode-select --install)
  •  Windows: Visual Studio
  •  Ubuntu, Debian: sudo apt-get install build-essential

Getting Started

The easiest way to get started is to install Gladys with NPM :

npm install -g gladys --unsafe-perm

Gladys is now located where you global node_modules are.

For example on Raspbian or on a Mac, it's located in :

/usr/local/lib/node_modules/gladys

Connect Gladys to MySQL

To connect Gladys to your database, you need to enter your connections informations in the config/connections.js file.

Modify the following lines with your own informations :

 sailsmysql: {
    adapter: 'sails-mysql',
    host: 'localhost', 
    port: 8889, 
    user: 'root', 
    password: 'root',
    database: 'gladys'
  },

Note : You need to create the database first in MySQL :

CREATE DATABASE gladys;

Create tables

Gladys create automatically all the tables it needs. (only in development mode, not in production, so be sure to start Gladys one time in development mode before trying production mode).

Start Gladys

$ node app.js

Visit Gladys dashboard

If you are on localhost, visit : http://localhost:1337 (in development mode), orhttp://localhost (in production).

If you want to access Gladys anywhere on your local network, just visit : http://ip_of_your_machine:1337.

Gladys on a server

If you are trying to install Gladys on a VPS or a dedicated server, or any device which don't have an audio card ( a server can't play music, can't speak ), that's possible !

You need to change the file config/machine.js. Go to line 21 and change the line soundCapable : true to soundCapable : false.

When you install the NPM dependencies, you can remove package linked to audio playing, because they won't be able to install on you server ( module lame, speaker and player ).

Getting Google API KEY

If you want Gladys to be connected to your Google account ( to read your calendar for example ), you need to register in Gladys config file your Google API Key.

  • Visit Google Developpers Console
  • Click CREATE PROJECT
  • Enter a Project Name (for example "Gladys") , then click CREATE
  • Then select APIs & auth from the sidebar and click on Credentials tab
  • Click CREATE NEW CLIENT ID button :
  • Application Type: Web Application
  • Authorized Javascript origins: http://localhost
  • Authorized redirect URI: http://localhost:1337/googleapi/create
  • Copy and paste Client ID and Client secret keys into config/googleapis.js

You must allow the created project to access to your calendar, and your emails. Your developper console must look like that :

Alt

FAQ

npm install returns me a lot of errors !

Make sure that node-gyp is working fine. Wait, what is node-gyp ?

Node-gyp is a cross-platform command-line tool written in Node.js for compiling native addon modules for Node.js.

To be sure that you're doing that good, check node-gyp installation guide.

Can't install npm package speaker

On Debian/Ubuntu, the ALSA backend is selected by default, so be sure to have the alsa.h header file in place :

$ sudo apt-get install libasound2-dev

For more informations, check node-speaker repository.

Contributing

Pull request are welcome, but code must follow some guidelines.

If you want to develop a new functionality, develop a Gladys Module instead of modifying the core! More about modules on the website.

Roadmap

All the work is listed on our Trello !

Links

About

Your home automation assistant built with Node.js and AngularJS

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 90.9%
  • CSS 9.0%
  • Shell 0.1%