Friday, September 22, 2023
Google search engine
HomeSmart HomeHow to build a Smart home using open source and Raspberry Pi

How to build a Smart home using open source and Raspberry Pi

Smart home is something you want when you are looking to save time for doing menial tasks like going to a tube light to switch it on or when you want to know what the weather is without being too sure if it spells ‘wheather’, ‘whether’ or ‘what is synonym for climate?’.

If you are a perfectionist and like things a certain way, you might want to go an extra mile and build an open source smart home hub device yourself tailored to your particular needs. So, the first Question to pop in a keen mind such as yourself is, “What actually is a smart home hub?” To explain with an example, just like the central processing unit is the brain of a computer and controls all its connected devices after you give simple commands, a smart home hub is the brain of a larger system of compatible devices like tube lights, fans, television, blinders, etc which you can automatically control by just giving simple modifiable commands to the Smart home hub.

Open sources are sources that do not require permission to access, are generally free to the public and usually credible in nature and as mentioned earlier, those individuals and families with specific needs, can build a smart home hub themselves using relevant hardware and opensource platforms mostly available for free on the internet giving them more freedom for customizations. Some of the key advantages of the this home open source automation is that it does not take a toll on your electricity bill because of its low power consumption; can work with just a stable internet connection with significantly low data consumption due to its ability to sleep and wake according to use. 

Now since we are clear that a smart home hub built personally with a home automation open source platform is called an ‘opensource smart home hub’, we can move onto the next question in order, ‘What are the good open source solutions?” A number of home automation open source platforms are available online that assist in building a smart home, and some of the most commonly used open sources include OpenHAB, Home assistant, HomeGenie and Mozilla webthings. If we are to explain in brief about the listed open source platforms, we would like to mention the following:

  1. Home Assistant: Like OpenHAB, Home assistant is also one of the most popular home automation open sources that can run from a basic Raspberry pi computer to a network attached storage device. It has compatibility with over 1400 devices ranging from lights to sensors, VoiceUI to alarms and so on. Home Assistant also has the facility to integrate with Alexa and google nest hub. It gives you cloud facilities for data storage and is coded in PYTHON computer language. Not just that, it is easy to install, has a user- friendly mobile application or inter face and most importantly, it is an absolutely free home automation open source platform. It is released under an MIT licence and can be downloaded from Github.  
  1. Mozilla webthings: Also called Mozilla’s things gateway. It is an opensource home automation software that runs on the idea of ‘Web of things’ which basically aims to connect real life electric devices to the world wide web or internet. Therefore, it can roughly be translated into ‘the Internet of devices. Yes, it is a software reference and not a philosophical one for you dreamers. It is one of the platforms that is recently receiving a lot of public attraction in the community. Its mechanism of action basically is that it allots, ‘Things URLs’ to the compatible device to make them recognizable and controllable by the user. Since it is a relatively new software, it has not quite yet matched to the diversity of OpenHAB and home assistant open source home automation platforms but it is developing and getting better with time. 
  2.  

Mozilla webthings is a no fuss simple and effective… There is no hype about its fancy UI. But there is the thing… it works without being noticed…

  1. OpenHAB: It stands for ‘open home automation bus’ and is one of the most widely used platforms because of its user- friendly nature and compatibility with many other devices. One of the key reasons people prefer open source platforms for home automation rather than already existing smart home hubs like Alexa and google nest hub, is privacy concerns. Yet, there are many individuals who feel secure and would like to add on the facilities given by these smart home hubs and OpenHAB gives the facility to combine your smart home with these smart hubs and is therefore a highly sought out after piece of software. Moreover, OpenHAB runs on a variety of operating systems like LINUX, Windows, MacOS and has compatible apps for both android and apple products making it one of the best Home automation open source available for making a wonderful user friendly Opensource Smart home hub. It is released under Eclipse public licence and it can be downloaded from Github
  1. HomeGenie: For a developer enthusiastically looking forward to build an open source smart home hub, HomeGenie might just be the home automation opensource platform he or she is looking for. It prides in itself for its user- friendly nature for even new users. It runs mainly on LINUX, Windows and MacOS. Though being a wonderful platform, it does not quite reach the level of service provided by OpenHAB and Home assistant. Neverthelessss, this home automation platform is also backed by a strong community, enough to gain mention here. 

Now for the important part of this article, lets go on a journey to find out how to build your own ‘Raspberry pi home automation system’ using the Mozilla webthings platform as your primary software. So, first let us get acquainted with the basics. To build any smart home hub device, you would need some hardware, preferably something that can be plugged in or connected to other devices and which would also have the ability to have devices get plugged, into itself; you would need a local network connection or WiFi connection; and you will also ultimately need a software to programme it which is so generously available in the open source websites. Here, in our scenario, we are making a ‘Raspberry Pi home automation system’ where raspberry Pi will be our hardware and Mozilla’s webthings will be the software. 

  1. Hardware: Appropriate for opensource home automated smart home hub! 

Now, raspberry pi is a Single Board Computer(SBC) which can be connected to other computers and has the facility of a USB port. For the Purpose for Mozilla webthings raspberry pi 3 Model b+ or Raspberry Pi Model 4 are suitable. Raspberry Pi has network supports like Bluetooth and WiFi for better connectivity.

2. Since the raspberry pi is a Single Board Computer , we need to have a SD card to enter the software. Preferably 16GB or higher(upto 64GB) 

  1. You will need wires for connection and a power source.
  2. You will also need the compatible devices such as lights and sensors which you wish to ultimately control after building the ‘Raspberry Pi smart home’. 
  3. Software: A helpful Home automation open source! 
  4. You’ll need to now download the Things gateway software from  here and transfer it into the SD card.  Etcher is a graphical application for Windows, Linux and MacOS which can assist in safely transferring the software. 

2. Github.com also gives a detailed set of instructions (You can insert the following code for a headless boot)

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
 
network={
    ssid="my_wifi_ssid"
    psk="my_password_in_plaintext"
    key_mgmt=WPA-PSK
}
  1. First time set-up: Excited for your Raspberry pi smart home? then Follow the following steps:
  1. Before you start the Raspberry Pi inserted with the SD card, make sure there is a USB broadband dongle like ZIGBEE or Z- wave attached to it, so that when you start the raspberry pi, it emits a local hotspot connection which is recognisable by your computer.
  2. The hotspot name would be, “Mozilla IoT Gateway” which when you connect from your computer will take you directly to the set-up page.
  3. First you will be given an option to connect to a WiFi network to which if you agree, you will be prompted to set up a wifi password making your connection secure. 
  4. Remember to stay connected to this network for the whole set up. After that , you will have the option to choose a subdomain for your gateway which will generate an SSIL certificate for you, but if you choose to make your own domain, you have to apply for the certificate separately.  
  5. You will then be securely redirected to your new subdomain and you’ll be prompted to create your user account on the gateway.
  6. You are now ready to add ‘things’. 
  7. Adding ‘things’: The essence of open source home automation!
  8. You will notice a ‘+’ sign at the bottom right of your screen. Click on it and it will put all the compatible devices that you have currently attached to the raspberry pi with adapters into pairing mode. Each device has its own set of instructions to fully pair which have to be followed. At the end all connected devices can be seen on the ‘Things’ screen. You have now successfully connected all ‘Things’ which can be controlled with just a tap or if you wish to have more control, you may click on ‘Expand’ option and if the device supports more commands, it will be displayed. 

2. Rules engine: for further customization you can use rules engine which also supports, ‘If this, then that’ kind of rules. For example, ‘If plug A is switched on, then switch off Plug B’. You may give each rule a name if you like and view it on the rules engine screen. 

