Bonsoir Keros,
Pour le moment je n'ai pas cherché avec la fonction os.date() à faire quoi que ce soit, je suis resté sur ton idée d'interrupteur virtuel sur lesquels je met une tempo d'allumage et lorsqu'il s'enclenche, ça déclenche ma contrainte de temps et la vérification est alors faite.
J'ai voulu réduire mes conditions, plutôt que faire des if then if then if then, j'ai voulu faire faire un if then else mais ça n'a pas fonctionné, j'ai du faire un if then else if
Si dans ce code je remplace le else if (condition) par un simple else, je reçoit des notifications toutes les 2 secondes.... Je comprend pas trop pourquoi.
Et bien écoute, je te remercie encore, moi qui y'a 2 jours je me demandais comment je m'en serai sorti... Ce n'est rien de folichon, mais bien content d'y être arrivé. Merci
Code : Tout sélectionner
Heure_Actuelle=os.date("%X")
commandArray = {}
if (devicechanged['Interrupteur salon'] == 'On') then
commandArray['Timer-Virtuel-5s'] = 'On'
commandArray['Timer-Virtuel-120s'] = 'On'
end
if (devicechanged['Timer-Virtuel-120s'] == 'On'and (otherdevices_temperature['Temp-virtuel'] < 100)) then
pression = (otherdevices['Temp-virtuel'])
pression=tonumber(pression)
commandArray['SendNotification']='DANGER POMPE#Désamorçage POMPE à : '..(Heure_Actuelle)..' @ '..(pression)..' bars#2'
commandArray['Interrupteur salon'] = 'Off'
elseif(devicechanged['Timer-Virtuel-120s'] == 'On'and (otherdevices_temperature['Temp-virtuel'] > 100)) then
commandArray['SendNotification']='POMPE OK#@bars#0'
end
return commandArray
Raspberry Pi 3, Domoticz, RFXComm, contrôle RTS, contrôle SPOT PISCINE

, 2 inter Chacon 1000W, 2 inter CHACON 3000W, AEON Stick ZWAVE, 1 wall plug
1 WEMOS avec capteur pression
Boitier sonde + LED en cours...