Introduction: Receive Picture Notifications When People Approach Your House With HomeKit
In this instructable I will walk you thru recycling an unused Android phone into a remotely accessible video camera via HomeKit, and using a motion sensor to trigger rich picture notifications on your IOS device.
Step 1: Parts List
1 - A running homebridge instance. There are a lot of other guides for this, so I won't repeat this here. I'm using a RaspberryPI 2 for mine.
2 - Apple TV4 or iPad running as homekit hub for remote access to the camera and motion sensor.
3 - A homekit motion sensor. For mine I'm using a X-10 MS14A Motion Sensor that I have had for a long time. This is connected to HomeKit via the homebridge-heyu plugin.
4 - An small bird house that you can repurpose for installing a motion sensor.
5 - An unused Android smartphone. In my case we had a Samsung S4 Mini that wasn't being used anymore.
6 - A charger for the cell phone.
7 - A suction cup cell phone holder. I bought one for $12 from Pacific Mall.
Step 2: Setting Up the Camera
On the phone, install the app 'IP Webcam'
In the app, select the following options:
1 - Video Preferences
- Video Resolution - Set to a maximum of 1920x1080 - make note of this value for later
- Phone Resolution - Set to a maximum of 1920x1080
- Main Camera - Primary Camera
2 - Effects
- Enable text overlay
- Overlay format %x %X
3 - Disable notification
4 - Stream on device boot
5 - Start Server
- Make note of url for phone on bottom of screen i.e. http://192.168.1.237:8080 This will be needed later
Step 3: Install the Camera
Pick a location to install your phone where it can see the location you want to monitor, and you can plug the phone changer. In my case I installed this in the front window behind the curtains.
Use the suction cup phone holder to hold the phone in the window, and plugin the phone.
On your computer, go to the url you recorded on the previous step. You should see the IP Webcam website. From here you can check and see if your phone is pointing the right direction and mirror/flip the display if needed.
Step 4: Configure Your Camera in Homebridge
On your computer running homebridge, install and configure the plugin homebridge-camera-ffmpeg-omx. For instructions on installing the plugin, please look here https://github.com/legotheboss/homebridge-camera-...
For your config.json, please use this as the settings for the camera, where X.X.X.X is the ip address of your phone/camera. For maxWidth and maxHeight please use the values from earlier.
"name": "Front Porch Camera",
"source": "-f mjpeg -i http://X.X.X.X:8080/video",
"stillImageSource": "-i http://X.X.X.X:8080/shot.jpg",
After restarting homebridge, and adding the camera in the Home app you should now be able to see the camera and watch video.
Step 5: Install and Setup Your HomeKit Motion Sensor
In my house I have on older X-10 system with a couple of their motion sensors I wasn't using. And I needed to install this in a location where it could watch the front walkway without being too obvious, so I picked a spot in the front garden, and installed it into a bird house I had lying around. It is a little obvious but not too much. It received an okay WAF score. Also my X-10 system was fully integrated into HomeKit with the homebridge-heyu plugin.
To configure the motion sensor into HomeKet it won't go into detail on this, as each sensor will have their own instructions, but the motion sensor and the camera both need to be in the same room on the Home app for rich notifications to work.
Step 6: Done
You should now start to receive notifications on you IOS device with a picture whenever the motion sensor is triggered. And if you swipe left on the notification you should be given the opportunity to view a larger picture.