]]>
https://www.mksmarthouse.com/blogs/openhab-2/google-home-and-openhab-22021-12-24T16:00:52-05:002021-12-24T16:00:53-05:00Google Home and OpenHAB 2MK SmartHouseGoogle Home and OpenHAB 2
Demo:
Hey guys Matt here from MKSmartHouse.com and in this video I am going to show you how to connect the Google Home to your OpenHAB 2 System.
I love the Google Home and think it is an awesome device that makes controlling smart devices really easy with voice control. You can be in another room and yell to google and tell it to turn on a device for you. In this video we will be connecting google home to our openhab 2 system so it can control our openhab items. For this video we are going to need a device running IOS or android, a computer running Windows or MacOS, an openHAB server and the star of the show a google home device. The links to all the devices, parts and guides mentioned are in the video description.
Speaking of links in the description, follow @mksmarthouse on twitter, instagram and snapchat because those are the place where I give sneak peaks on when videos are releasing and also where I ask for your input on topics and future videos. Lately I have also been posting things that only a true smart home enthusiast would appreciate.
For this guide I am going to assume you already have the google home installed and it is running perfectly using the setup instructions google provides and you can control it and can access it from the Google Home app. I am also going to assume that you have a items file and a rules file. If you do not then go take a look at my video where I explain how to setup the configuration files in openHAB. I will not be making two separate videos using Mac and PC because the process is really similar the only difference is that on mac you use Terminal to ssh and on PC you use putty.
If you are a smart home enthusiast like me and want to show that you are an Elite Member of the smart home community then check out smarthousesociety.com for premium quality hoodies, shirts and hats. Supplies are limited so check out the link in the description now!
1. The first thing we have to do is ssh into the OpenHAB Server. I recommend having my website guide open when you do this so that way you can just copy and paste commands.
2. Now type insudo nano /etc/openhab2/items/home.itemsand press enter.
3. Now we are going to add the tags that the Google Home supports to the items. The tags go right before the bindingconfig. The Google Home supports the following tags.[ “Switchable” ]This tag is used with the Switch item type, Dimmer item type, Color item type, as well as the Rollershutter item type, but you would not use this for a light that is what the next one is for.[ “Lighting” ]This tag is used for lights with the Switch item type, Dimmer item type, and the Color item type.[ “CurrentTemperature” ]This tag would be used with a device that reports temperature and has the Number item type.[ “Thermostat” ]This tag is used with an item that has a Group item type and has the following devices in the Group[ “CurrentTemperature” ] [ “TargetTemperature” ] [ “homekit:HeatingCooling” ]I personally do not use the tags associated with the Thermostat and have never used them but if you want more information on them then check it out the github, link is on my website, which is in the description. I just use the Lighting and the Switchable one, in the future we may be using the Current Temperature one. Alright let's take a look at my items file because I have already put in the tags. As you can see I put the Switchable tag next to the items that are the Switch item type but are not lights. I also put the switchable tag into the GarageDoorShutterDummy items because they are of the Rollershutter item type. Here is the complete item:
Rollershutter GarageDoorShutter1Dummy "Garage Door 1" <garagedoor> [ "Switchable" ]
I created a dummy switch for the garage doors because chamberlain myq does not like the command it receives when the google home talks to it so I created the dummy Rollershutters as a sort of Middleman to handle the requests. I will talk more about this later. You can also see I used the Lighting tag for the two light switches. I also used the lighting tag for my color led strips. If you guys have any questions on these tags leave them in the comments because chances are someone else probably has it too.
4. Anyway once all your tags are in place, press control x then y and enter to save.
Now we have to address the Rollershutter items because when the google home sends a command it uses percents so let’s fix it. This step is optional and only if you have a Rollershutter item that needs on and off or up and down instead of percents.
5. Type insudo nano /etc/openhab2/rules/home.rulesand press enter.
6. Then type in the following:
rule "Garage Door 1 Voice Control"
when
Item GarageDoorShutter1Dummy received command
then
if (receivedCommand < 50)
{
sendCommand(GarageDoorSwitch1, ON)
}
else
{
sendCommand(GarageDoorSwitch1, OFF)
}
end
I pasted it in twice and modified it because I have two garage doors. All this rule is doing is taking the percent from the dummy items and then either sending the on or off command to the device. If your device requires up or down then change the ON to UP and OFF to DOWN.
7. Now press control x then y and enter to save.
Great! The items are now ready, so the next thing we are going to do is connect the Google Home.
8. So grab your mobile device that already has the Home app installed and open the app.
9. First press the three lines at the top left to bring up the menu.
10. Then press on home control.
11. In the bottom right click on the plus sign.
12. It will bring up a list smart devices you can add to the google home, scroll down and press on openhab.
13. It will open up a web browser page, so type in your myopenhab.org username and password and press sign in.
14. It will load a new page, press allow. Once that is finished it will say something like authorized or connected. After it will show you all of the items it found, if you want you can go through and organize the devices by room.
15. Then hit done.
That is it! The google home now has access to all your devices and you can control them with voice commands! Let’s test it. “Ok google, turn on MK Light” “Ok Google, set Garage Door 1 to 0%” “Ok Google, turn on Sprinklers Zone 1” “Ok google set Desk LED Strip to Blue” “Ok google set MK Blinds to 100” Great! The device is connected and working! Now we can control our openHAB items with voice commands! That concludes this complete guide to connecting the google home to openhab 2. In the description you will find links to all the parts and devices used in the video as well as a link to mksmarthouse.com/shop where I have a wide range of smart home kits that you can put together such as blinds, led strips, sprinkler system and door sensors. Alright thank you for watching and If you have any questions leave them in the comments section below or head over to mksmarthouse.com/forum. Good Bye!
Raspberry Pi 3:http://amzn.to/2m62Kg6 - doesnt work
Power Adapter:http://amzn.to/2lIyh5E
]]>
https://www.mksmarthouse.com/blogs/openhab-2/dark-mode2021-12-24T15:58:39-05:002021-12-24T15:58:40-05:00Dark ModeMK SmartHouse
OpenHab Dark Mode:
Hey guys Matt here from MKSmartHouse.com and in this video I am going to show you a secret mode in openHAB.
In this complete guide I will show you how to activate the secret mode in openHAB. The secret mode is dark mode for the basic ui. I found this feature when I was playing around in the openhab settings and noticed that basic ui had some drop downs. I am so glad I found it because I usually have openhab up on one of my monitors and at night it's very blinding. With this dark mode it just blends into the night and I think it looks really cool especially with the glow from the LED Strip behind it.
If you are a smart home enthusiast like me and want to show that you are an Elite Member of the smart home community then check out smarthousesociety.com for premium quality hoodies, shirts and hats. Also, for 24 hours from the time this video goes live you can use the exclusive coupon code “darkmode” and get 10% off your entire order. Supplies and time are limited so check out the link in the description now!
1. Anyway, to activate dark mode first access your web user interfaces. Those that don’t know how to do that type in your your openhab’s ip address:8080 mine is 192.168.0.4:8080.
2. Then click on paper ui.
3. Next click configuration.
4. In the sub menu click services.
5. After in the top navigation bar click UI. You should see all the different user interfaces.
6. We are interested in Basic UI so click its configure button.
7. Next click on the drop down underneath the word theme.
8. Now click on the word dark.
9. Finally click Save. Awesome!
10. Dark mode is now active, so let's check it out. Go back to the web user interfaces and click basic UI.
There you go the beautiful dark mode is loaded up and ready to be used!
If you want to switch back to the default mode just go back through this guide and choose default in the drop down and hit save.
That concludes this complete guide to activating the secret dark mode. In the description you will find links to all the parts and devices used in the video as well as a link to mksmarthouse.com/shop where I have a wide range of smart home kits that you can put together such as blinds, led strips, sprinkler system and door sensors. Alright thank you for watching and If you have any questions leave them in the comments section below or head over to mksmarthouse.com/forum. Good Bye!
Hey guys Matt here from MKSmartHouse.com and in this video I am going to show you how to update openHAB.
In this complete guide I will show you how to update your openHAB server to the latest openHAB release. At the time of recording the latest openHAB release is openHAB 2.3. I am currently running openHAB 2.2. Before I begin I would like to say it feels good to be back and you guys will be seeing more videos as I have been working on a lot of things while I was gone. One of the things I have been working on is SmartHouse Society which is a clothing brand I started so I could show my smart home pride. If you guys want to show you are part of the elite society of smart house members and also want to support the channel you can go to smarthousesociety.com, there will be a link in the description.
Speaking of links in the description, follow @mksmarthouse on twitter, instagram and snapchat because those are the place where I give sneak peaks on when videos are releasing and also where I ask for your input on topics and future videos.
Anyway, to update your openhab server you are not going to need besides a computer and your openHAB server.
I highly recommend backing up your openHAB server before you begin. If you have not watched my openhab backup video then I really recommend it as it could save you a lot of stress if something were to happen. If you have watched that video and did everything in the video then your openhab server should already be automatically backed up.
1. The first thing we have to do is ssh into the openhab server so if you are on mac use terminal and on windows use putty.
2. Next, type insudo openhabian-configand press enter. You might need to type in your admin password.
Note: A pop up might come up asking if you want to update use the arrow keys and go over skip and press enter.
3. After use the arrow keys and go over update and press enter.
Note: If there is an update it will stop the config tool and update so you will need to go back into it with sudo openhabian-config and press enter, also if there is a pop up press enter.
4. Once that finished use the arrow keys and go over update system and press enter.
5. If configuration file prompts come up just keep typing inNand enter because we want to keep our modified files.
6. Once it finishes use the arrow keys and go over Exit and press enter.
7. It is also a good practice to update the raspberry pi itself so type insudo apt-get update && sudo apt-get upgradeand press enter.
8. As a final step I like to go ahead and reboot the server. So type insudo reboot
That is it! Once it boots up your openHAB server should be all up to date.
That concludes this complete guide to updating your openhab server. In the description you will find links to all the parts and devices used in the video as well as a link to mksmarthouse.com/shop where I have a wide range of smart home kits that you can put together such as blinds, led strips, sprinkler system and door sensors. Alright thank you for watching and If you have any questions leave them in the comments section below or head over to mksmarthouse.com/forum. Good Bye!
Hey guys Matt here from MKSmartHouse.com and in this video I am going to show you how to connect your chromecast to openhab.
In this complete guide I will show you how to connect your google chromecast to openhab so you can control it from your phone, computer, amazon echo and eventually habpanel.
First let me show you how it looks on my phone, there are two items, the first one is a control item and from here we can go back, pause, play and go forward. In the second item we can control the volume via a slider.
Speaking of volume we can also control it using the amazon echo, “Alexa set Living Room Chromecast Volume to 100”
The items needed to complete this guide are the following: 1. A computer running either mac or windows, I will not be making a seperate guide for each because we are just going to be using it for ssh. 2. A fully setup Google Chromecast. The links to all the parts and devices mentioned are in the video description.
Speaking of links in the description, follow @mksmarthouse on twitter, instagram and snapchat because those are the place where I give sneak peaks on when videos are releasing and also where I ask for your input on topics and future videos.
1. The first thing we have to is go to the web user interface of our openhab server and then paper ui.
If you don’t know how to access this then watch my home automation server setup guide.
2. Anyway next click configuration and then bindings.
3. Click the plus sign and bindings.
4. In the search bar type in chromecast.
5. Once you see the binding press the install button.
Great the binding is now installed so let’s add the actual chromecast.
6. Click on inbox and then search for things.
7. After press chromecast binding.
It will now go through and look for the chromecasts on your network.
8. Once your chromecast shows up click the checkmark next to it.
9. A box will pop up, give the chromecast a name and press add as thing.
This chromecast is going into the living room so i'm going to give it a name relating to that. The chromecast is now added. There are 2 pieces of text we need in order to make chromecast items.
10. So, go to Configuration then things and click on your chromecast. You should see 2 channels, volume and control. Keep the paper ui tab open, you will need it later.
11. Next, ssh into the pi so on windows use putty and mac use terminal.
I recommend having my website open so that way you can just copy and paste commands, link is in the description.
12. The first thing we have to do is create the chromecast items in the items file so type insudo nano /etc/openhab2/items/home.itemsand press enter.
Player LivingRoomChromecastControl "Living Room Chromecast Control" <mediacontrol> { channel="chromecast:chromecast:cb1204772c97f92a8df21f8fc363dccc:control" }
But, the values in what we just typed in will not work for your specific chromecast.
14. So let's go back to your paper ui and copy the volume and control binding text from the paper ui to your items file. Now it is properly connected. The two items we created are a volume control and media controller, we will see how they look at work in the basic ui. Also, in the volume item I added the switchable tag so that way I can control the volume through Alexa.
15. Now press control x then y and enter to save.
16. Now we need to add the items into the sitemap so type in sudo nano /etc/openhab2/sitemaps/home.sitemap and press enter.
If you have been following along with my guides then you know I have many frames in my sitemap.
17. Since this chromecast is going into my living room I am going to paste the following code in my living room frame.
This code simply imports the items so I can use them in the basic ui.
18. Now press control x then y and enter to save.
Awesome! We are now completely done with the setup! Let’s test it out!
19. First cast something to the chromecast either from your phone or your computer.
20. Then, open up basic ui from your web user interface, you should see the chromecast items in the frame you put them in.
21. Test out the buttons in the control section.
22. Next test the volume slider.
23. Finally, if you have an Amazon Echo ask alexa to set the volume. “Alexa set Living Room Chromecast Volume to 50”
That concludes this complete guide to connecting the Google Chromecast to openhab. In the description you will find links to all the parts and devices used in the video as well as a link to mksmarthouse.com/shop where I have a wide range of smart home kits that you can put together such as blinds, led strips, sprinkler system and door sensors. Alright thank you for watching and If you have any questions leave them in the comments section below or head over to mksmarthouse.com/forum. Good Bye!
Hey guys Matt here from MKSmartHouse.com and in this video I am going to show you the complete way to backup your openhab server using a mac.
Imagine that one day you open up your openHAB app on your phone and there is nothing there, you then quickly go to your computer and try to ssh into the server but it just keeps saying “Connection refused”. At this point all is lost, all your hard work, all the time you put in, simply gone. But, lucky for you that was just an imagination and it can all be simply avoided by following this guide.
In this complete guide I will cover exactly how to backup your openhab server. The way this backup will work is there will be an external flash drive plugged into the raspberry pi and every day the raspberry pi will backup the openhab configuration and user data files to the flash drive. Now, this does solve a majority of the backup problem but what about the rest of the pi or other non openhab related items. Well, since we don't change much non openhab items on the raspberry pi after it is initially set up, we will do a manually backup of the SD card onto the flash drive through the computer. More on that later, let's just get started!
The items needed to complete this guide are the following: Number one, is a fully setup any model of raspberry pi running openhab, I am using a raspberry pi 3 in a clear enclosure that has a fan which generates a lot of air flow to the raspberry pi, I also installed heatsinks on the pi for even more cooling. I did this much cooling because I never want to run the risk of the pi overheating and failing. If you want a kit to protect your pi you can find it at mksmarthouse.com/shop. If your pi is not setup check out my home automation server setup guide. Number two is a computer running MAC OS or OS X, if you have a windows computer then check out my guide where I do this same guide except using a windows computer. Number three, is an SD card reader of some kind that can read the type of SD card you have in your pi, I only need a micro SD card reader but this one reads both sizes of sd cards. Lastly, number four you need a flash drive that is the same size as the sd card in your pi my sd card is 32gb so I bought a 32gb flash drive. The links to all the parts and guides mentioned are in the video description.
Speaking of links in the description, follow @mksmarthouse on twitter, instagram and snapchat because those are the place where I give sneak peaks on when videos are releasing and also where I ask for your input on topics and future videos.
1. The first thing we have to do is plug the flash drive into the computer.
2. Next go to spotlight, type in disk utility and press enter.
3. In the left column click on your flash drive. The next part we are about to do will erase everything on the flash drive so make sure you do not have anything important on it.
4. Then press the erase button. In the name box type in OHBACKUP and in the format select ExFat. Click erase.
5. Next we need to head over to the written version of this guide on my website, link is in the description.
6. Here we need to download the OHBackup_script. This is the script that we setup to automatically backup openhab every day at 12am and it will also delete backups that over 30 days old in order to not fill up the flash drive completely. 7. So go over to your downloads folder, double click on the zip file and then drag the script to the flash drive we will use for backing up. Once that is copied over eject the flash drive from your computer.
8. Grab the flash drive from your computer and plug it into the raspberry pi.
9. Before we get any further I just wanted to show you the basic ui of this server to demonstrate that this pi is fully configured and has a sitemap with items in it in other words it has a data on it. I have already done this process to my main openhab server which is why I will be using this pi.
10. Now open up terminal on your mac and ssh into the pi. I recommend having the written version of this guide open so that way you can just copy and paste the commands I am about to show you.
11. The first thing we have to do is install support for exfat so type insudo apt-get install exfat-fuse and press enter. You may need to type in your password and press enter.
11.1. It will then ask if you want to confirm type y and press enter.
11.2. Next enter super user so type insudo suand press enter.
12. Next we have to make a directory to mount the flash drive to, so type inmkdir /mnt/OHBackupDriveand press enter.
13. Now we have to find out what the UUID or id number of our flash drive is in order to mount it to the directory so type inlsblk -o UUID,NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL,MODELand press enter.
14. As you can see this is the 32gb flash drive I inserted into the pi and here is its UUID, this is important so write it down somewhere.
15. In order to mount the flash drive to the directory we need to modify the fstab so type innano /etc/fstaband press enter.
16. Now at the bottom of the file type in
UUID=C73C-F2E6 /mnt/OHBackupDrive auto defaults,auto,umask=000,users,rw 0 0 and press enter.
17. Replace the UUID with the UUID of your flash drive.
18. Once you changed the UUID press control x then y and enter to save.
19. Now to execute the mounting procedure instead of rebooting type inmount -aand press enter.
20. To confirm that it mounted to the directory type indf -k /mnt/OHBackupDriveand press enter, you should see how much of the folder is used and some other information.
21. Ok, now we are done with super user so type inexitand press enter.
22. Next up is to copy the script from the flash drive to the bin folder do this by typing insudo cp /mnt/OHBackupDrive/OHBackup_script /binand press enter.
23. Next we need to give the script permission to execute, so type insudo chmod u+x /bin/OHBackup_scriptand press enter.
24. To execute the script type insudo /bin/OHBackup_scriptand press enter.
25. You should see it say Openhab backup script and Success! Backup made.
26. Now, let's confirm that it did save so type incd /mnt/OHBackupDriveand press enter then type in ls and press enter. You should see a zip file. Great! OpenHAB was successfully backed up.
27. Now let’s make this backup process happen automatically everyday at 12 am.
28. Type insudo crontab -e and press enter. It might ask you which editor to use, type in2 to use nano and press enter.
29. In the bottom of the file type in0 0 * * * /bin/OHBackup_scriptwhat this does is execute the backup script everyday at 12 am.
30. Now press control x then y and enter to save.
31. Like I mentioned in the beginning the script only backs up openhab stuff like your items, things, sitemaps, configuration files etc, so stuff like the the mqtt server settings will not be backed up, those things we need to backup manually. I recommend backing up manually before/after every time you make a change to the raspberry pi that is not directly integrated with openhab or when you make an openhab software update.
32. In order to backup manually we need to first shut down the pi so type insudo halt and press enter.
33. Once the pi is fully shut down and the lights are not blinking, unplug the power cable, sd card and flash drive.
34. Then plug the sd card and flash drive into the computer.
35. Next open up applepibaker, if you dont know what apple pi baker is then go check out my automation server setup guide mac version.
36. Anyway type in your admin password for your computer and press ok.
37. In the pi crust section select your sd card and then click create backup.
38. It will then ask what to name it also where to save, name it what you want and choose your desktop as the location and click ok.
39. Once it finished open up finder and select your flash drive. Right click, create a new folder, and name it SDCardBackups.
40. Now, right click on the img file and click compress.
41. Once it finished compressing drag the zip file from your desktop to the SDCardBackups folder.
42. Once it copies over you are completely done backing up your automation server.
43.You can now eject the flash drive as well as the sd card and plug them back into the pi.
44. Once they are plugged in you can connect power again.
45. Congratulations, you are now safe from potential failures and part of the small percentage of people that actually backup their OpenHAB server. Help spread awareness of backing up openhab by sharing this video everywhere you possibly can and save people from the headache of a failed server with no backup. To demonstrate a change made after a manual backup I am going to make a modification to the sitemap file. As you can see the sitemap is changed. Now for demonstration purposes I am going to issue a OpenHAB Runtime backup with the commandsudo /bin/OHBackup_script normally your backup would occur automatically at 12am but for the purposes of this video I am going to back it up now. You can also use this command if you are about to do any modifications to the configuration files and want something to fall back on just in case you mess up.
For demonstration purposes I am going to simulate a raspberry pi failure that can happen to anyone and results in a complete data loss.
[Hits raspberry pi with the hammer]
Now lets go over how to restore your openhab server if it did go through a failure.
1. You would first plug both a new sd card either the same size or bigger than the original and the OHBackup flash drive into the computer.
2. Then open finder to your SDCardBackups folder and drag the backup you want to use to your desktop.
3. Once it finishes copying double click on the zip file to expand it into a proper img file.
4. Then open up apple pi baker, type in your admin password and press ok.
5. Now click on your sd card in the Pi-Crust Section. In the Pi-Ingredients section click on the 3 dots. It will bring up a mini finder, navigate to your desktop and click on the img file we previously expanded from the zip file.
6. Then click restore backup. Once it is formatted eject the flash drive and unplug both the sd card and flash drive. Plug both items items into the pi and plug in the power cable.
7. Once the pi boots up ssh into it through terminal.
8. The first thing we have to do is get into the backup drive and see which zip file we want to restore to so type in cd /mnt/OHBackupDriveand press enter.
9. To see what's inside type in ls and enter. I am going to backup to the latest zip file which is this one.
10. Next we need to stop openhab so type insudo systemctl stop openhab2.serviceand press enter.
11. Now we are going to restore openhab so type in sudo $OPENHAB_RUNTIME/bin/restore /mnt/OHBackupDrive/INSERTBACKUPNAME.zip before you hit enterreplace INSERTBACKUPNAME with the name of your backupand press enter.
12. It will ask you to confirm, pressyand enter.
13. Finally, start up openhab again by typing insudo systemctl start openhab2.serviceand press enter.
14. Your openhab server should be fully restored. If I open up the basic UI you can see all the data is still there including the recently made modification to the sitemap.
Finally, that concludes this complete guide to backing up and restoring your openhab server. In the description you will find links to all the parts and devices used in the video as well as a link to mksmarthouse.com/shop where I have a wide range of smart home kits that you can put together such as blinds, led strips, sprinkler system and door sensors. Alright thank you for watching and If you have any questions leave them in the comments section below or head over to mksmarthouse.com/forum. Good Bye!
OpenHab Backup
Using Windows:
Hey guys Matt here from MKSmartHouse.com and in this video I am going to show you the complete way to backup your openhab server using windows.
Imagine that one day you open up your openHAB app on your phone and there is nothing there, you then quickly go to your computer and try to ssh into the server but it just keeps saying “Connection refused”. At this point all is lost, all your hard work, all the time you put in, simply gone. But, lucky for you that was just an imagination and it can all be simply avoided by following this guide.
In this complete guide I will cover exactly how to backup your openhab server. The way this backup will work is there will be an external flash drive plugged into the raspberry pi and every day the raspberry pi will backup the openhab configuration and user data files to the flash drive. Now, this does solve a majority of the backup problem but what about the rest of the pi or other non openhab related items. Well, since we don't change much non openhab items on the raspberry pi after it is initially set up, we will do a manually backup of the SD card onto the flash drive through the computer. More on that later, let's just get started!
The items needed to complete this guide are the following: Number one, is a fully setup any model of raspberry pi running openhab, I am using a raspberry pi 3 in a clear enclosure that has a fan which generates a lot of air flow to the raspberry pi, I also installed heatsinks on the pi for even more cooling. I did this much cooling because I never want to run the risk of the pi overheating and failing. If you want a kit to protect your pi you can find it at mksmarthouse.com/shop. If your pi is not setup check out my home automation server setup guide. Number two is a computer running windows, if you have a mac computer then check out my guide where I do this same guide except using a mac. Number three, is an SD card reader of some kind that can read the type of SD card you have in your pi, I only need a micro SD card reader but this one reads both sizes of sd cards. Lastly, number four you need a flash drive that is the same size as the sd card in your pi my sd card is 32gb so I bought a 32gb flash drive. The links to all the parts and guides mentioned are in the video description.
Speaking of links in the description, follow @mksmarthouse on twitter, instagram and snapchat because those are the place where I give sneak peaks on when videos are releasing and also where I ask for your input on topics and future videos.
1. The first thing we have to do is plug the flash drive into the computer.
2. Next open up file explorer and click on this PC. The next part we are about to do will erase everything on the flash drive so make sure you do not have anything important on it.
3. Right click on your flash drive and press format
4. In the volume label box type in OHBACKUP and in the filesystem select exFAT. Click start.
5. Next we need to head over to the written version of this guide on my website, link is in the description.
6. Here we need to download the OHBackup_script. This is the script that we setup to automatically backup openhab every day at 12am and it will also delete backups that over 30 days old in order to not fill up the flash drive completely. 7. So go over to your downloads folder, double click on the zip file and then drag the script to the flash drive we will use for backing up. Once that is copied over eject the flash drive from your computer.
8. Grab the flash drive from your computer and plug it into the raspberry pi.
9. Before we get any further I just wanted to show you the basic ui of this server to demonstrate that this pi is fully configured and has a sitemap with items in it in other words it has a data on it. I have already done this process to my main openhab server which is why I will be using this pi.
10. Now open up putty to ssh into the pi. I recommend having the written version of this guide open so that way you can just copy and paste the commands I am about to show you.
11. The first thing we have to do is install support for exfat so type in sudo apt-get install exfat-fuse and press enter. You may need to type in your password and press enter.
11.1. It will then ask if you want to confirm type y and press enter.
11.2. Next enter super user so type insudo su and press enter.
12. Next we have to make a directory to mount the flash drive to, so type in mkdir /mnt/OHBackupDrive and press enter.
13. Now we have to find out what the UUID or id number of our flash drive is in order to mount it to the directory so type inlsblk -o UUID,NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL,MODELand press enter.
14. As you can see this is the 32gb flash drive I inserted into the pi and here is its UUID, this is important so write it down somewhere.
15. In order to mount the flash drive to the directory we need to modify the fstab so type innano /etc/fstaband press enter.
16. Now at the bottom of the file type in
UUID=C73C-F2E6 /mnt/OHBackupDrive auto defaults,auto,umask=000,users,rw 0 0and press enter.
17. Replace the UUID with the UUID of your flash drive.
18. Once you changed the UUID press control x then y and enter to save.
19. Now to execute the mounting procedure instead of rebooting type inmount -a and press enter.
20. To confirm that it mounted to the directory type indf -k /mnt/OHBackupDriveand press enter, you should see how much of the folder is used and some other information.
21. Ok, now we are done with super user so type inexitand press enter.
22. Next up is to copy the script from the flash drive to the bin folder do this by typing insudo cp /mnt/OHBackupDrive/OHBackup_script /binand press enter.
23. Next we need to give the script permission to execute, so type insudo chmod u+x /bin/OHBackup_scriptand press enter.
24. To execute the script type insudo /bin/OHBackup_scriptand press enter.
25. You should see it say Openhab backup script and Success! Backup made.
26. Now, let's confirm that it did save so type incd /mnt/OHBackupDriveand press enter then type inlsand press enter. You should see a zip file. Great! OpenHAB was successfully backed up.
27. Now let’s make this backup process happen automatically everyday at 12 am.
28. Type insudo crontab -eand press enter. It might ask you which editor to use, type in2to use nano and press enter.
29. In the bottom of the file type in0 0 * * * /bin/OHBackup_scriptwhat this does is execute the backup script everyday at 12 am.
30. Now press control x then y and enter to save.
31. Like I mentioned in the beginning the script only backs up openhab stuff like your items, things, sitemaps, configuration files etc, so stuff like the the mqtt server settings will not be backed up, those things we need to backup manually. I recommend backing up manually before/after every time you make a change to the raspberry pi that is not directly integrated with openhab or when you make an openhab software update.
32. In order to backup manually we need to first shut down the pi so type in sudo halt and press enter.
33. Once the pi is fully shut down and the lights are not blinking, unplug the power cable, sd card and flash drive.
34. Then plug the sd card and flash drive into the computer.
35. Next open up win32diskimager and press yes in the pop up, if you don't know what win32diskimager is then go check out my automation server setup guide windows version.
36. Anyway click on the little folder icon, we are now going to choose where to save the img, so choose your desktop and name the backup whatever you want, before you click save take a look at what letter your sd card is and then click save.
37. Now choose the letter of your sd card in the drop down
38. Finally click read
39. Once it finished open up file explorer and select your flash drive. Right click, create a new folder, and name it SDCardBackups.
40. Now, right click on the img file and hover over to send to and click compressed.
41. Once it finished compressing drag the zip file from your desktop to the SDCardBackups folder.
42. Once it copies over you are completely done backing up your automation server.
43.You can now eject the flash drive as well as the sd card and plug them back into the pi.
44. Once they are plugged in you can connect power again.
45. Congratulations, you are now safe from potential failures and part of the small percentage of people that actually backup their OpenHAB server. Help spread awareness of backing up openhab by sharing this video everywhere you possibly can and save people from the headache of a failed server with no backup. To demonstrate a change made after a manual backup I am going to make a modification to the sitemap file. As you can see the sitemap is changed. Now for demonstration purposes I am going to issue a OpenHAB Runtime backup with the command sudo /bin/OHBackup_script normally your backup would occur automatically at 12am but for the purposes of this video I am going to back it up now. You can also use this command if you are about to do any modifications to the configuration files and want something to fall back on just in case you mess up.
For demonstration purposes I am going to simulate a raspberry pi failure that can happen to anyone and results in a complete data loss.
[Hits raspberry pi with the hammer]
Now lets go over how to restore your openhab server if it did go through a failure.
1. You would first plug both a new sd card either the same size or bigger than the original and the OHBackup flash drive into the computer.
2. Then open file explorer to your SDCardBackups folder and drag the backup you want to use to your desktop.
3. Once it finishes copying right click on the zip, click extract all and then extract.
4. Then open up win32diskimager, and click yes in the pop up.
5. Now select your sd card letter in the drop down and then click on the folder icon. It will bring up the file explorer, navigate to your desktop, unzipped image folder and click on the img file.
6. Then click write backup. Once it is formatted eject the flash drive and sd card and unplug both the sd card and flash drive. Plug both items items into the pi and plug in the power cable.
7. Once the pi boots up ssh into it through terminal.
8. The first thing we have to do is get into the backup drive and see which zip file we want to restore to so type in cd /mnt/OHBackupDriveand press enter.
9. To see what's inside type inlsand enter. I am going to backup to the latest zip file which is this one.
10. Next we need to stop openhab so type insudo systemctl stop openhab2.serviceand press enter.
11. Now we are going to restore openhab so type in
before you hit enterreplace INSERTBACKUPNAME with the name of your backupand press enter.
12. It will ask you to confirm, pressyand enter.
13. Finally, start up openhab again by typing insudo systemctl start openhab2.serviceand press enter.
14. Your openhab server should be fully restored. If I open up the basic UI you can see all the data is still there including the recently made modification to the sitemap.
Finally, that concludes this complete guide to backing up and restoring your openhab server. In the description you will find links to all the parts and devices used in the video as well as a link to mksmarthouse.com/shop where I have a wide range of smart home kits that you can put together such as blinds, led strips, sprinkler system and door sensors. Alright thank you for watching and If you have any questions leave them in the comments section below or head over to mksmarthouse.com/forum. Good Bye!
Hey guys Matt here from MKSmartHouse.com and in this video I am going to show you how to use the OpenHAB 2 GPIO Binding.
The GPIO Binding allows us to interact with the onboard gpio pins of the raspberry pi. When I say interact I mean be able to turn the GPIO pins on and off as well as read the status of the input on a GPIO pin.
First up let's go over the parts I am going to use to demonstrate the GPIO binding. I am going to use a white LED, 5 volt 4 Channel relay board, Momentary button and a door sensor. For tools we are just going to need female dupont jumper cables. The links to all the materials, tools and parts are over on my website, the link is in the description.
To make this guide easier I am going to be using my testing raspberry pi running a fresh installation of openhabian. I have a complete guide on my channel showing how to install and setup openhabian. The raspberry pi is sitting in a clear plastic enclosure with a built in fan which is cooling the heat sinks I have installed. I have a kit for the raspberry pi on my shop over at mksmarthouse.com/shop.
Now take the components and connect them to the raspberry pi using the female dupont jumper cables and according to this picture. If you have any questions on the wiring ask it down in the comments below and I will try to answer it. Here is a clip of my wiring.
Next we have to setup the GPIO binding. I will not be doing two separate videos for mac and PC because the only difference is the software used to SSH, on mac you use terminal and on windows you use PUTTY.
1. To install the binding go to your openhab web user interface and click on paper ui.
2. Then go to add-ons. After that click on bindings and in the search type in GPIO and install the one that says GPIO binding.
3. If you want to configure some other settings for the GPIO binding you can go to the configuration tab and then the bindings sub tab.
4. After that you can click the configure button in the GPIO binding.
Personally I didn’t touch any of the settings. The binding is installed, now let’s use it.
5. SSH into the raspberry pi using the program based on your operating system.
I recommend having my website open so you can just copy and paste commands. For this guide, I am going to assume that you have an item's file and a sitemap file. If you do not, then check out my video where I cover the configuration files.
6. Anyway the first thing we are going to do is create the items in the items file.
7. Type insudo nano /etc/openhab2/items/home.itemsand press enter.
What we did is create the items that control as well as read the status of the various things we connected. Let me explain what each item does and what each part means. The first item is the one that controls the LED. The first part is the item type and since this will turn the LED ON and OFF we will use the switch type. The next part is the item name and I just called it LED. After that is the label text and this is what shows up in the user interface, again I just wrote LED. The next part after that is the binding config. I assigned this item to GPIO 21 because that is where I plugged in on the raspberry pi. The next set of items are for the relay board and since it is a 4 channel board I created 4 items. Each item is almost the same except for the binding config. I am going to show you a couple different ways you can configure this binding, but for this relay board the item config you should be using for every channel is the one on channel 1. The first part of the binding config is the pin to connect to and for this one is pin 26, the next part is activelow which is set to yes. Active low means that when the switch is off there will be no voltage applied to the gpio pin and when the switch is on there will be voltage applied. After that is initialValue and what this does is tell openhab what to set the initial value of the item during initialization. This one is set to high because I want the switch to be off during initialization. The next item is channel 2 and for this one I set activelow to yes and initialValue to low. So, this one will be like channel 1 except during initialization the switch will be on during initialization. The binding config for channel 3 and 4 are a littile bit different because they do not have the initialValue so instead they will use the default value of high. Also these two items have different values in activelow. You will be able to see how the different items work later when I show you a demo of everything working.
Next up is the gpio pins that act as inputs. First is the door sensor and since the door sensor has two states open and closed we will use contact for the item type. For the label text I just wrote Door Sensor and format of the input as %s. In the binding config I mapped it to GPIO pin 16, and set debounce to 10. Debounce means the time it waits before reading the input on a pin in milliseconds. After that is again activelow and this is set to yes because the way the button works is it applies voltage which trip the pin high. The button item is basically the same except it does not have a debounce parameter in the binding config.
9. That is it for the items file, now press control x, then y and enter to save.
10. Now we are going to put the items into the sitemap file so type insudo nano /etc/openhab2/sitemaps/home.sitemapand press enter.
11. Then paste the following into a bracket:
Switch item=LED
Switch item=channel1
Switch item=channel2
Switch item=channel3
Switch item=channel4
Text item=Button
Text item=DoorSensor
And press enter.
All we did is import the items into the sitemap.
12. To save press control x then y and enter to save. Let’s test everything out.
Go to your web user interface and then basic ui, I am going to do it on a tablet. Before we play with the buttons lets take a look at the status of everything, The led is of and so is its switch, channel 1 is off so is its switch, channel 2 is on and so is its switch, chanel 3 is on and so is its switch, channel 4 is on but its switch is not on. Now lets look at the input devices, the button is not pressed and on the interface it says open, and the door sensor is closed and on the interface it is also closed.
Alright now let’s play with everything, when I turn the LED switch on the LED turns on. To determine whether a relay is On just look at the leds on the relay board. When I turn on channel 1 the channel 1 relay turns on, When I turn off the channel 2 switch the relay turns off, when I turn off channel 3 the relay turns off. But when I turn on channel 4 the relay turns off. Now let’s test out the input devices, when I press the button it goes to the closed state and when I separate the door sensor contacts it goes to the open state. That is it for the GPIO Binding!
If you need any of the parts shown in the video you can buy a kit, the PCB or 3D printed parts to make this device as well as other devices at the link in the video description. Alright thank you for watching and If you have any questions leave them in the comments section below or head over to mksmarthouse.com/forum. Good Bye!
]]>
https://www.mksmarthouse.com/blogs/openhab-2/amazon-echo-alexa-and-openhab-22021-12-24T15:34:47-05:002021-12-24T15:34:48-05:00Amazon Echo (Alexa) and OpenHAB 2MK SmartHouse
Amazon Echo (Alexa) and OpenHAB 2
Hey guys Matt here from MKSmartHouse.com and in this video I am going to show you how to connect the Amazon Echo to your OpenHAB 2 System.
I love the amazon echo and think it is an awesome device that makes controlling smart devices really easy with voice control. You can be in another room and yell to alexa and tell her to turn on a device for you. In this video we will be connecting alexa to our openhab 2 system so she can control our openhab items. The only thing we are going to need for this video is the Amazon Echo device, I will leave a link to all the Amazon Echo devices in the description to my website but, personally I have only used the Echo Dot. For this guide I am going to assume you already have the device installed and it is running perfectly using the setup instructions Amazon provides and you can control it and can access it from the Alexa app. I am also going to assume that you have a items file and a rules file. If you do not then go take a look at my video where I explain how to setup the configuration files in openHAB. I will not be making two separate videos using Mac and PC because the process is really similar the only difference is that on mac you use Terminal to ssh and on PC you use putty.
1. The first thing we have to do is ssh into the OpenHAB Server.
I recommend having my website guide open when you do this so that way you can just copy and paste commands.
2. Now type insudo nano /etc/openhab2/items/home.itemsand press enter.
3.Now we are going to add the tags that the Amazon Echo supports to the items. The tags go right before the bindingconfig.
The amazon echo supports the following tags:
[ “Switchable” ]This tag is used with the Switch item type, Dimmer item type, Color item type, as well as the Rollershutter item type, but you would not use this for a light that is what the next one is for.
[ “Lighting” ]This tag is used for lights with the Switch item type, Dimmer item type, and the Color item type.
[ “CurrentTemperature” ]This tag would be used with a device that reports temperature and has the Number item type.
[ “Thermostat” ]This tag is used with an item that has a Group item type and has the following devices in the Group
[ “CurrentTemperature” ]
[ “TargetTemperature” ]
[ “homekit:HeatingCooling” ]
I personally do not use the tags associated with the Thermostat and have never used them but if you want more information on them then check it out the GitHub, link is on my website, which is in the description.
I just use the Lighting and the Switchable one, in the future we may be using the Current Temperature one.
Alright let's take a look at my items file because I have already put in the tags. As you can see I put the Switchable tag next to the items that are the Switch item type but are not lights. I also put the switchable tag into the GarageDoorShutterDummy items because they are of the Rollershutter item type. Here is the complete item:
Rollershutter GarageDoorShutter1Dummy "Garage Door 1" <garagedoor> [ "Switchable" ]
I created a dummy switch for the garage doors because chamberlain myq does not like the command it receives when the amazon echo talks to it so I created the dummy Rollershutters as a sort of Middleman to handle the requests. I will talk more about this later. You can also see I used the Lighting tag for the two light switches. If you guys have any questions on these tags leave them in the comments because chances are someone else probably has it too.
4. Anyway once all your tags are in place, press control x then y and enter to save.
Now we have to address the Rollershutter items because when the echo sends a command it uses percents so let’s fix it. This step is optional and only if you have a Rollershutter item that needs on and off or up and down instead of percents.
5. Type insudo nano /etc/openhab2/rules/home.rulesand press enter. Then type in the following:
// Control Garage Door 1 With Voice Sends ON or OFF Depending On Percentage
rule "Garage Door 1 Voice Control"
when
Item GarageDoorShutter1Dummy received command
then
if (receivedCommand < 50)
{
sendCommand(GarageDoorSwitch1, ON)
}
else
{
sendCommand(GarageDoorSwitch1, OFF)
}
end
I pasted it in twice and modified it because I have two garage doors. All this rule is doing is taking the percent from the dummy items and then either sending the on or off command to the device. If your device requires up or down then change the ON to UP and OFF to DOWN.
6. Now press control x then y and enter to save.
Great! The items are now ready, so the next thing we are going to do is connect the Amazon echo.
7. So grab your mobile device that already has the Alexa app installed and open the app.
8. First press the three lines at the top left to bring up the menu.
9. Then press skills.
10. In the search type in openHAB.
11. Click on the openHAB skill.
12. Then click enable.
13. It will open up a web browser page, so type in your myopenhab.org username and password and press sign in.
14. It will load a new page, press allow.
15. Once that is finished scroll up and press the done button.
16. It will then ask you if you want to discover devices, click on the Discover Devices button.
It will now look for the OpenHAB items. Once it finished then it should have found all of your openHAB items and they should all be listed there. That is it! The amazon echo now has access to all your devices and you can control them with voice commands!
Let’s test it.
“Alexa, turn on MK Light”
“Alexa set Garage Door 1 to 0%”
“Alexa, turn on Sprinklers Zone 1”
Great! The device is connected and working! Now we can control our openHAB items with voice commands! Alright thank you for watching and If you have any questions leave them in the comments section below or head over to mksmarthouse.com/forum where you have a better chance of it getting answered. Good Bye!
]]>
https://www.mksmarthouse.com/blogs/openhab-2/homekit-siri-home-app-and-openhab-22021-12-24T15:33:30-05:002021-12-24T15:33:31-05:00HomeKit (Siri + Home App) And OpenHAB 2MK SmartHouseHomeKit (Siri + Home App) And OpenHAB 2
Hey guys Matt here from MKSmartHouse.com and in this video I am going to show you how to connect Home Kit to your OpenHAB 2 System.
I love using home kit and think it is an awesome way to control your smart devices, especially with favorites where you can turn stuff on from control center. You can also use siri to control your home kit devices. In this video we will be connecting Home Kit to our openhab 2 system so we can control our openhab items. The only thing we are going to need for this video is a computer and your iOS device. For this guide I am going to assume you have the home app on your phone and have not deleted it. I am also going to assume that you have an items file. If you do not then go take a look at my video where I explain how to setup the configuration files in openHAB. I will not be making two seperate videos using Mac and PC because the process is really similar the only difference is that on mac you use Terminal to ssh and on PC you use putty.
The first thing we have to do is ssh into the OpenHAB Server.
I recommend having my website guide open when you do this so that way you can just copy and paste commands.
Now type insudo nano /etc/openhab2/items/home.itemsand press enter.
Now we are going to add the tags that Home Kit supports to the items.
If you have seen my video where I connect the Amazon Echo to OpenHAB 2 then you will notice the tags are the same.
The tags go right before the bindingconfig.
Home Kit supports the following tags.
[ “Switchable” ]This tag is used with the Switch item type, Dimmer item type, and Color item type but you would not use this for a light that is what the next one is for.
[ “Lighting” ]This tag is used for lights with the Switch item type, Dimmer item type, and the Color item type.
[ “CurrentTemperature” ]This tag would be used with a device that reports temperature and has the Number item type.
[ “Thermostat” ]This tag is used with an item that has a Group item type and has the following devices in the Group
[ “CurrentTemperature” ]
[ “TargetTemperature” ]
[ “homekit:HeatingCooling” ]
I personally do not use the tags associated with the Thermostat and have never used them but if you want more information on them then check it out the openHAB Docs, link is on my website, which is in the description.
I just use the Lighting and the Switchable one, in the future we may be using the Current Temperature one. Alright let's take a look at my items file because I have already put in the tags. As you can see I put the Switchable tag next to the items that are the Switch item type but are not lights. I also put the switchable tag into the GarageDoorShutterDummy items because they are of the Rollershutter item type. But I did this for the amazon echo because the amazon echo supports rollershutters and home kit does not, if you do put the tag then you will only see an ON OFF switch in the Home App. You can also see I used the Lighting tag for the two light switches. If you guys have any questions on these tags leave them in the comments because chances are someone else probably has it too.
Anyway once all your tags are in place, press control x then y and enter to save.
Great! The items are now ready, so the next thing we are going to do is setup the Home Kit Binding.
First go to your web user interface and click on paper Ui.
Then click on addons in the left column.
After that click services.
In the top navigation click on MISC.
Then Click install next to where it says HomeKit Integration.
If it does not automatically say installed then wait a little and press refresh in your browser.
Anyway once it installs click on configuration in the left column and then services.
Next click the configure button in the Home Kit Integration box.
Now we are going to configure the Home Kit Binding.
In the port field type in9124
In the Pin field type in031-45-154
Next decide whether you want fahrenheit for temperatures, if you do then turn on the switch.
In the Thermostat Cool Mode field type inCoolOn
In the Thermostat Heat Mode field type inHeatOn
In the Thermostat Auto Mode field type inAutoOn
In the Thermostat Off Mode field type inOff
In the network interface field type in the ip address of your openhab server.
Once all those are typed in, click save.
The Home Kit Binding is now configured! Now all we have to do is connect openHAB to our home app.
So grab your mobile device that already has the Home app installed and open the app.
First on the message click get started.
Then Click add accessory.
After that click on the OpenHAB accessory.
It will warn you that is not certified, click add anyway.
It will then bring up the camera to scan a code, instead click enter code manually.
Type in031-45-154.
It should say something like successfully added and let you configure it.
Name the OpenHAB accessory whatever you want, I will have mine as OpenHAB.
Then choose a location for it. I will keep mine in default room.
Then choose if you want to include in favorites, I will not.
After that click next in the top right.
It will automatically go through the items in your items file that you added the tags to and ask you the same thing as the openhab accessory so go through it change the settings if you would like and keep clicking next. I don't want to change anything so I will just keep clicking the next button.
Once you finish with the last item it should bring you back to the home app home screen and should see a couple items, the rest are in rooms tab. That is it the items are added to Home Kit and the Home app! I won’t go through the Home app and everything just because it is a separate service on its own with many, many features. I will let you know one thing though, your favorite items show up in the control center. So, if I hold down on MK Light and press details the switch Include in favorites is turned on, and as you can see if I pull up control center it is there. Before we close out the video let's test out the the light switch using the home app. As you can see when I press it the light turns On. Now let's turn it off using siri. “Hey siri, turn off MK Light” As you can see it turned it off! Great! Home Kit is connected and working! Now we can control our openHAB items with Home Kit! Alright thank you for watching and If you have any questions leave them in the comments section below or head over to mksmarthouse.com/forum where you have a better chance of it getting answered. Good Bye!
]]>
https://www.mksmarthouse.com/blogs/openhab-2/mobile-device-access-on-android-ios2021-12-24T15:32:33-05:002021-12-24T15:32:34-05:00Mobile Device Access On Android + iOSMK SmartHouseMobile Device Access On Android + iOS
Hey guys Matt here from MKSmartHouse.com and in this video I am going to show you how to access the openhab server from a mobile device.
So what are we going to accomplish, well after this video is over we will be able to access the OpenHAB home automation server from both our iOS and Android devices.
iOS
1. First we are going to set up access on iOS so, go into the apple app store and in the search for openHAB.
2. Find the app with the openhab logo and install it.
3. Once the app is installed find it on your device and open it.
4. When it asks to allow notifications press allow.
5. Then it will ask which sitemap to use, press the home sitemap.
6. Currently the app is running the openhab demo so let's change that. Press the three lines at the top right which will bring up some options.
7. Press the settings option.
8. Then next to demo mode turn off the switch. It will now open up some new fields.
9. In the local URL type in http://youpiipadress:8080 obviously replace it with you actual pi ip.
11. Then in the username and password field type in the user account’s credentials from myopenhab.org that will be using the device. If you are following along then it is the last thing we did in the last video regarding myopenhab.org.
12. Then hit save in the top right.
13. By default the app will open up the default home sitemap, we don’t want that so press the three lines in the corner again.
14. Then press settings.
15. Now press Select Sitemap.
16. Now choose the sitemap that is not the home sitemap or in other words you want, mine is MK-SmartHouse.
17. It will now load that sitemap by default, and as you can see it loads all of our switches and stuff. Great we set up access on ios so let's move to android.
Android
1. First go to the google play store and in the search type in openHAB and press search.
2. Now find the app with the openHAB logo and install it.
3. Once the app is installed find it on your device and open it.
4. In the popup select the demo sitemap.
5. Currently the app is running the openhab demo so let's change that.
6. Press the three dots at the top right which will bring up some options.
7. Press the settings option.
8. Then next to demo mode press the check box to make it unchecked. It will now open up some new fields.
9. In the local URL type in http://youpiipadress:8080 obviously replace it with you actual pi ip.
11. Then in the username and password field type in the user account’s credentials from myopenhab.org that will be using the device. If you are following along then it is the last thing we did in the last video regarding myopenhab.org.
12. After that hit the back button on your device.
13. A box should pop up asking which sitemap to use press the home sitemap or whatever sitemap your main sitemap is called. It will now load that sitemap as the default one when you open up the app.
That’s it! OpenHAB is now setup on both types of mobile devices and we can now access our home automation server from anywhere using our mobile devices. In my experience mobile is mostly the way I access the smart home when I want to turn something on or off. Speaking of this concludes our openHAB basics as we now have the openHAB server fully setup for the devices we are going to add because we have openhab installed, we have mqtt installed, we set up remote access, and we can access it from both the web browser as well as mobile devices. In the next videos we are going to be creating our very own mqtt devices and adding them to our home automation server. If there is anything you would like to see a video of leave it in the comments section below. Alright thank you for watching and If you have any questions leave them in the comments section below or head over to mksmarthouse.com/forum where you have a better chance of it getting answered. Good Bye!
Hey guys Matt here from MKSmartHouse.com and in this video I am going to show you how to setup the openhab cloud connector for remote access.
So what exactly are we going to accomplish in this video? Well, we are going to setup the openhab cloud connector which connects our openhab 2 server to the openhab servers at myopenhab.org. This allows us to remotely control our home automation devices. For example after we do this you can turn on a switch at home from anywhere in the world as long as you have an internet connection. Also, this allows for push notifications to mobile devices. So, when we set up access to the automation server from mobile, which is the next video, we will be able to receive notifications such as the sprinklers are on or the door is open.
1. First thing we have to do is access the web user interface and go to paper ui.
2. Then go to the addons tab in the left column. In the top navigation bar go to misc.
3. Find the openHAB cloud connector and press install.
4. Once it is installed in the left column navigation go to configuration and then the services sub tab. In the openHAB Cloud box click configure.
5. In the mode field click the drop down and select Notifications and Remote Access.
6. In the base URL Field type in https://myopenhab.org/ and click save.
7. Now go to this URL https://myopenhab.org/login Type in an email address and password of your choosing, this will be known as the admin myopenhab account.
8. You may notice there are two other fields the UUID Field and the secret field, so lets go get them. Open up your ssh client, on mac open terminal and on windows open up putty then ssh in.
9. Type insudo nano /var/lib/openhab2/uuidand press enter.
10. It should open up a text file, this is the UUID so copy it and then paste it into the UUID field.
11. Then go back to the ssh window and press control x to exit the text document.
12. Now we are going to get the secret, so type insudo nano /var/lib/openhab2/openhabcloud/secretand copy the text from the text file and paste it into the secret field in the web browser.
13. Then accept the terms of use and privacy policy and click register.
14. Once you are all registered on the webpage it might say offline in the top right. So go back to the ssh window and type insudo rebootand press enter. The raspberry pi should now reboot.
15. Once it is booted back up refresh the myopenhab.org webpage and it should now say online.
Great, now it is all connected together so let’s go through all of myopenhab.org and show you all of its tabs. First up on the home page you should see text that says “Click here to access your openHAB’s dashboard” click it and you will now see your normal Web User interfaces as if you were at home which is good because now we could be a million miles away and still be able to access it. But, let’s go back to myopenhab so click the back arrow in your web browser. Now go to the items tab this tab will show the items that we allow external services to use, in the future we will connect IFTT and will use this feature more but for now it will be empty. The next tab is the event log and this shows all the different events that happen such as the system going on and offline. The notifications tab shows all the notifications that were sent out. When we click on the online tab it just takes us back to the event log. Then click on your accounts email and it will bring up some sub tabs. The first sub tab is account and in here we can change the UUID and secret myopenhab has access to, as well as change the password for the account. There are also two red buttons on the bottom which I do not recommend pressing. After that there is the devices sub tab and this just shows the devices that were logged in with this account and since we didn’t log into any there is nothing here. The next sub tab is Applications and this shows the applications that we approve to access our myopenhab account such as iftt in the future. The last sub tab and the last thing in myopenhab is users. This in my opinion is the most important tab because it is how the people who will be accessing your home automation server get there credentials to log in and the server can send unique messages. I recommend creating user accounts for everyone who will be accessing the automation server and it features so that way you can send them unique messages. For example, you can have the automation server send you a different wake up notification than someone else.
16. So let's go through and create more users, click add new user. Then type in the user’s email and password two times as well as choose the user type, I suggest making all users besides the admin regular users, then press add user. Repeat those steps for every user you want.
That’s it our openHAB automation server is now fully accessible outside of our home network and ready to be accessed from our mobile devices which is what the next video will cover. Alright thank you for watching and If you have any questions leave them in the comments section below or head over to mksmarthouse.com/forum where you have a better chance of it getting answered. Good Bye!
]]>
https://www.mksmarthouse.com/blogs/openhab-2/setting-up-the-configuration-files2021-12-24T15:21:50-05:002021-12-24T15:21:51-05:00Setting Up The Configuration FilesMK SmartHouseSetting Up The Configuration Files
Hey guys Matt here from MKSmartHouse.com and in this video I am going to show you the OpenHAB 2 Configuration files as well as how to set them up.
The configuration files make up the whole smart home and without them it would not work because with these files we create the things, which connect to the items that we can use in the sitemaps to then create rules for automation. The statement that I just made is exactly how it works because there are 4 main configuration files, things, items, sitemaps and rules.
1. To access all these files we have to ssh into the device so on windows open up putty and on mac open up terminal, if you don’t know how to ssh then you can refer to my setting up the home automation server series that will be linked below or in a card at the top right.
2. Anyway the folders for where we are going to create these files are located in the OpenHAB 2 folder so type incd /etc/openhab2and press enter.
3. To see all the folders in this folder type inlsand press enter.
4. As you can see there are many folders and they all do different things but the first folder we are going to access is the things folder so type incd thingsand press enter.
5. Then we are going to create the things file so type insudo nano home.thingsand press enter.
6. It should open an empty text document so make a comment type in//This is the Thingsfile then press control x then y and then enter.
Great we created our first configuration file. Eventually we will populate this file with devices that require a thing declaration, keep in mind that not all devices need it.
7. The next file we are going to create is the items file. So type incd..And press enter to go back to the main folder. Then type incd itemsand press enter.
8. Then type insudo nano home.itemsIt should open up a text document. The items file is where we are going to create or add all of our devices so they can be accessed such as a light switch.
9. Type in//This is the Items Fileand press enter 2 times. But, we are not done yet, I think this is a good time to show you one of the most important types of items and that is the switch, it is not the only type of item, for a complete list check out the documentation at docs.openhab.org.
10. Anyway the first item is a switch so first type in a comment explaining the next item we will create for reference purposes I wrote//Demo itemsand pressed enter.
11. Then type inSwitch DEMOSW "Demo Switch"and press enter, let me explain what we wrote, the first part is the type of item, the second part is its name and the third part is its label text, there are many more parts to an item such as its binding config but we will get to that when we add an actual device.
12. Now press control x then y and enter.
13. Then type incd..And press enter To go back to the main folder.
14. Next type incd sitemapsand press enter.
15. Then type insudo nano home.sitemapand press enter. It should open up a blank text document. The sitemap file is how you interact with the devices or the user interface.
16. Then type in the following code segment:
sitemap home label="MK-SmartHouse"
{
Frame label="Demo"
{
Switch item=DEMOSW
}
}
17. Then press control x then y and enter.
18. Now comes the fun part we are going to see what we created. Keep your ssh window up because we will access it later. Open up your web browser and go to the openhab web user interface. If you don’t know how to do that then look at my video on OpenHAB 2 web interfaces explanation link in the card or in the description.
19. Then go to paper ui, in the left column go to configuration and then the services sub tab.
20. Now we can configure the user interfaces, the first one is basic ui so click its configure button, in the Default Sitemap field change whatever is there tohomeand press save.
21. Do the same thing to classic ui, click configure, change the sitemap tohomeand press save.
22. Great, now go back to the main web interface screen by typing in the ip address of the pi again with :8080 and click on basic UI. You should see a switch and the text demo switch. It does not do anything but now you understand the process of creating it.
23. We can now also access classic ui and it will have the same information as basic ui it just looks a little different.
24. Now let's go back to the ssh window and let me explain what each piece of code does. Type insudo nano home.sitemapand press enter.
The line sitemap home label="MK-SmartHouse" creates a label in the top. Frame label="Demo" creates a new section or box in the interface with the name demo. Switch item=DEMOSW Brings the switch item to user interface so we can control it. Essentially you can keep creating more frames to organize your system, that is what I like to do, I create a new frame for every room in the house that I will have smart devices.
25. Here is My Sitemap file I will be using if you do use it then delete everything you have in your sitemap file and then paste it in.
sitemap home label="MK-SmartHouse"
{
Frame label="Demo"
{
Switch item=DEMOSW
}
Frame label="Information"
{
Switch item=DEMOSW
}
Frame label="Security"
{
Switch item=DEMOSW
}
Frame label="MK-Room"
{
Switch item=DEMOSW
}
Frame label="JK-Room"
{
Switch item=DEMOSW
}
Frame label="Master Bedroom"
{
Switch item=DEMOSW
}
Frame label="Living Room"
{
Switch item=DEMOSW
}
Frame label="Garage"
{
Switch item=DEMOSW
}
Frame label="Outside"
{
Switch item=DEMOSW
}
}
26. Then press control x then y and enter.
I put the demo switch in every frame because a frame can not be empty and they are just placeholders till we put in actual devices. If you go back to the basic UI You can see how it all looks.
27. Now let's talk a little about the rules file. This is the file that does all the automation and since it has so many different things I will show you how to utilize in its own video once we add some devices but in this video I will show you how to create the file. So type incd..And press enter to go back to the main folder, then type incd rulesand press enter.
28. Then we are going to create the file by typing insudo nano home.rulesand press enter, it should create a text document then type in//This is the rules filethen press control x then y and enter.
29. Type insudo rebootand press enter to reboot the device, I always recommend rebooting after making major changes like these.
That is it! The configuration files are all setup. Now we have the Automation server ready for devices to be added but, before we do that the next two videos will cover how to setup remote access so you can access your smart home from anywhere and control devices from anywhere. Which perfectly leads into the video after that, setting up mobile devices to access the home automation server from IOS and Android. Alright thank you for watching and If you have any questions leave them in the comments section below or head over to mksmarthouse.com/forum where you have a better chance of it getting answered. Good Bye!
]]>
https://www.mksmarthouse.com/blogs/openhab-2/web-interface-admin-explanation2021-12-24T15:20:16-05:002021-12-24T15:20:17-05:00Web Interface / Admin ExplanationMK SmartHouseOpenHAB 2 Web User Interfaces
Hey guys Matt here from MKSmartHouse.com and in this video I am going to show you around the Openhab 2 web user interfaces.
Openhab is a great platform and there are many things you can do on it but something new that happened is in openHAB 2 they introduced the OpenHAB web ui where you can see all the different user interfaces.
To access the web ui open up your web browser and head over to pi’s ip address with :8080 on the end. Mine is 192.168.0.4:8080. It should look like a bunch of rectangles and say Welcome to openHAB 2.
First up is the basic ui this is the user interface that we will create later on in the next video when we talk about the OpenHAB configuration files. Next up is paper ui and this is the administrative web user interface. The first tab on the left side is control and here we would be able to control devices that we have connected. Then we have inbox, this is where the system would search for devices when you have bindings installed I will show you this more in the future when we add devices. After that is configuration which has sub tabs starting with system where you can change a few things in OpenHAB I usually do not touch anything here. In the bindings sub tab it would show you all the bindings you have installed that are version 2.0, currently I don’t have any that are 2.0 because it is a fresh install that we did in the last set of videos and we installed mqtt which is version 1.9 so it does not show up here.
The services sub tab is like bindings expect instead of showing you all your bindings it shows services. We will configure Basic Ui and Classic Ui in the next video and the HABPannel will be confured much later on. If you look up top there is a voice tab but I don’t use that. Next sub tab is things and in here it would show all the devices or things you have connected for example later on we might have a belkin wemo light switch or a samsung smart tv.
Then the final sub tab is the items sub tab where you connect the things to items to provide individual data, for example a thing could be a light switch and two items for the light switch would be its state as well as turn it on or off. The Next tab is the Add-ons tab and in here we have many add ons or pieces of software so we can connect devices, in last video when we were setting up the server we installed the mqtt binding but there are so many more, have a look for yourself. But there are not just bindings there are also different user interfaces you can install, persistence, actions, transformations, voice and other miscellaneous things.
The final tab on the right is the preferences tab and here you just select your language. The next user interface is the Rest Api and this is where you can do http stuff, personally I do not use this. Then we have classic Ui which is the same thing as basic Ui it just looks different.
HABMIN is next and it just has so many features that I can’t cover them all but, essentially it is another administrative thing that I don’t use enough. Finally is HAB Panel which is new with OpenHAB 2 and I just love it so much, if you watched my smart house demo video, this is what the wall mounted interface was running. I will show you more of this when we make a wall mounted interface.
That is it for the OpenHAB 2 web interface, there isn’t really to much to it and that’s what makes it so awesome. The point of this video was just to do a walk around of the open hab web interface so you know where everything is as well as which videos will cover those parts. Which means that I will show you how to use the parts when the time comes. In the next video we will be talking about the OpenHAB configuration files as well as setting up the user interface for the smart home! Alright thank you for watching and If you have any questions leave them in the comments section below or head over to mksmarthouse.com/forum where you have a better chance of it getting answered. Good Bye!
]]>
https://www.mksmarthouse.com/blogs/openhab-2/setting-up-the-home-automation-server2021-12-24T15:17:13-05:002021-12-24T15:17:14-05:00Setting Up The Home Automation ServerMK SmartHouse
Setting Up The Home Automation Server
Demo:
Hey guys Matt here from MKSmartHouse.com and in this video I am going to give you a demo of the Home Automation Server we will be creating.
So the point of this demo is to show you the home automation server in action as well as how it all works. Also, Please also go ahead and press the like button because if all five videos in the Home Automation Server Series hit 200 likes then I will release the videos on how to actually use OpenHAB 2.0 sooner then it is scheduled.
Anyway the first thing I will show you is the device in action so as you can see here it is and it is mounted on the same wall as the network. But, you might be wondering what it is doing right now well, right now it is hosting the OpenHAB 2 service as well as the mqtt service. After completing this series we will be prepared and ready to create the user interfaces as well as connect our smart automation devices.
Now let's talk about how it all works. To start off the entire thing is running on a raspberry pi, in this case I am using a raspberry pi 3 but this will work fine on a 2 as well as anymore pi’s in the future. Next up the storage for the pi is a 32gb sandisk micro sd card class 10 of course for the extra data speed. The pi is being housed in a clear acrylic case with a fan built in. But the fan does not do the cooling on its own, I have also installed a heat sink which with the fan is pretty good cooling. The pi is being powered by a 5v 2.5 amp power adapter that is UL certified which is important for power stability. The actual pi is connected to the network via a green cat 6 cable. We will be installing the software onto the pi using either a Mac computer or a windows computer which each have their own video so when you do it make sure you watch the right video. The software we will be installing is OpenHAB 2 as well a Mosquitto Mqtt server. But, this has all been made easy because all we will be doing is flashing a prebuilt image called openHABian which makes everything a lot easier. To actually configure the pi we will be using a combination of the web browser and ssh. But, the entire software process will be explained in its respective video.
That’s all I have for the actual demo, now it is time for you to watch the next videos to learn how to setup your own home automation server running OpenHAB 2. Alright thank you for watching and If you have any questions leave them in the comments section below or head over to mksmarthouse.com/forum where you have a better chance of it getting answered. Good Bye!
Setting Up The Home Automation Server
Hardware:
Installing the heatsinks onto the raspberry pi:
1. Peal the backing off of the smaller heatsink
2. Take the smaller heatsink and place it on the small black square on the raspberry pi
3. Align the heatsink and then press down on it to make sure it attached
4. Peal the backing off of the bigger heatsink
5. Take the bigger heatsink and place it on the big black square on the raspberry pi
6. Align the heatsink and then press down on it to make sure it is attached
Setting up the case:
1. Take off all the protective acrylic packaging paper off of the acrylic pieces of the case (Use a knife to pick at a corner and pull off the plastic)
2. First take bottom piece, the one with the box in the center and the long side with the shorter distance of the side to the box facing you
3. Take out the 4 screws, 4 plastic washers and 4 nuts from the bag
4. Take the 4 screws and put them into the bottom plastics piece from underneath with the long side with the shorter distance of the side to the box facing you and place on flat surface
5. Take the 4 plastic spacers and put them on the screws
6. Take the raspberry pi and put it on the screws by ligning it up
7. Take the 4 nuts and put them on the screws
8. Take out the 4 nuts and 4 screws out of the bag
9. Take the top piece of the case and lay it flat with the gpio cut facing away from you and the big lift tabs to your left
10. Lift up the piece and stick in the 4 screws underneath the piece and through the holes
11. Take the fan and look around its sides to find two arrows
12. Orient the fan so the arrow is pointing up and where the cable exits the fan should be away from you
13. Take the fan and place it on the 4 screws
14. Take the 4 nuts and screw the fan down
15. Use a philips screw driver and a wrench or pliers
16. Take the two long side pieces for the case and put them on
17. 5v fan so plug the red side into pin 4 and black side into pin 6
18. But sadly the case does not fit with the connector how it is so we are going to shave off the side clip with a razor or knife then plug it in
19. Take the cable and sort off wrap it around the fan, and place the top piece in the two holes of the side pieces
20. Take the piece with two holes in it and align it over the front ethernet and usb ports, when you put on the piece first hook it over the top hooks and then the bottom clips
21. Then take the final piece and put it over the back, by hooking it on the top and cliping it in
22. Now the case is complete
Setting it up for use:
1. Plug in the ethernet cable into your network and into the raspberry pi
2. Plug in micro usb side into the raspberry pi but not into the wall socket yet
Setting Up The Home Automation Server
Software Mac:
Setting up the micro sd card (Updated 6/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
3. Go to: https://github.com/openhab/openhabian/releases
4. Scroll down to downloads and download the raspberry pi image by clicking on the file called “openhabianpi-raspbian-XXXXX.img.xz”
5. It should download
6. Go to: http://wakaba.c3.cx/s/apps/unarchiver.html and download The Unarchiver
7. Go to your downloads folder
8. Double click on the unarchiver.zip file
9. Drag The unarchiver to applications folder
10. Right click on the openhabianpi-raspbian-XXXXX.img.xz and open with the unarchiver it should unzip it and create a regular .img file without the .xz
12. Scroll down to most recent version (recommended) and click download now
13. Open finder and go to your downloads folder
14. Double click to unzip the ApplePi-Baker.zip
15. Then double click on ApplePi-Baker to open the program
16. You might get a warning saying unidentified developer, if so go to system preferences
17. Security and Privacy then click the button open anyway a box will pop up click open
18. Now we are in apple pi baker and it will ask for admin password for your computer, so type it in and press ok
19. Next in the left side click and select your micro sd card
20. Then in the IMG file field click the 3 dots to browse for the image
21. Head over to your downloads folder and select the openhabianpi-raspbian-XXXXX.img file and click open
22. Then click Restore Backup
23. When the box pops up that says Your ApplePi is ready! Click ok and remove the micro sd card from your computer.
24. Then quit apple pi baker
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 base components + MQTT Server Mosquito (Updated 6-21-17):
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
4. Open up terminal on mac and type inssh openhabian@192.168.0.4replace 192.168.0.4 with your pi's IP and press enter
5. Type inyesand press enter
6. Default password is openhabian
7. type insudo openhabian-configand press enter
8. Type in the default password openhabian
9. Use the arrow keys and go to update and press enter (it might kick you out of the configurator if so follow step 10 if not go to step 11)
10. Then go back to configuration type in sudo openhabian-config and press enter
11. Use arrow keys and go to Upgrade system and press enter
12. Once that is done use the arrow keys and go to optional components and press enter
13. Then use arrow keys and go down to Mosquitto and press enter
14. Then on the screen press enter while continue is highlighted
15. We will not be using authentication so use arrow keys and go over OK and press enter
16. It should now be installing our mqtt server
17. Once it is done press enter over OK
18. Use arrow keys go to exit and press enter
19. 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
20. 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
21. We are now going to change the samba password I will explain what this is later, anyway type insudo smbpasswd openhabianand press enter
22. You might have to Type in the sudo password so the one we just changed previously and press enter if not go to step 22
23. 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
24. Next we are going to change the timezone and locale so the raspberry pi can set its date and time
25. Type intimedatectl list-timezonesand 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
26. Type insudo timedatectl set-timezone Europe/Berlin butreplace the Europe/Berlin part with your timezonethen press enter
27. Then typetimedatectland press enter to check the timezone
28. We have now finished the initial configuration the home automation server
29. So now type insudo rebootand press enter, you might have to type in the sudo password and press enter
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 has the ending macos.dmg
4. It will start downloading
5. Once it downloads open up finder and go to your downloads folder
6. Double click on mqttfx……...macos.dmg
7. Box should pop up double click on MQTT.fx installer
8. Should give a warning of unidentified developer so go system preferences > security and privacy and the click open anyway
9. Another box will pop up click open
10. Then go through the setup by click next two times and then finish
11. It is now installed so go to launchpad and click on MQTT.fx
12. 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
13. Click on the gear at the top
14. Change broker address to the ip address of the raspberry pi mine is 192.168.0.4 and make sure the port is 1883
15. Then at the bottom click apply then click cancel
16. Now click connect
17. If it connects successfully and there is a green circle in the top right then you are good
18. Go over to the subscribe tab and type in the # symbol and press subscribe
19. Then in the publish tab type in hi in the field and then in the big box type in hello world! Then hit publish
20. Then go back to the subscribe tab and if you see hello world that we are very good
21. 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 inssh openhabian@192.168.0.4replace 192.168.0.4 with your pi's IPand press enter, then type in your sudo password and press enter
7. Type insudo nano /etc/openhab2/services/mqtt.cfgand 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>:1883and replace it withbroker.url=tcp://192.168.0.4:1883butchange 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
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
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
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 inopenhabian
15. Now it will ask for the password type in the default which isopenhabianand press enter
16. Congratulations we are now SSH into the raspberry pi
17. Type insudo openhabian-configand press enter
18. Type in the default passwordopenhabian
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 insudo openhabian-configand 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. Typepasswdand press enter, we are now going to change ssh password, so enter the default passwordopenhabianand 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 insudo smbpasswd openhabianand 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 intimedatectl list-timezonesand 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 insudo timedatectl set-timezone Europe/Berlinbutreplace the Europe/Berlin part with your timezonethen press enter
36. Then typetimedatectland press enter to check the timezone
37. We have now finished configuring the initial setup home automation server
38. So now type insudo rebootand press enter, you might have to type in the sudo password and press enter
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 inssh openhabian@192.168.0.4replace 192.168.0.4 with your pi's IPand press enter, then type in your sudo password and press enter
7. Type insudo nano /etc/openhab2/services/mqtt.cfgand 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>:1883and replace it withbroker.url=tcp://192.168.0.4:1883butchange 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
Setting Up The Home Automation Server
Final Install:
Preparation:
1. Unplug the raspberry pi from the micro usb cable as well as unplug the ethernet cable
2. Then bring over to a table and take the whole case apart because we need to make some small modifications
3. Next unscrew the raspberry pi from the bottom piece of the case and put it somewhere safe
4. Make sure you do not loose the small screws so move them somewhere safe
Modifying the case
1. Grab a small piece of wood, I am using a short piece of a 2 x 4 this is to prevent the desk being damaged
2. Then take the bottom piece of the acrylic case with the straight side to the left and the shorter side to the middle box facing you
3. Choose a drill bit that is bigger than the screws you are going to use to mount the pi, The screws I have are M3.5 so I chose a 4mm drill bit
4. Next grab your drill and put in the drill bit
5. I am going to drill two holes for mounting, one is going to be in between the micro sd card hole and the square cut out, the other hole is going to be in between the left edge and the square
6. Once the holes are drilled, we are going to countersink them so they are flush with the case
7. Find a counter sink bit that will make the screw flush, I chose a size 8 and found that it worked really well
8. Once you chose a size put it in the drill and go to the hole and just start drilling, while you are drilling though take breaks to test and see how flush the screw is
9. When the screw is perfectly flush then we are done and then repeat the procces for the other hole
10. Great now that both screws are counter sunk, put the case back together but, without the pi inside
11. Bring it over to where you are going to mount and play around with its positioning, keep in mind the locations of the ports and clearance
12. Once you chose its position bring the case back over to the table and take it apart.
13. After it is apart find a drill bit that is smaller than the screw we are going to use to mount the case
14. Take the bottom piece of the case back over to where we are going to mount it and drill holes use the bottom piece as a template
15. When the holes are drilled bring the bottom piece back to the table and put the two mounting screws through the holes
16. Then take 8 - 10 of the plastic washers and put them over the screws, the reason we do this is to provide a space between the bottom piece and the mounting surface so we can assemble the case on the wall
17. This is the tricky part grab the 4 screws that we use to mount the pi to the case and stick the through (Refer to the video if confused)
18. Now with all the screws in bring it over to the mounting place and screw in the mounting screws into the predrilled holes
19. To prevent the raspberry pi from ever shorting just in case I put pieces of electrical tape over the metal mounting screws
20. Next take the 4 small plastic spacers used for attaching the pi to the case and put them over the 4 screws we put in before screwing it to the wall
21. Then take the pi in addition to the 4 nuts and mount the pi to the case, since we can't reach the screws we will just finger tighten the nuts
22. All we have to do is assemble the case, so grab the microsd card side piece as well as the two long pieces and put them on
23. After take the piece with the fan, and connect the fan as well as put the piece on
24. Finally take the piece with the port cutouts and put it on
25. Before we plug in the cables I like to label them
26. I used my dymo label maker and made a label for the two sides of the ethernet cable as well as the power brick
27. I also labeled the actual pi with what type of server it is and its IP address
28. Then I took the micro usb cable and the ethernet cable and plugged them in
29. The automation server is now done in terms of hardware
]]>
https://www.mksmarthouse.com/blogs/openhab-2/setting-up-the-home-network-12021-12-24T14:49:37-05:002021-12-24T14:49:38-05:00Setting Up The Home NetworkMK SmartHouse
Setting Up The Home Network:
Demo:
Hey guys Matt here from mksmarthouse.com and in this video I am going to give you a demo of the Network we are going to be creating.
So the point of this demo is to show you the system in action as well as how it all works. Also, when each one of these 4 videos in the network series hits 100 likes I will release the video of setting up the home automation server with OpenHAB 2 sooner than it is planned. Anyway, let’s start off with the device in action part. Let me just take out my phone and as you can see we have a couple different wifi networks. With the network we have two sets of wireless we have the guest wifi and the normal personal wifi. Then within those two sets we have the 2.4GHz and the 5GHz. The 5GHz is the faster one and whenever possible always use it but some devices are not 5GHz capable so they would use the 2.4GHz. Another thing is that with this network and the wireless I have full wifi coverage throughout the property from outside to the second floor. Which for this Smart Home system is very necessary. We can also access anyone of these wifi networks from anywhere around the house. With this network we can also connect many wired device that we have. To end off what it can do I am just going to show you the speed test of the wired network and the wireless network. It can handle quite a bit. So, now let's go over how it all works. Down here in the basement we have the main network which consists of the Modem, Router and ethernet switch. We start off by getting internet from the ISP through this coaxial cable which then goes into the modem and gets outputted through this red ethernet cable and goes into the router. The router is the brain of the network as it assigns IP addresses and talks with the modem. This router also is one part of the wireless setup. Then we have this yellow ethernet cable which goes to the ethernet switch and it distributes the ethernet signal between all the wired devices in the house including the two wifi access points that I have. One of the access points is in the garage so I have an ethernet cable running to there and then I have another access point in my room where I have ethernet jack that goes to the ethernet switch. The access points are what are responsible for increasing the wifi range which is why I have two of them in addition to the main router's wifi. I am not saying they are necessary to everyone but what is necessary is complete wifi coverage throughout the entire home so all the future sensors and devices can connect to it. That’s it that is the network we will be creating in the next couple of videos, first is the hardware video where we connect everything, next is the software video where we configure everything and then lastly, we have the final installation video where we mount and install everything in their final positions. If, you have a network already which you probably already do, then you should still watch these videos as there might be something I do differently than you. Also, even if you have a network you could get some ideas from mine on some upgrades you could possibly do such as a new router or increasing the wifi range using access points. Some of you might be saying, just show us the smart home stuff and I am, I am showing the complete process from start to finish of a smart home and the network by far is the most important because if you don't have a strong network the communication between devices will be terrible and your smart home will fail. The point is make sure you have a very stable and fast network, which you can watch these next videos to make sure. Alright thank you for watching and If you have any questions leave them in the comments section below or head over to mksmarthouse.com/forum where you have a better chance of it getting answered. Good Bye!
Hey guys Matt here from mksmarthouse.com and in this video we are going to be talking about the hardware in the network.
To start off let’s talk about the hardware we are going to be using in the network. But before we do that make sure you like this video because when each one of these 4 videos in the network series hits 100 likes I will release the video of setting up the home automation server with OpenHAB 2 sooner than it is planned. Anyway, the modem we are going to be using is the arris surfboard sb1641. Please note I will not be showing in detail how to setup the modem with the ISP because it is different with each ISP. This is an amazing modem and has many positive reviews all over the internet. Speaking of positive reviews the main router I chose also does, I chose the the TP-Link Archer C7. So these two devices take care of the basic network and for most people that's it for the network. But, since in my house there are a little bit more wired devices I'm going to need an ethernet switch and that is where the D-Link 16-Port gigabit ethernet switch comes into play. Lastly, since I want more wifi coverage, let me rephrase that since I need complete wifi coverage I am going to use these two Netgear AC1750’s. Now you might be asking why I need two more routers. Well these two devices have an access point feature in their software that allows them to act as wifi access points instead of routers and extend the range of the wifi network. The links to where to get all the hardware I will be using is in the description below.
First we are going to reset all the devices to factory settings. So we are going to connect our power strip to power, and then turn it on. The modem and switch don't get reset so we will skip those and move on to the routers starting with the main one the archer c7. Plug the power adapter into the power strip and into the router. Next press the power button in the back to turn it on, then wait a minute or two until the device powers on and the asterisk looking thing flashes slowly. After, press and hold the WPS/RESET button for more than 10 seconds until the SYS LED or Asterisk looking thing becomes a quick flash from a slow flash. Then release the button and wait for the Router to reboot to its factory default settings. Next we are going to reset the Netgear AC1750 so, first we are going to plug the power adapter into the powerstrip then into the device and press the power button into the on position. Then let the device boot for a minute or two. Once it is booted take a paperclip and press and hold the red button down for 10 seconds. Finally the device will reboot. Repeat this reset process for anymore AC1750’s or access points you may have.
To finish off the power distribution let's connect the D-Link ethernet switch to power and the Arris Modem to power, which is just connecting their power bricks to the power strip and then the other ends into the devices. Speaking of power this powerstrip is one that has a surge protector built in which is very important to protect all of the network hardware.
Now that everything is reset and set to as if it is brand new let's get to work. To test everything before we install it we are going to connect everything on a separate table. To start off let's talk about internet connection. Personally I have cable internet meaning that I get my internet from my ISP over a coaxial cable. Therefore I have a cable modem which is the first thing we are going to connect. So, I am going to take the coaxial cable from my ISP and plug it into the modem. Next up is the main router which again is the TP-Link Archer C7. To connect the devices together we are going to be using Cat6 ethernet cables and I got some in different colors to color code the network a little. To connect the modem and the router together I am going to use a red ethernet cable, so one end is going to go into the ethernet port of the modem and then the other end is going to go into the wan port of the archer c7. For most people this could conclude the network setup due to the fact that this could provide you enough wifi coverage and enough ethernet ports for all your wired devices. But, for me I require more of both of these devices so to solve the problem of more ethernet ports next we are going to connect the 16 port ethernet switch and to do so we are going to take a yellow ethernet cable and put one end into the first lan port of the router and the first ethernet port of the ethernet switch. After that let's tackle the problem of the wifi. The easiest way to determine how many access points you need is to just to assume where most of your devices are going to be as well as where you think the wifi needs to be stronger. So let's connect our two routers that we are going to use as wifi access points. The thing about these access points is that they are wired access points which means they require an ethernet connection to the network. So the places where I want these to increase the wifi need to have an ethernet connection of some sort. And I am lucky because they do, as I want to put one of these access points in my garage where I have an ethernet cable ran to and then I am going to put the other access point in my room where I have an ethernet jack that goes to the main network as well. But anyway for now we are going to use another cat6 cable for each of the access points and one end goes into the next available ethernet port of the switch and the other end goes into the wan port of the access point. Do this for as many access points you have. And that’s it for the hardware of the network. You do not necessarily have to use this exact setup as I have, but I have found it to work perfectly for the smart house and transmit data very fast and reliably. In the next video we are going to talk about the software and configuring all the devices! Alright thank you for watching and If you have any questions leave them in the comments section below or head over to mksmarthouse.com/forum where you have a better chance of it getting answered. Good Bye!
Hey guys matt here from mksmarthouse.com and in this video we are going to be setting up the software for the home network.
The only thing we are going to need to setup the software in the network is a computer with an ethernet port. I won’t be doing two separate videos for Mac and PC because this is mostly in a web browser which in my case is google chrome. Also, when each one of these 4 videos in the Network series hits 100 likes I will release the video of setting up the home automation server with OpenHAB 2 sooner than it is planned.
First thing we have to do is setup the main router, the Archer C7 from TP-Link. So we are going to take an ethernet cable and plug it into a LAN port of the router and then take the other end and plug it into the ethernet port of the computer. Since I have a 2016 MacBook Pro I needed to use a couple dongles… Anyway, then we have to find the IP address of the router, it is typically 192.168.0.1 or 192.168.1.1 but, on the Archer C7 it is always 192.168.0.1. If you are on Mac you can go to System Preferences then network and look at the router field. On pc you can open command prompt and type in ipconfig and then look at the router field. Next we are going to take that IP address and put it into the address or URL bar in the web browser and press enter. The router’s web page will pop up and will ask for a username and password, for the archer C7 the default username is admin and the password is admin then press login. If you didn’t know this is the router’s user interface and how you can configure and change it as well as show you its status and certain information. Before we do anything we should Upgrade the Firmware of the device. I am not going to show how to do that for this particular router because I have already done it, and because if you do it wrong it could brick your device. If you really want to update the firmware which I recommend, you can google it and find dedicated guides. The first thing we are going to do is head over to DHCP and change the Start IP address to start at 192.168.0.50 instead of 192.168.0.100. Then press save, and a box should pop up, just press OK. The reason I am doing this is because I don’t need 100 reserved IP adresses I only need about 50. Next, I am going to head over to network and then WAN. Then I am going to click the check box next to “Use these DNS Servers” and in the primary DNS type in 8.8.8.8 then in secondary type in 8.8.4.4 then click save. The reason I changed the DNS servers is because I like using google dns servers instead of the default ones. Once we click save it will obtain network parameters again with the new dns server settings. When it finished obtaining head over to Wireless 2.4GHz. Here we are going to change the name of the 2.4GHz wifi network, I recommend doing something meaningful and you can remember because we are going to be using this quite a bit in addition to the password which we will set next. I named my 2.4GHz network K-WiFi then clicked save. Now we are going to change the password so in the left column click Wireless Security and then in the PSK Password field type in a password you would like to use and scroll down and hit save. The 5GHz network is next so click on Wireless 5GHz in the left column. Here we are going to change the name of the 5GHz wifi network and click save. I named mine K-WiFi5GHz. This name should be different than your 2.4GHz wifi network. Then head over to Wireless Security and Change the password in PSK password field and scroll down and hit save. This password could be the same or different than your 2.4GHz network but you should remember it anyway. Next is the Guest Network so click that in the left column. First click the check box to the left of Guest Network (2.4G) and change the name of network, I chose K-Guest then later on I chose K-GuestWiFi. Also, click the dropdown that says disable security and choose WPA/WPA2-Personal and choose a password in the PSK Password field. Then scroll down and hit save. But we are not done yet because now we have to set up the guest 5GHz network. So, click the checkbox next to Guest Network (5G) and change the name of the network, I chose K-GuestWiFi5GHz. Also, click the dropdown that says disable security and choose WPA/WPA2-Personal and choose a password in the PSK Password field, this can be the same or different as the 2.4GHz network. Then scroll down and hit save. Next to apply all these changes we are going to head over to System tools, reboot and press the reboot button, when the box pops up click ok. The device should reboot and the page should become blank, keep hitting refresh until the login box comes up once it does login with the default credentials we talked about before. Speaking of we should change those so go to system tools and password. I kept the username the same of admin and changed the password. Please remember these credentials as we will be using them to access this router many more times in the future. Once done click save. It will automatically log you out, so log back in with your new credentials. And that's it we are done with the main router, next is the wireless access points So, exit out of this tab. Now unplug the ethernet cable from the LAN port of the main router and plug it into a LAN port on the Netgear AC1750. Now, like the main router we have to access the router’s web page. If you are on Mac you can go to System Preferences then network and look at the router field. On pc you can open command prompt and type in ipconfig and then look at the router field. On the Netgear AC1750 it is usually 192.168.1.1 to start of. Next we are going to take that IP address and put it into the address or URL bar in the web browser and press enter. Upon first connection of the router it will automatically run through setup by first checking the internet connection then asking you to set a couple things. First is a password I recommend using the same login password as the main router to keep it consistent when logging into each router to access settings. Next pick and answer two security questions. Then click next. Then it will show you the current wifi settings just ignore them and press take me to the internet. But, we won't be using it as we will type in that router's ip address again to change some settings. There should be a pop up box asking for the username and password, so enter them and press login. First we are going to click the advanced tab, then in the left column click advanced setup then wireless AP. Here click the box next to Enable AP Mode and press apply. When the box comes up press ok. The device will now reboot! Now we are going to open up a new tab and go to the main router’s IP address to find the other router’s new IP address. So type in the main router's ip in the address bar and hit enter. Then log in and go to DHCP in the left column and then DHCP Clients List. Here we can see all the devices connected to the network. But we are looking for our netgear router and here it is at the bottom, it is listed using its model number R6300v2 so we are going to look at its assigned IP which is 192.168.0.53. We are going to take that IP and open a new tab and put that IP in the address bar and press enter. Then we are going to log in. Now we are going to be configuring it to match the main router. So first head over to wireless. Then in the wireless network (2.4GHz) Change the SSID to match the main router's 2.4GHz wifi ssid, in my case that is K-WiFi. Also, change the mode to 450Mbps instead of 217 Mbps in the drop down. We also have to change the 2.4GHz wifi password to match the main router's 2.4GHz wifi password. Next is the 5GHz WiFi Network, and we are going to type in the same 5GHz SSID and password as the main router mine is K-WiFi5GHz. Then we are going to press apply and it will update all the settings. After that click Guest Network in the left column. In the 2.4GHz network match the same SSID as the main router, mine is K-GuestWiFI, Then in the 5GHz also match the same SSID as the main router mine is K-GuestWiFi5GHz. Also, for both the 2.4GHz section and 5GHz section click WPA2-PSK[AES] and match the same password as the main router for each network. Then click the box next to enable Guest Network in both the 2.4GHz section and the 5GHz section. Then hit apply. Lastly, go to the advanced tab then in the left column click administration and router update. Then on that page, in the section that says Check for new version from the internet click the check button. Now it is checking for a new firmware in my case there was none so i clicked back. And that is it we are done configuring the access point so now just click logout in the upper right hand corner. Now unplug the ethernet cable from the access point and plug it into more access points if you have any and repeat the same process. Once you are done configuring the access points we now have to give them static IP addresses so we can always access them from the same address. So, to do this we are going to plug the computer into the LAN port of the main router. Then we are going to open up the web browser and access the main router's web page by typing in its IP address in the address bar and then logging in. Then in the left column go to DHCP and Address Reservation. Ignore what I currently have there and don’t worry that you do not have it. Anyway click the add new button. Now there are two fields one is asking for the MAC Address of the device and the IP Address we want to assign it to. To find the MAC address we simply have to go to the device and look for the tag that says MAC address. But when we type it in everything should be uppercase and separated by a dash every two characters. Once that is entered we have to decide on a IP address for it. Personally I am just going to go in order, so I am going to give this access point 192.168.0.2. The reason I am giving 2 and not 1 is because 1 is reserved for the router so we cannot use that. Anyway now we hit save. Then when the box pops up click OK. Now again since I have two I am going to repeat the same process for the other one except for this one I am going to give it an IP of 192.168.0.3. Then save and OK. Once we are back on the Address Reservation Page there should be a little red warning on the bottom saying to reboot, so press the “click here” to reboot. Then click the reboot button and OK in the pop up box. Then give it a minute to reboot. Once the router is fully booted, reboot each access point by pressing the power button to turn it off for 10 seconds and then pressing it again to turn it back on. Once the access points are fully booted head back over to the computer open a new tab and test out the new IP address. And that is it, the software is fully setup. So, you can go ahead and unplug the computer from the ethernet port of the router as well as from the computer. The network is now ready for final installation which is what we are going to do in the next video. Alright thank you for watching and If you have any questions leave them in the comments section below or head over to mksmarthouse.com/forum where you have a better chance of it getting answered. Good Bye!
Final Install: https://www.youtube.com/watch?v=j41JveqPUQM&feature=emb_title
Hey guys Matt here from mksmarthouse.com and in this video we are going to be finishing up the network by installing it the home.
So what do I mean by final installation, well I mean put all the components where they need to go such as putting the access points in their final locations and mounting the rest of the equipment on the wall. Also, when each one of these 4 videos in the network series hits 100 likes I will release the video of setting up the home automation server with OpenHAB 2 sooner than it is planned. The materials we are going to me using are an impact driver, a tape measure, some random screws, an Open Slot Wiring Cable Raceway, CAT 6 ethernet cables, a label maker and label tape. The links to where to get all the materials and products I use will be in the description. So, let's start off by discussing where I am going to mount it, well I am going to mount it here right next to the power panels. Now I know what some of you may be thinking, electrical interference that's not good. Well, I have had my previous network down here and I have not seen any quality issues or anything so I am going to continue to have it down here, I mean it is my network so I can do it how ever I want and you too can do your network however you want and put it where ever you want. Anyway, as you can see there are currently wires all over the place and the old equipment on the wall. So I am going to start by taking it all off to have a clean and cleared workspace. And there, I tucked some of the wires and removed all the old equipment. I am going to start off by mounting the power strip, so my power strip has 4 holes so I put 4 screws in the wall and just slid it on. Once the power was mounted, I took the router and the modem and played around with its placement to see how I like it. Once I found where I like it, I took a screw and put it in the wall using the impact driver, then I took a tape measure and measured the distance between the two holes on the router. Then I took that measurement and used it to put the other screw in the wall. Then once both screws were in I put the router on the wall. For the modem I applied the same process of putting in a screw, measuring distance, put in the other screw and finally mounting. Then I took the Ethernet switch and played around with its placement. Once I found where I like it I applied the same mounting technique as before. Now that everything is mounted it is time to manage all the cables. I have this cool cable management raceway thing with many holes and slits to run all the cables, it works really well and when I am done I just put the cover on and all the cables are gone. I am going to start off with the power cables. I just put them in the race way and ran them to there destinations. Next is the ISP Coax cable and the yellow ethernet cable in between the router and the switch, I just put them in the raceway and tucked them. Now that we are adding cables it is time to start labeling so we can keep track of all of them and tell where they are going. So, I am going to use this simple DYMO label maker to do so. To make a cable label, I just type in where the cable is going and then I press the print button wait for it to print, and then I press the print button again wait for it to print and then I press the cut button. The label now has the text twice and is very long with a big white space in the middle which is good. Then I just take the backing off of the label and fold it over the cable to create a little double sided flag. I do this for all my cables before I plug it in. Speaking of now I ran all my ethernet cables to the switch using the raceway. As you look at these clips you can clearly tell everything is labeled and can tell where it is going. Now that all the cables are ran we can now put the cover the raceway to hide all the cables. There we go all the cables are managed and labeled! So now it is time to label the hardware starting with the power bricks. If you were to label anything I high recommend labeling the power bricks so that way if you need to unplug it you know exactly what is what. Next I labeled all the hardware and the IP addresses of the devices. I even labeled the access points so I know which is which as well as where as where they go. Speaking of it is now time to install them. The first one we are going to install is on the second floor in my room. To install the access point all we have to do is plug in the power adapter into the wall, then plug an ethernet cable into the ethernet jack in the wall that goes to the ethernet switch in the main network, I used a black CAT6 ethernet cable. Then we take the ethernet cable and plug it into the yellow wan port of the Netgear AC1750 router / Access point. After that we take the other end of the power adapter and plug it into the access point and press the power button to turn it on if it is off. Now this access point is installed and is time to install the Garage Access point. So in my garage I have an ethernet cable running to it from the main house going into the ethernet switch in the main network. I also have an extension cord running from an outlet on the wall to the upper level of the garage so that we have both ethernet and power up there. So, the first thing I did is connect the power adapter into the extension cord so now I have two leads the ethernet cable and the other end of the power adapter. All that's left is to connect the ethernet to the WAN port of the Access Point and connect the power to the DC jack and turn it on. To finish it up i just tucked it away and we are done! The network is now complete, we now have full fast wifi coverage on the whole entire property, as well as a fast ethernet going through the fast ethernet switch. We are now ready to start the home automation and smart home journey. Alright thank you for watching and If you have any questions leave them in the comments section below or head over to mksmarthouse.com/forum where you have a better chance of it getting answered. Good Bye!
Hey guys Matt here from mksmarthouse.com and in this video we are going to be talking about the hardware in the network.
To start off let’s talk about the hardware we are going to be using in the network. But before we do that make sure you like this video because when each one of these 4 videos in the network series hits 100 likes I will release the video of setting up the home automation server with OpenHAB 2 sooner than it is planned. Anyway, the modem we are going to be using is the arris surfboard sb1641. Please note I will not be showing in detail how to setup the modem with the ISP because it is different with each ISP. This is an amazing modem and has many positive reviews all over the internet. Speaking of positive reviews the main router I chose also does, I chose the the TP-Link Archer C7. So these two devices take care of the basic network and for most people that's it for the network. But, since in my house there are a little bit more wired devices I'm going to need an ethernet switch and that is where the D-Link 16-Port gigabit ethernet switch comes into play. Lastly, since I want more wifi coverage, let me rephrase that since I need complete wifi coverage I am going to use these two Netgear AC1750’s. Now you might be asking why I need two more routers. Well these two devices have an access point feature in their software that allows them to act as wifi access points instead of routers and extend the range of the wifi network. The links to where to get all the hardware I will be using is in the description below.
First we are going to reset all the devices to factory settings. So we are going to connect our power strip to power, and then turn it on. The modem and switch don't get reset so we will skip those and move on to the routers starting with the main one the archer c7. Plug the power adapter into the power strip and into the router. Next press the power button in the back to turn it on, then wait a minute or two until the device powers on and the asterisk looking thing flashes slowly. After, press and hold the WPS/RESET button for more than 10 seconds until the SYS LED or Asterisk looking thing becomes a quick flash from a slow flash. Then release the button and wait for the Router to reboot to its factory default settings. Next we are going to reset the Netgear AC1750 so, first we are going to plug the power adapter into the powerstrip then into the device and press the power button into the on position. Then let the device boot for a minute or two. Once it is booted take a paperclip and press and hold the red button down for 10 seconds. Finally the device will reboot. Repeat this reset process for anymore AC1750’s or access points you may have.
To finish off the power distribution let's connect the D-Link ethernet switch to power and the Arris Modem to power, which is just connecting their power bricks to the power strip and then the other ends into the devices. Speaking of power this powerstrip is one that has a surge protector built in which is very important to protect all of the network hardware.
Now that everything is reset and set to as if it is brand new let's get to work. To test everything before we install it we are going to connect everything on a separate table. To start off let's talk about internet connection. Personally I have cable internet meaning that I get my internet from my ISP over a coaxial cable. Therefore I have a cable modem which is the first thing we are going to connect. So, I am going to take the coaxial cable from my ISP and plug it into the modem. Next up is the main router which again is the TP-Link Archer C7. To connect the devices together we are going to be using Cat6 ethernet cables and I got some in different colors to color code the network a little. To connect the modem and the router together I am going to use a red ethernet cable, so one end is going to go into the ethernet port of the modem and then the other end is going to go into the wan port of the archer c7. For most people this could conclude the network setup due to the fact that this could provide you enough wifi coverage and enough ethernet ports for all your wired devices. But, for me I require more of both of these devices so to solve the problem of more ethernet ports next we are going to connect the 16 port ethernet switch and to do so we are going to take a yellow ethernet cable and put one end into the first lan port of the router and the first ethernet port of the ethernet switch. After that let's tackle the problem of the wifi. The easiest way to determine how many access points you need is to just to assume where most of your devices are going to be as well as where you think the wifi needs to be stronger. So let's connect our two routers that we are going to use as wifi access points. The thing about these access points is that they are wired access points which means they require an ethernet connection to the network. So the places where I want these to increase the wifi need to have an ethernet connection of some sort. And I am lucky because they do, as I want to put one of these access points in my garage where I have an ethernet cable ran to and then I am going to put the other access point in my room where I have an ethernet jack that goes to the main network as well. But anyway for now we are going to use another cat6 cable for each of the access points and one end goes into the next available ethernet port of the switch and the other end goes into the wan port of the access point. Do this for as many access points you have. And that’s it for the hardware of the network. You do not necessarily have to use this exact setup as I have, but I have found it to work perfectly for the smart house and transmit data very fast and reliably. In the next video we are going to talk about the software and configuring all the devices! Alright thank you for watching and If you have any questions leave them in the comments section below or head over to mksmarthouse.com/forum where you have a better chance of it getting answered. Good Bye!
Setting Up the Home Network
Software:
Hey guys matt here from mksmarthouse.com and in this video we are going to be setting up the software for the home network.
The only thing we are going to need to setup the software in the network is a computer with an ethernet port. I won’t be doing two separate videos for Mac and PC because this is mostly in a web browser which in my case is google chrome. Also, when each one of these 4 videos in the Network series hits 100 likes I will release the video of setting up the home automation server with OpenHAB 2 sooner than it is planned.
First thing we have to do is setup the main router, the Archer C7 from TP-Link. So we are going to take an ethernet cable and plug it into a LAN port of the router and then take the other end and plug it into the ethernet port of the computer. Since I have a 2016 MacBook Pro I needed to use a couple dongles… Anyway, then we have to find the IP address of the router, it is typically 192.168.0.1 or 192.168.1.1 but, on the Archer C7 it is always 192.168.0.1. If you are on Mac you can go to System Preferences then network and look at the router field. On pc you can open command prompt and type in ipconfig and then look at the router field. Next we are going to take that IP address and put it into the address or URL bar in the web browser and press enter. The router’s web page will pop up and will ask for a username and password, for the archer C7 the default username is admin and the password is admin then press login. If you didn’t know this is the router’s user interface and how you can configure and change it as well as show you its status and certain information. Before we do anything we should Upgrade the Firmware of the device. I am not going to show how to do that for this particular router because I have already done it, and because if you do it wrong it could brick your device. If you really want to update the firmware which I recommend, you can google it and find dedicated guides. The first thing we are going to do is head over to DHCP and change the Start IP address to start at 192.168.0.50 instead of 192.168.0.100. Then press save, and a box should pop up, just press OK. The reason I am doing this is because I don’t need 100 reserved IP adresses I only need about 50. Next, I am going to head over to network and then WAN. Then I am going to click the check box next to “Use these DNS Servers” and in the primary DNS type in 8.8.8.8 then in secondary type in 8.8.4.4 then click save. The reason I changed the DNS servers is because I like using google dns servers instead of the default ones. Once we click save it will obtain network parameters again with the new dns server settings. When it finished obtaining head over to Wireless 2.4GHz. Here we are going to change the name of the 2.4GHz wifi network, I recommend doing something meaningful and you can remember because we are going to be using this quite a bit in addition to the password which we will set next. I named my 2.4GHz network K-WiFi then clicked save. Now we are going to change the password so in the left column click Wireless Security and then in the PSK Password field type in a password you would like to use and scroll down and hit save. The 5GHz network is next so click on Wireless 5GHz in the left column. Here we are going to change the name of the 5GHz wifi network and click save. I named mine K-WiFi5GHz. This name should be different than your 2.4GHz wifi network. Then head over to Wireless Security and Change the password in PSK password field and scroll down and hit save. This password could be the same or different than your 2.4GHz network but you should remember it anyway. Next is the Guest Network so click that in the left column. First click the check box to the left of Guest Network (2.4G) and change the name of network, I chose K-Guest then later on I chose K-GuestWiFi. Also, click the dropdown that says disable security and choose WPA/WPA2-Personal and choose a password in the PSK Password field. Then scroll down and hit save. But we are not done yet because now we have to set up the guest 5GHz network. So, click the checkbox next to Guest Network (5G) and change the name of the network, I chose K-GuestWiFi5GHz. Also, click the dropdown that says disable security and choose WPA/WPA2-Personal and choose a password in the PSK Password field, this can be the same or different as the 2.4GHz network. Then scroll down and hit save. Next to apply all these changes we are going to head over to System tools, reboot and press the reboot button, when the box pops up click ok. The device should reboot and the page should become blank, keep hitting refresh until the login box comes up once it does login with the default credentials we talked about before. Speaking of we should change those so go to system tools and password. I kept the username the same of admin and changed the password. Please remember these credentials as we will be using them to access this router many more times in the future. Once done click save. It will automatically log you out, so log back in with your new credentials. And that's it we are done with the main router, next is the wireless access points So, exit out of this tab. Now unplug the ethernet cable from the LAN port of the main router and plug it into a LAN port on the Netgear AC1750. Now, like the main router we have to access the router’s web page. If you are on Mac you can go to System Preferences then network and look at the router field. On pc you can open command prompt and type in ipconfig and then look at the router field. On the Netgear AC1750 it is usually 192.168.1.1 to start of. Next we are going to take that IP address and put it into the address or URL bar in the web browser and press enter. Upon first connection of the router it will automatically run through setup by first checking the internet connection then asking you to set a couple things. First is a password I recommend using the same login password as the main router to keep it consistent when logging into each router to access settings. Next pick and answer two security questions. Then click next. Then it will show you the current wifi settings just ignore them and press take me to the internet. But, we won't be using it as we will type in that router's ip address again to change some settings. There should be a pop up box asking for the username and password, so enter them and press login. First we are going to click the advanced tab, then in the left column click advanced setup then wireless AP. Here click the box next to Enable AP Mode and press apply. When the box comes up press ok. The device will now reboot! Now we are going to open up a new tab and go to the main router’s IP address to find the other router’s new IP address. So type in the main router's ip in the address bar and hit enter. Then log in and go to DHCP in the left column and then DHCP Clients List. Here we can see all the devices connected to the network. But we are looking for our netgear router and here it is at the bottom, it is listed using its model number R6300v2 so we are going to look at its assigned IP which is 192.168.0.53. We are going to take that IP and open a new tab and put that IP in the address bar and press enter. Then we are going to log in. Now we are going to be configuring it to match the main router. So first head over to wireless. Then in the wireless network (2.4GHz) Change the SSID to match the main router's 2.4GHz wifi ssid, in my case that is K-WiFi. Also, change the mode to 450Mbps instead of 217 Mbps in the drop down. We also have to change the 2.4GHz wifi password to match the main router's 2.4GHz wifi password. Next is the 5GHz WiFi Network, and we are going to type in the same 5GHz SSID and password as the main router mine is K-WiFi5GHz. Then we are going to press apply and it will update all the settings. After that click Guest Network in the left column. In the 2.4GHz network match the same SSID as the main router, mine is K-GuestWiFI, Then in the 5GHz also match the same SSID as the main router mine is K-GuestWiFi5GHz. Also, for both the 2.4GHz section and 5GHz section click WPA2-PSK[AES] and match the same password as the main router for each network. Then click the box next to enable Guest Network in both the 2.4GHz section and the 5GHz section. Then hit apply. Lastly, go to the advanced tab then in the left column click administration and router update. Then on that page, in the section that says Check for new version from the internet click the check button. Now it is checking for a new firmware in my case there was none so i clicked back. And that is it we are done configuring the access point so now just click logout in the upper right hand corner. Now unplug the ethernet cable from the access point and plug it into more access points if you have any and repeat the same process. Once you are done configuring the access points we now have to give them static IP addresses so we can always access them from the same address. So, to do this we are going to plug the computer into the LAN port of the main router. Then we are going to open up the web browser and access the main router's web page by typing in its IP address in the address bar and then logging in. Then in the left column go to DHCP and Address Reservation. Ignore what I currently have there and don’t worry that you do not have it. Anyway click the add new button. Now there are two fields one is asking for the MAC Address of the device and the IP Address we want to assign it to. To find the MAC address we simply have to go to the device and look for the tag that says MAC address. But when we type it in everything should be uppercase and separated by a dash every two characters. Once that is entered we have to decide on a IP address for it. Personally I am just going to go in order, so I am going to give this access point 192.168.0.2. The reason I am giving 2 and not 1 is because 1 is reserved for the router so we cannot use that. Anyway now we hit save. Then when the box pops up click OK. Now again since I have two I am going to repeat the same process for the other one except for this one I am going to give it an IP of 192.168.0.3. Then save and OK. Once we are back on the Address Reservation Page there should be a little red warning on the bottom saying to reboot, so press the “click here” to reboot. Then click the reboot button and OK in the pop up box. Then give it a minute to reboot. Once the router is fully booted, reboot each access point by pressing the power button to turn it off for 10 seconds and then pressing it again to turn it back on. Once the access points are fully booted head back over to the computer open a new tab and test out the new IP address. And that is it, the software is fully setup. So, you can go ahead and unplug the computer from the ethernet port of the router as well as from the computer. The network is now ready for final installation which is what we are going to do in the next video. Alright thank you for watching and If you have any questions leave them in the comments section below or head over to mksmarthouse.com/forum where you have a better chance of it getting answered. Good Bye!
Setting Up the Home Network
Final Install:
Hey guys Matt here from mksmarthouse.com and in this video we are going to be finishing up the network by installing it the home.
So what do I mean by final installation, well I mean put all the components where they need to go such as putting the access points in their final locations and mounting the rest of the equipment on the wall. Also, when each one of these 4 videos in the network series hits 100 likes I will release the video of setting up the home automation server with OpenHAB 2 sooner than it is planned. The materials we are going to me using are an impact driver, a tape measure, some random screws, an Open Slot Wiring Cable Raceway, CAT 6 ethernet cables, a label maker and label tape. The links to where to get all the materials and products I use will be in the description. So, let's start off by discussing where I am going to mount it, well I am going to mount it here right next to the power panels. Now I know what some of you may be thinking, electrical interference that's not good. Well, I have had my previous network down here and I have not seen any quality issues or anything so I am going to continue to have it down here, I mean it is my network so I can do it how ever I want and you too can do your network however you want and put it where ever you want. Anyway, as you can see there are currently wires all over the place and the old equipment on the wall. So I am going to start by taking it all off to have a clean and cleared workspace. And there, I tucked some of the wires and removed all the old equipment. I am going to start off by mounting the power strip, so my power strip has 4 holes so I put 4 screws in the wall and just slid it on. Once the power was mounted, I took the router and the modem and played around with its placement to see how I like it. Once I found where I like it, I took a screw and put it in the wall using the impact driver, then I took a tape measure and measured the distance between the two holes on the router. Then I took that measurement and used it to put the other screw in the wall. Then once both screws were in I put the router on the wall. For the modem I applied the same process of putting in a screw, measuring distance, put in the other screw and finally mounting. Then I took the Ethernet switch and played around with its placement. Once I found where I like it I applied the same mounting technique as before. Now that everything is mounted it is time to manage all the cables. I have this cool cable management raceway thing with many holes and slits to run all the cables, it works really well and when I am done I just put the cover on and all the cables are gone. I am going to start off with the power cables. I just put them in the race way and ran them to there destinations. Next is the ISP Coax cable and the yellow ethernet cable in between the router and the switch, I just put them in the raceway and tucked them. Now that we are adding cables it is time to start labeling so we can keep track of all of them and tell where they are going. So, I am going to use this simple DYMO label maker to do so. To make a cable label, I just type in where the cable is going and then I press the print button wait for it to print, and then I press the print button again wait for it to print and then I press the cut button. The label now has the text twice and is very long with a big white space in the middle which is good. Then I just take the backing off of the label and fold it over the cable to create a little double sided flag. I do this for all my cables before I plug it in. Speaking of now I ran all my ethernet cables to the switch using the raceway. As you look at these clips you can clearly tell everything is labeled and can tell where it is going. Now that all the cables are ran we can now put the cover the raceway to hide all the cables. There we go all the cables are managed and labeled! So now it is time to label the hardware starting with the power bricks. If you were to label anything I high recommend labeling the power bricks so that way if you need to unplug it you know exactly what is what. Next I labeled all the hardware and the IP addresses of the devices. I even labeled the access points so I know which is which as well as where as where they go. Speaking of it is now time to install them. The first one we are going to install is on the second floor in my room. To install the access point all we have to do is plug in the power adapter into the wall, then plug an ethernet cable into the ethernet jack in the wall that goes to the ethernet switch in the main network, I used a black CAT6 ethernet cable. Then we take the ethernet cable and plug it into the yellow wan port of the Netgear AC1750 router / Access point. After that we take the other end of the power adapter and plug it into the access point and press the power button to turn it on if it is off. Now this access point is installed and is time to install the Garage Access point. So in my garage I have an ethernet cable running to it from the main house going into the ethernet switch in the main network. I also have an extension cord running from an outlet on the wall to the upper level of the garage so that we have both ethernet and power up there. So, the first thing I did is connect the power adapter into the extension cord so now I have two leads the ethernet cable and the other end of the power adapter. All that's left is to connect the ethernet to the WAN port of the Access Point and connect the power to the DC jack and turn it on. To finish it up i just tucked it away and we are done! The network is now complete, we now have full fast wifi coverage on the whole entire property, as well as a fast ethernet going through the fast ethernet switch. We are now ready to start the home automation and smart home journey. Alright thank you for watching and If you have any questions leave them in the comments section below or head over to mksmarthouse.com/forum where you have a better chance of it getting answered. Good Bye!