voila ma config pour ceux que ça peut aider :
freebox.sh
ajout de "sur la", des chaines gratuites freebox, du repaly (pour mon fils), contrôle du volume style "met le son a 25", diverse prononciation pour appeler certaines touches, ...
ATTENTION : bien regardé le chemin des scripts car j'ai créée un dossier bash
Code : Tout sélectionner
#!/bin/bash
#########################declaration des variables#################################
user="pi"
ifttt="" #remise à zero d'ifttt
chaine="sh /home/$user/domoticz/scripts/bash/chg_chaine.sh"
touche="sh /home/$user/domoticz/scripts/bash/chg_touche.sh"
########################Recuperation de la valeur d'ifttt##########################
case $# in
1) ifttt="$1";;
2) ifttt="$1 $2";;
3) ifttt="$1 $2 $3";;
4) ifttt="$1 $2 $3 $4";;
5) ifttt="$1 $2 $3 $4 $5";;
6) ifttt="$1 $2 $3 $4 $5 $6";;
7) ifttt="$1 $2 $3 $4 $5 $6 $7";;
8) ifttt="$1 $2 $3 $4 $5 $6 $7 $8";;
9) ifttt="$1 $2 $3 $4 $5 $6 $7 $8 $9";;
esac
######################################Changement de chaines######################################################
#echo "$ifttt" >> "freebox".txt
case "$ifttt" in
# Par nom de chaine
"tf 1") $chaine 0 0 1;;
"france 2") $chaine 0 0 2;;
"france 3") $chaine 0 0 3;;
"canal plus") $chaine 0 0 4;;
"france 5") $chaine 0 0 5;;
"m 6") $chaine 0 0 6;;
"arte") $chaine 0 0 7;;
"c 8") $chaine 0 0 8;;
"w 9") $chaine 0 0 9;;
"tmc") $chaine 0 1 0;;
"nt1") $chaine 0 1 1;;
"nrj 12") $chaine 0 1 2;;
"lcp") $chaine 0 1 3;;
"france 4") $chaine 0 1 4;;
"bfm") $chaine 0 1 5;;
"bfm tv") $chaine 0 1 5;;
"cnews") $chaine 0 1 6;;
"cstar") $chaine 0 1 7;;
"gulli") $chaine 0 1 8;;
"france haut") $chaine 0 1 9;;
"hd 1") $chaine 0 2 0;;
"équipe") $chaine 0 2 1;;
"6 ter") $chaine 0 2 2;;
"numéro 23") $chaine 0 2 3;;
"rmc") $chaine 0 2 4;;
"rmc découverte") $chaine 0 2 4;;
"disney channel") $chaine 0 4 8;;
"lci") $chaine 0 2 6;;
"game one") $chaine 0 3 7;;
"game one + 1") $chaine 0 8 9;;
"france info") $chaine 0 2 7;;
"rtl 9") $chaine 0 2 9;;
"national geographic") $chaine 0 6 0;;
"nat géo") $chaine 0 6 0;;
"ab moteur") $chaine 1 7 5;;
"nrj hits") $chaine 0 6 5;;
"nat géo wild") $chaine 0 6 1;;
"no life") $chaine 0 9 3;;
"gang") $chaine 0 9 4;;
# Par numéro de chaine
"la 1") $chaine 0 0 1;;
"la 2") $chaine 0 0 2;;
"la 3") $chaine 0 0 3;;
"la 4") $chaine 0 0 4;;
"la 5") $chaine 0 0 5;;
"la 6") $chaine 0 0 6;;
"la 7") $chaine 0 0 7;;
"la 8") $chaine 0 0 8;;
"la 9") $chaine 0 0 9;;
"la 10") $chaine 0 1 0;;
"la 11") $chaine 0 1 1;;
"la 12") $chaine 0 1 2;;
"la 13") $chaine 0 1 3;;
"la 14") $chaine 0 1 4;;
"la 15") $chaine 0 1 5;;
"la 16") $chaine 0 1 6;;
"la 17") $chaine 0 1 7;;
"la 18") $chaine 0 1 8;;
"la 19") $chaine 0 1 9;;
"la 20") $chaine 0 2 0;;
"la 21") $chaine 0 2 1;;
"la 22") $chaine 0 2 2;;
"la 23") $chaine 0 2 3;;
"la 24") $chaine 0 2 4;;
"la 25") $chaine 0 2 5;;
"la 26") $chaine 0 2 6;;
"la 27") $chaine 0 2 7;;
"la 28") $chaine 0 2 8;;
"la 29") $chaine 0 2 9;;
"la 30") $chaine 0 3 0;;
"la 31") $chaine 0 3 1;;
"la 89") $chaine 0 8 9;;
"la 48") $chaine 0 4 8;;
"la 60") $chaine 0 6 0;;
"la 175") $chaine 1 7 5;;
"la 65") $chaine 0 6 5;;
"la 37") $chaine 0 3 7;;
"la 61") $chaine 0 6 1;;
"la 93") $chaine 0 9 3;;
"la 94") $chaine 0 9 4;;
"sur la 1") $chaine 0 0 1;;
"sur la 2") $chaine 0 0 2;;
"sur la 3") $chaine 0 0 3;;
"sur la 4") $chaine 0 0 4;;
"sur la 5") $chaine 0 0 5;;
"sur la 6") $chaine 0 0 6;;
"sur la 7") $chaine 0 0 7;;
"sur la 8") $chaine 0 0 8;;
"sur la 9") $chaine 0 0 9;;
"sur la 10") $chaine 0 1 0;;
"sur la 11") $chaine 0 1 1;;
"sur la 12") $chaine 0 1 2;;
"sur la 13") $chaine 0 1 3;;
"sur la 14") $chaine 0 1 4;;
"sur la 15") $chaine 0 1 5;;
"sur la 16") $chaine 0 1 6;;
"sur la 17") $chaine 0 1 7;;
"sur la 18") $chaine 0 1 8;;
"sur la 19") $chaine 0 1 9;;
"sur la 20") $chaine 0 2 0;;
"sur la 21") $chaine 0 2 1;;
"sur la 22") $chaine 0 2 2;;
"sur la 23") $chaine 0 2 3;;
"sur la 24") $chaine 0 2 4;;
"sur la 25") $chaine 0 2 5;;
"sur la 26") $chaine 0 2 6;;
"sur la 27") $chaine 0 2 7;;
"sur la 28") $chaine 0 2 8;;
"sur la 29") $chaine 0 2 9;;
"sur la 30") $chaine 0 3 0;;
"sur la 31") $chaine 0 3 1;;
"sur la 89") $chaine 0 8 9;;
"sur la 48") $chaine 0 4 8;;
"sur la 60") $chaine 0 6 0;;
"sur la 175") $chaine 1 7 5;;
"sur la 65") $chaine 0 6 5;;
"sur la 37") $chaine 0 3 7;;
"sur la 61") $chaine 0 6 1;;
"sur la 93") $chaine 0 9 3;;
"sur la 93") $chaine 0 9 4;;
######################################Appuie sur une touche######################################################
"allume la") $touche power_on;;
"éteins la") $touche power_off;;
"monte le son de 15") $touche vol_inc+15;;
"baisse le son de 15") $touche vol_dec-15;;
"monte le son de 10") $touche vol_inc+10;;
"baisse le son de 10") $touche vol_dec-10;;
"monte le son de 1") $touche vol_inc+1;;
"baisse le son de 1") $touche vol_dec-1;;
"monte le son de 5") $touche vol_inc+5;;
"baisse le son de 5") $touche vol_dec-5;;
"le son à 5") $touche vol_a_5;;
"le son à 10") $touche vol_a_10;;
"le son à 15") $touche vol_a_15;;
"le son à 20") $touche vol_a_20;;
"le son à 25") $touche vol_a_25;;
"ok") $touche ok;;
"sur ok") $touche ok;;
"en vf") $touche VF;;
"en vo") $touche VO;;
"en version originale") $touche VO;;
"les sous - titres") $touche sub;;
"pas de sous - titres") $touche no_sub;;
"suivante") $touche program_up;;
"suivant") $touche program_up;;
"précédente") $touche program_down;;
"précédent") $touche program_down;;
"le replay") $touche replay;;
"le replay de tf1") $touche replaytf1;;
"le replay de tf1 dessin animé") $touche replaytf1jeunesse;;
"les dessins animés de tf1") $touche replaytf1jeunesse;;
"le replay de france 5") $touche replayfranceTV;;
"le replay de france tv") $touche replayfranceTV;;
"le replay de france 5 enfants") $touche replayfranceTVenfants;;
"le replay de france tv enfants") $touche replayfranceTVenfants;;
"les dessins animés de france 5") $touche replayfranceTVenfants;;
"le direct") $touche live;;
"live") $touche live;;
"mute") $touche mute;;
"sur pause") $touche play;;
"en pause") $touche play;;
"pause") $touche play;;
"play") $touche play;;
"sur play") $touche play;;
"lecture") $touche play;;
"sur lecture") $touche play;;
"haut") $touche up;;
"sur haut") $touche up;;
"bas") $touche down;;
"sur bas") $touche down;;
"droite") $touche right;;
"sur droite") $touche right;;
"sur gauche") $touche left;;
"gauche") $touche left;;
"retour") $touche back;;
"sur retour") $touche back;;
"back") $touche back;;
"ok") $touche ok;;
"sur ok") $touche ok;;
"accueil") $touche home;;
"sur accueil") $touche home;;
"la chaîne enregistrer") $touche rec;;
"enregistre") $touche rec;;
"verte") $touche green;;
"menu") $touche green;;
"bleu") $touche blue;;
"recherche") $touche blue;;
"rouge") $touche red;;
"retour") $touche red;;
"jaune") $touche yellow;;
"info") $touche yellow;;
esac
exit 0
--------------------------------------------------------------------------------------
fichier chg_touche.sh
rajouter votre code télécommande bien sure
Code : Tout sélectionner
#!/bin/bash
touche=$1
telecommande=votre code télécommande
if [ $touche = "vol_inc+10" ]
then
echo "ok volume +10"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
elif [ $touche = "vol_dec-10" ]
then
echo "ok volume -10"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
elif [ $touche = "vol_inc+15" ]
then
echo "ok volume +15"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
elif [ $touche = "vol_dec-15" ]
then
echo "ok volume -15"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
elif [ $touche = "vol_inc+1" ]
then
echo "ok volume +1"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
elif [ $touche = "vol_dec-1" ]
then
echo "ok volume -1"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
elif [ $touche = "vol_inc+5" ]
then
echo "ok volume +5"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
elif [ $touche = "vol_dec-5" ]
then
echo "ok volume -5"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec"
elif [ $touche = "vol_a_5" ]
then
echo "ok volume a 5"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec&long=true"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec&long=true"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec&long=true"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
elif [ $touche = "vol_a_10" ]
then
echo "ok a 10"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec&long=true"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec&long=true"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec&long=true"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
elif [ $touche = "vol_a_15" ]
then
echo "ok a 15"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec&long=true"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec&long=true"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec&long=true"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
elif [ $touche = "vol_a_20" ]
then
echo "ok a 20"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec&long=true"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec&long=true"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec&long=true"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
elif [ $touche = "vol_a_25" ]
then
echo "ok a 25"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec&long=true"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec&long=true"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_dec&long=true"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=vol_inc"
elif [ $touche = "power_on" ]
then
echo "freebox on"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=power"
sleep 7
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=home"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=ok"
elif [ $touche = "power_off" ]
then
echo "freebox off"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=power"
elif [ $touche = "program_up" ]
then
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=prgm_inc"
elif [ $touche = "program_down" ]
then
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=prgm_dec"
elif [ $touche = "play" ]
then
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=play"
elif [ $touche = "back" ]
then
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=back"
elif [ $touche = "replaytf1" ]
then
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=home"
sleep 3
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=home"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=right"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=ok"
sleep 5
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=ok"
elif [ $touche = "replaytf1jeunesse" ]
then
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=home"
sleep 3
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=home"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=right"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=ok"
sleep 5
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=ok"
sleep 11
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=up"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=right"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=right"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=right"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=right"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=right"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=ok"
elif [ $touche = "replayfranceTV" ]
then
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=home"
sleep 3
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=home"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=right"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=ok"
sleep 5
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=right"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=ok"
elif [ $touche = "replayfranceTVenfants" ]
then
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=home"
sleep 3
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=home"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=right"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=ok"
sleep 5
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=right"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=ok"
sleep 11
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=left"
elif [ $touche = "live" ]
then
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=green"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=ok"
elif [ $touche = "VF" ]
then
echo "VF"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=green"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=ok"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=ok"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=ok"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=red"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=red"
elif [ $touche = "VO" ]
then
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=green"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=ok"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=ok"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=ok"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=red"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=red"
elif [ $touche = "sub" ]
then
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=green"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=ok"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=ok"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=ok"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=red"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=red"
elif [ $touche = "no_sub" ]
then
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=green"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=ok"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=ok"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=ok"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=down"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=ok"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=red"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=red"
elif [ $touche = "ok" ]
then
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=ok"
else
echo "autre"
sudo curl "http://hd1.freebox.fr/pub/remote_control?code=$telecommande&key=$touche"
fi
---------------------------------------------------------------------------------
Mes scripts LUA :
le premier grâce a deux variables "allumer" et "eteindre" me permet de contrôler allumage et l'extinction de mes différents équipements via mon "ORVIBO All in one", des requêtes HTTP pour le freebox, et des messages envoyés a mon PC via "autoremote" installé sur "google chrome" (ainsi que sur mon téléphone) et "Eventgosth" installé sur mon PC.
Pour le ORVIBO je passe par des scènes car il faut laisser passer un certain délais entre chaque envoi de touche mais on peut passer par le script shell aussi, mais bon la on peut l’appeler aussi sans passer par un LUA, via une touche et c'est mieux si l'on veut créer une scène dans TASKER sur son téléphone ... bon ok la je pars peut être trop loin pour certains mais bon lol.
Pour mon PC j'utilise Eventgosth et autoremote, avec eux je peux envoyer un message a mon pc en utilisant autoremote mon pc va recevoir le message exemple "PC son casque" qui va etre detecté par Eventgosth puis eventgosth va lui lancer des actions que j'ai programmé, j'utilise aussi depuis peu un "plugin domoticz" qui existe sur Eventgosth qui permet a l'ordi de controler directement domotcz (switch, push, raw etc..). Par exemple il va allumer ma TV + mettre HDMI 2 + éteindre l'ampli (plugin domoticz) puis étendre mon écran (car j'ai deux écran PC + télé) puis changer la source du son de mon PC.
Code : Tout sélectionner
commandArray = {}
meubletv1=uservariables["allumer"]
meubletv1=string.lower(meubletv1)
meubletv2=uservariables["eteindre"]
meubletv2=string.lower(meubletv2)
---------------------------------------------------------------------------------------------------------------------------------------------------
if (uservariables['allumer'] == 'la télé' or uservariables['allumer'] == 'la télévision') then
commandArray['Scene:Allumer TV freebox'] = "On"
os.execute('/home/pi/domoticz/scripts/bash/freebox.sh '..'allume la'..'&')
print("allumer "..meubletv1)
--commandArray['Variable:allumer']=''.."vide"
--commandArray['SendEmail']='script_dvariable tété allumé #télé allumé#xxxxxxxxxxxxxx
elseif (uservariables['eteindre'] == 'la télé' or uservariables['eteindre'] == 'la télévision' or uservariables['eteindre'] == 'tout' or uservariables['eteindre'] == 'le meuble télé') then
commandArray['Scene:Eteindre TV freebox'] = "On"
os.execute('/home/pi/domoticz/scripts/bash/freebox.sh '..'éteins la'..'&')
print("éteindre "..meubletv2)
--commandArray['Variable:eteindre']=''.."vide"
--commandArray['SendEmail']='script_dvariable tété éteinte #télé éteindre#xxxxxxxxxxxxxxxxxxxx
end
if (uservariables['allumer'] == "l ' ampli" or uservariables['allumer'] == 'le pionneer' or uservariables['allumer'] == "l'amplificateur") then
os.execute('/home/pi/domoticz/scripts/python/orvibo.py -i 192.168.2.166 -e /home/pi/domoticz/scripts/python/ampliOn.ir &')
print("allumer "..meubletv1)
elseif (uservariables['eteindre'] == "l ' ampli" or uservariables['eteindre'] == 'le pionneer' or uservariables['eteindre'] == "l'amplificateur") then
os.execute('/home/pi/domoticz/scripts/python/orvibo.py -i 192.168.2.166 -e /home/pi/domoticz/scripts/python/ampliOff.ir &')
print("éteindre "..meubletv2)
end
if (uservariables['allumer'] == "l'écran de télévision" or uservariables['allumer'] == "l'écran télé" or uservariables['allumer'] == "le deuxième écran") then
os.execute('/home/pi/domoticz/scripts/python/orvibo.py -i 192.168.2.166 -e /home/pi/domoticz/scripts/python/tvon.ir &')
print("allumer "..meubletv1)
elseif (uservariables['eteindre'] == "l'écran de télévision" or uservariables['eteindre'] == "l'écran télé" or uservariables['eteindre'] == "le deuxième écran") then
os.execute('/home/pi/domoticz/scripts/python/orvibo.py -i 192.168.2.166 -e /home/pi/domoticz/scripts/python/tvoff2.ir &')
print("éteindre "..meubletv2)
end
if (uservariables['allumer'] == 'la Freebox' or uservariables['allumer'] == 'le Freeplayer' or uservariables['allumer'] == 'le boitier télé') then
os.execute('/home/pi/domoticz/scripts/bash/power_freebox.sh &')
print("allumer "..meubletv1)
elseif (uservariables['eteindre'] == 'la Freebox' or uservariables['eteindre'] == 'le Freeplayer' or uservariables['eteindre'] == 'le boitier télé') then
os.execute('/home/pi/domoticz/scripts/bash/freebox.sh '..'éteins la'..'&')
print("éteindre "..meubletv2)
end
if (uservariables['allumer'] == 'les led' or uservariables['allumer'] == 'LED' or uservariables['allumer'] == 'les LED') then
os.execute('/home/pi/domoticz/scripts/python/orvibo.py -i 192.168.2.166 -e /home/pi/domoticz/scripts/python/LEDPowerOn.ir &')
commandArray['eclairage LED']='On'
print("j'allume "..meubletv1)
elseif (uservariables['eteindre'] == 'les led' or uservariables['eteindre'] == 'LED' or uservariables['eteindre'] == 'les LED') then
os.execute('/home/pi/domoticz/scripts/python/orvibo.py -i 192.168.2.166 -e /home/pi/domoticz/scripts/python/LEDPowerOff.ir &')
commandArray['eclairage LED']='Off'
print("j'éteins "..meubletv2)
end
if (uservariables['allumer'] == 'le pc' or uservariables['allumer'] == "l'ordinateur" or uservariables['allumer'] == 'mon pc' or uservariables['allumer'] == 'mon ordinateur') then
commandArray['PC WOL']='On'
print("j'allume "..meubletv1)
elseif (uservariables['eteindre'] == 'le pc' or uservariables['eteindre'] == "l'ordinateur" or uservariables['eteindre'] == 'mon pc' or uservariables['eteindre'] == 'mon ordinateur') then
commandArray['PC WOL']='Off'
print("j'éteins "..meubletv2)
end
if (uservariables['allumer'] == 'le deuxième écran' or uservariables['allumer'] == "l'écran de télé" or uservariables['allumer'] == "l'écran de télévision" or uservariables['allumer'] == 'le second écran') then
commandArray['OpenURL']='www.autoremotejoaomgcd.appspot.com/sendmessage?key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
print("j'allume "..meubletv1)
elseif (uservariables['eteindre'] == 'le deuxième écran' or uservariables['eteindre'] == "l'écran de télé" or uservariables['eteindre'] == "l'écran de télévision" or uservariables['eteindre'] == 'le second écran') then
commandArray['OpenURL']='www.autoremotejoaomgcd.appspot.com/sendmessage?key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
print("j'éteins "..meubletv2)
end
if (uservariables['allumer'] == "le son sur l'ampli" or uservariables['allumer'] == "le son de l'ampli" or uservariables['allumer'] == "le son sur les enceintes" or uservariables['allumer'] == 'les enceintes') then
commandArray['OpenURL']='www.autoremotejoaomgcd.appspot.com/sendmessage?key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
print("j'allume "..meubletv1)
elseif (uservariables['eteindre'] == 'le deuxième écran' or uservariables['eteindre'] == "l'écran de télé" or uservariables['eteindre'] == "l'écran de télévision" or uservariables['eteindre'] == 'le second écran') then
commandArray['OpenURL']='www.autoremotejoaomgcd.appspot.com/sendmessage?key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
print("j'éteins "..meubletv2)
end
-------------------------------------------------------------------------------------------------------------------------------------------------------
raz="vide"
commandArray['Variable:allumer']=''..raz
commandArray['Variable:eteindre']=''..raz
--commandArray['Variable:freebox']=''..raz
return commandArray
------------------------------------------------------------------------------------------
Mon LUA pour Freebox.sh
Ici j'utilise deux variables perso : "son_freeplayer_vol_dec" et "son_freeplayer_vol_inc" pour faire la commande vocale "met le son a 25" par exemple (bien relever vos IDX si vous voulez faire comme moi)
Vous voyez aussi des LED c'est que j'ai un ruban led que je contrôle en IR (infrarouge) grâce a mon orvibo
Code : Tout sélectionner
commandArray = {}
meubletv3=uservariables["son_freeplayer_vol_dec"]
meubletv3=string.lower(meubletv3)
meubletv4=uservariables["son_freeplayer_vol_inc"]
meubletv4=string.lower(meubletv4)
ifttt=uservariables["freebox"]
ifttt=string.lower(ifttt)
raz="vide"
user="pi"
if (uservariablechanged['freebox'] or uservariablechanged['son_freeplayer_vol_dec'] or uservariablechanged['son_freeplayer_vol_inc']) then
------ baisse le son via applet iftt "baisse le son de X" ---------------------------------
if (uservariablechanged['son_freeplayer_vol_dec']) then
print("valeur d'ifttt au début du script : "..meubletv3)
print("lancement du script freebox.sh avec ifttt = baisse le son de "..meubletv3)
os.execute('bash /home/'..user..'/domoticz/scripts/bash/freebox.sh baisse le son de '..meubletv3..'&')
print("son sur - "..meubletv3)
end
------ baisse le son via applet iftt "monte le son de X" ---------------------------------
if (uservariablechanged['son_freeplayer_vol_inc']) then
print("valeur d'ifttt au début du script : "..meubletv4)
print("lancement du script freebox.sh avec ifttt = monte le son de "..meubletv4)
os.execute('bash /home/'..user..'/domoticz/scripts/bash/freebox.sh monte le son de '..meubletv4..'&')
print("son sur + "..meubletv4)
end
------ change de chaine, replay, etc .. via applet iftt "mets sur X" ---------------------
if (uservariablechanged['freebox']) then
print("valeur d'ifttt au début du script : "..ifttt)
print("lancement du script freebox.sh avec ifttt = "..ifttt)
os.execute('bash /home/'..user..'/domoticz/scripts/bash/freebox.sh '..ifttt..'&')
end
if (uservariables['freebox'] == 'les led sur vert' or uservariables['freebox'] == 'les led sur verte' or uservariables['freebox'] == 'les led couleur verte' or uservariables['freebox'] == 'les led de couleur verte' or uservariables['freebox'] == 'les led en vert' or uservariables['freebox'] == 'les led verte') then
commandArray['Scene:Allumer LED verte'] = "On"
print("je mets "..ifttt)
end
if (uservariables['freebox'] == 'les led sur rouge' or uservariables['freebox'] == 'les led couleur rouge' or uservariables['freebox'] == 'les led de couleur rouge' or uservariables['freebox'] == 'les led en rouge' or uservariables['freebox'] == 'les led rouge') then
commandArray['Scene:Allumer LED rouge'] = "On"
print("je mets "..ifttt)
end
end
------ vide toutes les variables ---------------------------------------------------------
commandArray['Variable:son_freeplayer_vol_dec']=''..raz
commandArray['Variable:son_freeplayer_vol_inc']=''..raz
commandArray['Variable:freebox']=''..raz
------ arrete le script si freebox est "vide" ---------------------------------------------
if (ifttt=="vide" or ifttt== nil) then
print("sortie du script freebox")
return commandArray
end
return commandArray
--------------------------------------------------------------------------------------
voila
pour les applets IFTTT:
allume $, éteins $, reviens en arrière, reviens au direct, enregistre la chaîne, coupe son, appuie sur $ + touche $, baisse le son de # + diminue le son de #, monte le son de # + augmente le son de #, mets la # + mets sur la #, mets la $ + mets sur $.
Attention a bien changer vos IDX de variables dans l'envoi de requêtes via webhooks
je mets certains liens pour ceux que cela intérresse :
autoremote pour chrome :
https://chrome.google.com/webstore/deta ... fcfb?hl=fr
eventgosth pour PC :
http://www.eventghost.net/
plugin domoticz pour eventgosth :
https://github.com/WoLpH/eventghost-domoticz
plugin autoremote pour eventgosth :
https://joaoapps.com/autoremote/eventghost/
requêtes pour le ORVIBO :
https://github.com/cherezov/orvibo/blob ... /orvibo.py
plugin pour TASKER (appli android d'automatisation) :
https://joaoapps.com/