Esphomelib - A comprehensive solution for using ESPs with Home Assistant


You’re trying to compile for the ESP32 on an RPi, right? That’s currently unsupported (basically, the C++ compiler doesn’t work on the RPi CPU architecture). So you will unfortunately need to install esphomeyaml on another machine.


Did you ever solve this as I’m suffering the same but only with BIN’s created with V1.7.0, ones created with previous versions all OK, all wiring checked multiple times ans all model options tried


Hi there,

Awesome project and I really hope it’ll open the door for more people such as myself to building our own sensors and components!

So I got both a NodeMCU and MPU6050
How should I connect the wires for the configuration example to work ?

I would love to try this out but have no idea how to put the 2 together :frowning:


Hello! im on on a linux VM on a QNAP NAS
got the add-ons install and create my first ESP component, but I got this error when trying to compile

[Mon Jul 2 11:13:08 2018] Processing node_dht22 (platform: espressif8266; board: nodemcuv2; framework: arduino)

[API] ConnectionError: HTTPConnectionPool(host=‘’, port=80): Max retries exceeded with url: /v2/lib/search?query=name%3A%22ArduinoOTA%22 (Caused by NewConnectionError(’<urllib3.connection.HTTPConnection object at 0x7efecd5dd050>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution’,)) (incremented retry: max=5, total=1)

I found that address :"ArduinoOTA" return nothing
this one return what needed I guess :"ArduinoOTA"

is that an url formating error in the code ??? (the %3A seems to be the prob…)

I can ping the api from the HASSIO container… so… its not an network issue I think
I also try the trick to put the IP and name in the /etc/HOSTS file… didnt work



Really like the concept with this so though I would give it a try.

However i run into issues even using a DHT11 … error Invalid readings! Please check your wiring etc…

