Adding sonoff with ESPHome to HA

Hi, I have plugged in Sonoff device with ESPHome on it. Home Assistant has discovered device and suggested to add it to HA. So i did. I can now see my Sonoff device among devices and can control it. Next step, I went to ESPHome menu on the left side. Device is not there. I clicked + sign and entered name, ssid, password for new node. But how do I connect that node to the device? Wizard did not ask for IP or MAC. I would like to see my device here and be able to update config file, upload it to sonoff. Not sure where connection between node and device is set?

I get the impression you didn’t create the ESPhome config file from within the ESPhome add-on in HA.

Put a copy of the ESPhome config file for that device (the whatever_device.yaml) into the esphome directory on your HA server. ie: config\esphome\whatever_device.yaml

Esphome module in HA by default connects to “name-of-yaml-file.local”. So, if you named your yaml file, say, garage.yaml it will try to connect to garage.local (observe log when it tries to upload). To connect/uplad into existing ip module use command:” use_address: 192.168.x.x

I find Yaml file config\esphome\esp1.yaml

esphome:
  name: esp1
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: "********"
  password: "**********"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp1 Fallback Hotspot"
    password: "CtBw0UqbNX5X"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

Should I change code like this?

esphome:
  name: esp1
  platform: ESP8266
  board: esp01_1m
  use_address: 192.168.1.230

I think that “use_address” goes under wifi section.
Wifi config

Ideally you should allocate a fixed IP address to your devices.

eg: (from the docs)

wifi:
  ssid: MyHomeNetwork
  password: VerySafePassword

  # Optional manual IP
  manual_ip:
    static_ip: 10.0.0.42
    gateway: 10.0.0.1
    subnet: 255.255.255.0

Will do. Do I need to use use_

 use_address: 192.168.1.230

in combination to static_ip ? I can not understand what links Device within HA and the Node within ESPHome menu on the left side of the screen

No, that is for when you want to change the IP address already in the node. In your case you don’t use that at all, just the static IP.

Here is an example of one of my nodes:

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
    static_ip: 192.168.0.68 
    gateway: 192.168.0.1
    subnet: 255.255.255.0

The IP address is what links the node to HA. The ESPhome add-on uses a request to the network to scan for the node. Depending on your network config this can sometimes not work to detect the node as ‘online’, thus showing ‘offline’ even though the node works. If this is the case you can try using the status_use_ping option in the add-on config.