top of page

SETTING UP THE SERVER

Step by Step Instructions for setting up the OpenHab2 Server

Directions

Setting a Static IP Address for the Raspberry Pi

 

1. Go to your routers web page using a web browser, mine is 192.168.1.254 and login

2. Then go to DHCP and DHCP Client list

3. Look through the list and find openHABianPi

4. Then copy its MAC address

5. Now head over to address reservation

6. Then click add new

7. In the MAC address field paste the pi’s MAC address

8. And then give it a reserved IP address, I would suggest 192.168.1.100

9. Then click save and in the pop up box click ok

10. There will be a little warning saying that it needs to reboot so click on the thing that says “click here”

11. And press the reboot button and ok in the pop up box

12. Allow sufficient time for the router to properly restart

13. Once the router is fully booted unplug the raspberry pi wait 10 seconds and then plug it back in

14. Wait 1 minute for the raspberry pi to boot back up

Setting Up OpenHAB 2.0 web config

 

1. Then open up your web browser and go to http://192.168.1.100:8080 

2. You should see a webpage asking which setup you would like, we are going to click Expert

3. OpenHab will now install the user interfaces, this could take a few minutes so be patient

 

Setting up SSH:

1. Go To http://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

2. Find where it says “MSI(‘Windows Installer’)” and click on the .msi file that corresponds with your system type 32 or 64 bit (most modern systems are now 64bit)

3. Open File Explorer then go to your downloads folder

4. Double click on the .msi file that starts with putty-

5. When the box comes up hit run

6. Click the next button 2 times and then click install when the box comes up click yes

7. Once done hit finish

8. Now we are going to open putty, so either search for it in the search bar or go to wherever your applications are and run it

9. Right click on it and press pin to task bar so you always have access to it as you will use this program frequently. 

10. In the Host Name field type in the IP address of the raspberry pi  (192.168.1.100)

11. In the Saved Sessions field type in Home Automation Server and press the save button

12. Click Open

13. Box should pop up saying not cached in the registry, just press yes

14. In the prompt box it will say login as: type in openhabian

15. Now it will ask for the password type in the default which is openhabian and press enter

16. Congratulations we are now SSH into the raspberry pi

17. type in sudo openhabian-config and press enter

18. Type in the default password openhabian

19. Use the arrow keys and go to update and press enter (it might kick you out of the configurator if so follow step 20 if not go to step 21)

20. Then go back to configuration type in sudo openhabian-config and press enter

21. Use arrow keys and go to Upgrade system and press enter

22. Once that is done use arrow keys and go down to Mosquitto and press enter

23. Then on the screen press enter while continue is highlighted

24. We will not be using authentication so use arrow keys and go over OK and press enter

25. It should now be installing our mqtt server

26. Once it is done press enter over OK

27. Use arrow keys go to exit and press enter

28. It should give you a warning that we didn't change the password so we are going to change some passwords I recommend using the same new password for the next two things

29. Type passwd and press enter, we are now going to change ssh password, so enter the default password openhabian and press enter then enter a new password and press enter then confirm that password by typing it in again and enter it should say updated successfully

30. We are now going to change the samba password I will explain what this is later, type in sudo smbpasswd openhabian and press enter

31. You might have to Type in the sudo password so the one we just changed previously and press enter if not go to step 33

32. Now type in a new password I recommend using the same password as the sudo password so type it in and press enter then type it in again and press enter

33. Next we are going to change the timezone and locale so the raspberry pi can set its date and time

34. type in timedatectl list-timezones and press enter Then use the arrow keys to scroll down through the list to find your time zone, once you find it highlight it and then copy or remember it then press control z to exit

35. Type in sudo timedatectl set-timezone Europe/Berlin but replace the Europe/Berlin part with your timezone then press enter

36. Then type timedatectl and press enter to check the timezone

37. We have now finished configuring the initial setup home automation server

38. So now type in sudo reboot and press enter, you might have to type in the sudo password and press enter

 

Testing The MQTT Server Mosquito:

1. Once it is done rebooting go to http://mqttfx.org/

2. Press Download MQTT.fx then click on the one below Latest version

3. It will take you to a new page click on the file that suits your windows the first windows one is 64 bit and the second one is 32 bit

4. It will start downloading

5. Once it downloads open up file explorer and go to your downloads folder

6. Double click on mqttfx……...windows

7. Click run and then when the other box comes up click yes

8. Click next 3 times and then click finish

9. Go to your search bar or wherever your applications are and look for mqttfx and the double click on it to open the program

10. This is now a good time to explain what this is, this is a program that tests mqtt stuff so you can debug it and see if it is working

11. Click on the gear at the top

12. Change broker address to the ip address of the raspberry pi mine is 192.168.1.100 and make sure the port is 1883

13. Then at the bottom click apply then click cancel

14. Now click connect

15. If it connects successfully and there is a green circle in the top right then you are good

16. Go over to the subscribe tab and type in the # symbol and press subscribe

17. Then in the publish tab type in hi in the field and then in the big box type in hello world! Then hit publish

18. Then go back to the subscribe tab and if you see hello world that we are very good

19. We successfully set up the mqtt server.

 

Connecting The MQTT Mosquito server to OpenHAB 2:

1. Now lets connect the mqtt server to openhab, Open up your web browser and go to http://192.168.1.100:8080 

2. Then click paper ui, paper ui is the web administration panel for the automation server

3. Add ons

4. In the search box type in MQTT

5. Next to where it says MQTT Binding click install wait for it to install

6. Go back to terminal and ssh into raspberry pi, type in ssh openhabian@192.168.1.100  and press enter, then type in your sudo password and press enter

7. type in sudo nano /etc/openhab2/services/mqtt.cfg and press enter

8. Putty Might ask for the sudo password so enter that

9. The only thing we are going to change is the server or url to our broker so delete the line #<broker>.url=tcp://<host>:1883 and replace it with broker.url=tcp://192.168.1.100:1883 

10. Press Control x and then press y then press enter to save.

Congratulations you have completed the Software Part of Setting Up The Home Automation Server

© 2026 Website Content - Q5 Electronics UK.

bottom of page