Giter Club home page Giter Club logo

homecontrol's Introduction

Introduction

Go Go Report Card

Collection of different IoT services implemented in golang with the help of gRPC and Protobuf.

The first implemented service allows the control of Philips Hue lights if they are in the same network or if the Philips Hub API is accessible.

Sequence Diagrams under ./doc/DIAGRAMS.md

Getting Started

# If not yet done create Philips Hue credentials and follow the instructions printed to STDOU
$ go run setup/add-application.go

# Build server and client.
# Install server and client to ${GOPATH}/bin
make all

# Install server and client to ${GOPATH}/bin
make install

# Build and start docker image
make docker-build docker-run

# Clean generate protobuf and binaries
make clean

# Start local server with TLS
go run server/main.go -tls

# Blink lights that are part of group 2 via homecontrol service hosted
# locally.
go run client/main.go -host 127.0.0.1:50051 -tls -cmd blink -group 2

# Dockerized client example with service hosted under 192.168.1.2
docker run -it --rm networld/homecontrol /client -host 192.168.1.2:50051 -cmd blink

# Dockerized client example with service hosted under 192.168.1.2. TLS support
make tls
docker run -it --rm --name homecontrol -v ~/.homecontrol:/.homecontrol networld/homecontrol /client -host 192.168.1.2:50051 -tls -cmd blink
docker exec -it homecontrol /client -tls

Examples: Client

# Change the lights in group 3 to GREEN
$ ./client/client -group 3 -cmd on -brightness 1 -sat 1 -hue 25500

# Change the lights in group 3 to RED
$ ./client/client -group 3 -cmd on -brightness 1 -sat 1 -hue 65535

Features

  • TLS encrypted connections
  • Lights: Philips Hue support

Appendix A: Directory Structure

├─ api
│  ├─ generated                 # Generated Code from protobuf files
│  │  ├─ hue                        # Service 1 package
│  │  │  └─ hue.pb.go
│  │  └─ version                    # Service 2 package
│  │     └─ version.pb.go
│  └─ proto                     # All the protobuf service definitions
│     ├─ hue.proto
│     └─ version.proto
├─ client                       # Client implementation, using api/generated code
│  ├─ client
│  └─ main.go
├─ go.mod
├─ go.sum
├─ server                       # Server implementation, using api/generated code
│  ├─ hue.go
│  ├─ main.go
│  ├─ server
│  └─ version.go
└─ utils                        # Helper code used by client and server
    └─ version.go

homecontrol's People

Contributors

obale avatar dependabot[bot] avatar

Stargazers

John Manos avatar

Watchers

Osvaldo avatar James Cloos avatar  avatar Kostas Georgiou 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.