Re: aide pour réalisation script en lua
Publié : 10 mai 2020, 17:55
si si vill1driver je lis tes messages mais je ne réponds pas comme je ne suis pas le demandeur.
Reprenez le contrôle de votre domotique
https://easydomoticz.com/forum/
Code : Tout sélectionner
commandArray={}
--pour connaitre les valeurs on met des print. Tu les commentes avec -- quand tu n'en as plus besoin.
print('otherdevices[\'UV\'] '..otherdevices['UV'])
print('otherdevices[\'Pluie\'] '..otherdevices['Pluie'])
-- print('otherdevices[\'Nuit\'] '..otherdevices['Nuit'])
print('otherdevices[\'Vent\'] '..otherdevices['Vent'])
-- print('otherdevices[\'Absence\'] '..otherdevices['Absence'])
print('otherdevices[\'Store Terrasse\'] '..otherdevices['Store Terrasse'])
print('otherdevices[uservariables["store exterieur"]] '..uservariables["store exterieur"])
-- Ouverture Store Terrasse
if (devicechanged['Store Terrasse']=='On' and otherdevices['Absence']=='Off') then
commandArray['Ouverture Store Terrasse']='On'
print('Ouverture Store Terrasse')
commandArray ['Variable:store exterieur']='ouvert'
commandArray['SendNotification']='Store Terrasse#Ouverture Store Terrasse'
-- Fermeture du Store Terrasse
elseif (devicechanged['Nuit']=='On' and otherdevices['Absence']=='Off' and otherdevices['Store Terrasse']=='16.0') then
commandArray['Fermeture Store Terrasse']='On'
print('Fermeture Store Terrasse')
commandArray ['Variable:store exterieur']='ferme'
commandArray['SendNotification']='Store Terrasse#Fermeture Store Terrasse'
end
return commandArray
Code : Tout sélectionner
commandArray={}
--pour connaitre les valeurs on met des print. Tu les commentes avec -- quand tu n'en as plus besoin.
print('otherdevices[\'UV\'] '..otherdevices['UV'])
print('otherdevices[\'Pluie\'] '..otherdevices['Pluie'])
-- print('otherdevices[\'Nuit\'] '..otherdevices['Nuit'])
print('otherdevices[\'Vent\'] '..otherdevices['Vent'])
-- print('otherdevices[\'Absence\'] '..otherdevices['Absence'])
print('otherdevices[\'Store Terrasse\'] '..otherdevices['Store Terrasse'])
print('otherdevices[uservariables["store exterieur"]] '..uservariables["store exterieur"])
-- Ouverture Store Terrasse
if (devicechanged['Store Terrasse']=='On' and otherdevices['Absence']=='Off') then
commandArray['Ouverture Store Terrasse']='On'
print('Ouverture Store Terrasse')
commandArray ['Variable:store exterieur']='ouvert'
commandArray['SendNotification']='Store Terrasse#Ouverture Store Terrasse'
-- Fermeture du Store Terrasse
elseif (devicechanged['Nuit']=='On' and otherdevices['Absence']=='Off' and otherdevices['Store Terrasse']=='16.0') then
commandArray['Fermeture Store Terrasse']='On'
print('Fermeture Store Terrasse')
commandArray ['Variable:store exterieur']='ferme'
commandArray['SendNotification']='Store Terrasse#Fermeture Store Terrasse'
end
return commandArray
Code : Tout sélectionner
commandArray={}
--pour connaitre les valeurs on met des print. Tu les commentes avec -- quand tu n'en as plus besoin.
print('otherdevices[\'Store Terrasse\'] '..otherdevices['Store Terrasse'])
print('otherdevices[uservariables["store exterieur"]] '..uservariables["store exterieur"])
-- Ouverture Store Terrasse
if (devicechanged['Store Terrasse']=='On' and uservariables["store exterieur"] == 'ferme' and otherdevices['Absence']=='Off') then
commandArray['Ouverture Store Terrasse']='On'
print('Ouverture Store Terrasse')
commandArray ['Variable:store exterieur']='ouvert'
commandArray['SendNotification']='Store Terrasse#Ouverture Store Terrasse'
-- Fermeture du Store Terrasse
elseif (devicechanged['Store Terrasse']=='Off' and uservariables["store exterieur"] == 'ouvert' and otherdevices['Absence']=='Off') then
commandArray['Fermeture Store Terrasse']='On'
print('Fermeture Store Terrasse')
commandArray ['Variable:store exterieur']='ferme'
commandArray['SendNotification']='Store Terrasse#Fermeture Store Terrasse'
end
return commandArrayCode : Tout sélectionner
commandArray={}
--pour connaitre les valeurs on met des print. Tu les commentes avec -- quand tu n'en as plus besoin.
print('otherdevices[\'Store Terrasse\'] '..otherdevices['Store Terrasse'])
print('otherdevices[uservariables["store exterieur"]] '..uservariables["store exterieur"])
-- Ouverture Store Terrasse
if (devicechanged['Store Terrasse'])
if uservariables["store exterieur"] == 'ferme' and otherdevices['Absence']=='Off') then
commandArray['Ouverture Store Terrasse']='On'
print('Ouverture Store Terrasse')
commandArray ['Variable:store exterieur']='ouvert'
commandArray['SendNotification']='Store Terrasse#Ouverture Store Terrasse'
-- Fermeture du Store Terrasse
elseif (uservariables["store exterieur"] == 'ouvert' and otherdevices['Absence']=='Off') then
commandArray['Fermeture Store Terrasse']='On'
print('Fermeture Store Terrasse')
commandArray ['Variable:store exterieur']='ferme'
commandArray['SendNotification']='Store Terrasse#Fermeture Store Terrasse'
end
end
return commandArrayJe ne vois pas l’intérêt puisque tu appuies sur le bouton, tu regardes s'il fait nuit.vr6man a écrit : 10 mai 2020, 18:13 Par contre comment rajouter pour que le store ne s'ouvre pas si il fait nuit
Code : Tout sélectionner
commandArray={}
--pour connaitre les valeurs on met des print. Tu les commentes avec -- quand tu n'en as plus besoin.
print('otherdevices[\'UV\'] '..otherdevices['UV'])
print('otherdevices[\'Pluie\'] '..otherdevices['Pluie'])
-- print('otherdevices[\'Nuit\'] '..otherdevices['Nuit'])
print('otherdevices[\'Vent\'] '..otherdevices['Vent'])
-- print('otherdevices[\'Absence\'] '..otherdevices['Absence'])
print('otherdevices[\'Store Terrasse\'] '..otherdevices['Store Terrasse'])
print('otherdevices[uservariables["store exterieur"]] '..uservariables["store exterieur"])
-- Ouverture Store Terrasse
if (devicechanged['Store Terrasse']=='On' and otherdevices['Absence']=='Off') then
commandArray['Ouverture Store Terrasse']='On'
print('Ouverture Store Terrasse')
commandArray ['Variable:store exterieur']='ouvert'
commandArray['SendNotification']='Store Terrasse#Ouverture Store Terrasse'
-- Fermeture du Store Terrasse
elseif (devicechanged['Nuit']=='On' and uservariables["store exterieur"] == 'ouvert'and otherdevices['Absence']=='Off' and otherdevices['Store Terrasse']=='16.0') then
commandArray['Fermeture Store Terrasse']='On'
print('Fermeture Store Terrasse')
commandArray ['Variable:store exterieur']='ferme'
commandArray['SendNotification']='Store Terrasse#Fermeture Store Terrasse'
end
return commandArray