I have seen some people a bit confused on how to set a static IP for the new Hass.io host HassOS. I know their are other guides but they are mostly buried in other posts. Anyway heres how to set up a static IP on Hass.io/HassOS.
Step 1: Once you have got Hass.IO up and running following the guide and can access the front end go to step 2.
Step 2: Take a USB stick put it into your PC and rename it to “CONFIG”.
Step 3: Create the folder “network” and inside create a text file called “my-network” then delete the .txt extension click yes and it should save. The file’s icon should just be a white/blank file icon in windows explorer.
Step 4: Open up that file with Notepad++ or similar and paste in these lines. These lines of code are for a Ethernet connection with a Static IPv4 but if you want to configure WiFi here are more examples of code. Change the IP and gateway IP to fit your setup. Eg. 192.168.1.111 is the Pi’s IP and 192.168.1.1 is your router/gateway’s IP.
Step 5: where UUID is you need to generate a unique one here copy and paste it into the “UUID: section”. Save the file and remove the USB stick from your PC.
Step 6: Shutdown your Pi (pull the power plug or thorough SSH) and insert the USB stick into any free port. Start up the Pi once the stick is inserted.
Step 7: Once it starts up and you can reach the UI go to the Hass.io tab, click on “System” on the far right, scroll down and find host system and click “import from USB”.
Step 8: Wait until it is complete then shut down the Pi, pull the USB and restart, it should now have a static IP.
Please note this will only work for the new HassOS install’s menaing that you have recently downloaded the newest IMG.
Hope this helps Riley.