Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/networld-to/homecontrol
Internet of Things (IoT) home control unit. Philips Hue light control GRPC service.
https://github.com/networld-to/homecontrol
go golang grpc iot philips-hue protobuf
Last synced: about 2 months ago
JSON representation
Internet of Things (IoT) home control unit. Philips Hue light control GRPC service.
- Host: GitHub
- URL: https://github.com/networld-to/homecontrol
- Owner: networld-to
- License: mit
- Created: 2017-08-19T01:27:08.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-04-19T12:43:54.000Z (9 months ago)
- Last Synced: 2024-06-20T08:14:03.979Z (7 months ago)
- Topics: go, golang, grpc, iot, philips-hue, protobuf
- Language: Go
- Homepage:
- Size: 149 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Introduction
[![Go](https://github.com/networld-to/homecontrol/workflows/Go/badge.svg)](https://github.com/networld-to/homecontrol/actions?query=workflow%3AGo)
[![Go Report Card](https://goreportcard.com/badge/github.com/networld-to/homecontrol)](https://goreportcard.com/report/github.com/networld-to/homecontrol)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](./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