Page 1 of 2

Domoticz able to activate motionEye motion detection

Posted: Saturday 03 March 2018 14:31
by Antori91
Hello,

I've just finished setting up motionEye for camera management in addition to Domoticz. It's great...
- 100% web mode (without install of plugin / applet / dll) with traditional browser or smartphone, all cameras are displayed whatever the brand of the camera,
- motion detection feature integrated into the software (more configurable than the native functions embedded in the cameras) with alert emails sending or others stuff,
- and...activation / unactivation of this motionEye detection feature from Domoticz. When I activate my alarm appliance using the Domoticz SecurityPanel for example, my wired alarm is armed but ... also all the cameras, i.e. the Motion/MotionEye motion detection, which was before in pause mode, is activated. ** The trick (I use) is to use the motion HTTP API and to modify the threshold parameters of all my motion camera threads **.

In terms of resources required for motionEye, after many tests, I am about 3% CPU per camera and 200 Kbs for LAN/WAN bandwidth per camera. I use VGA resolution within motion/motionEye.
motionHTTP_API_Threshold.JPG
motionHTTP_API_Threshold.JPG (80.66 KiB) Viewed 12956 times
Web_MotionEye - Copie.JPG
Web_MotionEye - Copie.JPG (367.81 KiB) Viewed 12956 times
Mobile_Screenshot_motionEye - Copie.JPG
Mobile_Screenshot_motionEye - Copie.JPG (134.57 KiB) Viewed 12956 times

Re: Domoticz able to activate motionEye motion detection

Posted: Saturday 03 March 2018 14:47
by Antori91
Using a script, all my motionEye cameras threads are also automatically activated or unactivated when I switch On/Off my alarm appliance using the security panel.
Detection Activated.JPG
Detection Activated.JPG (255.49 KiB) Viewed 12946 times

Re: Domoticz able to activate motionEye motion detection

Posted: Saturday 03 March 2018 16:05
by EdddieN
Is this working in a RPI? How did you do it?


Sent from my iPhone using Tapatalk

Re: Domoticz able to activate motionEye motion detection

