Awesome Open Source
Awesome Open Source

homie-esp8266 banner


Homie for ESP8266 / ESP32

Build Status Latest Release Gitter PlatformIO

An Arduino for ESP8266 / ESP32 implementation of Homie, an MQTT convention for the IoT.

This branch of Homie for ESP8266 implements Homie 3.0.1 and adds support for ESP32.


The Git repository contains the development version of Homie for ESP8266. Stable releases are available on the releases page.

Note that there is no release of the 3.x.y branch yet. Please use the git repository if you are interested in latest development.

Using with PlatformIO

PlatformIO is an open source ecosystem for IoT development with cross platform build system, library manager and full support for Espressif ESP8266 development. It works on the popular host OS: Mac OS X, Windows, Linux 32/64, Linux ARM (like Raspberry Pi, BeagleBone, CubieBoard).

  1. Install PlatformIO IDE
  2. Create new project using "PlatformIO Home > New Project"
  3. Open Project Configuration File platformio.ini

Stable version

  1. Add "Homie" to project using platformio.ini and lib_deps option:
platform = espressif8266
board = ...
framework = arduino
lib_deps = Homie

Add the PIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY build flag to ensure reliable OTA updates.

Development version

  1. Update dev/platform to staging version:

  2. Before editing platformio.ini as shown below, you must install "git" if you don't already have it. For Windows, just go to and the download will start automatically. Note, this is only a requirement for the development versions.

  3. Add development version of "Homie" to project using platformio.ini and lib_deps option:

platform = ...
board = ...
framework = arduino

; the latest development branch (convention V3.0.x) 
lib_deps =

Happy coding with PlatformIO!


#include <Homie.h>

const int PIN_RELAY = 5;

HomieNode lightNode("light", "Light", "switch");

bool lightOnHandler(const HomieRange& range, const String& value) {
  if (value != "true" && value != "false") return false;

  bool on = (value == "true");
  digitalWrite(PIN_RELAY, on ? HIGH : LOW);
  Homie.getLogger() << "Light is " << (on ? "on" : "off") << endl;

  return true;

void setup() {
  Serial << endl << endl;
  digitalWrite(PIN_RELAY, LOW);

  Homie_setFirmware("awesome-relay", "1.0.0");

  lightNode.advertise("on", "On", "boolean").settable(lightOnHandler);


void loop() {

Requirements, installation and usage

The project is documented on with a Getting started guide and every piece of information you will need.


I am a student and maintaining Homie for ESP8266 takes time. I am not in need and I will continue to maintain this project as much as I can even without donations. Consider this as a way to tip the project if you like it. 😉

Donate button

Alternative Project Comparisons
Related Awesome Lists
Top Programming Languages
Top Projects

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Html (242,126
Arduino (30,716
Internet Of Things (11,924
Esp (8,421
Mqtt (7,901
Esp8266 (4,928
Home Automation (2,219
Platformio (1,050
Espressif (470
Homie (44