Bon, j’y suis arrivé !
J’ai trouvé un vieux message et à partir de là j’ai bricolé un script bash existant que je laisse ici pour les suivants :
#!/bin/bash
IPX800=XXX.XXX.XXX.XXX
LOGFILE=« /var/log/domoticz/ipx800.log »
DOMOTICZSERVER=XXX.XXX.XXX
DOMOTICZPORT=8080#Créer avant vos sondes de température virtuelle dans DomoticZ (Hardware > Dummy > Create > Temperature) puis récupérer les IDX et ajoutez les ci-après :
IDX_TEMP_1=XXXX
IDX_TEMP_2=XXXX
IDX_TEMP_3=XXXX
IDX_TEMP_4=XXXXif ping -c 1 $IPX800 > /dev/null ; then # if host is online then
#Retrieve temperatures from IPX800 - Mettez vos identifiants / mot de passe à la place des XXXXX
curl --silent ‹ http://XXXXX:XXXXX@ ›$IPX800’/admin/status.xml’ > $LOGFILETEMP_1=$(cat $LOGFILE | grep « » | cut -d « > » -f2 | cut -d « < » -f1)
TEMP_1=$(echo ‹ scale=1; ›« $TEMP_1*0.323-50.1 » | bc | awk ‹ {printf(« %.1f\n », $1)} ›)TEMP_2=$(cat $LOGFILE | grep « » | cut -d « > » -f2 | cut -d « < » -f1)
TEMP_2=$(echo ‹ scale=1; ›« $TEMP_2*0.323-50.1 » | bc | awk ‹ {printf(« %.1f\n », $1)} ›)TEMP_3=$(cat $LOGFILE | grep « » | cut -d « > » -f2 | cut -d « < » -f1)
TEMP_3=$(echo ‹ scale=1; ›« $TEMP_3*0.323-50.1 » | bc | awk ‹ {printf(« %.1f\n », $1)} ›)TEMP_4=$(cat $LOGFILE | grep « » | cut -d « > » -f2 | cut -d « < » -f1)
TEMP_4=$(echo ‹ scale=1; ›« $TEMP_3*0.323-50.1 » | bc | awk ‹ {printf(« %.1f\n », $1)} ›)for i in 1 2 3 4
do
#report Temperature
eval IDX=‹ $‹ IDX_TEMP_$i
eval TEMP= ›$‹ TEMP_$i
#Mettez vos identifiants / mot de passe à la place des XXXXX
curl --silent http://XXXXX:XXXXX@$DOMOTICZSERVER:$DOMOTICZPORT ›/json.htm?type=command¶m=udevice&idx= ›$IDX’&nvalue=0&svalue='$TEMP > /dev/null
doneelse
echo « IPX800 not responding to ping, is it connected to LAN? »
fi