Files
Domoticz/volets4.sh
2025-03-06 11:09:58 +01:00

26 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
DOMO_IP="localhost" # Domoticz IP Address
DOMO_PORT="81" # Domoticz Port
Gauche_IDX=684 # numéro ID de l interrupteur du relais
Droit_IDX=701
Milieu_IDX=699
duree=$2
lockfile-create "/tmp/volet4.lockfile"
echo "Avant $1" >>/tmp/test
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$Droit_IDX&switchcmd=$1" &
sleep $duree
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$Droit_IDX&switchcmd=$1" &
sleep 2
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$Milieu_IDX&switchcmd=$1" &
sleep $duree
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$Milieu_IDX&switchcmd=$1" &
sleep 2
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$Gauche_IDX&switchcmd=$1" &
sleep $duree
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$Gauche_IDX&switchcmd=$1" &
echo "Apres" >>/tmp/test
lockfile-remove "/tmp/volet4.lockfile"