Cannot discover ESPHome device on second network

I have a RPi set up with both Ethernet and Wifi

Ethernet: 192.168.0.x
Wifi: 192.168.1.x

Wifi is connected to the internet and ethernet has a Wifi access port
I can ping every device on both networks from the HA shell.
However, devices on the Ethernet side network do not show up in the “Discovered” list .

When I manually enter the host name of the device, I get: Device already configured. But it doesn’t appear in the discovered list nor do its entities appear in the entities list.

Am I making a fundamental mistake with dual networking?

I think the solution is to ensure mdns is forwarded between the two networks.

Agreed with Tom. I believe even though the OS sees both network interfaces, HA only uses the primary one (which I’m guessing based on your description is the ethernet port on the Pi). Also, I don’t really understand your description of your network. What does “ethernet has a WiFi access port” mean? Maybe a quick diagram would help.

Thank you for the response.

I’m not sure how the HA determines which adapter is the “Main” one.

There RPi connects to two networks.

192.168.1.x (RPi internal Wifi Connection)… This is wifi network has an internet gateway.

192.168.0.x (Ethernet Port) The wired network has a wifi access point (a standard router) to which all the ESPHome sensors will connect. This is internal only and has no internet egress.

Any sensors connected to the wifi 1.x network show up as “devices discovered”

But sensors on the 0.x network do not appear on the “devices discovered” list even if I enter their address and port number directly.

I am able to OTA installations of YAML files without problem and can stream their log files. But alas cannot add them to the devices list nor add their entities to any dashboard.

I hope this makes things clearer.

Is there a way to change mdns?

Yeah don’t do that. Home Assistant is not a router or a DHCP server. Yes there is a DHCP add-on but you would be better off with something designed to do it properly.

Get a router. Connect HA to it (wired Ethernet). Connect your Wi-Fi access point(s) to it (wired Ethernet). Connect your Internet gateway to it. Connect a network switch to it if you need more wired Ethernet ports.

Set up VLANs in the router and switch if you want that sort of segregation.

“Yeah don’t do that”

Do what? Are you replying to me or the person who said change the mdns settings?

not entirely sure what you’re recommending.

– edit: I see you are the one mentioning mdns…

I am not using HAOS as a DHCP server, not sure why I would need to, TBH since both connections are to DHCP controlled networks.

The problem is that the network policy does not allow direct connection of IOT devices to the network without a proxy to control them (HAOS RPi in this case).

The network policy does not allow wired devices to connect so have to use Wifi.

The RPi’s internal wifi is powerful enough to create a solid connection to the corporate access point…

I have a DHCP enabled router sat in a central location wired via Ethernet to the RPi (192.168.0.x) that accepts wifi connections from ESPHome devices.

I have programmed the yaml files onto those devices OTA via the router, no problem there. I have used the log files to determine that all 12 devices are functioning perfectly and updating the sensors ever 10 seconds as required.

All of the programmed devices show up in ESPHome Builder page and I am even able to issue ESPHome firmware updates whenever they are released, without issues.

None of the devices show on the discovered devices section of “devices and services” so I am unable to add those devices to any dashboards.

You are trying to use home assistant as a router between two networks. Don’t do that.

As Tom said.

You have a “dual homed” rpi in that config. Home Assistant has no support for “dual homed” servers.

It will use the one WITH a gateway as the default network, so most integrations/device types will never find the device(s) on your 192.168.0.x network.

The better way to do it is have a router than can selectively repeat traffic (like mDNS) between the networks in a controlled manner. You could try doing that on your RPi by installing AVAHI, but that just makes your install even MORE unsupported…

OK, now I have an answer that states the problem, thank you. (automatiaclly assuming devices are on side of network with Gateway)

Can’t I just change the default network to the Ethernet side?

That’s all I want to do.

I’m only using the wifi side to send emails to customers and to access the UI.
I don’t need anything to be detected on that side or ever have anything connected at all on that side.

–edit: The 192.168.1.x side belongs to the customer and has a strict policy so in the production environment I will have absolutely zero devices connected on that side of the network and all discovery services will be blocked by the network filters in any case).

As an aside, why does HA assume I have my devices on the internet facing side of a network setup (the one wih the gateway) and can I make it detect devices on another network instead?

You will still have HA in a router setup and it has no tools to be configured for that, so it will be hit and miss if the network comes up right after a restart.
If you are only using ESPHome, then the ESPHome addon can use pings instead of mDNS to check if devices are online. It is a setting in the addon, but probably listed as an unused feature on the page.

Yes I’m only using esphome

It is frustrating that I can do everything except discover the device.
I can install, OTA update, read the live stream logs but just can’t add any of the entities to my dashboards…

let be have a look for that ping stuff… I doubt it will help because all my devices show up in ESPHome panel already, just not in the discovered panel.

You should be able to add the device by IP, but that will require a fixed IP on th device, of course.

2 Likes

The device is already showing in the Esphome panel and it is fully configured and working perfectly.

But it is not showing in the discovery panel. It has a fixed ip allocated by the router based on MAC address.

If I try to add integration it tells me the device is already discovered.

How do I discover a device by ip address?

Check your firewall log. Maybe you have to enable access to port 6053 or similar.

Your post lead me to the solution.

By adding “fixing ip” to my search I came up with a 3 year old thread with someone with the identical issue to me.

Your comment was the closest:

In the YAML file, there is an option, under wifi: separate from the the usual manual_ip: section called

use_address:

If I add the ip address under that heading, it can be connected to using “ADD INTEGRATION” and even though it won’t appear in the regular “discovered” devices list, it does appear under the devices list of the ESPHome.

Here is the thread from 2022 that lead to the solution.