ESPHome Gateway

I have an esp8266 sensor that I’ve developed on my home ISP for use in a different house/ISP. I have it setup with 2 ssid/password combinations as explained in the documentation. I also use static ip addressing.

Before sending it off to the second house I was thinking I would need to change the gateway but now I’m not sure exactly what that’s doing for me. House 1 routers’s ip is and house2 is I entered house2’s gateway and recompiled the sensor and it still connected to house1. I was thinking it shouldn’t have but evidently my thinking is wrong.

Can someone please explain what the gateway in the static ip configuration does for me?

  - ssid: !secret wifi_ssid_house1
    password: !secret wifi_password_house1
  - ssid: !secret wifi_ssid_house2
    password: !secret wifi_password_house2

    static_ip: !secret static_ip_esp8266_test
    gateway: !secret static_gateway

The gateway is the ip address of the device (typically your router) that acts as the connection point to another network - either your lan or the internet

I think the reason that it’s connecting to house1 is because the SSID’s are tried in order. If it can connect to SSID for house1 it doesn’t try to connect to house2.

Try turning off the house1 router and see if it then connects to the house2 router.

Since typically you ESPHome device won’t need to connect to the internet or a secondary network I don’t think the gateway address is doing much for you. especially since it is going to be connecting to house1 by default.

Thank you for the sanity check. What you said is what I was thinking or is it overthinking? Anyway I’ve sent it off to house2 and will see in a couple days if it connects there.

1 Like