Can't add ESPhome integration

@WallyR

rob@rob-Z97:~$ ping 192.xxx.x.229
PING 192.xxx..229 (192.xxx.x.229) 56(84) bytes of data.
64 bytes from 192.xxx.0.229: icmp_seq=1 ttl=255 time=55.2 ms

rob@rob-Z97:~$ ping 192.xxx.0.229:6053
ping: 192.xxx.x.229:6053: Name or service not known


When I run

avahi-browse -alr

on my linux system it finds homeassista,local: port No ok, but doesn’t find the esp32 board

I don’t seem to recall any of these problems that I am having now when I originally setup the sp32 board with HA etc about 18 months ago. It only stopped working because I bought a new router.

You can not ping a port. :slight_smile:
And IP addresses with 192.168.x.x is local only addresses, so no danger in showing them. :wink:
You should be able to ping the name value listed under the esphome section in the YAML configuration by adding .local to the end.

I think you should try to disconnect the sensors you have physical connected to the ESP device and maybe also remove the i2c: section and the sensor: section.
This will make sure that the device can actually run in a bare setup.

Ok, just so I have got it right:
In my yaml file,
name : home, so you say to add .local , thereby making it name: home.local
Is that correct

The easiest way to fix it would be to give your device a static IP address here:

@tom_l
Yes I tend to agree, but could please tell me what the exact format is to do that, as I don’t remember from the last time I did it

Update:
I added a static ip
manual_ip:
static_ip: 192.xxx.x.229
gateway: 192.168.x.1
subnet: 255.255.255.0

but got errors in the log file saying Components not found

There’s an example in the docs:

I copied the example, changed the details and I’m getting errors when I validate the file

INFO Reading configuration /config/esphome/home.yaml...
Failed config

manual_ip: [source /config/esphome/home.yaml:8]
  
  Component not found: manual_ip.
  static_ip: 192.xxx.x.229
  gateway: 192.xxx.x.1
  subnet: 255.255.255.0

The error tells you that you are missing a colon (:) after manual_ip

Look at your code then look at the example again.

I think it has to do with the indent,
for yaml, and also python, indent is imprtante.

so you have something like this

wifi:
  id: wifiId
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  power_save_mode: HIGH
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "${device_name} Fallback Hotspot"
    password: !secret wifi_password
  # Optional manual IP
manual_ip:
  static_ip: 192.168.0.123
  gateway: 192.168.0.1
  subnet: 255.255.255.0

but manual ip should be part of wifi
so add a tab to manual_ip and everyting below it.

wifi:
  id: wifiId
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  power_save_mode: HIGH
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "${device_name} Fallback Hotspot"
    password: !secret wifi_password
  # Optional manual IP
  manual_ip:
    static_ip: 192.168.0.123
    gateway: 192.168.0.1
    subnet: 255.255.255.0

Weird, I do have a colon after IP, but the validation process says full stop???

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

# Optional manual IP
manual_ip:
  static_ip: 192.xxx.x.229
  gateway: 192.xxx.0.1
  subnet: 255.255.255.0


Compare:

Example

wifi:
  ssid: MyHomeNetwork
  password: VerySafePassword
  manual_ip:
    static_ip: 192.168.0.123
    gateway: 192.168.0.1
    subnet: 255.255.255.0

Yours

manual_ip:
  static_ip: 192.xxx.x.229
  gateway: 192.xxx.0.1
  subnet: 255.255.255.0

Also there is no point obscuring local ip addresses. They are not routable over the internet so no one can use that info against you.

@bkbartk
thanks that worked great, and validates fine now, but still a problem. For the static Ip I am using the one for wifi

INFO Reading configuration /config/esphome/home.yaml...
INFO Starting log output from 192.168.0.229 using esphome API
WARNING Can't connect to ESPHome API for 192.168.0.229: Error connecting to ('192.168.0.229', 6053): [Errno 111] Connect call failed ('192.168.0.229', 6053)
INFO Trying to reconnect to 192.168.0.229 in the background



How are you flashing the ESP32?

Do you still have GPIO0 connected to ground?

I am selecting the file, then click on the 3 dots, bottom right,
Download YAML
Install
Plug into this computer
Open ESPHome Web
Connect
Choose File.

Its a performance, and I’m sure it was this long winded 18 months or so ago!

Yes I do have the GPIO pins grounded

The auto discovery in ha (to find esphome nodes) works via mDNS. (that’s the reserved .local)

You can still add your (not audiscovered) hosts manually by using the hostname or IP address.

So if your (let’s name it esphome) node is not accessible via:

  • esphome.local

you can try the hostname (with your domain name, for example .home.arpa)

  • esphome.home.arpa

or go with the IP address in case you have it statically configured or a permanent lease from DHCP

  • 192.168.0.123

While in your case @Rob_Heselwood it looks like there is more than one problem. Best you can do now to get help is to get serial logs out of your device and show them to use. You can try to add the esphome node to HA when capturing logs to see if anything actually reaches it :bulb:

Choose the download file option instead. Then flash the .bin file to the esp using the ESPHome flash tool:

This has a serial debug window that may help.

@orange-assistant
Ok thanks, I appreciate what your telling me.
first what are the serial logs, just the logs when I click on it for the yaml file?

@tom_l
Thanks , I already have the ESPHome-flasher.
Now even though the file validates ok without error, the ESPHome -Flasher says:
Unexpected error: the firmware binary is invalid (magic byte=65, should be E9)

Did you select “legacy format” when creating the .bin file?

You should.