So I found a half decent solution for myself and I hope it might help Luke +others.
I have an Rpi3 with a cam direct to the board. Just one at the moment as this the system is still prototype for me. I have a Linux server running samba that acts like a NAS and is my home automation server inc. motioneye that will concentrate the rest of the camera nodes as I set them up.
The WebUI and my home automation box will trigger a script to use ssh and public keys.
Copy the public key from machine you want to control the MotionEyeOS node from (my home automation box in this case)
[root@homeauto ~]# cat ~/.ssh/id_rsa.pub
Copy this text and manually ssh to the MontionEyeOS node. Create ssh_authrozed_keys and copy the public key from the previous step. I then rebooted for good measure.
[root@bar-cam ~]# echo "ssh-rsa AAAAB3NzaC1yc2ELIFGLUFGLJDGCKLJHnLW6dusIv52ZoY9yIKHdRlkSZ/gBLY0<--snip-->uuB2R6ngaAmsjn4i0GLErZSRtKdTuG3qfBtSe6SQE8Kw4PijQp7PCejDVlWc7VRH8lk6YhiVr0G5rAr root@homeauto" > /data/etc/ssh_authorized_keys
[root@bar-cam ~]# reboot
Now the home automation box can login to MotionEyeOS with no interaction from the user and issue commands. In this case we want to change the config of a camera I have configured called "Bar" (This camera will protect my booze!! :)
[root@homeauto ~]# ssh root@bar-cam
The authenticity of host 'bar-cam (192.168.1.114)' can't be established.
ECDSA key fingerprint is 04:60:84:53:6f:91:f7:3e:62:fc:61:e1:65:7c:a9:25.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'bar-cam' (ECDSA) to the list of known hosts.
[root@bar-cam ~]#
I found the camera config file under /data/etc/thread-1.conf. For those interested in how and as I only had one camera to find this might be useful for people with more but going to assume they are thread-2.conf etc, anyway:
[root@bar-cam ~]# grep -lir "bar" /data/etc/*
/data/etc/hostname
/data/etc/thread-1.conf
From here it was easy to narrow down.
I'll assume that motion detection is currently enabled for recordings so go ahead and make a copy of this file called <cam-name>.on
[root@bar-cam ~]# cp /data/etc/thread-1.conf bar-cam-conf.on
Go to the UI turn OFF motion detection and apply changes. Copy the updated config to bar-cam-conf.off.
[root@bar-cam ~]# cp /data/etc/thread-1.conf bar-cam-conf.off
We can use diff to see the difference:
[root@bar-cam ~]# diff bar-cam-conf.on bar-cam-conf.off
--- bar-cam-conf.on
+++ bar-cam-conf.off
@@ -26,7 +26,7 @@
# @working_schedule
-ffmpeg_output_movies on
+ffmpeg_output_movies off
height 1080
stream_quality 85
threshold 64800
Now to turn motion detection (or any other config change using the same principal) we can just copy our specific config copy tot he running and restart MotionEyeOS.
cp /data/etc/bar-cam-conf.off /data/etc/thread-1.conf && /etc/init.d/S85motioneye restart
Return to the UI and check this worked.
For completeness here is the script I run from my homeautomation box (again triggered from a webUI/voice command)
[root@bar-cam ~]# nano bar-cam-motion-on.sh
#!/bin/bash
ssh admin@bar-cam << EOF
cp /data/etc/bar-cam-conf.on /data/etc/thread-1.conf && /etc/init.d/S85motioneye restart
EOF
[root@bar-cam ~]# chmod +x bar-cam-motion-on.sh
[root@bar-cam ~]# ./bar-cam-motion-on.sh
API would be sweet but I guess this is a good alternative. Great project, great work. Thanks for everyone involved and I hope this post helps someone.