ESPHome integrations failed

Hello,

I’m using Home Assistant Supervised on Rasbian. I try to install ESPHome integration to control an ESP32 device.
When I try to install ESPHome integration by enter the ip adress of my ESP32 device, i have the message :
Impossible de se connecter à ESP. Assurez-vous que votre fichier YAML contient une ligne 'api:'.

  • my ESP32 device is well connected to my network with ‘192.168.1.47’ ip adress
  • I add ‘api:’ in my configuration.yaml file.
  • 6053 port is well redirected on my router

Thanks to your help

can you post the yaml? Are you running the the esphome addon aswell? and if so does the device show up in there?

Here is my configuration.yaml file


# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
# Enable Home Assistant API
api:

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
evohome:
  username: ***
  password: ***

I’m using Home Assistant Supervised so, if I understood well, I haven’t addons but just integrations

Thanks

Not your configuration.yaml, the yaml file of the ESPHome device.

Developer Tools -> Info

Look for this:

installation_type Home Assistant Supervised

If your’s looks like that then you have addons (and integrations! To get the ESPHome addon, you need to add a repo. Click on the three dots at top right in Supervisor and add https://github.com/esphome/hassio. Now you can install the ESPHome addon.

I think maybe I have a problem with my home assistant installation : image

Is it normal ?

You must have api: in the configuration file for your ESPHome device, not in the main Home Assistant configuration.yaml. See the simple example below.

esphome:
  name: esp_device
  platform: ESP8266
  board: huzzah

api:

# Rest of the file...

Also, you shouldn’t need to do any port forwarding on your router for ESPHome discovery to work.

It says it is not docker, hassio, or venv. How did you install it? Is that a RPi 3?

thank you for you help and sorry for my questions…

I add in /home/pi/.homeassistant folder a ESP32.yaml file including :

esphome:
  name: ESP32
  platform: ESP32
  board: nodemcu-32s

api:

# Example configuration entry
wifi:
  ssid: xxx
  password: xxx

  # Optional manual IP
  manual_ip:
    static_ip: 192.168.1.47
    gateway: 192.168.1.254
    subnet: 255.255.255.0

I tried add ESPHome integration by enter host : “ESP32” or “ESP32.local”.
I have message :

I still have the same message by entre host : "192.168.1.47

Add:

ota:
  password: 'esp32'

to the .yaml and install that. It does not matter what password you use but I think you need to enable ota: Copy that .yaml configuration into ESPHome and it may work!

Double check the IP address for the ESP32. You should be able to ping the address. You can install “zenmap” https://nmap.org/download.html or use nmap from the command line. This will do a ping sweep of your network:

# nmap -sn 192.168.1.0/24

I’m not sure what the MAC addresses look like for ESP32 but Google all the ones you do not recognise.

I added :

ota:
  password: 'esp32'

in my ESP32.yaml file but same issue.

Ping seems OK :

pi@raspberrypi:~ $ nmap -sn 192.168.1.47
Starting Nmap 7.70 ( https://nmap.org ) at 2020-06-09 18:15 CEST
Nmap scan report for 192.168.1.47
Host is up (0.15s latency).
Nmap done: 1 IP address (1 host up) scanned in 0.17 seconds

I’ll try tomorrow to install Hass.io on another SD card to see if ESPHome installation by add on interface solves the problem…
But I’d like
to keep Rasbian installed and I wish to not have all my zwave devices to remove et include again…

Remove the static ip (the whole manual ip section) and let your DHCP assing the ip address. Check from the router what ip the esp has and try that.

Does the device show as online in the ESPHome Configuration page? There should be a green dot and word online next to it like this one:

image.png

This is separate from the Home Assistant integration, so it should show online even if you haven’t completed adding the integration. If it does show online, add

logger:
  level: DEBUG

to your configuration. When the device reappears as online, start by clicking Show Logs. You should be able to see if it has connected to the API. It can sometime take awhile for the device to appear or to connect.

When you change from a static IP as mentioned above, you can also view the IP address in the log.

I solve my problem.
I just forgot to install ESPHome on my rasbian by

pip install esphome

before add the integration in home assistant

I thought i should control my ESP32 device either by Rasbian either by Home Assistant…

Thank you for your help

1 Like

Anhone get this working with the epshome docker container (not hassio)? I’m trying to get it all setup without having a device yet, but it gives me this api error and there is no esphome root config file created. (it does create .esphome/platformio though…)

Thanks!