Posted: Saturday 03 March 2018 17:33
by Antori91
Yes, sure it works in a RPI...I did it in a RPY. My Domoticz server is a Synology but the server I use to manage the cameras (where I've installed motion/motionEye) is a Raspberry.

About how I did it, you have information about motion HTTP API here http://www.lavrsen.dk/foswiki/bin/view/ ... ionHttpAPI
To explain a little bit further, motionEye sits on motion. Motion is the core system and is able to receive requests using HTTP API. I assume that motionEye itself uses that HTTP API to manage motion. So I use this motion HTTP API to change on the fly some parameters which results in enabling or not the motion detection. To come back to my architecture, because I use two servers and so motion receives requests from a remote server, I have to change motion.conf. The parameter webcontrol_localhost must be changed from on (default) to off. But if you have only one server, I assume you don't have to take care about this. Last, notice that motion port (7999 in my installation - defined in motion.conf) is not motionEye port (usually 8765).

Re: Domoticz able to activate motionEye motion detection

Posted: Saturday 03 March 2018 19:23
by heggink
Brilliant idea! Did you manage to get the camera itself working with domoticz? I never managed to get it to work.
Oh wait, you probably only use the server side of motioneye, not the client/camera itself? I also run a couple of motioneye cameras. These I have not managed to get to work with domoticz.

Re: Domoticz able to activate motionEye motion detection

Posted: Sunday 04 March 2018 8:10
by Antori91
I use my cameras both from Domoticz and MotionEye. This is possible because my cameras support both snapshot url (used from Domoticz) and video streaming url (used from MotionEye).

In fact, two of my cameras don't support snapshot. For these two cameras, I didn't try to use the motionEye client url but I use the tool avconv to generate snapshots from the cameras video streaming url. Then Domoticz see these two cameras as *supported* snapshot cameras. Last, notice because I use two servers, in the Raspberry where avconv is installed, I also installed Apache. Apache is used as a proxy which answers to Domoticz camera snapshot requests (Within Apache configuration, I defined a symbolic link to get the generated avconv snapshots).

Re: Domoticz able to activate motionEye motion detection

Posted: Saturday 01 December 2018 14:43
by EDsteve
I also discovered motionEye and love it.
But i can't really get the HTTP web control working like you did.

My motion.conf is configured as shown:

Code: Select all

############################################################
# HTTP Based Control
############################################################

# TCP/IP port for the http server to listen on (default: 0 = disabled)
webcontrol_port 8080

# Restrict control connections to localhost only (default: on)
webcontrol_localhost off

# Output for http server, select off to choose raw text plain (default: on)
webcontrol_html_output on

# Authentication for the http based control. Syntax username:password
# Default: not defined (Disabled)
; webcontrol_authentication username:password
So i should be able to control it on port 8080 right?
But when i type into the browser: http://192.168.8.130:8080/ or http://192.168.8.130:8080/1/config/set?threshold=100000
It just comes: This site can't be reached.

I also tried the standard port 8765 where i can reach the motioneye web-panel.
But this just gives me: {"error": "not found"}

What do i not see?

Re: Domoticz able to activate motionEye motion detection

Posted: Sunday 02 December 2018 18:19
by Antori91
Hello
The motion.conf file to modify is located in /etc/motioneye and not the one in /etc/motion. Here is my motion.conf.
Also you've to restart motion/motionEye ("sudo systemctl restart motioneye") after you modify motion.conf.

Code: Select all

/etc/motioneye $ cat motion.conf
# @enabled on
# @show_advanced on
# @normal_password xxxxxxxxxxxxxxxxxxxxx
# @admin_username xxxxxxxxxxxxxxxxxxxxx
# @admin_password xxxxxxxxxxxxxxxxxxxxx
# @normal_username xxxxxxxxxxxxxxxxxxxxx
thread thread-1.conf
thread thread-2.conf
thread thread-3.conf
thread thread-4.conf
thread thread-5.conf
webcontrol_html_output on
webcontrol_port 7999
setup_mode off
webcontrol_parms 2
webcontrol_localhost off

Re: Domoticz able to activate motionEye motion detection

Posted: Tuesday 04 December 2018 8:25
by EDsteve
Cooool. Works nice. Love it. Thanks for Info.
I indeed edit the wrong config.

Re: Domoticz able to activate motionEye motion detection

Posted: Wednesday 22 May 2019 14:31
by fma388
Thanks for info, works perfectly !

Just a question. Is there possible to use webcontrol_authentication with your HTTP API ? (username:password)
My camera is on other raspi than Domoticz.

Thanks

Re: Domoticz able to activate motionEye motion detection

Posted: Wednesday 22 May 2019 15:38
by Antori91
fma388 wrote: Wednesday 22 May 2019 14:31 Just a question. Is there possible to use webcontrol_authentication with your HTTP API ? (username:password)
My camera is on other raspi than Domoticz.
Thanks
Hello,
I assume yes (you have to add "webcontrol_authentication username:password" to /etc/motioneye/motion.conf), but...I've never tried...

https://www.lavrsen.dk/foswiki/bin/view ... entication

Re: Domoticz able to activate motionEye motion detection

Posted: Wednesday 22 May 2019 15:43
by fma388
Antori91 wrote: Wednesday 22 May 2019 15:38 Hello,
I assume yes (you have to add "webcontrol_authentication username:password" to /etc/motioneye/motion.conf), but...I've never tried...
I've configure webcontrol_authentication in motion.conf but doesn't work. I think we have to add the identifiers in the API but I don't know how..

Re: Domoticz able to activate motionEye motion detection

Posted: Wednesday 22 May 2019 16:08
by Antori91

Re: Domoticz able to activate motionEye motion detection

Posted: Wednesday 22 May 2019 16:17
by fma388
Thank you very much ! It works !

Re: Domoticz able to activate motionEye motion detection

Posted: Saturday 23 November 2019 19:08
by QSKONE
This is not working for me

motionEye Version 0.41
Motion Version 4.2.2
OS Version motionEyeOS 20190911

Works well commands from lavrsens wiki

Code: Select all

http://IP:7999/1/detection/start
http://IP:7999/1/detection/pause

Re: Domoticz able to activate motionEye motion detection

Posted: Saturday 14 December 2019 20:29
by EdwinK
No matter what I try, I can't get MotionEye to show a camera feed in Domoticz :(
Screen Shot 2019-12-14 at 20.25.40.png
Screen Shot 2019-12-14 at 20.25.40.png (60.1 KiB) Viewed 6491 times
When I go directly to http://192.168.0.5/picture/1/current/?_ ... <signature deleted> I can see the feed.

Re: Domoticz able to activate motionEye motion detection

Posted: Saturday 14 December 2019 21:13
by felix63
In the direct link you don't give a port number. But in domoticz you seem to refer to port 8081. If you change that port number 8081 to 80 what happens?

Re: Domoticz able to activate motionEye motion detection

Posted: Sunday 15 December 2019 22:37
by EdwinK
Same. Nothing changes :(

Now I think about it, it's indeed strange that Motioneye gives a streaming port at 8081, but it doesn't use it in the links to provide.

Re: Domoticz able to activate motionEye motion detection

Posted: Monday 16 December 2019 11:50
by Antori91
Hello EdwinK,
The parameters you entered in Domoticz are clearly false. For this Snapshot URL given by motionEye: http://192.168.0.5/picture/1/current/?_ ... ydede71809
I will try:
protocol: http
ip address: 192.168.0.5
port: 80
username: admin
password:
imageURL: /picture/1/current/?_username=#USERNAME&_signature=yyyyyyyyyyyyyyyyyydede71809

PS: about your last post, the streaming port is for streaming, not for snapshot. motionEye gives two different URLs for snapshot and streaming. Domoticz supports only snapshot mode.

Re: Domoticz able to activate motionEye motion detection

Posted: Monday 16 December 2019 13:05
by EdwinK
Thanks. Going to try this later.

Mm.. still not working :(

And fixed now. :)