Aller au contenu
Smart

Hc2 y Remotec Zxt-120

Recommended Posts

--[[
%% autostart
%% properties
85 value
%% weather
%% events
%% globals
DiaNoche
--]]

local startSource = fibaro:getSourceTrigger();
if (
 ( fibaro:getGlobalValue("DiaNoche") == "Noche"  and  tonumber(fibaro:getValue(85, "value")) > 0 ))

  if (
      ( tonumber(fibaro:getValue(71, "value")) == 0 )) then
setTimeout(function()
local delayedCheck0 = false;
local tempDeviceState0, deviceLastModification0 = fibaro:get(71, "value");
if (( tonumber(fibaro:getValue(71, "value")) == 0 ) and (os.time() - deviceLastModification0) >= 600) then
    delayedCheck0 = true;
end
  then
    fibaro:call(85, "turnOff");
    fibaro:call(56, "setMode","0");
     
end

 

--[[
%% autostart
%% properties
71 value
%% weather
%% events
%% globals
--]]

if fibaro:countScenes() > 1  then
  fibaro:abort()
end

local startSource = fibaro:getSourceTrigger();
if (
 ( fibaro:getGlobalValue("DiaNoche") == "Dia"  and  fibaro:getGlobalValue("FrioCalor") == "Calor"  and  tonumber(fibaro:getValue(71, "value")) > 0 ))
then
	fibaro:call(85, "turnOn");
	fibaro:call(56, "setMode", "2");
	fibaro:call(54, "setThermostatSetpoint", "1", "24");
end

Bonjour, j’ai créé cette scène, où j’aimerais bien si c’est NUIT ou qu’il n’ya aucun mouvement pendant 10 minutes, éteignez l’air. Mais je ne peux pas le faire fonctionner, je ne sais pas où est l'erreur. Les appareils que j'ai sont un fgs223 connecté à l'air, un remotec zxt-120 et un capteur de mouvement Fibaro.

La même chose se produit lorsque vous activez l'air lorsqu'il fait jour et que la variable est en chaleur et qu'il y a du mouvement, puis allumez l'air.

Salutations

Partager ce message


Lien à poster
Partager sur d’autres sites

Hi @Smart

 

Maybe like this, no tested ;-)

--[[
%% autostart
%% properties
71 value
%% weather
%% events
%% globals
DiaNoche
--]]


if fibaro:countScenes() > 1  then fibaro:abort() end

local source = fibaro:getSourceTrigger()
local noche = fibaro:getGlobalValue("DiaNoche") == "Noche"
local nomove = tonumber(fibaro:getValue(71, "value")) == 0
local on = tonumber(fibaro:getValue(85, "value")) > 0
local lastModified = fibaro:getModificationTime(71, "value")

if source.type == "global" or source.type == "property" then
    if (noche and nomove and (os.time() - lastModified) >= 600) and on then
      fibaro:call(85, "turnOff")
      fibaro:call(56, "setMode","0")
    end
end

 

Partager ce message


Lien à poster
Partager sur d’autres sites
il y a 13 minutes, pepite a dit :

Hi @Smart

 

Maybe like this, no tested ;-)


--[[
%% autostart
%% properties
71 value
%% weather
%% events
%% globals
DiaNoche
--]]


if fibaro:countScenes() > 1  then fibaro:abort() end

local source = fibaro:getSourceTrigger()
local noche = fibaro:getGlobalValue("DiaNoche") == "Noche"
local nomove = tonumber(fibaro:getValue(71, "value")) == 0
local on = tonumber(fibaro:getValue(85, "value")) > 0
local lastModified = fibaro:getModificationTime(71, "value")

if source.type == "global" or source.type == "property" then
    if (noche and nomove and (os.time() - lastModified) >= 600) and on then
      fibaro:call(85, "turnOff")
      fibaro:call(56, "setMode","0")
    end
end

 

Merci beaucoup maintenant je l'essaie
La scène de l'inflammation de l'air est bien?
Parce qu'il y a des moments où je dois l'éteindre et l'allumer pour que la scène fonctionne?

Partager ce message


Lien à poster
Partager sur d’autres sites
Il y a 1 heure, pepite a dit :

Hola @Smart

 

Tal vez así, no probado ;-)







  
         

        

 

J'ai essayé la scène d'arrêt, mais le capteur était en sécurité pendant 11 minutes et la scène n'a pas été exécutée.

