LIQUIDATION SALE! FREE Shipping on orders over $49 USA $99 INTERNATIONAL USE CODE: "LIQUIDATION" for 50% OF

OpenHab2: Setting Up The Home Automation Server Software Windows

Setting Up The Home Automation Server

Software Windows:

 

Setting up the micro sd card (Updated 8/21/17):
1. Grab the micro sd card at least 16 gb recommended 32GB
2. Put the micro sd card into your computer, could be using a micro sd card reader
4. Scroll down to downloads and download the raspberry pi file by clicking on the file called “openhabianpi……..xyz”
5. It should download
6. Go to: http://www.7-zip.org/ and download and install 7-Zip
7. Once it is installed right click on openhabianpi....xyz then hover over to 7-Zip and click extract here
8. The file is now a .img file
10. Click the download button and it should automatically download
11. Once it is done downloading open file explorer and go to your downloads folder
12. Double click on Win32DiskImager to install it
13. Click run and then yes in the pop up boxes
14. Click next, agree to the terms, click next, next, next, next and then click install
15. Once it is done click finish
16. You should get an error that says “Unable to execute file” click ok
17. Go into the search bar or wherever your applications are and find Win32 Disk Imager
18. But we have to run as administrator so right click on it and press run as administrator then click yes in the pop up
19. First we have to load the image so click on the folder icon next to the Image File Field
20. Go to the downloads folder and double click on the file that starts with openhabianpi
21. Next in the device drop down select the letter drive of your micro sd card if you are unsure you can go to the file explorer and check the letter of the drive
22. Click write
Putting the micro SD card into the raspberry pi:
1. Take the micro sd card and put it into the raspberry pi, the logo on the SD card should be facing down
2. Then take the other end of the power adapter and plug it in
3. The raspberry pi is now booting
4. Please be patient and set a timer for 45 minutes because that is how long the first boot will take
Setting up the static IP address:
1. Go to you routers web page using a web browser, mine is 192.168.0.1 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, continuing on from the network videos, I am going to give it 192.168.0.4
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. Let the router 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://yourpiipadress:8080 replace the yourpiipadress with your pi’s ip address, mine is http://192.168.0.4:8080
2. You should see a webpage asking which setup you would like, we are going to click Expert
3. Now it should be installing our user interfaces, this could take a couple minutes so be patient
Setting up SSH:
2. Find where it says “MSI(‘Windows Installer’)” and click on the .msi file that corresponds with you system architecture either 32 or 64 bit personally I choose 64 bit
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 taskbar so you always have access to it
10. In the Host Name field type in the IP address of the raspberry pi
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, anyway 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.0.4 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, so go to open up your web browser and go to http://yourpiipadress:8080 replace the yourpiipadress with your pi’s ip address, mine is http://192.168.0.4:8080
2. Then click paper ui, paper ui is the web administration pannel 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.0.4 replace 192.168.0.4 with your pi's IP 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. Might ask for 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.0.4:1883 but change the IP address to match your raspberry pi
10. Press Control x and then press y then press enter to save
Software Part Complete For The Setting Up The Home Automation Server