Welcome to Smart Home Forum by FIBARO
Dear Guest,
as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.
As a member you can:
- Start new topics and reply to others
- Follow topics and users to get email updates
- Get your own profile page and make new friends
- Send personal messages
- ... and learn a lot about our system!
Regards,
Smart Home Forum by FIBARO Team
Question
nmins 0
Hi,
I'm sorry if the question is stupid, or if it is to be found on this forum in an other way, but I spend the last 7 hours struggling... I'm trying to create a LUA scene that will alert me when the garden gate is open for 10 minutes. The reason why I feel stupid about it is that I already have scenes that do exactly this, and they all work fine. The difference with these is that I use door sensors for the scenes that are working and the garden gate has a build in ZWave IBT4ZWAVE.
So, in attempt to give something back to whoever can help me, this is a Lua scene that actually works:
---------------------------------------
--[[
%% properties
100 value
%% weather
%% events
%% globals
--]]
local startSource = fibaro:getSourceTrigger();
if(startSource["type"] == "other") then
fibaro:call((fibaro:getGlobal('AaiFoon')), 'sendPush', "Backdoor open for 10 minutes!!" );
else
if (( tonumber(fibaro:getValue(100, "value")) > 0 )) then
setTimeout(function()
local delayedCheck0 = false;
local tempDeviceState0, deviceLastModification0 = fibaro:get(100, "value");
if (( tonumber(fibaro:getValue(100, "value")) > 0 ) and (os.time() - deviceLastModification0) >= 600) then
delayedCheck0 = true;
end
local startSource = fibaro:getSourceTrigger();
if (
( delayedCheck0 == true )
or
startSource["type"] == "other"
)
then
fibaro:call((fibaro:getGlobal('AaiFoon')), 'sendPush', "Backdoor open for 10 minutes!!" );
end
end, 600000)
end
end
---------------------------------------
The problem with the GardenGate module is that I want to get a notification whenever the "state" is not "Closed", while the "value" of a door sensor is giving back true or false, which can be converted to numbers (I Think that that is the issue). Unfortunately, I do not understand the initial Lua code very well as I "Copied it with pride" almost 4 years ago, and I cannot find the initial source anymore...
I figured that it should not be so difficult to start some kind of 10 minute countdown to an action, that gets canceled if the status changes in the meantime, but that was 7 hours ago ... :-(
So any help from you guru's will be greatly appreciated.
Nmins
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.