Partager ce message


Lien à poster
Partager sur d’autres sites

Hi,

 

I think it's normal, the scene will be executed only if the 4th conditions are OK :

 - DIANOCHE =Noche AND no detetction during 10 minutes AND 85 is ON.

 

Try this one i add debug.


 

--[[
%% autostart
%% properties
71 value
%% weather
%% events
%% globals
DiaNoche
--]]


if fibaro:countScenes() > 1  then fibaro:abort() end

local source = fibaro:getSourceTrigger()
local noche = fibaro:getGlobalValue("DiaNoche") == "Noche"
local nomove = tonumber(fibaro:getValue(71, "value")) == 0
local on = tonumber(fibaro:getValue(85, "value")) > 0
local lastModified = fibaro:getModificationTime(71, "value")

if source.type == "global" or source.type == "property" then
    if (noche and nomove and (os.time() - lastModified) >= 600) and on then
      fibaro:call(85, "turnOff")
      fibaro:call(56, "setMode","0")
      print("DiaNoche : " ..noche.. " - 85 : ON - No move during 10 minutes")
    else
      print("The 4th conditions are not OK, Not Noche or 85 not ON, or MOVE during the 10 minutes")
    end
end

 

Partager ce message


Lien à poster
Partager sur d’autres sites
Le 8/11/2018 à 5:37, pepite a dit :

Hola,

 

Creo que es normal, la escena se ejecutará solo si las condiciones 4 están bien :

 - DIANOCHE = Noche Y sin deteccción durante 10 minutos Y 85 está ENCENDIDO.

 

Intente esto, agrego la depuración.


 







  
         

          
    

Bonjour, j'ai essayé, les conditions sont réunies, mais il ne réagit pas. Cela ne le fait que si j'éteins et rallume la scène.
Lors du débogage, cela me dit que les conditions ne sont pas remplies, mais vérifiez les variables et les scènes et les conditions sont parfaites.

 

Partager ce message


Lien à poster
Partager sur d’autres sites

image.png.30ba7963c42f821e48eb50887d167c17.png

--[[
%% autostart
%% properties
%% weather
%% events
%% globals
--]]


if fibaro:countScenes() > 1  then fibaro:abort() end

local source = fibaro:getSourceTrigger()
local dia = fibaro:getGlobalValue("DiaNoche") == "Dia"
local calor = fibaro: getGlobalValue ("FrioCalor") == "Calor"  

if source.type == "global" then
      fibaro:call(36, "setMode", "2");
	  fibaro:call(34, "setThermostatSetpoint", "2", "24");
end  
		

La même chose vaut pour la scène d'allumage. Celui de lua directement ne tirant pas manuellement la scène fonctionne, celui de bloc je dois lui donner le jeu dans l'icône pour qu'il s'active.

Partager ce message


Lien à poster
Partager sur d’autres sites
il y a 45 minutes, Smart a dit :

si j'éteins et rallume la scène.

Hi, then the scene is ok also ?

the scene starts only when the ID 71 change or when Global Dianoche change. It was what you do in your first scene. It's not waht you want ?

Partager ce message


Lien à poster
Partager sur d’autres sites
il y a 11 minutes, pepite a dit :

Hola, entonces la escena está bien también?

la escena comienza solo cuando la identificación 71 cambia cuando cambia Dianoche global. Fue lo que haces en tu primera escena. ¿No es lo que quieres?

Ce serait dans cette pièce que je devrais remplir les 2 conditions, si c'est NUIT (après 20 heures jusqu'à 7 heures du matin) ou s'il n'y a pas de mouvement, que l'air sorte. Quand je vais à la nuit, l'air est allumé.
Dans une autre pièce, je lui ai juste dit de s'éteindre la nuit, et il ne l'a pas fait non plus. Et la scène d'éclairage quand il fait jour, ne le fait pas automatiquement non plus.

--[[
%% autostart
%% properties
%% weather
%% events
%% globals
DiaNoche
--]]


if fibaro:countScenes() > 1  then fibaro:abort() end

local source = fibaro:getSourceTrigger()
local noche = fibaro:getGlobalValue("DiaNoche") == "Noche"

if source.type == "global" then
      fibaro:call(85, "turnOff")
      fibaro:call(56, "setMode","0")
      print("DiaNoche : " ..noche.. "")
    else
      print("The  conditions is not OK, Not Noche")
