Home

Awesome

Open Home Automation

THIS REPOSITORY IS NOT MAINTAINED ANYMORE, SEE ESPHome AS AN ALTERNATIVE.

Introduction

Nowadays everything becomes connected to the Internet and gives us a glimpse of many new possibilities. Home automation is part of it and offers many advantages for their users. This repository is dedicated to Home Assistant, an open source project with an amazing community, ESP8266 and ESP32 modules, the MQTT protocol and much more [...].

Home Assistant

Home Assistant is a home automation platform running on Python 3. The goal of Home Assistant is to be able to track and control all devices at home and offer a platform for automating control [Home-Assistant].

MQTT

MQTT is a machine-to-machine (M2M)/"Internet of Things" connectivity protocol. It was designed as an extremely lightweight publish/subscribe messaging transport. It is useful for connections with remote locations where a small code footprint is required and/or network bandwidth is at a premium [mqtt.org].

Home-Assistant

Content

Requirements

Most of the examples below are using the MQTT protocol and so require to integrate MQTT into Home Assistant by defining a MQTT broker. More information can be found at the MQTT component's page.

Stock Home Assistant

configuration.yaml :

mqtt:
  broker: 127.0.0.1
  port: 1883                      
  username: '[Redacted]'
  password: '[Redacted]'
  discovery: true                 # optional
  discovery_prefix: homeassistant # optional

Hass.io

configuration.yaml :

mqtt:
  broker: core-mosquitto
  username: '[Redacted]'
  password: '[Redacted]'
  discovery: true                 # optional
  discovery_prefix: homeassistant # optional

More options to connect the broker are available and described here.

Sketches for ESP8266/ESP32 modules

Lights, sensors, switches and more can be built on top of MQTT. This section contains a few examples based on MQTT and on a NodeMCU board (ESP8266/ESP32).

Title / linkDescription
LightA simple example to control a led
LightA simple example to control a led and its brightness
LightA simple example to control a RGB led
LightA simple example to control a RGB led (with OTA and mDNS)
LightAn alternative firmware for the Arilux AL-LC0X LED controller
LightAn alternative firmware for the Arilux AL-LC0X LED controller with multiple effects from the WS2812FX
LightA simple example to control a RGBW led, based on the MQTT JSON Light component (brightness, rgb, white, color temperature and effects) and including the MQTT Discovery
LightAn alternative firmware for AI-Thinker RGBW bulbs, based on the MQTT JSON Light component and including the MQTT Discovery functionality
SwitchA simple example to control a switch
SwitchAn alternative firmware for the Sonoff Basic switches
SwitchAn alternative firmware for the Sonoff TH switches, including the MQTT Discovery functionality
SensorA simple example to measure the temperature and the humidity (DHT22 sensor)
SensorA simple example to measure the brightness (photocell)
Binary SensorA simple example to detect motions (PIR motion sensor)
Binary SensorA simple example to monitor the state of a window/door
Binary SensorA full example describing how to monitor your environment with different sensors (SHT3X, DHT22, TEMT6000, etc.)
Binary SensorAn example describing how to trigger an action when a specific BLE device is detected (ESP32)
Binary SensorAn example describing how to trigger an action when a specific NFC tag is detected

Configuration examples for Home Assistant

This section contains a few configuration examples dedicated to Home Assistant.

Title / linkDescription
Alarm ClockAn example describing how to create an alarm clock with the components provided by HA
openhomeA school project based on Home Assistant and using only open source HW and SW
Zigate & ZigBee devicesAn example describing how to add and control ZigBee devices paired to a Zigate

OpenHome with Home Assistant and MQTT

Miscelleneous

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

If you like the content of this repo, please add a star! Thank you!