Git Product home page Git Product logo

mako-smarthome's Introduction

Mako SmartHome

This project implements a SmartHome HTTP Server for managing a smart home based on the deCONZ REST API.

The HTTP Server and Lua libraries are based on the Mako Server, itself an extension of the Barracuda Application Server. Mako is incredibly light, hence the whole application can be run on the most basic Raspberry Pi or equivalent (my setup uses less than 2MB of memory for EVERYTHING).

From the deConz-rest-plugin page:

To communicate with Zigbee devices the RaspBee / RaspBee II Zigbee shield for Raspberry Pi, or a ConBee / ConBee II USB dongle is required.

Getting Started

  1. Download the Mako Server binary on the Raspberry Pi.
  2. Checkout the code in this repository.
  3. Create a mako.conf file containing API keys and your location (see example below).
  4. Run mako -c mako.conf -l::smarthome.
  5. Open http://<your-server>:<port>/smarthome/ on a browser.

This assumes you already have a Raspbee/ConBee device running and the smart devices connected via the Phoscon App.

Example mako.conf

homeio='/home/renato/mako'

sensorsServerUrl = "http://192.168.1.2" -- where deconz API is running
deconzKey='<generated when you start deconz>'
weatherApiKey='<get API key at https://openweathermap.org/>'
latitude=37.2514795 -- location used for weather only
longitude=-116.3766731

Make the server a Linux Service

The Raspberry Pi needs to run the server as a deamon, so that when you restart it, the server is started up automatically.

To do that, create a systemd service. For example:

## For this file to have any effect, it should be copied as follows:
##
## sudo cp mako.service /etc/systemd/system/mako.service
## sudo chmod 644 /etc/systemd/system/mako.service
##
## Then, start the service with 'sudo systemctl start mako'.
## To make it also start on boot, run 'sudo systemctl enable mako'.
##
## See https://www.linode.com/docs/guides/start-service-at-boot/
##

[Unit]
Description=Smarthome Mako Server
After=network-online.target

[Service]
ExecStart=/home/renato/mako/mako

[Install]
WantedBy=multi-user.target

Now, the server can be monitored as a service:

# check status
$ systemctl status mako

# restart
$ systemctl restart mako

# check the logs
$ journalctl -u mako.service -e -f

Blog Post

I wrote a blog post about coming up with my setup.

Check it out.

mako-smarthome's People

Contributors

renatoathaydes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mako-smarthome's Issues

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.