Aller au contenu

killing instances


Smart

Messages recommandés

--[[
%% autostart
%% properties
199 value
182 value
%% weather
%% events
%% globals
--]]

local startSource = fibaro:getSourceTrigger();
if ( ( tonumber(fibaro:getValue(199, "value")) == 0  and  fibaro:getGlobalValue("DiaNoche") == "Noche"  and  fibaro:getGlobalValue("Tecla") == "No"  and  tonumber(fibaro:getValue(182, "value")) > 0 )
or
startSource["type"] == "other")
then
	fibaro:call(199, "turnOn");
	setTimeout(function()
		fibaro:call(199, "turnOff");
	end, 60000)
if (fibaro:countScenes() > 1) then
  fibaro:abort()
end

Good afternoon, I want to create a scene that fulfills the following characteristics;
If it is night and the key is not active (create a variable that tells me if Key Yes / No) then the light goes on 60 seconds when it passes through the Motion Sensor.
But it does not work for me, and at the same time every time the scene is triggered I want to kill that instance.

Lien vers le commentaire
Partager sur d’autres sites

hello, 

 

try to move :

il y a 20 minutes, Smart a dit :

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

at the begining of the scene, before :

il y a 21 minutes, Smart a dit :

local startSource = fibaro:getSourceTrigger();

 

Lien vers le commentaire
Partager sur d’autres sites

il y a 2 minutes, jjacques68 a dit :

Hola, 

 

Intenta moverte :

al comienzo de la escena, antes :

 

Excuse my ignorance, in which part of the scene I put it?
I converted it from block to Lua, it worked well on the block, the only thing that when the 10 instances were completed did not work anymore, that's why I turned it into LUA and I added the Kill option to it.

Lien vers le commentaire
Partager sur d’autres sites

i think something like that :

 

--[[
%% properties
199 value
182 value
%% weather
%% events
%% globals
--]]

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


if tonumber(fibaro:getValue(199, "value")) == 0 
	and fibaro:getGlobalValue("DiaNoche") == "Noche"
	and fibaro:getGlobalValue("Tecla") == "No"
	and tonumber(fibaro:getValue(182, "value")) > 0
then
	fibaro:call(199, "turnOn")
	setTimeout(function()
					fibaro:call(199, "turnOff")
				end, 60000)
end

i deleted %%autostart and conditions with trigger.

Lien vers le commentaire
Partager sur d’autres sites

×
×
  • Créer...