However since i repurposed this from sitting running happily for months reporting temp and humidity (written in C##) I could not quite understand why something so simple was not working right… Copied back over with my original code and its all happy and working again…

Can confirm the pin and wiring was correct and all components work as they should. So i will keep an eye on this project… but continue with coding in C


WOW WOW WOW Love it. Just saw this yesterday. Down loaded it and got it set up. I had an old wemos d1 for at least two years. Could never get it to work with ha and mqtt so gave up on it. Saw this yesterday got it set up and my living room temp sensor is setting here just purring along. Thanks so very much for such a great tool.

Tom C


awesome! what a truly amazing piece of work. thank you ottowinter. such a great tool!


This project is awesome – so impressive!

I’m trying to use it to strap a Wemos D1 Mini onto my ceiling fan remote, roughly using this guide. I’m a bit confused about how to approach it, though… Each remote button is triggered (momentarily) by a GPIO pin. Should I use GPIO switches or GPIO output? I can’t make sense of the different Fan components; do you have more sample code?



I am having the same problem. Latest install, and fresh Esphomelib install.
Did you find a solution yet?


I am having a problem when trying to measure temperatures.

I tried to use MAX6675 sensor with K-Type thermocouple and in room temperatures I get measures that are hundreds of celsius and changes (steps) seems to be always also about hundred or something.

I have tried with 2 different sensors and thermocouples.

Tried to scale the results but the there is limit in esphomelib. Also when I removed this limitation in code but there seems to happen (some kind of) overflow and because of this I failed to find out if I could scale the measures down (I am not good at coding…).

EDIT: This seems to be bug in current 1.7 version. There seems to be fix in next upcoming version.


@v0ltage120 @Erwin_Nieuwenhuis

I can’t tell if your problems are exactly the same as ours, but you might look over the following for two different methods of resolving DNS issues within docker:


So can esphomeyaml be installed on a raspberry Pi? If so, are people installing it on the same Raspberry Pi that Home Assistant is running on. I have Home Assistant installed in a virtual environment. Should esphomeyaml be installed in the same virtual environment or just run as Pi?

Really excited about this but want to move cautiously so as not to mess up my home assistant install.



It can be installed anywhere. I have successfully run it on my laptop, which doesn’t have any link to HA.


Can it run on windows or Linux only?


I am unsure. Try it and see.


Hi all,

Using esphomeyaml and a sonoff 4CH-R2 switch, I’ve integrated the electric panel of the garden to my HA and it’s working very well: Automation has come to the garden !!! :slight_smile:

Now I’m wondering if anyone can help me with some doubts related to monitorize and manage a power failure of the electric panel (input 220V AC) using HA. Which is the easier way to detect a 220V AC power failure and send notifications with HA? Is there any sensor compatible with esphomeyaml which I can use? (take into account that I don’t have any UPS there so NUT is not possible)

To do that, I’ve started connecting an old 220V AC detector relay I had to the output of the Differential Control Interruptor (a tipical DIN rail DPN protector switch). If the input 220V AC fails, this simple relay can close another isolated circuit (i.e. 5V DC circuit). My question is how to control this external relay? Is there any chance using the ESP8266 pin A0 (GPIO17) ? I guess using that approach I’ll need another DC power supply connected to GPIO17 and use the external relay to open/close the circuit. Is there other easier approach?

Thank in advance!



The guide to create a custom sensor is not working. Can anybody give me a hand to create a custom sensor to measure the power usage using EmonLib through ADC.
This is the error when I try to create a custom sensor

Compiling .pioenvs/watertank/src/main.cpp.o
src/main.cpp: In constructor 'CustomSensor::CustomSensor(uint32_t)':
src/main.cpp:8:90: error: no matching function for call to 'esphomelib::sensor::PollingSensorComponent::PollingSensorComponent(uint32_t&)'
CustomSensor(uint32_t update_interval) : sensor::PollingSensorComponent(update_interval) {}
src/main.cpp:8:90: note: candidates are:
In file included from .piolibdeps/esphomelib/src/esphomelib/controller.h:15:0,
from .piolibdeps/esphomelib/src/esphomelib/application.h:12,
from src/main.cpp:2:
.piolibdeps/esphomelib/src/esphomelib/sensor/sensor.h:205:12: note: esphomelib::sensor::PollingSensorComponent::PollingSensorComponent(const string&, uint32_t)
explicit PollingSensorComponent(const std::string &name, uint32_t update_interval);
.piolibdeps/esphomelib/src/esphomelib/sensor/sensor.h:205:12: note:   candidate expects 2 arguments, 1 provided
.piolibdeps/esphomelib/src/esphomelib/sensor/sensor.h:203:7: note: esphomelib::sensor::PollingSensorComponent::PollingSensorComponent(const esphomelib::sensor::PollingSensorComponent&)
class PollingSensorComponent : public PollingComponent, public Sensor {
.piolibdeps/esphomelib/src/esphomelib/sensor/sensor.h:203:7: note:   no known conversion for argument 1 from 'uint32_t {aka unsigned int}' to 'const esphomelib::sensor::PollingSensorComponent&'
.piolibdeps/esphomelib/src/esphomelib/sensor/sensor.h:203:7: note: esphomelib::sensor::PollingSensorComponent::PollingSensorComponent(esphomelib::sensor::PollingSensorComponent&&)
.piolibdeps/esphomelib/src/esphomelib/sensor/sensor.h:203:7: note:   no known conversion for argument 1 from 'uint32_t {aka unsigned int}' to 'esphomelib::sensor::PollingSensorComponent&&'
src/main.cpp: In function 'void setup()':
src/main.cpp:49:7: error: 'class esphomelib::Application' has no member named 'make_mqtt_sensor_for'
App.make_mqtt_sensor_for(custom_sensor, "Custom Sensor Example");```


Nice work on this project!

I have some Sonoff Basics with esphomelib, they are automaticly added to Home Assistant as switch.
How can I change the esphomeyaml so that they are added as light.

  - platform: gpio
    name: "Kleine lamp"
    pin: GPIO12


What can I do if image size to flash my esp32 is too large ? O wanna run a ble tracker hub but it fails with too big xxxx.elf file


Hi @pinkpi I had similar issues with a DHT22 but that was resolved by specifying the module type in esphomeyaml. Did you try that?