Re: Projet TBH
Publié : 03 déc. 2015, 21:12
Code : Tout sélectionner
puissance = tostring(tonumber(puissanceTBH))Code : Tout sélectionner
puissance = tostring(puissanceTBH)Reprenez le contrôle de votre domotique
https://easydomoticz.com/forum/
Code : Tout sélectionner
puissance = tostring(tonumber(puissanceTBH))Code : Tout sélectionner
puissance = tostring(puissanceTBH)Code : Tout sélectionner
2015-12-08 13:10:06.677 Error: EventSystem: /home/pi/domoticz/scripts/lua/script_time_tbhweb_meteo.lua:14: bad argument #2 to 'tonumber' (base out of range)Code : Tout sélectionner
tempInt,hygroInt,tempExt,hygroExt =tostring(tonumber(tempHyroTBH:match("([^;]+);([^;]+);([^;]+);([^;]+)")))
print(tempInt.." "..hygroInt.." "..tempExt.." "..hygroExt)
Code : Tout sélectionner
tempInt,hygroInt,tempExt,hygroExt = tempHyroTBH:match("([^;]+);([^;]+);([^;]+);([^;]+)")
print(tempInt.." "..hygroInt.." "..tempExt.." "..hygroExt)
Code : Tout sélectionner
tempInt,hygroInt,tempExt,hygroExt = tempHyroTBH:match("([^;]+);([^;]+);([^;]+);([^;]+)")
tempInt = tostring(tonumber(tempInt))
hygroInt =tostring(tonumber(HygroInt))
...
Code : Tout sélectionner
commandArray = {}
---recupere l'heure en minutes
time=os.time()
minutes=tonumber(os.date('%M',time))
hours=tonumber(os.date('%H',time))
maintenant=tonumber(hours*60+minutes)
if(maintenant%10 ==0 )then
local appelTBH=assert(io.popen("php /home/pi/domoticz/scripts/php/capteur_meteo_2.php LOGIN MDP"))
local tempHygroTBH = appelTBH:read('*all')
appelTBH:close()
tempInt,hygroInt,tempExt,hygroExt = tempHygroTBH:match("([^;]+);([^;]+);([^;] +);([^;]+)")
print(tempInt.." "..hygroInt.." "..tempExt.." "..hygroExt)
--Ensuite remplissez votre commandArray avec les donnees recueillies :)
commandArray[1] = {['UpdateDevice'] = '28|0|' ..tempInt..";"..hygroInt}
commandArray[2] = {['UpdateDevice'] = '29|0|' ..tempExt..";"..hygroExt}
end
return commandArray
Code : Tout sélectionner
print(tempHygroTBH)