end
			

 

Partager ce message


Lien à poster
Partager sur d’autres sites

@Smart

 Bizz. an test this maybe. 85 should be on ;-)
 

--[[
%% autostart
%% properties
%% weather
%% events
%% globals
DiaNoche
--]]


if fibaro:countScenes() > 1  then fibaro:abort() end

local source = fibaro:getSourceTrigger()
local noche = fibaro:getGlobalValue("DiaNoche") == "Noche"

if source.type == "global" then -- if its the caribale global who starts the scene
    print("Variable starts the scene : " ..source.varName.. " - DiaNoche : " ..fibaro:getGlobalValue("DiaNoche"))
    if noche then -- if DiaNoche == Noche
        fibaro:call(85, "turnOff")
        fibaro:call(56, "setMode","0")
        print("Extinction of 85 and setMode 56 to 0")
    end

else
      print("The  conditions is not OK, Not Noche")
end

 

Partager ce message


Lien à poster
Partager sur d’autres sites
il y a 19 minutes, pepite a dit :

@Smart

 Bizz. an test this maybe. 85 should be on ;-)
 


--[[
%% autostart
%% properties
%% weather
%% events
%% globals
DiaNoche
--]]


if fibaro:countScenes() > 1  then fibaro:abort() end

local source = fibaro:getSourceTrigger()
local noche = fibaro:getGlobalValue("DiaNoche") == "Noche"

if source.type == "global" then -- if its the caribale global who starts the scene
    print("Variable starts the scene : " ..source.varName.. " - DiaNoche : " ..fibaro:getGlobalValue("DiaNoche"))
    if noche then -- if DiaNoche == Noche
        fibaro:call(85, "turnOff")
        fibaro:call(56, "setMode","0")
        print("Extinction of 85 and setMode 56 to 0")
    end

else
      print("The  conditions is not OK, Not Noche")
end

 

Ok, maintenant j'essaye.
En ce qui concerne l'allumage, voyez-vous quelque chose d'étrange? Je veux pendant la journée s'il fait chaud allumer l'air à 24 °. Pour cela j'ai fait une variable FROID, et après une scène qui me dit que si la T ° du mouvement dépasse 27 ° = Chaleur

Partager ce message


Lien à poster
Partager sur d’autres sites
il y a une heure, Smart a dit :

--[[ %% autostart %% properties %% weather %% events %% globals --]]

For the "ON"Scene, you mis the name of the variable in the header

Partager ce message


Lien à poster
Partager sur d’autres sites
il y a 42 minutes, pepite a dit :

Para la escena "ON", pones el nombre de la variable en el encabezado

--[[
%% autostart
%% properties
%% weather
%% events
%% globals
DiaNoche
FrioCalor
--]]


if fibaro:countScenes() > 1  then fibaro:abort() end

local startSource = fibaro:getSourceTrigger();
if (
 ( fibaro:getGlobalValue("DiaNoche") == "Dia"  and  fibaro:getGlobalValue("FrioCalor") == "Calor" ))
then
	fibaro:call(36, "setMode", "2");
	fibaro:call(34, "setThermostatSetpoint", "2", "24");
end

Je mets les variables, mais ça ne réagit pas non plus

Partager ce message


Lien à poster
Partager sur d’autres sites

Bonjour @Smart

 

You change the code i sent to you to test.

The scene will start only WHEN the variableCHANGE, only at that moment.

So the scene will start WHEN the variable DIANOCHE is modified :

 

NOCHE --> DIA

AND

DIA --> NOCHE

Partager ce message


Lien à poster
Partager sur d’autres sites
Hace 3 horas, nagger dijo:

Hola @Smart

 

Cambias en el código que que que que pruebes.

La escena debe solo la variable CUANDO CAMBIA, solo en ese momento.

Entonces la escena de CUANDO es la variable modificada DIANOCHE :

 

NOCHE -> DIA

Y

DIA -> NOCHE

 
 
 
 
 
224/5000
 
Oui, je comprends cela, mais la variable a changé de Nuit à Jour et elle n’a pas activé les ondes. Le sujet de la variable Chaleur Froide, ne changera pas car nous sommes pratiquement en été et toujours la température est supérieure à 27 °

Partager ce message


Lien à poster
Partager sur d’autres sites

×