Hi community,
Looking for some insight. I am not a coder, more a tinkerer…
I recently set up motioneye because I was looking for a better way to detect activity through my cameras. I have this tuned in exceedingly well and it gets the job done just fine. I also trigger doods for certain cams and send me a snapshot with image analysis, but now, with motioneye being so dialed in, I really don’t even need it to filter events more.
What I’m trying to do is make it easier to serve up the last created video clips from motioneye to telegram, so I have more context on the go quickly than just a single snapshot.
I can easily detect properly and create the clips in motioneye.
I also did some googling and figured out how to do a simple python script to look at the motioneye folder for the most recent mp4 and then copy it to a folder that Hass could easily access and serve up to telegram. What I don’t know how to do is when to check for a new file. Ideally it would be after receiving an event that a file was created.
Where I’m stuck is how to automate the copy process.
Ideally, here is what I want to do.
When a new movie file is created by motioneye add-on, copy it and rename it to CAMERANAME-latest.mp4 to a folder Hass can easily access.
How could I monitor the motioneye movie clip creation and once that is done copy it to a new place?
I wondering how would be best to accomplish this. I saw motioneye has the ability to run a command when a new media file is created.
Maybe a curl command there to trigger an input Boolean in HA. Then have HA do an automation on that input Boolean to
-
Run Script to copy /rename clip
1a. I saw there is a shell command integration, but not sure if that is the best. I tried this pointing to the hosts location for python and the script, but the docker Hass instance on that host doesn’t seem it can access it. The logs are pretty minimal so not sure where it’s failing. -
Send clip to telegram
Last, maybe this isn’t best served by HA. I figured I’d start here as having HA and Hassio add-ons I’d try to keep it in the family. I’m also open to other options like maybe appdaemon is a fit for this? I just don’t which way to go
Any input greatly appreciated!