I’m semi-new to trying to create automation. One I’d like to do is record footage from my Generic Camera (It connects via HTTP using RTSP.
I would like my Aqara motion sensor to trigger an event to make the camera footage record for a period of time, or while the motion is detected by the sensor, and then stop, and save the footage somewhere. I’d love to upload it to a OneDrive location, but that’s maybe asking a lot.
I see there is a Stream service, but struggling to work it out. Is there a way to start streaming to a file, and then stopping, and then upload? Or copying/saving it to a location on my Home Assistant hardware? I am running on a large SSD drive, so space isn’t an issue (now).
For interest sake, the camera is a Wyze Cam V2, but as it’s using the Generic Camera type in HA, I’m not sure the make makes any difference.
I have this at the moment as an automation:
alias: Record Front Door
description: ""
trigger:
- type: motion
platform: device
device_id: 4d727454e9a999ba25cedd7557b00d40
entity_id: 373c998453c894cfa937394718cde899
domain: binary_sensor
condition: []
action:
- service: camera.record
target:
entity_id: camera.front
data:
duration: 30
lookback: 0
filename: /tmp/{{ now().strftime("%Y%m%d-%H%M%S") }}.mp4
mode: single
OK, I think the issue is that for some reason, HA cannot record from my Generic cameras. It seems to be picking up an old camera that I used on Synology Servalance Station… But none of my Generic Cameras (The ones I actually use, and can see on my dashboard) show up.
I’m about to try and setup a Nedis Wi-Fi camera and try to integrate it into HA through the generic camera platform. If that’s even possible, I would love to have the videos or snapshots that the camera takes when something trips the in-built motion sensor saved in some way. Preferably not on the SSD I run HA from.
Of course it’s possible with the cloud service of the camera, but I don’t really care for corporative cloud services.
So would be really interesting to hear if you or anyone else reading this, got this to work.