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

Help Converting scene to LUA


Question

Guest puma
Posted

Hi

 

I am a bit of a novice when it comes to LUA I have read a heap of stuff but just can't get my head around it. I have created a few scenes using block scenes however as you are all probably aware they have their limitations as I am finding.

 

All that I am trying to do is create two different types of scenes.

 

1. A run on timer when we have a shower I would like the fan to stay on for X amount of time after the lights have been turned off. This does work however if for example someone goes into the bathroom and turns the light on as soon as it is tuned off the timer starts. Then within X time if someone else was to go in and turn the light on and fan on it doesn't reset the countdown timer so the fan could turn off half way through a shower. Not really ideal.

 

Please login or register to see this image.

/monthly_2020_03/1554133156_ScreenShot2020-03-26at6_59_02pm.png.aa518ac67c2162ca9ca75c2eb93e117a.png" />

 

2. I would like a 20min timer for most of my lights. Now this works ok for normal switches as I can set the max instances to 10 and they wouldn't; usually get pressed 10 times in 20 mins however the max running instances even being at 10 for the dimmers just doesn't work. If my kids go into their room and plays with the dimmer every time it gets changed it counts as an instance. 

 

1836360459_ScreenShot2020-03-26at7_06_37pm.png.0347ec2e63cb38aba1caa1a1f6753396.png

 

Basically I somehow need it to reset every time the switch is pressed and restart the countdown again.

 

Is this possible?

 

Thanks in advance.

12 answers to this question

Recommended Posts

  • 0
Guest puma
  • Inquirer
  • Posted

    No one here can help with this?

    • 1
    Posted
    On 4/2/2020 at 7:52 AM, puma said:

    No one here can help with this?

    These scenes could work...

     

    The bathroom

    Please login or register to see this code.

     

    A scene that watches multiple lights and turns off lights that have been on for a certain amount of time (20min in this case). Resets time if switch is turned off/on .

    Please login or register to see this code.

     

    • 0
    Guest puma
  • Inquirer
  • Posted

    @jgab Wow they are absolutely perfect they work just as described everything I have tested so far works perfectly.

     

    Thanks very much for your help.

    • 0
    Guest puma
  • Inquirer
  • Posted

    @jgab All the scenes I have created are sitting here with an instance running.

     

    Is this normal?

     

    Plus I have noticed that sometimes they break and then stop working, I haven't been able to find out what actually stops them from running just yet so I don't really have much of an idea on where to start to try and fix it.

     

    Please login or register to see this image.

    /monthly_2020_04/1948017742_ScreenShot2020-04-27at9_10_16am.png.a31f2e7bdca6957f1639e6e5509ba394.png" />

    • 0
    Posted

    Not the answer your looking for, but I use the Everspring ST814 humidity sensor. based on the humidity it arranges the fan fully automatic. No hassle with buttons. Works perfect. 

    Please login or register to see this attachment.

    • 0
    Guest puma
  • Inquirer
  • Posted

    @SmartHomeEddy Thats a fantastic idea however I can't get that here in Australia we operate the Zwave on 921.4Mhz 

    • 0
    Posted

    That’s too bad, that ain’t gonna work. I can’t find any humidity sensor for the Australia frequency. 

    • 0
    Posted

    "All the scenes I have created are sitting here with an instance running.  Is this normal?"

     

    Yep, a "running instance" means the code is executing in the background.  In your case, it's checking the switch / checking the light every 1000ms (ie every second).  

    That's this code:

    Please login or register to see this code.

    If the scene isn't running, your fan won't turn off automatically.

    • 0
    Posted (edited)

    You can easily connect a DHT22 sensor to the Fibaro Smart Impant in order to meaure humidty.  If you want to switch 230V (eg for a fan)  then you would also need an external relay.  Altogether a bit more fiddly but quite doable.

    The DHT22 costs less than A$15.

     

    see here for a diagram on how to connect: 

    Please login or register to see this link.

    Edited by Tim__
    Added link
    • 0
    Guest puma
  • Inquirer
  • Posted

    @Tim__ Thanks for the response!

     

    I'm still having some issues with the scenes just randomly stopping and I have no idea why.

     

    Can you see anything in the code that would possibly make them stop?

    • 0
    Posted
    1 hour ago, puma said:

    @Tim__ Thanks for the response!

     

    I'm still having some issues with the scenes just randomly stopping and I have no idea why.

     

    Can you see anything in the code that would possibly make them stop?

    Is the option "Do not allow alarm to stop scene while alarm is running" on the scene tab unchecked? Then check it.

     

    • 0
    Guest puma
  • Inquirer
  • Posted

    @jgab No it wasn't selected on any of the scenes.

     

    I have now ticked it so I will see how that goes.

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