Welcome to Smart Home Forum by FIBARO
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!
Smart Home Forum by FIBARO Team
I'm confused to run scene with or without "while true do" cycle to use scene all triggered command change.
I have the following easy code without "while true do" to change the airfresh working status if the alarm system is on or off. Work without an problem, if the alarm system status ( thrue smart implant input ) is changed the wall plug of the airfresh also changed
Here is the LUA code:
local airfreshId = 55;
alarm = tonumber(fibaro:getValue(34, 'value'));
airfreshStatus = tonumber(fibaro:getValue(airfreshId, 'value'));
if ( alarm == 0 and airfreshStatus == 0 )
elseif ( alarm == 1 and airfreshStatus == 1 )
-- Main program
And here is the similar LUA code when I need to switch on or off the bathroom electrical radiator heating. If I use this LUA code without "while true do" cycle and I change the termostat adjustment no any action happened. If I use the same code with "while true do" cycle this work perfect.
local thermostat -- id:28 radiator thermosztat
local roomtemp -- id:29 room temperature
local radiatorheatId = 54; -- id:54 radiator heating
local heatingwater -- id:281 boiler heating water temp
local heatingwaterpump -- id:272 heating water pump
local tempswitch = true;
thermostat = tonumber(fibaro:getValue(28, 'value'));
roomtemp = tonumber(fibaro:getValue(29, 'value'));
heatingwater = tonumber(fibaro:getValue(281, "value"));
heatingwaterpump = tonumber(fibaro:getValue(272, "value"));
if ( (roomtemp - thermostat) >= 0 )
tempswitch = false;
tempswitch = true;
( tempswitch == true and
heatingwater < 30 and
heatingwaterpump == 0 )
-- Main program
while true do
fibaro:sleep(60000); -- Wait 1 minute
Can you please advise why I need to run while true do cycle in the 2nd program, if the 1st program run without this cycle perfect ?
Link to comment
Share on other sites
0 answers to this question
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.