J'essai de recupérer quelques calorie par la gestion de l'ouverture des volets en cas de beau temps (production photovoltaique moyenne)
J'ai commencé mon script est je but sur la condition:
-Si les volets sont fermé et (que la puissance des panneaux solaires est supérieur a 750w pendant 600sec) alors.
Je joint mon script:
Code : Tout sélectionner
--------------------------------
------ Variables à éditer ------
--------------------------------
local capteur = 'Photovoltaique' --Température de consigne
local thermostat = 'Chauffage_maison' --Nom de l'interrupteur virtuel du thermostat
local volet = 'Velux_2eme' --Nom du volet a fermer
--------------------------------
-- Fin des variables à éditer --
--------------------------------
commandArray = {}
function timedifference (s)
year = string.sub(s, 1, 4)
month = string.sub(s, 6, 7)
day = string.sub(s, 9, 10)
hour = string.sub(s, 12, 13)
minutes = string.sub(s, 15, 16)
seconds = string.sub(s, 18, 19)
t1 = os.time()
t2 = os.time{year=year, month=month, day=day, hour=hour, min=minutes, sec=seconds}
difference = os.difftime (t1, t2)
return difference
end
if (otherdevices[thermostat]=='On') then
index1,index2,index3,index4,puissance,retour = otherdevices_svalues[''.. capteur ..'']:match("([^;]+);([^;]+);([^;]+);([^;]+);([^;]+);([^;]+)")
puissance = tonumber(puissance)
print(' ' .. puissance .. ' ')
--if (otherdevices[''..volet..'']=='Off' and (puissance > 750 depuis 600sec)) then
--commandArray[volet]='On'
--end
--if (otherdevices[''..volet..'']=='On' and (puissance < 750 depuis 1800sec)) then
--commandArray[volet]='Off'
end
return commandArray
Merci d'avance pour l'aide