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 192.168.1.1 and house2 is 192.168.1.254 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?
Thanks

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

  manual_ip:
    static_ip: !secret static_ip_esp8266_test
    gateway: !secret static_gateway
    subnet: 255.255.255.0
    dns1: 8.8.8.8

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