-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
sendNotification from external process... #268
Comments
You would probably use the NodeHelper to expose a URL, which MotionEye calls as a WebHook, triggering the notification. I'm not the utmost expert on this, but this should be the correct solution. |
I got the same idea. A node_helper is already working... I´ll keep you posted. |
One simple solution could be: (in your node helper) start: function() {
var self = this;
this.expressApp.get(this.name + '/foo', function (req, res) {
res.send('OK');
self.doSomething();
});
},
doSomething: function() {
// Do something here, like sending a socket message to the frontend.
} You could now invoke the (Code is not tested, but something like the above should work ...) |
Thanks for the Code-Snippet. Missing ")" bracket after ´/foo´? |
Sorry, missing |
Thanks. I´m still getting a "Cannot GET /urlserver/foo" from my browser when I´m calling the url. |
What is the exact url you are calling? |
I´m running the whole thing on my mac. so : http://localhost:8080/urlserver/foo |
and |
correct. |
Should work. You could try debugging by checking all registered routes, using something like: console.log(this.expressApp.stack); (Not sure of that works ...) |
use:
|
Would it be ok for you to proceed any further discussion of this issue on: https://forum.magicmirror.builders? This way I can limit the use of GitHub issues to bug reports. |
Of course. Thanks for your assistance. |
Hi,
I´m fairly new to the whole node/socket thingy, but I´m wondering if it´s possible to send
a notification from an external process outside the MagicMirror Universe.
Specifically I would like to send a Notification from MotionEye, which has the ability to call a URL if it detects a Movement. This notification could perhaps show a picture of your frontdoor etc...
Perhaps somebody can give me a hint, if somethings like this would be possible, so I can dive into it.
Thank you.
The text was updated successfully, but these errors were encountered: