Secure Home Sensors

Smiley face

Philips Hue API

Network Camera

PIR Motion Sensor

GMail Controller

VoIP Calls Using IFTTT.com

Conclusions

Smiley face

The Secure Home Sensors devices include:

1. Vibration Sensor

2. Passive Infrared (PIR) Motion Detection Sensor

3. Network Camera

Each of these devices incorporates a Raspberry Pi Zero computer that has a WiFi connection to your local home network, as well as, Internet connectivity.

These devices communicate with one another over the WiFi network to create an intelligent, integrated home security system.

Vibration Sensor:

The vibration sensor from Secure Home Sensors has a multitude of uses in your home and in your car. It uses IFTTT.com Maker Webhooks to communicate with other systems in your home, such as Philips Hue lighting.

The Secure Home Sensors vibration sensor can also work directly with the Philips Hue API to control the lights without using IFTTT.com.

Philips Hue API Developer

Step-by-step examples are shown below.

The sensor can be used to detect tampering at windows, doors and on your car. If someone tries to open your window the sensor will be triggered and can turn on lights in the room, or outside of the house. It can also send you an email alert.

Smiley face

The Secure Home Sensors vibration sensor connects to other systems in your home like lights and security cameras by using IFTTT.com.

The tutorial below gives a step-by-step example of how the vibration sensor is configured to work with a Philips Hue lighting system.

To start using IFTTT Maker Webhooks you must create a new account and obtain a security key.

Sign Up

Smiley face

After you sign in to your new account you can go to My Applets and click on the New Applet button.

Smiley face

When you see the New Applet page, click on the “+” symbol to the left of “this”.

Smiley face

On the Choose a Service page type in “webhooks” and click on the Maker Webhooks icon.

Smiley face

On the Choose Trigger page click on “Receive a web request”.

Smiley face

Type in “vibration_sensor” as the Event Name.

Click on “Create trigger” and you will be taken back to the “if then that” page, which will show the Maker Webhooks icon.

Smiley face

Next, click on the “+” symbol to the left of “that”.

Smiley face

Type “hue” in the search box and click on the Philips Hue icon.

Smiley face

On the Choose Action page click on the tile named “Turn on lights”.

Smiley face

At this point, IFTTT will connect to your Philips Hue bridge and display the names that you have assigned to lights, or groups of lights in your system.

Click on the light name that you want to be turned on when the vibration sensor is triggered.

Smiley face

Next, click on the “Create action” button.

Smiley face

The action will be created and displayed on the Review and Finish page.

If everything is correct, click on the green tile and the applet will be created.

Smiley face

On your My Applets page toggle the applet to “On”.

Smiley face

To change the Hue lights configured to work with the vibration sensor click on the gear icon.

Smiley face Smiley face

On your My Applets page click on the Activity tab to see actions that have occurred on your new applet.

Smiley face

You can test the action from a URL without running the vibration sensor.

https://maker.ifttt.com/trigger/vibration_sensor/with/key/ (KEY)

To implement the new IFTTT EVENT with the vibration sensor a configuration file on the SD card on the sensor is edited to include:

[ifttt]

maker_channel_key = (paste your key here)

maker_channel_event = vibration_sensor

Multiple events can be triggered from the sensor.

The vibration sensor can send a secure email to your GMail account.

This is done by editing the email section of the configuration file to include:

[gmail]

send_address = send_account@gmail.com

smtpUser = your_account@gmail.com

smtpPass = (type your password here)

IMPORTANT NOTE: Your GMail Account Name and Password are entered by you and stored locally on the vibration sensor. Nobody else has access to this information.

Smiley face

Putty can be used to access the vibration sensor configuration file from a laptop computer.

Smiley face Smiley face

FileZilla can be used to copy the configuration file from your PC to the vibration sensor.

Smiley face

The Secure Home Sensors vibration sensor can work directly with the Philips Hue API to control the lights without using IFTTT.com.

To use the Philips Hue API you will need to know the IP address of your Hue bridge.

You will also need to create a Hue user that will be associated with the vibration sensor.

Using the Philips Hue API:

Philips Hue API Developer

To get the IP address of your Hue bridge use the following URL in your browser:

https://www.meethue.com/api/nupnp

"id":"001788fffe1805f0","internalipaddress":"192.168.1.73"

Copy the bridge IP address for use in the vibration sensor configuration file.

You will create a new user by using a Hue tool named "clip.html."

Before executing a command with the tool, you must press the button at the center of your Hue bridge to communicate with it.

Smiley face

In the Command Response window there is a User ID in quotation marks to the right of "username".

Copy it (excluding the quotation marks) and paste it into a text file. You will need to use it in the vibration sensor configuration file.

[ { "success": { "username": "mpYAuqeheiD3E6DHWrrqiKMaNc0GWR8oDzjxMIjY" } } ]

Smiley face

The vibration sensor configuration file will have the following entries for Hue:

[hue]

hue_user_id = mpYAuqeheiD3E6DHWrrqiKMaNc0GWR8oDzjxMIjY

hue_bridge_ip = 192.168.1.73

