Vérifie si la variable humid est un entier ou un string. Provenant de json, il doit s'agir d'un string, alors qu'un integer est attendu.
Essaye comme ceci :
Code : Tout sélectionner
humid = tonumber(humid)
commandArray['UpdateDevice'] = '1505|' .. humid .. '|0'
Code : Tout sélectionner
idx = 1505
humid = tonumber(humid)
commandArray['UpdateDevice'] = idx .. '|' .. humid .. '|0'
SI tu souhaites passe la valeur de HUM_STAT en variable, la syntaxe :The above sets the parameters for a Humidity device
IDX = id of your device (This number can be found in the devices tab in the column "IDX")
HUM = Humidity: 45%
HUM_STAT = Humidity_status
Humidity_status can be one of:
0=Normal
1=Comfortable
2=Dry
3=Wet
Code : Tout sélectionner
idx = 1505
humid = tonumber(humid)
hum_stat = 1
commandArray['UpdateDevice'] = idx .. '|' .. humid .. '|' .. hum_stat Code : Tout sélectionner
commandArray['UpdateDevice'] = idx..'|'..humid..'|'..hum_stat