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
Apax 1
Hi Folks!
I try to learn lua code from scratch. not just copy & past... and i need some basic help
Why does not the lamp (id28) flash , when "door1" and "ir" becomes ones.
It feels like the script does not start automatically, but then I press the "start" it works if "door1" and "ir" are ones.
I am probably missing something, a start command?? (Active scene is checked)
my code:
--[[
%% autostart
%% properties
20 ,60 value
%% globals
--]]
local ir
local door1
door1 = fibaro:getValue(60, 'value')
ir = fibaro:getValue(20, 'value')
fibaro:debug('Doorsensor is = ' .. door1)
fibaro:debug('IR-sensor is = ' .. ir)
if (door1== "1") and (ir== "1") then
fibaro:call(28, "turnOn");
fibaro:sleep(2000);
fibaro:call(28, "turnOff");
end
2 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.