Trying to configure multiple Static IP options on a device

Hi all,

I’ve put together a simple heat sensor with ESPhome but I need to set it up for two different networks (mine and my parents) setting the SSID and password is no problem but how do I get the multiple static IP to work?
if I go through the documentation I see it is possible
" manual_ip (Optional ): Manually configure the static IP of the node when using this network. Note that when using different static IP addresses on each network, it is required to set use_address , as ESPHome cannot infer to which network the node is connected." (taken from the documentation).

I’m having trouble understanding how to use it though…

I’ve tried

manual_ip:
    use_address:
      - static_ip: 192.168.1.49
        gateway: 192.168.1.1
        subnet: 255.255.255.0
        dns1: 192.168.1.1
        dns2: 192.168.1.1
      - static_ip: 192.168.0.49
        gateway: 192.168.0.1
        subnet: 255.255.255.0
        dns1: 192.168.0.1
        dns2: 192.168.0.1

and

    use_address:
      - static_ip: 192.168.1.49
        gateway: 192.168.1.1
        subnet: 255.255.255.0
        dns1: 192.168.1.1
        dns2: 192.168.1.1
      - static_ip: 192.168.0.49
        gateway: 192.168.0.1
        subnet: 255.255.255.0
        dns1: 192.168.0.1
        dns2: 192.168.0.1

with no joy, can anyone help me please?

Thank you in advance

Robin

I assume that this device will move from one home to the other?
You are misreading the use_address: component. This is a temporary connection when changing the IP of the device.

I never use static IP, let alone multiple static addresses, but the docs have an example.

1 Like

Ahh… yes you are correct, sorry I totally missed that.

ok back to the drawing board…

thank you for your help

Robin

You weren’t clear but do you want to move a device between locations?

I have a device that connects to my home network, to my daughter’s network when visiting, and to the Access Point in my car. Connecting to multiple devices makes this work. I would NEVER try to do this with static IPs. I have more than 100 IP clients on my home network and my daughter has a couple of dozen. Keeping track of this many static IP addresses would be a disaster waiting to happen.

Ah, Sorry yes this will be moving between networks and houses. I’ve got the multiple networks thing sorted and just leaving the IP the router give is is working good enough so its all good.

thank you though :slight_smile: