Giter VIP home page Giter VIP logo

homekit-enviroplus's Introduction

HomeKit Enviro+

An Apple HomeKit accessory for the Pimoroni Enviro+ running on a Raspberry Pi.

The accessory added to iOS

Dependencies

  • Go - this accessory is written in Go
  • HomeControl - to expose climate readings from the Enviro+ as an Apple HomeKit accessory
  • enviroplus-exporter - to read the sensors of the Enviro+ and export them for scraping by Prometheus

Installation

Install this on a Raspberry Pi, or test it on macOS.

Setup

  1. Install Go >= 1.14 (useful Gist for Raspberry Pi)
  2. Clone this project: git clone https://github.com/sighmon/homekit-enviroplus and then cd homekit-enviroplus
  3. Install the Go dependencies: go get
  4. Install and run the Prometheus enviroplus-exporter
  5. Optionally if you'd prefer a Docker container of the exporter, see: balena-enviro-plus

Build

  1. To build this accessory: go build homekit-enviroplus.go
  2. To cross-compile for Raspberry Pi on macOS: env GOOS=linux GOARCH=arm GOARM=7 go build homekit-enviroplus.go

Run

  1. Execute the executable: ./homekit-enviroplus
  2. Or run with the command: go run homekit-enviroplus.go

Start automatically at boot

  1. sudo cp homekit-enviro.service /lib/systemd/system/homekit-enviro.service
  2. sudo systemctl daemon-reload
  3. sudo systemctl enable homekit-enviro.service
  4. sudo systemctl start homekit-enviro.service

Optional flags

The flag defaults can be overridden by handing them in at runtime:

  • -host=http://0.0.0.0 The host of your Enviro+ sensor
  • -port=1006 The port of your Enviro+ sensor
  • -sleep=5s The time between updating the accessory with sensor readings (5s equals five seconds)
  • -dev This turns on development mode to return a random temperature reading without needing to have an Enviro+

e.g. to override the port run: go run homekit-enviroplus.go -port=8000 or ./homekit-enviroplus -port=8000

Reset this accessory

If you uninstall this accessory from your Apple Home, you'll also need to delete the stored data for it to be able to be re-added.

macOS

  1. Delete the data in the folder created: homekit-enviroplus/Enviro+/
  2. Restart the executable

Raspberry Pi

  1. Remove the persistent data: rm -rf /var/lib/homekit-enviroplus/data
  2. Restart the Raspberry Pi

Thanks

This project uses the amazing work of Matthias. Please consider donating if you found this useful.

homekit-enviroplus's People

Contributors

sighmon avatar

Watchers

 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.