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

Basic Code Clips for LUA starters


robmac

Question

To help those that are not familiar with LUA a starter library of clips that work in Fibaro.

Please add any you find useful.

Link to comment
Share on other sites

  • Answers 151
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

Posted Images

Recommended Posts

  • 0

Ok

Problem solved, it works

Thanks

Please login or register to see this image.

/emoticons/default_icon_smile.gif" alt=":-)" />

Link to comment
Share on other sites

  • 0

Hi,

I'm having trouble with multiple click function and dimmer.

I want to do something like this:

2clicks - turns ON my bedroom light to 100%

3clicks - my house goes to sleep and bedroom light DO NOT turn on 100%

Right now dimmer recognizes two clicks every time and lights will go 100% - but its sooo bright then. I made a scene which dimmed the lights, but still this takes some time before starts..

how can I skip ID14 (2clicks) when I'm making 3 clicks

Please login or register to see this image.

/emoticons/default_icon_question.gif" alt=":?:" />

Link to comment
Share on other sites

  • 0

I never made it working properly 3click function. I decided to stack to 1click plus long press...

Link to comment
Share on other sites

  • 0

example how to set up rain delay for drenchers or adjustWater

all data you can get from there

Please login or register to see this code.

virtual device code

Please login or register to see this code.

Link to comment
Share on other sites

  • 0
Arbu-jl,

try this one

Please login or register to see this code.

Hi A.Socha, i tried your latest script above customizing it with my config, works perfect for the 1st heating section but then stops and i get the following error in the debug window:

"[ERROR] 20:27:10: line 25: attempt to call field 'decode' (a nil value)"

Can you let me know how i can correct this ?

Thanks

Geo

Link to comment
Share on other sites

  • 0

xXGEOXx, check ip hc2 and password in code

Please login or register to see this code.

Link to comment
Share on other sites

  • 0
xXGEOXx, check ip hc2 and password in code

Please login or register to see this code.

Hi A.Socha, exactly what I did first on top of editing section id. I just checked again and I have my ip and password associated to my box in there. it does put the first section on holliday temp, the problem happen starting at the second section id where for some reasons it seems not able to retrieve current set temp...my section id are 3,4,5,6,7 and 3 is well set on holliday mode. If ip/password were not correct it wouldn't even change the first section id, correct ?

Thanks

Geo

Link to comment
Share on other sites

  • 0

Looking forward a solution to switch off the heating when a bunch of windows / doors are opened.

Idea is to add a list of door / windows sensors, if they are opened for more than 5 minutes for example, then heaters (electrical heating) are turned off until door is closed.

When the doors / windows are all closed then, have to wait for 10 minutes (for example) then enable again the heating as it was before.

Do someone has same kind of code to share (maybe LUA code I think, or nice integrated feature ?).

Thanks

Xavier

Link to comment
Share on other sites

  • 0
-25 and +25 is how many minutes after or before sunrise/sunset

Please login or register to see this code.

Hello jompa, thank you for this example. I'm new to lua and the problem that I had with this example is that you have to wait until the next sunrise and sunset occurs before the global variable "Night" is set.

I modified your code and came up with the solution below. When you run this, It will set "Night" immediately.

Please login or register to see this code.

Jan

Link to comment
Share on other sites

  • 0
Hi A.Socha, i tried your latest script above customizing it with my config, works perfect for the 1st heating section but then stops and i get the following error in the debug window:

"[ERROR] 20:27:10: line 25: attempt to call field 'decode' (a nil value)"

Can you let me know how i can correct this ?

Any solution? Have the same issue.

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Hi A.Socha, i tried your latest script above customizing it with my config, works perfect for the 1st heating section but then stops and i get the following error in the debug window:

    "[ERROR] 20:27:10: line 25: attempt to call field 'decode' (a nil value)"

    Can you let me know how i can correct this ?

    Any solution? Have the same issue.

    try

    Please login or register to see this code.

    Problem with code is that the variable json containing a string is created that shields the true json variable that has all the methods so in the second pass json.encode and json.decode are nil

    Link to comment
    Share on other sites

    • 0

    robmac,

    thanks a lot - it's working

    Please login or register to see this image.

    /emoticons/default_icon_smile.gif" alt=":-)" />

    Andrew, could you please change the code so that everyone can use the proper one?

    It's very handy.

    Link to comment
    Share on other sites

    • 0

    Hi, could anyone make me a sample for such scene:

    If variable "something" is 1 then run the scene ID11 after 5 hours (18000sec).

    Should it work with block scene or this time is too long for block? How to do this with LUA?

    Link to comment
    Share on other sites

    • 0

    On the Fibaro website (

    Please login or register to see this link.

    ) they have an example on the bottom of the page that this should work:

    But it doesn't... it just fires directly. So I gues that's a bug. Because it would be very nice!

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0

    Hey,

    thank you very much - it works

    Please login or register to see this image.

    /emoticons/default_icon_wink.gif" alt=";-)" />

    Link to comment
    Share on other sites

    • 0

    I made such scene, marked both boxes - scene active and start with hc2.. and worked like a charm.

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0

    MHH gonne test it again. Because I did it with 3 minutes and that worked perfectly! now with 55 it fails :\ so maybe it has got something todo with the time...

    Link to comment
    Share on other sites

    • 0

    I made another one with 5hours, Im gonna check tomorrow, if it has worked or no.

    Link to comment
    Share on other sites

    • 0

    Lauri, be sure to have uncheked checkbox for global test

    Link to comment
    Share on other sites

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