Accurate Motion from IP Camera

I recently purchased and hooked up some zwave motion sensors to write automation for my IP Camera. I have an outdoor camera on the front porch, and its currently setup to e-mail a picture and record a small 60 second clip of the time there was motion. The camera’s built in motion detection is based on change in pixels, and its terrible for outdoor use. So many environmental effects will trigger an e-mail. So I get way too many false alarms.

My goal is to utilize the door sensor and outdoor motion sensor (near camera) to generate more accurate e-mail notifications (and attach screen grab from current camera frame). The camera has a .jpg that is generated and accessible via a local URL. Perhaps there is something I could trigger serverside that would pull down and attach that image.

automation 16:
alias: ‘E-mail Notification with Motion’

trigger:
- platform: state
entity_id: binary_sensor.front_porch_motion_motion
from: ‘off’
to: ‘on’

condition:
- condition: state
entity_id: binary_sensor.front_door_sensor
state: ‘off’

action:
- service: homeassistant.turn_on
entity_id: custom_program

This would be a simple automation that I need to build off of but is an example of my sensors… but to be more specific about what I want to do:

I would like an e-mail attachment when there is motion.

I would like it to be disabled when the door is open or if the door was shut in the last 5 minutes. This would stop false alarms, like taking a dog out for a few minutes.

I really don’t know where to start with pulling the still image that is currently displaying on a URL provided by the camera.

This post can help you I think.

1 Like

You can make a template sensor to track the state of the door being open or shut for the period of time and make that state one of your conditions.

1 Like