Comments (27)
As long as MotionEye doesn't keep "pinging" the mirror when there is motion, or even better, when motion stops, there is no way for the module to know when to hide the stream.
It would be out of scope for the module to do the image analysis.
I've requested this feature in MotionEye: motioneye-project/motioneyeos#722
from mmm-motioneye.
A question… When the “ping” comes in from motioneye, does the timer always reset?
Example:
If the timer is 30 secs, the module get a ping from motioneye, the module is shown. 25 seconds passes and then another a ping comes in. Will the timer then be set again to 0 and wait 30 "new" seconds or will the module hide anyway after just 5 more seconds?
Does that make sense? :)
from mmm-motioneye.
My understanding is that MotionEye will notify you once and then not notify you again until no motion is detected.
If multiple notifications are sent from MotionEye to the module, then the timeout will restart. So - the timeout is time after last notifcation before fading out starts.
from mmm-motioneye.
I'm working on a potential workaround:
When MotionEye starts to record a movie, the .thumb-file for the movie file is missing. After some time (~60 seconds) the .thumb file is created.
My idea is to add a command notification in MotionEye to start a script. The parameter for the script is the path for the movie file (using parameters). Then the script will wait until the .thumb-file is created and then send a MotionEye_Stopped notificaton to my module.
Not 100% if this will work, but I will let you test when I'm ready :)
from mmm-motioneye.
Yes, that works if you save the movies... However in my case, I do not save anything. It's strictly a "Real time" system. Just for fun. :) What I can do is to the time outs to very short in MotionEye, for the moment I have:
Motion Gap: 5 seconds
Captured Before: 1 frames
Captured After: 1 frames
Minimum Motion Frames: 10 frames
That works fairly well, if you disregard the occasional showing and hiding of the module(s). :)
from mmm-motioneye.
Would it be an option to turn on recording, but let the script delete the file when notification is sent to my module? I know it's not optimal, but best I can do at the moment...
It's already 99% implementet. Just need to update some documentation.
from mmm-motioneye.
Yes, that's ok. :) I'm just having this way because I don't "need" the movies. But for functionality, no problem. :)
from mmm-motioneye.
You could use in motion(eye)
'on_movie_end'
to do exactly what you want!
from mmm-motioneye.
@Snille Hi, I've added the option to set autoHideDelay to 0 to never autohide. Hope this works like you want it...? If so, please close this issue :)
from mmm-motioneye.
Hm, I'm not getting it. :) How does it get hidden if there is no "Nothing is moving" signal from MotionEye and the auto hide timeout is disabled?.. Have I missed something? :)
from mmm-motioneye.
By using "on_movie_end" (thanks, @hellyberry!) and the web hook for hiding a camera. I will document this step soon. I forgot I didn't add this step yet... :-)
from mmm-motioneye.
Hmm... Well. been testing a bit now. And as far as the show and hide, it works. However, I don't know if this is "your" problem or just me not getting how to do it. :) So like this, I use MMM-ProfileSwitcher and have profile classes for different modules. If I set the "Cameras" classes to "default and/or everyone" the camera will show up as it should when motion occurs. And it will hide when motion dissiperas.
But If I "log in" with a profile, the camera headers will show up (without a picture of course because there is no motion)... I can hide them of course by visiting the "hide" link (for each camera). But if I don't do that manually the heders will show until a motion is triggered and then a hide is triggered.
So, If I assign a specific profile the the cameras, the headers will show (without a picture) for that profile, and will stay until the same as above happens or until the profile is logged out.
Well... So let's set the class to a profile that don't exists. Like "None".
Then the cameras will never be showed, even if a motion is triggered... Any ideas? :)
I'm thinking make an option to use the "force-to-show-option" for the modules in the config. I added that option to my "MMM-ModuleBar" to be able to show modules that's locked hidden by other modules (I think that is the case here), the MMM-ProfileSwitcher locks the modules hidden.
So, a twist. If I use my modulebar to show and then hide the cameras, it all works. They pop up when a motion is triggered and dissiperas when there is no motion anymore.
Conclusion: I "remove" the lock with my module. :) This of course only works until the browser is refreshed or the MM is restarted. :)
from mmm-motioneye.
Not sure about this since I'm not using any modules to show/hide other modules. But my guess is this:
The problem with modules in MM is that you can't start them hidden. That's why I send a MotionEyeHide notification to all camera modules with autoHide enabled to make them hide. You've probably seen they show up a split second when starting MM before they get hidden.
Anyway, I guess your profile module shows all modules, but since getDom returns an empty DIV, only headers are shown. That makes sense since it was not a motion that triggered the module.
Maybe just turn off autoHide? 😉
from mmm-motioneye.
First, I was a bit quick to say that show/hide works ok. The "autoHideDelay: 0" works, hides the cams (after about a second as you said, all good). The problem I noticed now is when motion is present, the cam pops up (as it should) then when the motion goes away only one (number 3) goes away? If motion has happen and stopped on any of the other cameras they don't go away... If I visit the "hide" links, they hide. So that makes me think that it is something with the the "on_movie_end" notification that don't work. I'm looking in to this now. I actually don't think it's in your module it's a problem. I can't see any "Hide Camera" information coming in to the MM if I check the MP2 logs...
Turn off autoHide... There are 6 (soon to be 7) cameras, there is not space enough on my mirror... :)
Still the issue with the show on motion if module is locked hidden remains... :) I'll get back to you on that one when I figured out the rest. :)
from mmm-motioneye.
Do you configure on_movie_end on each RPi Zero or on the central hub?
from mmm-motioneye.
Maybe Motion Eye has no concept of which camera the "on_movie_end" happens for...?
from mmm-motioneye.
I configure it all on the HUB. So, on the 3 network cameras, the option ends up in etc/motioneye/thread-x.conf (x= 1-3) the other (motioneyeos) cameras have their own thread-1.conf in /data/etc on each system. I have checked them all, and all have these two lines defined:
on_picture_save /usr/lib/python2.7/site-packages/motioneye/scripts/relayevent.sh "/data/etc/motioneye.conf" picture_save %t %f; wget http://MMIP:8080/motioneye/hide/x
on_movie_end /usr/lib/python2.7/site-packages/motioneye/scripts/relayevent.sh "/data/etc/motioneye.conf" movie_end %t %f; wget http://MMIP:8080/motioneye/hide/x
MMIP = My Magic Mirror IP
X = The camera number to hide.
It would be strange if only one camera can have the on_move_end when all can have show on motion. :)
I'm lost... :)
from mmm-motioneye.
Did you enable motion triggered recording of Movies on all Motion Eye's? It is a movie event...
from mmm-motioneye.
Hmm... I have note enabled recording of movies on any camera. :)
from mmm-motioneye.
What about picture? Extra options seems to modify config for that too...
from mmm-motioneye.
Nope, no pictures activated either... :) I'll try now to activate to sav movies on all cameras to see if it works...
from mmm-motioneye.
Well... It works now! :) Now all cameras seams to show and hide! :) Nice! So, recording HAS to be enabled (let's not think of the one that actually worked without enabling recording...). Goodie, case closed!
from mmm-motioneye.
In the /etc/motioneye folder you should find names like 1, 1.1, 2, 2.1, 2.2 etc (last path of web trigger url = camera id). Do you have them? They are created by wget if you don't supress output...
Hey - you just closed! :-)
from mmm-motioneye.
I have them now. I did not before... :)
from mmm-motioneye.
You can try this:wget -qO- $url &> /dev/null
Notice: Big letter O - not zero...
from mmm-motioneye.
Added... I'm guessing the $url means the actual hide URL, right? :)
from mmm-motioneye.
Yes, I just copied from a forum-post.
from mmm-motioneye.
Related Issues (14)
- Multiple instances... HOT 2
- Nothing to see.. HOT 1
- does not work
- syntax error in config width HOT 2
- syntax error in module HOT 1
- AutoHide is not working HOT 1
- Attempting to center unhidden div
- CORS problems... HOT 7
- Not working in MM 2.18 HOT 1
- Close stream when module is hidden. HOT 2
- Start module hidden. HOT 11
- Show animation not fading... HOT 4
- Love this module!! HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mmm-motioneye.