Here is quick project summary of the Pi3 Control Hub project created for the Pi IoT Design Challenge - Smarter Spaces with Raspberry Pi 3. The idea here was to create a Hub and spoke network of Raspberry Pi's with the Pi 3 as the Hub , which had Home- Assistant installed on it, which is a powerful open- source home automation platform. And  a few other versions of the Pi used as the spokes , that is

  • Pi B+ and EnOcean sensor Kit and Module, used to automate the blinds
  • Pi Zero and Pi Noir Camera 2 to build a security camera, with Motion installed for intruder detection (" basically to catch the raccoons overturning Garbage bins )
  • Pi A+ with a servo motor to build a key-less door entry system , which can be unlocked using a secret password using a simple python-flask app

Here is a video demo, of some of the features implemented as part of the project

 

As part of the Hub , here are few features I plan on use on a day to day basis

- Controlling the Hue Light bulbs using the Home-Assistant

- Check weather conditions on the Sense Hat before leaving for work in Morning

- Use the Pi Camera connected to the Hub to Monitor stuff , like a print job running on my 3D printer, by opening Home-Assistant on a tablet

- Checking the outside temperature and comparing it to the temperature from the Yahoo weather API, this will be handy in the winter.

- Checking on the picture gallery of the intruder detected, basically checking if I was able to catch some raccoons in action.

- Checking if my Aunt/Mother visited me when i was away,given that they both have a spare key. Here the EnOcean magnetic contact switch connected to door will log an entry in Home-Assistant History, which I can come an check on in the evening.

 

 

 

Here are the links to the various blogs, with a brief description

Spoke 1 - Security Camera

IMG_2852.JPG

(in the image above you see the EnOcean temperature sensor attached which is used send the outside temperature to the Hub aka home assistant on Pi 3 via MQTT)

As part of this spoke a Raspberry Pi Zero with a camera connector was used with a Pi Noir camera V2 was used and we setup motion for intruder detection.

Pi Control Hub: Spoke 1 :Security Camera - setting up Motion to stream video

Using the Single File PHP gallery we create a gallery of pictures that you can access from the Pi Zero, via a web browser on you laptop

Pi Control Hub: Spoke 1 :Security Camera (continued)- Photo gallery of the intruders

And, also designed and 3D printed STL files for an enclosure, which kind-off looks like a security camera , you can find the STL files at

Pi Control Hub: Spoke 1 :Security Camera  -- STL files to 3D print

 

 

Spoke 2 -  Blinds Automation

IMG_2Rt.JPG

This was the most interesting and challenging spoke that was put together, considering this was the first time I was using the EnOcean Sensor kit and module, which meant I ran some basic test using FHEM and tried blink a few LEDs when the EnOcean push button was pressed + Temperature module detected temperature + Magnetic contact was Open/Closed , which were all connected to Raspberry Pi B+ via the EnOcean module.

Pi Control Hub:Spoke 2:Blinds Automation-- Setting up EnOcean Sensor and Blinking LEDs

To open and close the blinds the plan was to use a gear motor which was driven by the Sparkfun motor driver , when a EnOcean push button was clicked

Pi Control Hub:Spoke2:Blinds Automation(continued)--Driving Motor with EnOcean PushButton

Lastly we 3D printed an enclose for the Pi B+ and EnOcean module and a mount for the gear motor , the STL files can be found at

Pi Control Hub:Spoke2:Blinds Automation(continued)-3D Printing Holder and Motor mount

 

Blinds Automation using Raspberry Pi and EnOcean Sensor Kit

 

 

Spoke 3 -  Key-Less Door Entry

IMG_2593.JPG

As part of this spoke a Pi A+ was used with a servo motor. In addition, a python-flask application was written which was hosted on the Pi A+ connect to my home Wifi. This App will be used to unlock the back door using a secret password which was setup in the code.

Pi Control Hub:Spoke3: Key-less Door entry-testing the Servo

The challenge with this spoke was to design the files to 3D print to find the door knob and the servo mount, if you plan to replicate this you can find the STL files at

Pi Control Hub:Spoke3: Keyless Door entry STLs

 

Key-less Door Entry using the Raspberry Pi

 

HUB

For the Hub as mentioned above Home-Assistant was installed on the Raspberry Pi 3, and as part of the first blog we set a lot of sensors that included

- Weather from the Yahoo API

- Bandwidth speed test

-Monitoring  your favorite twitch channels

-Getting today's value of BitCoin

-Getting the Pi 3 CPU usage and Disk space usage

IMG_2820.JPG

 

In addition we also setup the Phillips Hue bridge and setup an automation rule to switch on the light when you are at home, using the bluetooth of the your phone.

Pi Control Hub: Setting up Home Assistant+Controlling  Philips hue

Home Assistant setup on Raspberry Pi3 - testing Philips Hue bulbs

 

Now, no home automation project is complete with out music , which meant the setup of Mopidy with a couple of speakers and Adafruit s Stereo 3.7W Class D Audio Amplifier, for the circuit and commands check out

Pi Control Hub: Music with Mopidy and Home Assistant

Mopidy setup with and Home Assistant on a Raspberry Pi 3

 

The next blog shows how to setup the Pi Camera V2 in Home Assistant to stream video, and also integrate the feed from the security camera spoke

Pi Control Hub: Integrating Camera's in Home Assistant

 

Now to develop the case to fit all electronic components, a mix of 3D printing and basic wood working with a Dremel was used and we also installed Chromium on raspbian-jessie

Pi Control Hub: The HUB

 

And as part of the final blog we integrated the EnOcean Temperature Sensor and the Magnetic contact sensor which mimics the door opening and closing in Home-Assistant , by installing mosquitto MQTT broker on the Pi 3 and installed MQTT client  on the Pi B+ which is connected with the EnOcean module.

Pi Control Hub : Getting EnOcean Sensor data to Hub via MQTT

MQTTfhem.png

(n the screen shot above , the left hand side is the terminal running the program to get the EnOcean Temperature and Magnetic Contact sensor values on Pi B+ connected to the EnOcean module + FHEM event monitor in the browser. And the right,  is Home Assistant dashboard showing the two sensors EnOcean Temperature in circle in the middle and the Door represent the magnetic contact sensor, which is the last circle on the right,  installed on Pi 3, aka the Hub.)