Yes! ça marche, merci (j'ai eu du mal mais au final c'est bon)
le site retourne la couleur en majuscule et je comparait avec la couleur en miniscule
Code : Tout sélectionner
#!/bin/bash
tempo=$(curl -s "http://domogeek.entropialux.com/tempoedf/now")
#ancien capteur dummy "text"
#curl "http://192.168.192.31:8080/json.htm?type=command¶m=udevice&idx=15&svalue=$tempo"
if [ $tempo = "BLEU" ]; then
curl "http://192.168.192.31:8080/json.htm?type=command¶m=udevice&idx=35&nvalue=0&svalue=Bleu"
fi
if [ $tempo = "BLANC" ]; then
curl "http://192.168.192.31:8080/json.htm?type=command¶m=udevice&idx=35&nvalue=1&svalue=Blanc"
fi
if [ $tempo = "ROUGE" ]; then
curl "http:/192.168.192.31:8080/json.htm?type=command¶m=udevice&idx=35&nvalue=2&svalue=Rouge"
fi