Ghoosti 17 Signaler ce message Posté(e) 16 août 2019 (modifié) Bonjour, Je viens de parcourir le topic et je n'ai pas vu (ou trouver) si cela était possible. J'essaie de changer l'icone principal d'un VD en fonction du résultats de plusieurs variables. J'ai ceci dans le main loop qui fonctionne MAIS pour 1 variable --[[ %% autostart %% properties %% globals --]] local ID = fibaro:getSelfId() local StatutECLCuisine = fibaro:getGlobal('StatutECLCuisine') local StatutECLLivingTBL = fibaro:getGlobal('StatutECLLivingTBL') local StatutECLLiving = fibaro:getGlobal('StatutECLLiving') local StatutECLSalon = fibaro:getGlobal('StatutECLSalon') local StatutECLTerrasse = fibaro:getGlobal('StatutECLTerrasse') fibaro:call(ID,"setProperty","ui.Label1.value",StatutECLCuisine) fibaro:call(ID,"setProperty","ui.Label2.value",StatutECLLivingTBL) fibaro:call(ID,"setProperty","ui.Label3.value",StatutECLLiving) fibaro:call(ID,"setProperty","ui.Label4.value",StatutECLSalon) fibaro:call(ID,"setProperty","ui.Label5.value",StatutECLTerrasse) -- ID des icones local icoOFF = 1061 local icoON = 1062 if StatutECLCuisine == "OFF" then fibaro:call(ID,"setProperty","currentIcon",icoOFF) else fibaro:call(ID,"setProperty","currentIcon",icoON) end Voici le VD en question, donc comment faire pour le second ? Living Table ? J'essaye de ne pas passer par les boutons Merci Modifié 16 août 2019 par Ghoosti Partager ce message Lien à poster Partager sur d’autres sites
Lorenzo 18 Signaler ce message Posté(e) 16 août 2019 (modifié) hello je suppose que je ne comprends pas tout mais je suppose que tu as essayé : if (StatutECLCuisine == "ON" or StatusLivTable = "ON" ) then fibaro:call(ID,"setProperty","currentIcon",icoON) else fibaro:call(ID,"setProperty","currentIcon",icoOFF) end Ne faut il pas declarer les 2 variables dans %% Globals ? Modifié 16 août 2019 par Lorenzo Partager ce message Lien à poster Partager sur d’autres sites
Ghoosti 17 Signaler ce message Posté(e) 18 août 2019 Salut Lorenzo, Oui c bien ce que j'essaye de faire Ne faut il pas declarer les 2 variables dans %% Globals ? Comme ceci ? --[[ %% autostart %% properties %% globals StatutECLCuisine StatutECLSalon --]] MAIS rien ne change, les icônes ne changent pas Partager ce message Lien à poster Partager sur d’autres sites
Ghoosti 17 Signaler ce message Posté(e) 18 août 2019 (modifié) OK, ça fonctionne avec ceci --[[ %% autostart %% properties %% globals --]] if Cuisine == "ON" or Salon == "ON" then fibaro:call(idVD,"setProperty","currentIcon",icoON) else fibaro:call(idVD,"setProperty","currentIcon",icoOFF) end Au final j'ai ceci et ça fonctionne, merci @Lorenzo --[[ %% autostart %% properties %% globals --]] -- ID des icones local icoOFF = 1061 local icoON = 1062 if Cuisine == "ON" or LivingTable == "25" or LivingTable == "50" or LivingTable == "75" or LivingTable == "100" or Living == "25" or Living == "50" or Living == "75" or Salon == "ON" or Terrasse == "ON" then fibaro:call(idVD,"setProperty","currentIcon",icoON) else fibaro:call(idVD,"setProperty","currentIcon",icoOFF) end Modifié 18 août 2019 par Ghoosti MAJ Partager ce message Lien à poster Partager sur d’autres sites
Lorenzo 18 Signaler ce message Posté(e) 25 août 2019 Partager ce message Lien à poster Partager sur d’autres sites