[00:00] Hey guys Matt here from MKSmartHouse.com and in this video I am going to show you how to make your smart home alert you when a door opens. [00:14] As you may recall in my first video on this channel I demonstrated that when I opened Well, since then I have made some changes. What happens now is that when I open the door the LED strip changes to a color and then [00:31] after 5 seconds changes back to the previous state the LED strip was in. The previous state of the LED strip could either be a color or off. Im sitting at my desk with noise canceling headphones on working as fast as I can, to [00:46] Then out of nowhere I hear “What you up to?” What happened was someone entered the house and snuck up on me. [00:58] So, I am still at my desk working hard and then someone opens the door down stairs. The LED strip behind my monitors turns red and stays like that for 5 seconds and then [01:11] Now I expect this person and will not be surprised. Since we have established a practical scenario let me show you how to set it up. [01:24] 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 LED strip control which I have a complete guide for on my channel. [01:40] A fully setup door sensor, I have a guide for this as well. 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 [01:54] because those are the place where I give sneak peaks on when videos are releasing and also 1. The first thing we have to is ssh into the pi so on windows use putty and mac use terminal. [02:12] 2. Next we are going to choose which LED strip or strips to send the alert to. To find that out we are going to look at the items file so type in sudo nano /etc/openhab2/items/home.items [02:29] In the file scroll down to your LED Strip controls and choose which led strip or strips you want to use, they will be the color item type. I am going to be using both MKLEDStripControl1Color and MKLEDStripControl2Color. [02:45] For some of the rules I am going to use 1 LED strip and some I will use 2. Once you figured out which ones you are going to use write them down and press control x. [02:57] Next we are going to modify the rules file so type in sudo nano /etc/openhab2/rules/home.rules [03:09] The first thing we have to do is import the map variable types so type in import java.util.Map The second thing we have to do is create variables to hold the current states of the LED strips [03:24] so underneath the import statement type in var map hsbValueTemp1 = null make the same amount of variables as you do LED strips, since I have 2 I am going to make 2 variables. [03:38] If you remember in the door sensor software videos we made rules for the door sensor that when the security system switch is on then it will send a notification to your phone. Well we are going to be putting a small piece of code before the check for the security [03:52] hsbValueTemp1 = storeStates(MKLEDStripControl1Color) sendCommand(MKLEDStripControl1Color, "360,100,100") before the if statement and press enter. If you named your LED strip differently than mine in the items file then cange everywhere [04:06] you see MKLEDStripControl1Color with the item name of your LED strip. Let me explain what this does, first it initializes the temp value with the current state of the Then it sends a command to the LED strip with the new color to alert with, I have set mine [04:23] If you want to change the color then go to colorizer.org and in the HSV / HSB section 11. Once you chose a color, replace the 3 numbers in your rules file with the numbers colorizer [04:38] 12. Finally after 5 seconds the rules puts the LED strip back to its previous state. If you wanted to make the alert color time shorter or longer then change the 5 to a number [04:51] On this next door sensor I want both led strips to get the alert so I am going to is type createTimer(now.plusSeconds(5)) [| restoreStates (hsbValueTemp1) As you can see to add another LED strip to the rule, I simply added another variable [05:06] initialization, send command with the color and then a send command with its previous That is it in the rules file, press control x then y and enter. Let’s test it out! [05:20] First I am going to test out the side door as you can see when I open the side door the LED strip turns blue for 5 seconds and goes back to the previous color. Next up is the front door and when I open it, both the LED strip behind my monitors [05:34] turns red as well as the LED strip that is supposed to be behind my cubes but I have Finally, that concludes this complete guide to getting alerts through the LED strip. In the description you will find links to all the parts and devices used in the video [05:48] 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. [06:00] section below or head over to mksmarthouse.com/forum. Good Bye!