Aller au contenu

Rechercher dans la communauté

Affichage des résultats pour les étiquettes 'Association modules'.



Plus d’options de recherche

  • Rechercher par étiquettes

    Saisir les étiquettes en les séparant par une virgule.
  • Rechercher par auteur

Type du contenu


Forums

  • Bienvenue
    • Nouveau ? Présentez-vous
    • Le bistrot
    • Mon installation domotique
    • Annonces et suggestions
  • La Home Center et ses périphériques
    • La Home Center pour les nuls
    • HC 2 & Lite
    • HC 3
    • Modules Fibaro
    • Modules Z-wave
    • Périphériques et matériels autres
    • Plugins
    • Quick App
    • Multimédia (audio, vidéo ...)
    • Chauffage et Energie
    • Actionneurs & Ouvrants (Portail, volets, piscines, ...)
    • Eclairage
    • Applications Smartphones et Tablettes
  • Autres solutions domotiques
    • Box / Logiciel
    • Modules Nice (433 & 866 MHz)
    • Modules Zigbee
    • GCE Electronics
    • Modules Bluetooth Low Energy
  • Objets connectés
    • Les Assistants Vocaux
    • Netatmo
    • Philips Hue
    • DIY (Do It Yoursel)
  • Sécurité
    • Alarmes
    • Caméras
    • Portiers
    • Serrures
  • Informatique / Réseau
    • Tutoriels
    • Matériels Réseaux
    • Matériels Informatique
    • NAS
    • Virtualisation
  • Les bonnes affaires
    • Sites internet
    • Petites annonces

Calendriers

Aucun résultat à afficher.


Rechercher les résultats dans…

Rechercher les résultats qui…


Date de création

  • Début

    Fin


Dernière mise à jour

  • Début

    Fin


Filtrer par nombre de…

Inscription

  • Début

    Fin


Groupe


Jabber


Skype


Ville :


Intéret :


Version