bulb_group_number = 1

NOTE: The bulb group number is the Hue bulb group that will be turned on when the vibration sensor is triggered.

Smiley face

The vibration sensor uses a 5V A/C adapter that has a micro USB connector.

It can also be used with any rechargeable power bank with a micro USB connector and a 5V output, such as RavPower.

Smiley face

The IP address of the vibration sensor can be seen by looking at your WiFi router from a browser. For example, an AT&T router can be seen by entering 192.168.1.254 as a URL.

Smiley face

Network Cameras:

The Secure Home Sensors vibration sensor can be used to trigger multiple security cameras and lighting systems at the same time.

The ability to use independent sensors that are not built in to the security camera is a major advantage.

Smiley face

Secure Home Sensors has developed a security camera based on the Raspberry Pi Camera Module V2, which uses an 8 megapixel Sony sensor.

Smiley face Smiley face

The indoor camera is very small, and can be placed anywhere in your house near an A/C power outlet.

The Secure Home Sensors network camera also has a break-proof, weather-proof high impact PVC case for outdoor use. It requires access to an A/C power source.

Smiley face

The vibration sensor communicates with (triggers) the camera over the local WiFi network.

Smiley face

When the camera receives a vibration alert over the network, it turns on Philips Hue lights, takes a photo and sends it as an email attachment to your email address. It can also call your cell phone.

Smiley face

Image files created by the camera can automatically be sent to a Dropbox folder, and viewed in Dropbox.

Smiley face

The vibration sensor can be used in your car when it is parked in your driveway if your WiFi system can reach it.

If an intruder tries to steal your wheels, or your car, the sensor will be triggered and turn on lights in your home. It can also send an email alert notifying you that the event has taken place.

Smiley face

The sensor can be used to monitor appliances in your home that create vibrations when they run. For example, it can monitor your washing machine and notify you when a wash cycle is completed.

Smiley face

The vibration sensor can be used as a "tap switch" to turn on lights in your home.

You can tap on the sensor, or the table that the sensor is on, and turn on your lights.

The sensor can be triggered to turn on your lights from anywhere on the Internet by entering a URL with a security key from a web browser.

https://maker.ifttt.com/trigger/vibration_sensor/with/key/ (KEY)

Smiley face

PIR Motion Sensor:

A passive infrared sensor (PIR) detects changes in the amount of infrared radiation reaching it, which varies depending on the temperature and surface characteristics of the objects in front of the sensor. When a person passes in front of the background, such as a wall, the temperature at that point in the sensor's field of view will rise from room temperature to body temperature, and then back again. The sensor converts the resulting change in the incoming infrared radiation into a change in the output voltage, and this triggers the detection.

Smiley face Smiley face

GMail Controller:

Using the Secure Home Sensors system it is possible to control devices using Gmail.

For example, a “GROUP 1 ON” email title could tell the Philips Hue hub to turn on a group of bulbs assigned to the kitchen.

Smiley face

The control program on the Raspberry Pi reads incoming emails.

VoIP Calls Using IFTTT.com:

Setting up VoIP calls in IFTTT.com allows an email to trigger an alert call to your cell phone. The vibration sensor, or motion sensor sends a GMail to IFTTT that triggers a call to your cell phone.

Conclusions:

The Secure Home Sensors security system demonstrates that a Raspberry Pi Zero computer can be used to create a vibration sensor, PIR motion sensor and a network camera, and that these devices can communicate over the local WiFi network with one another, as well as, connect with remote Internet devices and services.

This combined local and remote connectivity is very important, and cloud-based platforms like Amazon Web Services Greengrass recognize that both are needed.

IFTTT.com is a step toward simple rules-based "recipes" that allow event-driven control.

The IFTTT interface displays the connections (configuration) and a history of interactions, but is not a control panel for the entire home automation system.

To change IFTTT configuration apps the user must manually edit the system.

There are a number of open source control systems like OpenHAB that have a user interface with devices, rules, settings and a dashboard. However, these systems are not easy to setup and use.

Vendor solutions like SmartThings can be configured with cross-vendor devices, but these systems are not easy to setup and use.

There is no universal control language, or logic that works on all of these systems, and they are programmed in several different computer languages that use incompatible frameworks and platforms.

Installing and setting up most home automation products requires registration on the vendor's website, and in some cases the product requires a constant connection with their Internet cloud service to work.

Most of these products require a smartphone app to use the system, or to re-configure it.

A much easier approach is to be able to control the system with a generic application that runs everywhere like GMail.

Most people have never thought about using email to control home automation, but do understand it's use for notifications sent from a home security system.

Simple text-based commands can be used with a GMail-based control system. "Turn On the Kitchen Lights" is easy to remember, and doesn't require any navigation in a complicated user interface.

This is much easier than using touch gestures, sliders, buttons and other UI controls on a smartphone.

For a GMail-based control system to work it must continually read incoming emails and communicate with devices on the local WiFi network to do things like turn on lights, start a camera video recording, unlock a door, etc.

An inexpensive Raspberry Pi Zero computer can be used for GMail-based control.