Git Product home page Git Product logo

aurora-server's Introduction

Aurora Server

Express.js server for Aurora smart home project.

Demo

Installation

create an "_env.js" file with inside:

var env = {
  production: false,
  port: 3456,
  mongo: "your mongo URL",
  mqtt_server: "your mqtt server, if you use the broker below it should be mqtt://localhost:1883",
  broker: {
    mongo_url: "mongodb://localhost:27017/",
    port: 1883
  },
  auth: {
    saltRounds: 10,
  },
  socket_server: "http://localhost:3456",
  weather:{
    token: "Your darksky.net API key",
    location: "lat,long",
  },
}
module.exports = env;

Then run

  npm install
  npm run start

Then visit localhost:3456. A MQTT and a Socket server will be started on port 1883 and on port 3457.

MQTT

Aurora Server will listen to all the messages on the mqtt broker with the topic

  :user_uuid/:node_uuid/updated

And will update the state of the node based on the message (in JSON).

A node should listen to

  :user_uuid/:node_uuid/update

For state changes from Aurora Server.

Use IFTTT + Google Assistant for voice controls

With the Aurora APIs and IFTTT, you can use your voice to control Aurora. Here is what you need to do:

  1. Create a new Applet on IFTTT
  2. Choose 'Google Assistant' as "This"
  3. Choose 'Say a simple phrase' as "trigger"
  4. Write your phrase (for example: 'Turn on the TV') and then write what you want the Assistant to say in response (for example: 'Turning on TV...')
  5. Choose 'Maker Webhooks' as 'action service'
  6. As URL, write {{URL}}/api/v1/nodes/{{UUID_NODE}}?access_token={{UUID_USER}}, where URL is the url where your server is hosted, UUID_NODE is the node UUID and UUID_USER is the user UUID. Note that you can't test this on localhost, you need to have a real domain.
  7. As Method, choose POST, and as Content Type choose "application/x-www-form-urlencoded"
  8. As Body, choose the node state that you want to change in the form {{key}}={{value}} (for example: open=true for a 'switch' node)
  9. That's it! Save the applet and use Google Assistant on Android or on Google Home to say your phrase Trigger (OK Google, turn on the TV). Everything will work as expected :)

Todo

  • Client: connect the React Client with MQTT via APIs
  • Create a new node from React Client
  • Better configuration for new Node (and type of node)
  • Schedule a node on/off
  • Share a node between more users
  • Refactor sharing part - schedule doesn't work
  • Better Layout and design
  • Add more node types

aurora-server's People

Contributors

urcoilbisurco avatar

Watchers

James Cloos 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.