Je souhaite via un interrupteur virtuel sous domoticz
Pouvoir gerer le service motion eye via la commande
sudo systemctl stop motioneye
et redemarrer le service via la commande:
sudo systemctl restart motioneye
Pour la mise en place du switch virtuel pas de soucis
Par contre pour le srcipt ?
Pour la commande du script via le switch virtuel, je pensais passer par les actions on et off
Mais comment faire ?
Si vous pouvez m'aider ?
Merci
script pour stopper motioneye
Re: script pour stopper motioneye
j'ai créé le script suivant en sh
c'est mon premier scripts
quand je lance directement le srcipt a la main, j'ai
pi@RASP_HOME:~/domoticz2/scripts $ motion.sh
-bash: motion.sh : commande introuvable
pi@RASP_HOME:~/domoticz2/scripts $ sudo motion.sh
sudo: motion.sh: command not found
c'est mon premier scripts
Code : Tout sélectionner
#!/bin/bash
#VARIABLE
RASP_MOTION ="192.168.0.242:8675"
PASSWORD=xxxxxx
DOMOTICZ_SERVER="192.168.0.251:8080"
idx="469"
ssh 192.168.0.242
PASSWORD
sudo systemctl stop motioneye
#Test si occurence =1
if [ $oc = 1 ]; then
Status="Off"
else
Status="On"
fi
echo $oc
#MAJ Interrupteur
curl "http://$DOMOTICZ_SERVER/json.htm?type=command¶m=switchlight&idx=$idx&switchcmd=$Status"
exit
pi@RASP_HOME:~/domoticz2/scripts $ motion.sh
-bash: motion.sh : commande introuvable
pi@RASP_HOME:~/domoticz2/scripts $ sudo motion.sh
sudo: motion.sh: command not found
-
Antori91
Re: script pour stopper motioneye
Bonjour,
Une alternative à l'arrêt distant de motionEye est d'utiliser les commandes http pour piloter à distance motion/motionEye, cf.
https://easydomoticz.com/forum/viewtopic.php?f=8&t=6072
Une alternative à l'arrêt distant de motionEye est d'utiliser les commandes http pour piloter à distance motion/motionEye, cf.
https://easydomoticz.com/forum/viewtopic.php?f=8&t=6072
Re: script pour stopper motioneye
ok je regarde ca
merci
merci