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
sam9s 0
Hi Friends
I am trying to create a simple scene where, as long as the door is open the alarm rings, and the moment the door is closed the alarm should stop. I am trying to achieve this via while do loop but without success.
I open the door alarm rings, but it does not switches off when door is closed. Below is the code
The logic is as follows .
If Door Ajar == Armed and breached
then
alarm turns on
and keep on running while the door is ajar
the moment door is closed the alarm stops
what is happening is the while loop gets stuck and you cannot even disarm the alarm in that case ....
--[[
%% properties
204 value
204 armed
%% weather
%% events
%% globals
--]]
local startSource = fibaro:getSourceTrigger();
if (
( (tonumber(fibaro:getValue(204, "value")) > 0 and tonumber(fibaro:getValue(204, "armed")) > 0) )
or
startSource["type"] == "other"
)
then
while ( tonumber(fibaro:getValue(204, "value")) ~= 0 ) do
fibaro:call(194, "turnOn");
end
end
Edited by sam9s9 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.