3. Floor plan: As the name suggests, by clicking on this option you can set up a floor plan of all compatible and paired devices across your house. You can click the pencil icon or edit button to view the image of your floor plan. You’ll need to create the floorplan image yourself. To assist you for this online tools or graphics editors are available, or you can just scan of a hand drawn map of your home. You can arrange devices on the floor plan by dragging them around the screen. Don’t forget to save.

4. Voice UI: One of the striking features of the Mozilla webthings gateway is it allows the Raspberry pi smart home to be controlled with voice commands. To do this, go to the ‘experiments’ option in settings. Once the ‘Speech command’ setting is on, a microphone icon will appear with the rules engine and floor plan icon. If your mobile or computer has a microphone, you can tap the microphone and issue a voice command to the anny connected device or to a room of connected devices like, “turn bedroom lights on”.

You have now successfully created a raspberry pi smart home using a raspberry pi home automation method with the help of open source home automation software which in this case in Mozilla Webthings. 

Based of properties, these are the capabilities and functions that the Mozilla webthings can perform!

For the simple minds of your family members, all these technicalities will sound jargon! If you wish to impress them, the best way is to switch on a smart bulb without having to get up from your chair. In order to do this, it is essential for you to know at least some of the smart bulb companies that can be connected to the raspberry pi smart home. here are a few:

  • EUFY
  • LIFX
  • MEROSS (or are only plugs supported?)
  • Philips Hue (via Zigbee)
  • Sengled
  • TP-Link
  • Wemo
  • Yeelight
  • Via Zigbee – Cree, Tradfri, Osram, Sylvania,
  • Via Z-Wave – GoControl

And for those of you who wish to go the extra mile, here are a few more devices:

  1. Thermostats:   Zen Thermostat, the Centralite HA 3156105 and the Z-Wave Honeywell TH8320ZW1000.
  2. Smart locks:  Yale YRD226 Deadbolt and Yale YRD110 Deadbolt.
  3. Motion sensors:  SmartThings Motion Sensor and SmartThings Multipurpose Sensor.

So, it should be evident by now as to why Mozilla webthings is gaining so much attraction, It is mainly because of 2 reasons, it is ‘free’ and it ‘lets you do your own thing’. With customization becoming the norm these days to stand out in community, enthusiastic users are now increasingly swarming towards Raspberry smart homes equipped with Mozilla. 

There are certain differences between the established open source home automation platforms like OpenHAB, Home assistant and Mozilla things gateway. To count a few:

  1. Home assistant is python based and Mozilla is java scripted.
  2. Mozilla allows for more customization and comprehensive floor planning.
  3. Since OpenHAB and Home assistant can connect to Alexa and google nest hub, security/ privacy concerns continue to exist.
  4. Raspberry Pi 3/4 is a light weight device with options for a lot of connections.

To some extent we can presume that Mozilla webthings might just replace the proprietary smart home hubs like Logitech harmony and Wink. This is mainly due to a more appealing user interface of Mozilla . Mozilla webthings is the go-to platform for a single home, its user interface is not as fancy as OpenHAB or Hassio making it more understandable for newbies. It is a simple system with huge potential to improves, it has universal connection with most devices and has a free cloud storage facility unlike some home automation open sources like Hassio. Being independent, it has the potential for much better voice command integration than the likes of Alexa, Google nest hub, Lenovo smart displays and other paid open sources. Alexa and google also do not generally support Z- wave and ZIGBEE. 

One of the other key features is the diversity shown by Raspberry Pi, as it can not only make smart home hubs but also printers, gaming machines, smart TVs, assists in basic robotics, still cameras and many more things. 

To explain one of the features you can customize, here is an example, ‘Smart Door- bell ring, automatically switches on the door camera to take a snapshot.’ This has such positive security applications and so on. Here, the command to take a snapshot was an automated command which you don’t have to make separately every time giving you the benefit of convenience! 

So, there you have it, Opensource smart home hubs are the future of fine housing with Raspberry Pi smart home taking the lead with Mozilla webthings being the most ideal home automation opensource candidate. 

 
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments