Giter Club home page Giter Club logo

home_automation's Introduction

Home_Automation

smart home automation

Project follows the below structure for home automation devices:-

  1. database - using mongo db to query list of devices.
  2. log_utils - using standard library 'bunyan' for logging.
  3. Utils - for additional method in code
  4. views - for any web view or html files

to Start project use 'npm start' command.

To run the code locally follow the below steps:-

  1. npm install
  2. enable the flag InsertOnce: true to make initial device addition to locally running Mogo Db.
  3. i have choosed mongo db to show more operation with no sql db's. same opearations i can perform with deviceList.json, by adding, removing and displying data from the deviceList.json file. use mongo db locally and create database 'devices' and collection 'deviceList'.
  4. npm start
  5. then try accessing url's:- http://localhost:3030/list, http://localhost:3030/delete?device=WifiRouter_device001 for adding device use postman for post request :- curl --location --request POST 'http://localhost:3030/add/'
    --header 'Content-Type: application/json'
    --data-raw '{ "device": "WifiRouter", "status": "on" }'

http://localhost:3030/getDeviceInfo

  1. Usually for additing device info we will use websocket or MQTT protocol. I am making use of MQTT protocol to publish the information from my device and subscribe the topic001 which i have published with device infomation. In realtime devices will publish data to mqtt broker and the client will subscribe the data from the broker. This also demonstrate the event handlings with clinet.on() methods.

  2. Using the library package 'bunyan' for logging and tracing purpose. we can enable log.debug, log.info, log.error using this.

  3. To run Testcases use 'npm test' or mocha ./test or launch.json to execute in visual studio code

  4. Added option to switch on and off the device and updating device status. This operation can be performed by sending sms or through the app.

home_automation's People

Contributors

mrutyunjayamsrit avatar

Watchers

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