Jump to content

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


  • 0

'then' expected near ')' error in scene. help asked?


Guest samuelboerhoop

Question

Guest samuelboerhoop

What is wrong with this scene?

 

I got an error message as follows: [[DEBUG] 17:28:23: line 14: 'then' expected near ')'

 

 

--[[
%% properties
%% globals
Time
Auto_Sleep_Mode
--]]
 
local cTime = fibaro:getGlobalValue('Time')
-- fibaro:debug(cTime)
 
--local cTime = os.date("%H:%M", os.time())
 
if (
 ( cTime == '01:30' ) and tonumber(fibaro:getValue(135, "value")) == 0  and fibaro:getGlobalValue("Auto_Sleep_Mode") == "AWAKE" ))
then
--fibaro:setGlobal("Auto_Sleep_Mode", "SLEEPING");
fibaro:setGlobal("Awake_Message", "FORGOT LIGHTS");
setTimeout(function()
fibaro:startScene(253); -- 175
end, 5000)
end
 
 
 
 
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Brackets are wrong :

Please login or register to see this code.

 
Count the opening and closing ones and you will see it

Please login or register to see this image.

/emoticons/default_wink.png" alt=";)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />
Link to comment
Share on other sites

  • 0
Guest samuelboerhoop
  • Inquirer
  • ok i got it: this gives me no errors anymore:

     

    if (
     ( cTime == '01:30' ) and tonumber(fibaro:getValue(135, "value")) == 0  and  fibaro:getGlobalValue("Auto_Sleep_Mode") == "AWAKE"  
    )
    Link to comment
    Share on other sites

    Guest
    This topic is now closed to further replies.
    ×
    ×
    • Create New...