Secure Home Sensors

Smiley face

Contact Us

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, Lifx and Wemo 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

The sensor can be used to detect tampering at windows, doors and on your car.

If tampering is detected, the system can turn on lights, take a photo and send it as an email attachment and call your cellphone.

Smiley face

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)

Smiley face

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.

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 2 ON” email subject is a command that tells the Raspberry Pi computer to tell the Philips Hue bridge to turn on the bulbs assigned to Group 2.

Smiley face

A control program on the Raspberry Pi reads incoming emails.

Google Assistant can be used to speak to your cell phone and send GMails to the Secure Home Sensors control system. Example: OK Google Send Email To (your email) Subject GROUP 2 ON.

24-Hour Schedules:

The Secure Home Sensors Security System uses two types of schedules:

1. Lighting Schedule

2. Security Schedule

The Lighting Schedule determines if lights are ON, or OFF during each hour of the day. (0 = OFF, 1 = ON)

The Security Schedule determines if individuals have ACCESS, or NO ACCESS during each hour of the day. (0 = NO ACCESS, 1 = ACCESS)

Each type of schedule has default settings, and can be overriden for specific calendar dates.

The schedules are controlled by Google Sheets that are accessed by a URL link over the Internet.

Smiley face

The Secure Home Sensors Control Panel is a Google Sheet that can easily be customized. It contains all of the devices in the system, and has buttons that send action emails to the Raspberry Pi computer in the home.

Smiley face

Vibration Sensor Event Log:

SHS sensors can update a Google Sheet that acts as an Event Log by using an IFTTT trigger. Each time the sensor is triggered a row is added to the spreadsheet showing the date and time of the event.

Smiley face

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.

The system uses well supported, free applications like Google Sheets and GMail. GMail is one of the most reliable message transport systems in the world, and can be used in a home security system.

Google Sheets has a large user community and the Google Sheets API makes automation possible.