1 résultat trouvé

  1. Shad

    Association De Module

    Associations des Modules Ce tutoriel à pour but d'expliquer comment associer efficacement des modules entre eux tous en évitant de faire des changements d'états inutiles. Pour quoi éviter les associations avec la Fibaro: Trop fouillis pour moi Faut une bonne mémoire pour ce rappeler de toutes les associations Peut-être difficile à débugger en cas de problème 1- Pour commencer l'entête du script, on y mettra les ID qui doivent démarrer la scène: --[[ %% properties 12 value 50 value 60 value 64 value %% globals --]] 2- On définie nos locals et nos modules : local startSource = fibaro:getSourceTrigger(); --Settings debug = "no"; --IdDevice lightMasterBathRoom = 12; ledMasterBathRoom = 26; rgbwMasterBathRoom = 30; lightKitchen = 60; lightSalleManger = 64; lightSalleManger2 = 62; spotKitchen = 88; lightRoom2 = 50; light2Room2 = 52; La fonction debug affichera en rouge un turnOn, en bleue un turOn, en vert un valeur et en orange la valeur et l'id de lu module de commande 3- La fonction qui permet d'éviter les changements d'états inutile. function StateDevice (typeDevice, idDevice, valueDevice) if (typeDevice == "contactDevice") then if (valueDevice == "turnOff") then if ( tonumber(fibaro:getValue(idDevice, "value")) == 1) then fibaro:call(idDevice, "turnOff"); if (debug == "yes") then fibaro:debug("<font color='blue'>Id: " .. idDevice .. ", value: TurnOff</font> "); end end elseif (valueDevice == "turnOn") then if ( tonumber(fibaro:getValue(idDevice, "value")) == 0) then fibaro:call(idDevice, "turnOn"); if (debug == "yes") then fibaro:debug("<font color='red'>Id: " .. idDevice .. ", value: TurnOn </font> "); end end end end if (typeDevice == "RgbwDevice") then if (valueDevice == "turnOff") then if ( tonumber(fibaro:getValue(idDevice, "value")) ~= 0) then fibaro:call(idDevice, "turnOff"); if (debug == "yes") then fibaro:debug("<font color='blue'>Id: " .. idDevice .. ", value: TurnOff </font> "); end end elseif (valueDevice == "turnOn") then if ( tonumber(fibaro:getValue(idDevice, "value")) == 0) then fibaro:call(idDevice, "turnOn"); if (debug == "yes") then fibaro:debug("<font color='red'>Id: " .. idDevice .. ", value: TurnOn </font> "); end end end end if (typeDevice == "DimmerDevice") then if (valueDevice == "turnOn" or valueDevice == "turnOff") then if (valueDevice == "turnOff") then if ( tonumber(fibaro:getValue(idDevice, "value")) ~= valueDevice) then fibaro:call(idDevice, "turnOff"); if (debug == "yes") then fibaro:debug("<font color='blue'>Id: " .. idDevice .. ", value: TurnOff </font> "); end end elseif (valueDevice == "turnOn") then if ( tonumber(fibaro:getValue(idDevice, "value")) == valueDevice) then fibaro:call(idDevice, "turnOn"); if (debug == "yes") then fibaro:debug("<font color='red'>Id: " .. idDevice .. ", value: TurnOn </font> "); end end end elseif ( tonumber(fibaro:getValue(idDevice, "value")) ~= valueDevice) then fibaro:call(idDevice, "setValue", valueDevice); if (debug == "yes") then fibaro:debug("<font color='green'>Id: " .. idDevice .. ", value: " .. valueDevice .. " </font> "); end end elseif (typeDevice == "contactBlind") then if (valueDevice == "Close" or valueDevice == "Open") then if (valueDevice ~= "Close") then if ( tonumber(fibaro:getValue(idDevice, "value")) ~= 0) then fibaro:call(idDevice, "close"); if (debug == "yes") then fibaro:debug("<font color='blue'>Id: " .. idDevice .. ", value: Fermé </font> "); end end elseif (valueDevice == "Open") then if ( tonumber(fibaro:getValue(idDevice, "value")) ~= 99) then fibaro:call(idDevice, "open"); if (debug == "yes") then fibaro:debug("<font color='red'>Id: " .. idDevice .. ", value: Ouvert </font> "); end end end elseif ( tonumber(fibaro:getValue(idDevice, "value")) ~= valueDevice) then fibaro:call(idDevice, "setValue", valueDevice); if (debug == "yes") then fibaro:debug("<font color='green'>Id: " .. idDevice .. ", value: " .. valueDevice .. " </font> "); end end end end La fonction StateDevice a besoin de 3 paramètres: typeDevice qui a pour valeur: contactDevice/RgbwDevice/DimmerDevice/contactBlind idDevice: l'id du device qu'il faut modifier l'état valueDevice qui a pour valeur: turnOn/turnOff/Close/Open/0-99 Attention, vue qu'il y a un problème pour les volets avec la box, le contactBlind ne fonctionne pas. 4- Et pour finir on met notre code d'associations: if (startSource['type']=='property') then if (debug == "yes") then fibaro:debug("<font color='green'>Id:" .. startSource['deviceID'] .. ", value: " .. tonumber(fibaro:getValue(startSource['deviceID'], "value")) .. "</font> "); end -- Lumière salle de bain Master if (startSource['deviceID'] == lightMasterBathRoom) then if ( tonumber(fibaro:getValue(lightMasterBathRoom, "value")) == 99 ) then StateDevice ("contactDevice", ledMasterBathRoom, "turnOn"); StateDevice ("RgbwDevice", rgbwMasterBathRoom, "turnOn"); elseif ( tonumber(fibaro:getValue(lightMasterBathRoom, "value")) <= 95 ) then StateDevice ("contactDevice", ledMasterBathRoom, "turnOff"); StateDevice ("RgbwDevice", rgbwMasterBathRoom, "turnOff"); end elseif (startSource['deviceID'] == lightKitchen) then if ( tonumber(fibaro:getValue(lightKitchen, "value")) == 99 ) then StateDevice ("contactDevice", spotKitchen, "turnOn"); elseif ( tonumber(fibaro:getValue(lightKitchen, "value")) < 99 ) then StateDevice ("contactDevice", spotKitchen, "turnOff"); end elseif (startSource['deviceID'] == lightRoom2) then if ( tonumber(fibaro:getValue(lightRoom2, "value")) == 99 ) then --StateDevice ("contactDevice", spotKitchen, "turnOn"); fibaro:call(52, "setValue", "99") elseif ( tonumber(fibaro:getValue(lightRoom2, "value")) < 99 ) then --StateDevice ("contactDevice", spotKitchen, "turnOff"); fibaro:call(52, "setValue", "0") end elseif (startSource['deviceID'] == lightSalleManger) then StateDevice ("DimmerDevice", lightSalleManger2, fibaro:getValue(lightSalleManger, "value")); end end Je vous ai mis qu'une partie de mon code pour voir un peu le fonctionnement. Amusez-vous bien.
×