Using "ipconfig" on HA Core

Greetings,

I need to be able to access to Window’s command line “ipconfig” results, but inside Home Assistant Core. Is there any way I can actually see the results from HA?

Below there is an image as an example of the kind of content I want

Open a HA console session and enter ha nework info.

How are you running HA, exactly? On Windows?

I’m actually using a Raspberry Pi 4 with HA Core running on it. It is connected to a Windows system on my computer.

“Connected” is vague.
But the only way I see is to enable the SSH server on windows, and use a “command_line” sensor establishing a ssh connection to execute the command.

1 Like


From what I see here, I can’t find the IP adress I was looking for. If I was searching for the http://192.168.191.70:11434/ one (that has the port to the Ollama configuration) on the IPv4 (using Zerotier) it does not appear here.

That’s an interesting way to do it. Do you have any kind of guide? I can’t remember seeing something like this around here.

ip a would be the closest equivalent. Your HA system’s ip is at the bottom here

1 Like

I’m confused. Why would you expect some results from your Windows machine on the HA machine?

At the end, I want to use Ollama on my HA as conversational assistant inside my application. That means I must configure whatever the IP adress of Ollama is (which changse from system to system). I tried on one computer and its http://192.168.191.70:11434/, but on another one was http://192.168.0.112:11434/ for example. What I want, is that given it will always be the ZeroTier IPv4 adress, get my addon to read from the system and find it, and authomatically place it as the ollama_url

Doesn’t ZeroTier assign static addresses? (Tailscale does)

Still confused. You have multiple instances of Ollama?

1 Like

From what I have been trying, ZeroTier assigns a different address to the computers of a certain private community. Thus making it impossible to just hardcode a single adress into the code.

I got ollama running on a Raspberry. What I want is that every user that uses it, is going to have their own ollama version.

  1. you will have multiple ollama instances running on different machines.
  2. each of those machines will be connected to HA through Zerotier
  3. Zerotier assign static addresses per machine

If all those statements are true, I don’t understand why you would need to detect the IP address, as they will always be the same (per machine).

1 Like

Every machine will always have the same one. However, in the future the address that appears for me will be different than the one it would appear for you. Right now on my cod this is what I have:

self.model = X (does not matter here)

    self.ollama_base_url = "http://192.168.191.70:11434"
    
    self.api_url = f"{self.ollama_base_url}/api/chat" 
    self.headers = {"Content-Type": "application/json"}`

My objective here is to have some kind of function that the addon on HA will be able to read the ollama_base_url authomatically and assign it like in the code.
Right now it was hardcoded, and it does not work due to the adress changing computer from computer.

Not sure I get it. I (figurally) will never get access to your machines unless you share them to me.
Is the plan to share the ollama servers through Zerotier?

In that case, what you’re trying to do through ipconfig won’t work, as the address will always be the one on your network. Routing will be done on Zerotier side.

Or is Zerotier assigning multiple addresses? I’m mapping my Tailscale experience, here, I don’t actually use Zerotier.

1 Like

I would like to have each client of the addon their own ollama installed. I do not plan to share my ollama servers or my machine. Assume to make the addon work the user already must have ollama installed and it running on their computer.

What I gathered is that ZeroTier allows access to a private community that each user can create within my addon. Thus, making the IP address coming from the IPv4 from Zerotier is essential to make it work (because the ollama assistant will work with private data generated on the addon).

So is the goal to auto-detect the Zerotier address on a remote computer you will have to give the IP address to?

So that autodetection would happen inside your app/addon?

Very difficult to grasp without some architecture drawing…

1 Like

The idea is not to think about external computers. Imagine each person their own community using ZeroTier. Me nor anyone can have another’s person address.

The automathic detection of the IP address will be within the addon, where once you start running it find the IPv4 and configures it without having the user to touch anything.

User initiates the addon —> Ollama starts —> Addon gets the IPv4 address for Ollama (the one used by ZeroTier) —> this allows the user to use the assistant

I might have been thinking also about the idea that if Ollama is already within the Raspberry (where HA is), it might not be necessary to use ZeroTier. However, installing a LLM inside a Raspberry Pi 4 might not be even possible or at least effective enough to try.

In any case, your HA will never run on (pure) Windows, so your initial question about “ipconfig” doesn’t make sense, really.

To get the HA network config of HAOS from within an app, you probably can use the supervisor API

1 Like