Aller au contenu

killing instances


Messages recommandés

Posté(e)
--[[
%% 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.

Posté(e)

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();

 

Posté(e)
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.

Posté(e)

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.

×
×
  • Créer...