home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.42k stars 30.31k forks source link

Add camera service to allow recording/snapshotting #835

Closed turnrye closed 8 years ago

turnrye commented 8 years ago

This feature is on the website but not yet implemented. I intend to implement this, but I'd love to hear others opinions of how it should behave.

"I would expect a service to make a snapshot, store it in a configurageble location that defaults to /snapshots. That would be enough for MVP"

Bart274 commented 8 years ago

I would love to be able to save snapshots in a configurable location. It would be great if you could have the same options as yawcam... (Name, number of saves, date in filename,...)

Op 2 jan. 2016 om 23:32 heeft Ryan Turner notifications@github.com het volgende geschreven:

This feature is on the website but not yet implemented. I intend to implement this, but I'd love to hear others opinions of how it should behave.

"I would expect a service to make a snapshot, store it in a configurageble location that defaults to /snapshots. That would be enough for MVP"

— Reply to this email directly or view it on GitHub.

kennedyshead commented 8 years ago

I made something on this for Motion. I did it as a restful wrapper for their shitty http service protocol ;) motion_restful

The thing missing atm is listing latest recordings, wich motion saves to a given db with one table:

CREATE TABLE `security` (
  `camera` int(11) DEFAULT NULL,
  `filename` char(80) NOT NULL,
  `frame` int(11) DEFAULT NULL,
  `file_type` int(11) DEFAULT NULL,
  `time_stamp` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
  `event_time_stamp` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

There is also frontend support missing for this in hass if I understand things correctly.

But whats working is ON/OFF for motion detection recording which is very useful

Bart274 commented 8 years ago

Too bad it's only for Linux and not for windows

Op 3 jan. 2016 om 11:03 heeft kennedyshead notifications@github.com het volgende geschreven:

I made something on this for Motion. I did it as a restful wrapper for their shitty http service protocol ;) motion_restful

The thing missing atm is listing latest recordings, wich motion saves to a given db with one table:

CREATE TABLE security ( camera int(11) DEFAULT NULL, filename char(80) NOT NULL, frame int(11) DEFAULT NULL, file_type int(11) DEFAULT NULL, time_stamp timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), event_time_stamp timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; There is also frontend support missing for this in hass if I understand things correctly.

— Reply to this email directly or view it on GitHub.

kennedyshead commented 8 years ago

Yes it is :/ Its quite easy to setup a small linux-dist on something like raspberry or cubieboard somewhere in the network though (or in virtualbox). I think this would work though https://github.com/kfei/dockmotion

Bart274 commented 8 years ago

Thanks for the tip, I'll try it later this week! :)

Op 3 jan. 2016 om 11:27 heeft kennedyshead notifications@github.com het volgende geschreven:

Yes it is :/ Its quite easy to setup a small linux-dist on something like raspberry or cubieboard somewhere in the network though (or in virtualbox). I think this would work though https://github.com/kfei/dockmotion

— Reply to this email directly or view it on GitHub.

kennedyshead commented 8 years ago

Just remember that motion_restful is just a POC :P

brusc commented 8 years ago

Being able to save snapshots from IP cameras would be great. I'm using Wansview IP cams with built-in motion detection and a RP FTP server to do that now. Integrating with HA would be awesome. Being able to have a "motion event" as a trigger would be awesome.

The real dream would to be able to automatically record video with cache that rolls over on motion events and for that motion event to be a trigger in automations as well.

kennedyshead commented 8 years ago

Have given this a lot off thought, I dont think that HA is a motion detector or should have that functionality "built in" That said there is always the option of writing a pip package with the help of cv2 and make that package do the work of capture and motion detection, then let HA show the states, turn on/off detections.

I already do the most parts of what I describe via motion and my little rest-server (now hooked through mqtt) but motion is not the best software I know to setup and to work with in general.

stjohnjohnson commented 8 years ago

I was wondering if maybe we should hook into something like zoneminder. It could be a camera component that can detect motion and receive events to record or snapshot. Zoneminder already does the snapshotting and recording. If so, I'd be interested in contributing this.

nzfarmer1 commented 8 years ago

I am new to HA. What's the status of this? We are integrating our farm cameras - well we can implement anything on the back end. But for the front end, showing a gallery/history of images is the goal. Has this been achieved out of the box, or via some custom programming by anyone? thx.

kennedyshead commented 8 years ago

@nzfarmer1 Yes, I use motion + a mqtt service to interface with it, as stated earlier in this thread. @stjohnjohnson That is exactly my point, far better to create a component imo.

nzfarmer1 commented 8 years ago

@stjohnjohnson +1 for this feature. Please keep us posted. We have a developer available to us if you want to get in touch. Our remote wireless cameras are only historical cams currently, but we'd like to integrate motion sensing options.

stjohnjohnson commented 8 years ago

So I looked into it @nzfarmer1, I got the MJPEG stream up and running to ZoneMinder but after about 1-2 hours ZoneMinder started to crash. Apparently they didn't expect people to stream so often.

In addition, they don't have real-time event notifications, instead it's kinda every 30-60 seconds it will evaluate any new events and act on them.

I'd throw out ZoneMinder for this project here. I'm open for something else. Right now I'm using my silly FTPd->MQTT bridge I wrote to detect basic motion and feed to HA: https://github.com/stjohnjohnson/mqtt-camera-ftpd

balloob commented 8 years ago

Closing this issue as feature requests should be posted in the forum.