Camera Service To Stop Recording

I’d like the ability to control camera recording with a sensor, either through automation using camera.start_recording and camera.stop_recording services or directly by adding a binary input option to the camera.record service which can be used instead of duration.

If a Camera is going to be used extensively for recording (like 24/7 recording) the option to specify filename and a binary_sensor for control could be added to the master camera config also.

you’ve answered your own question: use an automation which triggers on the sensor’s state change…

That would be the answer if the camera services existed for it to work which is my point. Currently the only service which is available is camera.record which you need to give a ‘duration’. I’d like camera recording to be controlled by a binary sensor for example so it records for as long as a condition is met. This would allow camera recordings to be controlled by motion sensors or TensorFlow components for example. It could be as simple as adding additional services to start and stop recordings manually without specifying duration (or defaulting to 30 seconds).

the duration is optional:
image
so I don’t understand what it is that you can’t achieve with what we currently have…

Duration is only optional because it defaults to 30 seconds if you give no value. There is no service to stop recording so without a duration it will record forever…

silly question, have you tried to turn the camera off to see if that would stop the recording? I know it’s not ideal / what you want but could be a work around.

For your Feature request, I’d rename into “add stop recording service to camera” as it’s this that you really want if I understand well (for the duration, you could set it to some stupidly high number so it keeps recording until you stop it)

I have renamed the request so it’s a bit more specific.

I haven’t tried turning the camera off to stop recording but I will give it a go. The cameras have multiple functions in my setup so this isn’t a viable solution for me but may be a temporary workaround for others if it works in conjunction with a long duration as you mention.

2 Likes

I’m also facing the same issue.

I would like to start a recording via the camera.record service, if I detect motion on another sensor, and stop it, if there is no motion.

Problem here is, that you have to define a recording duration with the camera.record service. If you don’t provide a duration, it defaults to 30 seconds. Second problem is, that there is no camera.record_stop service. So you cannot manually stop a running recording. I also tried the camera.turn_off service, which does not stop the recording.

So I would like to do a feature request to implement a camera.record_stop service. This would be really nice :slight_smile:

For different reasons I need the same function. My issue is that at times one of my cameras stays on camera.record indefinitely. So far the only way I’ve been able to fix the issue is by powering down the camera then turning it back on.

I tried using camera.turn_off and that doesn’t work. For testing purposes I have setup the power supply of the camera behind a relay that I can control via HA. Seems a simple camera.stop_record would fix the issue.

Full write up of my issue in case anyone can help.

Also need it

1 Like

I’m intrested too.

Such a function would be nice to have. This will allow me to automate recordings via NodeRed.
The use case is that I can start recording as soon as the camera motion sensors ate triggered, and then do an image analysis to see if there is a person in the frame or not.
If there is no person in the frame, I’d like to stop recording immediately. If a person is detected, i’d like to continue recording for 15 seconds, and then have the recording file sent to me via Telegram

What if you do another start recording with a duration of 1 sec, while it’s already recording?

I’m not sure I understand the question? The idea is you wouldn’t give a duration at all, rather you would manually start and stop recording based on a binary sensor (like a motion sensor) with an automation. So the request is to have the ability to start and stop recording manually without the need to set a duration.

If a call to start recording without a duration occurs whilst already recording this should be ignored. I think any “manual” recording session would need a unique ID or at least be separated from record calls made with a duration so that these are not impacted by calls to stop recording.

Current behavior is that it starts writing an additional file, so you have the entirety of the other recording, and a tiny 1 second long recording.

I also desire this feature. I have searched far and wide for security camera management software solutions, and every solution I have found is either very expensive or very bad. With the simple addition of this feature, Home Assistant would actually become one of the most robust security camera management solutions available, lacking only an adequate permissions management system.

I’m curious how difficult this feature would really be to add, there has clearly been some demand for it for quit a while now. Maybe it just hasn’t reached their threshold yet?

I really like the ss system or synology!!

Also need this. I’ve set up my alarm as a trigger to start recording. Would be nice to be able to trigger the recording to stop when I’ve assessed the situation.

Edit:
I ended up using motioneye to turn off and on recording on demand.

Is the stop action difficult to implement? I’d also need the feature because the motioneye has lot of other issues and I’m reticient to add an additional software just to stop a recording :slight_smile:

Pleasee :slight_smile: :hear_no_evil:

1 Like

Can’t believe there is no stop service of record camera yet…

:frowning:

1 Like

How is this possible??? we are approching to 2023 and we have no camera.stop_record service!!!

1 Like