Lots here to unpick. Will try to be clear.
I used the Tesla gateway browser interface (using the Tesla wifi interface Ip address) to set up the wired connection - static IP 192.168.1.39 and correct network gateway address and subnet. Router is set to reserve 1-99 so not assign DCHP addresses in that range. Connection works fine - can talk to the Tesla gateway from a browser. (just type in ip address and log on - can see energy flows and some system info)
The Tesla app on ios lets you select which wifi network the Tesla gateway connects to. Normally I connect to my home network - the same one HA is on. HA talks to Tesla Gateway on 192.168.1.38 - tesla browser interface gives no control over setting up the wifi address - installer? don’t know but I can’t change it.
Using the Tesla phone app I connected the gateway to a nearby wifi hotspot - open connection but no way for Gateway to use the wifi connection as it can’t log on to the hotspot even though it can connect.
192.168.1.38 no longer works to talk to the Gateway from my home network (no surprise!) - can easily test using a web browser - and HA shows unavailable.
192.168.1.39 still works fine as the wired connection is still on my network.
When I reselect my home network on the tesla phone app, the Tesla Gateway reconnects and .1.38 responds again from the browser and the data appears in HA.
So question remains - how to get Tesla integration to use the wired IP address not the original wireless address.
[Ethernet cable - you can easily find download the installation instructions for the gateway/battery. The standard RJ45 ethernet socket is behind the plastic cover held in place by one screw in the gateway. If you are not confident to install the cable don’t do it]