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

debug error lua:191: 'then' expected near ')'


Question

Posted

 

 

Please login or register to see this code.

I added a second sensor to my lua scene. and im now receiving this fatal exception. any pointers would be great!

 

[DEBUG] 15:50:30: [1;31m2018-08-21 15:50:30.843858 [ fatal] Unknown exception: /opt/fibaro/scenes/60.lua:191: 'then' expected near ')'

Please login or register to see this attachment.

5 answers to this question

Recommended Posts

  • 0
Posted

There is exactly the problem as the error message says. One opening bracket is missing or one closing is too much.

Remove the last closing bracket in line 189

  • 0
  • Inquirer
  • Posted

    @Alex thanks! i didnt realize the extra on 189 was causing that. it fixed the issue.  now i have new one after starting the scene.. hopefully you might be able to find the error. it says i have an unexpected ')' on  203.  i combed through it looking for typos and couldnt find any...

    Please login or register to see this attachment.

    Please login or register to see this attachment.

    • 0
    Posted

    Add one opening bracket at beginning of line 200

    ( I am not sure if your or/and constructs are all right).

     

    • 0
    Posted

    Please login or register to see this image.

     

    error here

     

    (tonumber(fibaro:getValue(jT.entrance.motion2,'value')) > 0) ) and

    should be

    (tonumber(fibaro:getValue(jT.entrance.motion2,'value')) > 0) and
    • 0
    Posted

    @matt1981

    May I suggest to define jT as global variable of the code. In this case you do not need to define it again and again in every function.

    To do so, just remove local statement at  the beginning:

    jT = json.decode(fibaro:getGlobalValue("jTable"))

    instead of

    local  jT = json.decode(fibaro:getGlobalValue("jTable"))

    Now you can delete all local definitions of jT in all functions

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...