Get Started

First steps to understand Microhomie and get to know it.


If you just started with MicroPython, a good start is the Getting started with MicroPython on the ESP8266 tutorial from the MicroPython documentation.

Prepare MQTT

Checkout mosquitto MQTT Server ( if you want to host a server yourself or head over to IO Adafruit (, create an account and use their MQTT API (

Install Microhomie on the ESP8266

The first thing you need to do is to load the Microhomie firmware, a modified MicroPython firmware, onto your ESP8266 device.

You can download the Microhomie firmware from the GitHub release page and flash it like any MircoPython firmware to your ESP8266 device. I.E:

esptool --port PORT --baud 460800 write_flash --flash_size=detect --verify -fm dio 0x0 microhomie-esp8266-v2.2.0.bin

Continue with the configuration and the Quick start with a simple LED node sections.

Install Microhomie on the ESP32

Install MicroPython

For now, follow this tutorial ( to install MicroPython on the ESP. Please remember to use the latest version of the ESP software during the installation.

Get the latest firmware for ESP32 boards.


On some boards, the installation of MicroPython will fail with an “connection timeout” if you have any wires attached to the board. This depends on your board and you have to detach all wires except power for the basic installation to work. This is only relevant for the installation of MicroPython and not Microhomie.

Once the installation is successful and you are able to execute python code on the ESP32, you can install Microhomie.

Install Microhomie

For the ESP32 you can just copy Microhomie with all requirements to your device.

Clone the Microhomie repository:

git clone

and copy lib and homie from your host to the device. homie should be copied to the device lib directory:

├── homie
│   ├──
│   ├──
│   ├──
│   ├──
│   ├──
│   ├──
│   └──
├── primitives
│   ├──
│   ├──
│   ├──
│   ├──
│   └──

For example we have an mpfshell script esp32_install.mpf to automate the deployment:

mpfshell ttyUSB0 -s esp32_install.mpf

Continue with the configuration and the Quick start with a simple LED node sections.


To configure your Microhomie device create a file from the file, make your changes and copy the file to your ESP8266 device.

Reference: settings — Homie Settings

Quick start with a simple LED node

The LED example in this guide use the on-board LED, so you don’t need to do any wiring to get started.

Copy the file from the examples/led directory to your ESP8266, reset the device and watch the incoming MQTT messages.

If everything is setup correctly, the data will then be pushed to the MQTT server in the homie format. Take a look at the homie specification ( to get an idea of the possibilities.

homie/2fe65700/$homie 4.0.0
homie/2fe65700/$name LED test
homie/2fe65700/$state init
homie/2fe65700/$implementation esp8266
homie/2fe65700/$nodes led
homie/2fe65700/led/$name Onboard LED
homie/2fe65700/led/$type LED
homie/2fe65700/led/$properties power
homie/2fe65700/led/power/$name LED Power
homie/2fe65700/led/power/$datatype boolean
homie/2fe65700/led/power/$settable true
homie/2fe65700/$extensions org.homie.legacy-firmware:0.1.1:[4.x],org.homie.legacy-stats:0.1.1:[4.x]
homie/2fe65700/$mac 80:7d:3a:bb:c7:8a
homie/2fe65700/$fw/name Microhomie
homie/2fe65700/$fw/version 2.2.0
homie/2fe65700/$stats/interval 60
homie/2fe65700/led/power true
homie/2fe65700/$stats/uptime 0
homie/2fe65700/$stats/freeheap 15520
homie/2fe65700/$state ready

To turn the on-board LED from your ESP8266 on or off send true or false to the property topic. For example:

mosquitto_pub -h HOST -u USER -P PASSWORD --qos 1 -t "homie/DEVICE-ID/led/power/set" -m false