Skip to content

ashokbabuy/home.pi

 
 

Repository files navigation

Home.Pi

Build Status

  • Simple Home Automation Solution with MQTT

Demo Application

Features

  • Home Automation with MQTT
  • Completely independent from the used technology (most bindings are actually written in node.js)
  • Cloud-based architecture (only the bindings to control the devices are running locally)

System Architecture

System Architecture

Installation

  • Install a MQTT Broker with Websocket Support, e.g.

  • Clone the repository and install the dependencies

    git clone https://github.com/denschu/homepi npm install

  • Create a Firebase Account

  • Place you device configuration in a configuration file e.g. "firebase-config.json" and upload it to your firebase account. See also the example "firebase-config-example.json" for further details.

Example configuration:

{
    "type" : "on_off",
    "value" : false,
    "name" : "Ceiling Light",
    "topic" : "/home/devices/livingroom/ceiling_light/value",
    "id" : "ceiling_light"
}
  • Run with local HTTP Server

Open app/js/config.js and modify the Firebase URL. You can use https://homepi.firebaseio.com for testing

cd www
python -m SimpleHTTPServer 8080
mosca --http-port 8000 --http-bundle --verbose | bunyan
  • Run with Docker

    docker run -p 1883:1883 -p 8000:8000 -v /var/db/mosca:/db matteocollina/mosca docker run -d -p 80:80 denschu/homepi

Build and Run it as native app

sudo npm install -g cordova ionic
ionic platform add ios
ionic build ios
ionic emulate ios

MQTT topic conventions

Subscribe to a topic for getting the value of a device

/home/devices/<room>/<device-name>/state
/home/devices/living_room/light1/state

Publish to a topic for setting the value of a device

/home/devices/<room>/<device-name>/state/set <value>
/home/devices/living_room/light1/state/set true

Available MQTT Bindings (separate git-Repositories)

Take a look at my puppet manifests to setup the Raspberry Pi very easily with puppet. You also get some help for the manual setup.

At the moment the following "experimental" MQTT bindings are available:

Technologies/Frameworks

  • node.js
  • MQTT
  • Ionic Framework (with AngularJS)

For further informations and setup instructions please refer to my blog posts.

About

Home Automation with AngularJS and MQTT on a Raspberry Pi

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors