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!



Smart Home Forum by FIBARO Team

  • 0

Quick lua code help please, getting error



One quick question I hope someone can help me with.

So I used your code and for a certain user I want to set a global variable to 1 and after timeout change it back to 0. I did this the following:


if (sa == '4') then

fibaro.debug("keypad", "Kids")

hub.setGlobalVariable('keypad_Kids', '1')

hub.setTimeout(3000, function()

hub.setGlobalVariable('keypad_Temp', '0')

hub.alert('push', {[1] = 2, }, 'Kids keypad Used', false, '')



But I get an error message: ‘end’ expected (to close ‘if’ at line 25) near



What am I doing wrong and how can I fix it?


Thanks in advance!

Link to comment
Share on other sites

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.

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...