first commit
This commit is contained in:
38
lua/script_time_Solaire.lua
Executable file
38
lua/script_time_Solaire.lua
Executable file
@@ -0,0 +1,38 @@
|
||||
require "scripts/lua/functions"
|
||||
|
||||
--recupere les minutes
|
||||
time=os.time()
|
||||
seconds=tonumber(os.date('%S',time))
|
||||
minutes=tonumber(os.date('%M',time))
|
||||
heures=tonumber(os.date('%H',time))
|
||||
jour=tonumber(os.date('%w',time))
|
||||
mois=tonumber(os.date('%M',time))
|
||||
|
||||
|
||||
--Initialise la commande de retour finale
|
||||
commandArray={}
|
||||
|
||||
-- ------------------------------------------------------------------------------
|
||||
-- Gestion de la production solaire
|
||||
-- ------------------------------------------------------------------------------
|
||||
--if (minutes %1 == 0) then
|
||||
local tab1 = split(otherdevices['CONSOMMATION_GENERALE'], ";")
|
||||
local watt_consomme = tonumber(tab1[1])
|
||||
--print("Time Consommation générale "..watt_consomme)
|
||||
|
||||
local tab = getValuesInTab('SolaireProduction')
|
||||
print("Time Production Solaire "..tab[1])
|
||||
local watt_solaire = tonumber(tab[1])
|
||||
|
||||
|
||||
if watt_solaire ~= nil and watt_solaire > 100 then
|
||||
if watt_consomme < 80 then
|
||||
print("Consommation devient faible => routage solaire")
|
||||
else
|
||||
print("Consommation encore importante solaire 100% injecté")
|
||||
end
|
||||
end
|
||||
|
||||
--end
|
||||
|
||||
return commandArray
|
||||
Reference in New Issue
Block a user