Re: Alimenter une variable à partir d'un script
Publié : 22 janv. 2019, 22:34
Ha oui, il manque un 
Code : Tout sélectionner
end Reprenez le contrôle de votre domotique
https://easydomoticz.com/forum/
Code : Tout sélectionner
end Code : Tout sélectionner
commandArray = {}
now=os.date("*t")
if now.min % 1 == 0 then -- exécution toutes les minutes
local matemperature = tonumber(string.format("%.1f", otherdevices_temperature['Temp. local piscine']))
local moncalcul = matemperature /16*60
commandArray['Variable:Filtration']=domoticz.round(moncalcul , 0)
end
return commandArrayCode : Tout sélectionner
Error: EventSystem: in Variable filtration: [string "commandArray = {}..."]:9: attempt to index global 'domoticz' (a nil value)
Code : Tout sélectionner
= tostring(maValeur) Code : Tout sélectionner
commandArray['Variable:Filtration']=tostring(moncalcul)Code : Tout sélectionner
Error: EventSystem: commandArray in script Variable filtration should only return ['string']='actionstring' or [integer]={['string']='actionstring'}Code : Tout sélectionner
Status: EventSystem: Script event triggered: Variable filtration