Git Product home page Git Product logo

hcontrol2's Introduction

hControl2

hControl2 : control your home from the distant.

###About This Project

Home automation has always been my dream. With today's technologies, it can be done relatively easy.
This project allow me to control my home from a distant.

Now, I'm using this project to control spotlight from my smartphone.
You may wonder why I need to use it for such purpose. The answer is simple. It's FUN!

###Architecture

#####Server The server runs web server written in python with Flask framework.
House states is kept inside hstates module where values can be changed from the API.
Server provides API for both arduino and web interface to access/modify house states.

#####Files related to server side

  • hcontrol2.py : main script
  • hauth.py : provide basic authentication
  • hstates.py : add, remove, get, set the states of objects in house
  • hutils.py : collection of utility functions

#####Client Client is the web interface written with HTML, CSS, jQuery2, and Bootstrap. Client connects to the server via the API to set / get information from the server.

#####Files related to client side

  • template/index.html : web interface
  • static/style.css : stylesheet

#####Arduino Connect to the server via Ethernet shield.
It use API to only read house state from the server.

#####Files related to arduino

  • hcontrol2duino.ino : Arduino sketch

Configurations

Authentication

Open file hauth.py and change PUB_KEY and AUTH_TOKEN
PUB_KEY is the passphrase required when accessing the web interface.
AUTH_TOKEN is the token returned from server if the PUB_KEY is correct.

Turn off debug mode

Open file hcontrol2.py, scroll down and change
app.run(debug=True) to app.run(host='0.0.0.0')

Add more objects

Now, hstates.py implement 2 class of objects which are OUTDOOR and INDOOR.
You may add more object by using function

  • hstates.add(object, group) : add new object to the group

You may look at hcontrol2.py as an example.

##Remarks I would save this is an incomplete work.
I haven't tested it thoroughly, so there are bugs hidden somewhere for sure.

Happy Coding ._.

hcontrol2's People

Contributors

hibikiledo 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.