Forum dédié aux problématiques concernant les scripts pour DomoticZ.
Entourez votre code et les logs avec les balises nommées code grâce au bouton <\>.
commandArray={}
print('otherdevices[\'Store Terrasse\'] '..otherdevices['Store Terrasse'])
print('otherdevices[\'Nuit\'] '..otherdevices['Nuit'])
-- Fermeture du Store Terrasse
if(otherdevices['Store Terrasse']=='16.0' and otherdevices['Nuit']=='On') then
commandArray['Store Terrasse']='Off'
print('Fermeture Store Terrasse')
commandArray['SendNotification']='Store Terrasse#Fermeture Store Terrasse'
end
return commandArray
@vr6man
Tu cherches quoi:
1- fermer ou ouvrir ton store en fonction de conditions et sans action sur un bouton de l'interface domoticz -> script_time
2- fermer ou ouvrir ton store en fonction de conditions et avec action sur un bouton de l'interface domoticz -> script_device
PI3+, Buster, Domoticz V2020.2, rflink, zwave, chauffage piloté par qubino, sondes oregon et Vil1d, boite aux lettres détection passage facteur, volets roulants qubino fibaro.
16 je ne sais pas. un pourcentage? il avait fini de s'ouvrir? tu as donc un problème avec le retour On/Off de ton/tes bouton(s). Regarde dans l'interface de domoticz/interrupteur les log de tes boutons.
Dernière modification par thier le 10 mai 2020, 14:36, modifié 1 fois.
PI3+, Buster, Domoticz V2020.2, rflink, zwave, chauffage piloté par qubino, sondes oregon et Vil1d, boite aux lettres détection passage facteur, volets roulants qubino fibaro.
thier a écrit : 10 mai 2020, 14:35
16 je ne sais pas. un pourcentage? tu as donc un problème avec le retour On/Off de ton/tes bouton(s). Regarde dans l'interface de domoticz/interrupteur les log de tes boutons.
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'])
if
-- Fermeture du Store Terrasse
if(devicechanged['Store Terrasse']=='Off' and otherdevices['Absence']=='Off' and otherdevices['Nuit']=='On') then
commandArray['Store Terrasse']='Off'
print('Fermeture Store Terrasse')
commandArray['SendNotification']='Store Terrasse#Fermeture Store Terrasse'
end
return commandArray
pense à enlever .lua des autres scripts pour pas que ça se morde la queue.
PI3+, Buster, Domoticz V2020.2, rflink, zwave, chauffage piloté par qubino, sondes oregon et Vil1d, boite aux lettres détection passage facteur, volets roulants qubino fibaro.
commandArray={}
print('otherdevices[\'Store Terrasse\'] '..otherdevices['Store Terrasse'])
print('otherdevices[\'Nuit\'] '..otherdevices['Nuit'])
-- Fermeture du Store Terrasse
if(otherdevices['Store Terrasse']=='16.0' and otherdevices['Nuit']=='On') then
commandArray['Store Terrasse']='Off'
print('Fermeture Store Terrasse')
commandArray['SendNotification']='Store Terrasse#Fermeture Store Terrasse'
end
return commandArray
Par contre en script device
avec le même script ca plante Domoticz car le script tourne en boucle
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'])
-- Fermeture du Store Terrasse
if(devicechanged['Store Terrasse']=='Off' and otherdevices['Absence']=='Off' and otherdevices['Nuit']=='On') then
commandArray['Store Terrasse']='Off'
print('Fermeture Store Terrasse')
commandArray['SendNotification']='Store Terrasse#Fermeture Store Terrasse'
end
return commandArray
PI3+, Buster, Domoticz V2020.2, rflink, zwave, chauffage piloté par qubino, sondes oregon et Vil1d, boite aux lettres détection passage facteur, volets roulants qubino fibaro.
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'])
-- Fermeture du Store Terrasse
if(devicechanged['Store Terrasse']=='Off' and otherdevices['Absence']=='Off' and otherdevices['Nuit']=='On') then
commandArray['Store Terrasse']='Off'
print('Fermeture Store Terrasse')
commandArray['SendNotification']='Store Terrasse#Fermeture Store Terrasse'
end
return commandArray