Can I Run Hassio without using a Router

I just want to know if I am wasting my time. I want to use Home Assitant for monitoring on an internal network. I was hoping tha tI could just connect the Pi and Sensors to a switch as opposed to a router. But for the life of me I can’t figure out how to do it.

Obviously, it works fine via a router with DHCP or a manual address but when I try the same via a switch I cannot connect to the http://homeassistant.local:8123.

I have set the ipv4 ip address to a manula address, DNS and gateway. IS there anythign else I am missing or is what I am trying to do just no possible with hassio?

Rather than trying to connect to:

http://homeassistant.local:8123

can you connect to:

http://192.168.1.x:8123

or whatever IP address you set?

Can you Ping the IP address you set?

Yes, I can ‘Lanscan’ and ping the port, so it’s there, setup and working. If I use the current IP address (192.168.0.172) with port 8123, it’s the same issue.

It immediatly works when i connect the switch (which the Pi and laptop are connect to) to a router. As soon as I disconnect the switch from the router, I can’t access HomeAssistant.

I tried setting the ipv4.DNS on the Pi to 1.1.1.1and 8.8.8.8. The gateway is currently set to 192.168.0.1

I’m at a loss here.

Are you able to connect a laptop to your HA machine with just a network cable? You’ll need to give the laptop a fixed IP. May be this will not allow connection either but, alternatively, it may show an issue with the switch. Is it a managed switch or a dumb one?

You can’t use gateways and DNS without a router. That’s what a router does, inspects the OSI layer three information (IP address) and routes the data packets between networks. A switch works on layer 2 (mac address) it has no method for dealing with packets outside the network it is on and no method for resolving domain names.

A cheap all in one modem-router-wifi box will do for small HA installations. You don’t have to connect it to the internet - after Home Assistant is set up (internet is required for that). You will however find that the lack of an NTP (network time) server may cause you issues eventually, particularly with time and sun triggers. Also you will be unable to update Home Assistant.

Out of interest, how would these issues manifest themselves?
All I am using this for is in-the-field monitoring. So go somewhere for 1 day, or 1 week, or it cold be running for up to a month. It could be in civillisation or could be in the middle of a desert. But then after that the data gets dumped until it gets used next time.

First of all, I appear to have got myself confused with what I had tried. Turns out I could LanScan the port but couldn’t ping it when the system was connected to a router.

Information that I didn’t include before was that my laptop was always set to a manual ipv4 address. The Pi originally was set to DHCP and connected to a router, becasue it was the only way I could get the HomeAssistant image to finish it’s install (I must admit, it took me a while to figure that one out). I wrote and tested my Node-Red flows, InfluxdB and Grafana dashboard. At that point all that was left to do was remove the setup from he router and setup the PI with a Static IP address. Which is how I arrived to this point.

However, what seems to have cured it is, if I disable my wifi on the laptop?!.
I should add that this is running on a Mac; so I tried setting the “Service Order” in Network settings but that has made no difference nor did creating a new “Location”.

So I guess I just have to have disable Wifi to connect to HomeAssistant via an Ethernet which is not a big deal. Unless someone recognises something I’m missing.

Update:
Turns out it’s a Browser issue of some sort. With Laptop and Pi connected together via a switch;

  1. Wifi enabled on Laptop, the Laptop can connect quite happily to home Assistant using the Safari Browser.

  2. Wifif enabled on Laptop cannot connect to Home Assistant using Firefox, Brave or Chrome Browsers. I can only connect to HomeAssistant if I disable Wifi on my laptop.

1 Like

I’m glad you’ve solved it

Thanks.

I played around further and the Browser thing was a sort of red-herring. Safari just doesn’t seem to be bothered by the follwing;
Basically I’ve had to set the Gateway address in the Raspberry-Pi as it’s own ipv4 address; so both gateway and ipv4 are now set to 192.168.0.172 and also the gateway/router address on my laptop to look at the same address as well. Which I guess kind of makes sense, using a switch as opposed to a router.

But I am interested in to know what ‘Time’ issues I may encounter by not being conected to an NTP server. If anyone knows? Also is it not possible to force one of the computers to be a master clock? Or plug something into the switch to act as a master clock for both systems? Thanks

The clock will drift. You will find time and sun triggers to be inaccurate. How much drift?

It’s in the order of a minute or two a month.

Sure, if it is connected to the Internet. Installing NTP on Windows

Ah okay, I see.

In that case I don’t think it should affect for what I’m doing. I don’t need to synchronise with the outside world for any reference. But thanks for the info.

As a thought though, could it be as simple as using a cheap, GPS antenna and extracting the GPS time from the NMEA data? And [somehow] use that for Node-Red timestamps? Or is it not that simple?