Turn an Old Phone Into a Smart Doorbell Camera With Facial Recognition
Introduction: Turn an Old Phone Into a Smart Doorbell Camera With Facial Recognition
CREDIT
This how to would not be possible if it weren't for <PERSON> & <PERSON> creating this article on Hackster.io. Please check it out.
Announce Who Is Home Using Facial Recognition
ASSUMPTIONS
* You have a basic understanding of YAML
* You can run docker containers
+ Windows
+ Unraid
+ Raspberry Pi
* You have a Home Assistant instance running
* You have a Facebox instance running
* You have a MotionEye instance running
Supplies
* IP Webcam - https://play.google.com/store/apps/details?id=com...
* MotionEye - https://github.com/ccrisan/motioneye/wiki
* Unraid - https://github.com/ccrisan/motioneye/wiki
* Docker - https://github.com/ccrisan/motioneye/wiki
* Facebox - https://github.com/ccrisan/motioneye/wiki
* Home Assistant - https://github.com/ccrisan/motioneye/wiki
* Discord - https://github.com/ccrisan/motioneye/wiki
* Google home devices
Step 1: Getting Home Assistant Ready for MotionEye
Add two input_booleans to your Home Assistance configuration.yaml file.
front_door_motion_sensor gives us a way to turn a switch off and on using MotionEye
front_door_motion_sensor_face_detect_this_pass We will use this later when we are making automations
configuration.yaml
input_boolean:
front_door_motion_sensor:
initial: off
front_door_motion_sensor_face_detect_this_pass:
initial: off
Below that we can add a binary sensor that ties directely to input boolean we just made.
front_door_motion_sensor gets it value directly from the input_boolean with the same name
configuration.yaml
binary_sensor:
- platform: template
sensors:
front_door_motion_sensor:
entity_id: input_boolean.front_door_motion_sensor
device_class: motion
value_template: '{{ is_state("input_boolean.front_door_motion_sensor", "on") }}'
Step 2: Create Long Live Token to Use With MotionEye
1. In Home assistant click on the user profile name
2. Scroll all the way down
3. Click Create Token
4. Name the token
5. Save the token for later
Step 3: Install IP Webcam on Your Phone
1. Install IP Webcam from the app store
2. Start the app
3. Click start server
4. Save the URL provided from the app
*You will need to assign your phone a static IP so that the URL doesn't change
Step 4: Connect Your Phone to Motioneye
1. Click the hamburger on the left
2. Click the drop down
3. Click add camera...
4. choose Camera Type - Network Camera
5. 141
Type the URL from the IP Webcam app and add "/video" to the end
1. Example: http://<IP_ADDRESS><PHONE_NUMBER>:8080/video
6. Click inside the camera input
1. An MJPEG Network Camera should appear
7. Click OK
The camera from your phone should now be connected to MotionEye.
Step 5: Configuring MotionEye Camera Settings
1. Scroll down to Video Streaming
2. Make sure Video Streaming is ON
3. Scroll down to Motion Detection
4. Make sure Motion Detection is turned ON
1. You will have to adjust the settings in the area to make sure your MotionEye isn't detecting motion too much or too little
5. Scroll Down to Motion Notifications
6. Turn on Run A Command
7. Edited the following string and paste it into the Run A Command
1. You will need your Home Assistant Long Lived Access Token that you made earlier
2. You will need your Home Assistant IP address and port
curl -X POST -k -H "Authorization: Bearer [YOUR TOKEN GOES HERE]" -H "Content-Type: application/json" -d '{"entity_id": "input_boolean.front_door_motion_sensor"}' http://[YOUR HOME ASSISTANT IP ADDRESS AND PORT]/api/services/homeassistant/turn_on
8. 141