-
Notifications
You must be signed in to change notification settings - Fork 670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Toggle motion detection on/off via API or else #800
Comments
I second this, could not find any way to do this! Or is there a way? |
A more elegant way is to implement a REST API in motion software to support this. Try convincing motion developers to implement this. |
There is a way - motioneye runs motion, which has a web control port (you can find the port number in the motion.conf configuration file, usually located in /etc/motioneye/motion.conf). I use it from my home alarm system to only run motion detection when the alarm system is armed, like the thread starter suggests. To start motion detection, run a command like
The '1' is for the camera number. To stop (pause) motion detection, run something like
You can use a web browser pointed at |
This doesn't work for me. Am I missing anything? |
@schneivo77, To enable access to that port from other machines, you have to ssh onto the device and edit /data/etc/motion.conf After that, you should be able to access the URLs :-) It's a bit confusing in my opinion. I think it would be more clear if the property was called something like |
I have created a script that runs on my router and can detect if my phone is connected to the wifi network. If it is, it disables motion detection using the web control method above. You can find the code here: https://gist.github.com/kabadisha/a87e50311d3ed4589f17a6e37c574a44 |
Hi @ccrisan, |
Now it works! Nice! Thanks a lot! :) |
Note from Motion documentation (https://motion-project.github.io/motion_config.html#Options_Stream_Webcontrol). I plan to use this feature, but wanted to share this in case anyone else was curious about the security risks of turning
|
@hamiltont indeed that setting is off by default in motionEye and should probably be left that way unless the unit runs in a local network where access is properly controlled. |
Good call @hamiltont and @ccrisan. I do run my cameras on a private local network, so no issue. I would be surprised if anyone was running their camera directly connected to the internet, but I guess statistics says that someone somewhere will... |
Hi i would like to use your script, do you have installation guide lines somewhere? |
@kabadisha not sure if you get notifications if i quote you so tagging you as well |
@pietje666 This is not a simple answer and will be quite a learning rabbit hole for you by the sounds of it, but I'll try and point you in the right direction :-) In order for the script to work, you need the following things:
All of the above are probably not available on any stock firmware, so something like DD-WRT or Tomato is your best bet. The wiki and forums for those are the best place to find out how to install them and how to do the above once you have. The above will also be fiddly to learn how to do, especially for someone who is not mega familiar with Unix and the command line, so Google and patience are your friends. Hope that points you in the right direction :-) |
@kabadisha thanks for the explanation. I got it working now using dd-wrt and cron job had to alter your script a bit since my router did not work with wl command had to use wl_atheros instead. |
I make python script to make ON/OFF motion detection by button i think that can help somebody |
piachuPL Many Thanks !
Rafik
On Friday, 13 September 2019, 11:28:24 BST, piachuPL <notifications@github.com> wrote:
I make python script to make ON/OFF motion detection by button i think that can help somebody
https://github.com/piachuPL/Motionoffon/
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
i use hassOS on a virtualbox, can you please tell me where to find /data/etc/motion.conf ? |
I know this is probably a long shot, but can a still picture be taken by webcontrol? |
I would like to turn motion detection on/off via webcore when my location mode in smartthings is away. Can this command be sent via webcore and if so, do you know the proper web request format? Edit: Once I set web control to off I was able to send a GET request with the http info from webcore to start and stop motion detection running on my local machine. |
Is it just me or does the status of motion detection not update in the MotionEye UI? I understand that we are sidestepping MotionEye by fondling Motion directly but it would be helpful to see this represented in the MotionEye UI. My assumption was that MotionEye was simply depicting the underlying Motion config but this would seem not to be the case. |
There are many things that don't change in motionEye when you change them in motion via webcontrol. They get out of sync when you manipulate motion directly... |
I can start and pause detection through the API successfully but I notice notifications aren't sent when motion is started from the API rather than motioneye. (webhook notification) |
Just a hint for them like me who tried to find this solution and this took a while for me to get it to work, first, create the file inside
and for
remember to change localhost (could work with IP adress) and the port (8080 in this example) and camera id (0 in this example) to your configuration. |
Hi Ccrisan,
I use motion eye and i would like to enable motion detection and recording only when i arm my home alarm and would need a way to do this in motioneye.
I guess i could stop the service and shuffle files around but i want to make sure i am not too intrusive.
Thanks,
Rafik
The text was updated successfully, but these errors were encountered: