Esphomelib - A comprehensive solution for using ESPs with Home Assistant


So when you’re still in the initial flashing stage, you only need to have an USB connection to the device. Pinging the ESP won’t help because it’s probably not even connected to WiFi. Are you still in the “first flashing” stage? Then it’s probably due to the FTDI adapter not being recognized, and I don’t know too much how to help with that.

@e_jp Somehow your computer still has esphomeyaml 1.6.2 installed somewhere. I would suggest just trying to remove esphomeyaml (with pip2 uninstall esphomeyaml and sudo pip2 uninstall esphomeyaml) until esphomeyaml ... run returns a command not found. Then you can try re-installing esphomeyaml again and I hope it should work.

@pcl I’m not sure what error you’re referring to :frowning: But here are a few steps that should help with all kinds of upload problems:

  1. Make sure the initial flashing works - So check that the first “upload” happens via USB.
  2. Look at the serial monitor logs (“logs” with the USB device selected in the header bar in the dashboard). Do any errors appear there? The esphomelib logs are a great place to debug these issues
  3. When the first upload worked and you’re now trying an OTA update, try flashing with a static IP in the wifi: section (if the static IP points to a new host, you’ll have to reflash with USB again; unless you’re using the command line version, then you can use --upload-port)
  4. Look at the logs again, does anything show up there?


@OttoWinter : Thanx for the prompt reply. Did a full fresh install, hassio and all and guess what : IT WORKS!

Thanx for al the effort you put into this, I’m gonna have a ball playing with this.


A warning to people starting out with nodemcu / esp8266 chips.

The chips use 3.3V, however a lot of the cheap sensors use 5.0V

For ease of use / sanity, make sure u buy 3.3V compatible sensors!!!

… otherwise you need to add a lot of extra electronics and soldering to convert the 5V signal to 3.3V.

I have so many 5V sensors etc that I don’t wont to use because of this problem.


I thought they had 5v and 3.3v? Mine do


mine all take 5V in, but the gpio only operate at 3.3V



I did the following steps:

[email protected]:~ $ sudo pip2 uninstall esphomeyaml
Uninstalling esphomeyaml-1.7.0:
Proceed (y/n)? y
  Successfully uninstalled esphomeyaml-1.7.0
[email protected]:~ $ pip2 uninstall esphomeyaml
Traceback (most recent call last):
  File "/usr/bin/pip2", line 9, in <module>
    from pip import main
ImportError: cannot import name main
[email protected]:~ $ esphomeyaml
-bash: /usr/local/bin/esphomeyaml: No such file or directory
[email protected]:~ $ sudo pip2 install esphomeyaml
Collecting esphomeyaml
Installing collected packages: esphomeyaml
Successfully installed esphomeyaml-1.7.0
[email protected]:~ $ esphomeyaml config/ dashboard

but still, dashboard is showing “esphomeyaml 1.6.2 Documentation” in the bottom right and same validation errors.

EDIT: problem solved by removing manually files in those locations:
[email protected]:~ $ sudo find / -name esphomeyaml


Your’s probably provides 5v out on VCC or Vin, but the logic on the pins D0-D# and A0-A# are going to be 3.3v and using a sensor that outputs at 5v will probably damage you esp


Take this with a grain of salt, but as long as the GPIOs are defined as inputs internally, you can most often hook up higher voltages such as 5v and even smaller negative voltages. The problem really only is when you have them defined as outputs. For example, if you have a 5V line connected to a GPIO pin, it will work quite happily as long as you’re just measuring if the signal is high or low. But if you put the pin into output mode and still have a 5v rail on the other end, the internals will have to sink all that current, which can lead to the chip being damaged.

Of course most sensors use the same pin as output and input for their protocol (such as i2c), so 5v will damage the chip. But if you know what you’re doing, you can often get away with just connecting it directly (or even with a simple in-series resistor).


Is this why I’ve found a few site recommending the use of a comparator in situations where abnormal voltage (>3.3V) is used?


Some of my nodemcu have 5V on the vc in pin.

Do you think this will work ok?

I tried running off 3.3v but it doesn’t work.


What is the “ultrasonic”.


ultrasonic distance sensor.


That 5V pin in your drawing is an input (Vin). You need to power the ultrasonic from eanother voltage source of +5V.


I think you can use VIN for voltage out if you use power via usb?

When I attach the multimeter to VIN + GND it reads 4.7V

Ahh it seems some nodemcu chips have 5V out on VIN.

One of my chips measures ~.9V on VIN and the other measures ~4.7V on VIN


thats correct, you can use it to grab 5v from the USB supply


Ahh I see, my mistake.

Here’s another example of the ultrasonic hookup:


I’ve removed a GPIO from my yaml of a device I’m working on and re-compiled to the ESP8266 but the binary sensor still shows up in hassio, even after a restart. Is there a method to cleanup sensors?


The usual recommendation I followed in this case was that the ultrasonic sensor’s trigger can be directly connected to an output pin on the ESP (i.e. trigger on 3.3V normally works), but the receiver should be connected through a voltage divider to the ESP’s input pin.


like this?


Yes, correct. “5V” end goes to the receiver pin on the ultrasonic sensor, “3.3V” goes to the ESP input.