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

Turn On Lights when garage door opens


christos

Question

Hello

I need some help from you guys...

i need to setup a lua code so that

30 minutes after sunset monitor the state of the garage door from the door/window sensor

if the state changes then switch lights xx for 10 minutes then switch them off

if the garage door is already open i dont want the lights to turn on at that time.....

i just want them to switch on if the door goes from closed to opened

can someone give me a hand here please???

regards

Christos

[ Added: 2013-09-05, 19:27 ]

ok lets try this one

Please login or register to see this code.

hmmmmmmmm

something is missig here

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Hi,

I would set a variable at 30 minutes past sunset to the time you want the light to no longer turn on. Have a look at my scheduler to do that.

then something like. I have two doors so my sensors are 78 and 115

Please login or register to see this code.

in the scheduler

Please login or register to see this code.

and create a variable in the variable panel under panels menu named TimeOfDay

You can put all of your timer events in the scheduler so you will probably only need one scene for all timers.

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Thank you for the great help my friend

    so i have copied the scheduler code you have made..... BTW it looks scary

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" /> :)

    and i have inserted this line

    luaDaySchedule:add("Sunset","TimeOfDay", "Evening" , "setGlobal", {"All"} , true, 30 )

    also i have created a variable name TimeOfDay and have put 30 as value

    here is the code

    Please login or register to see this code.

    but i get error in debug

    [DEBUG] 14:57:49: garage door is now 0

    [ERROR] 14:57:49: line 10: attempt to concatenate global 'TimeOfDay' (a nil value)

    what did i do wrong again here

    Please login or register to see this image.

    /emoticons/default_icon_confused.gif" alt=":-?" />

    [ Added: 2013-09-06, 14:42 ]

    ok this doesn;t give any errors

    Please login or register to see this code.

    but still confused about how to setup the time

    [ Added: 2013-09-06, 15:38 ]

    ok this doesn;t give any errors

    Please login or register to see this code.

    but still confused about how to setup the time

    Link to comment
    Share on other sites

    • 0

    Please login or register to see this code.

    sets the time the lights will turn on with door from sunset +30 to 1 in the morning

    Also be careful of case "Evening"

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hello

    Thank you very much for the help here Robert

    So the final code with your help is like this

    Please login or register to see this code.

    just to make sure i'm getting the right stated i have added the debug so in debug i get these results

    [DEBUG] 10:06:29: garage door is now 1 ( which means the door is open )

    [DEBUG] 10:06:29: Time Of Day Is Morning ( it is morning )

    30 minutes after sunset the state changes from morning to evening ( so the scheduler works just fine )

    BUT no lights turn on when i open the garage door....

    even though the garage door state is 1 and timeofday is evening..

    I'm wondering if there is a bug somewhere here

    Rob is your code working ok??

    christos

    [ Added: 2013-09-08, 09:19 ]

    UPDATE!!!

    After Restarting Homecenter The scene is working FINE!!!!

    Weird

    He He ... I love it!!!!!!

    Thank You ALL!!!!!!!!!!!!

    Please login or register to see this image.

    /emoticons/default_icon_mrgreen.gif" alt=":mrgreen:" />

    Please login or register to see this image.

    /emoticons/default_icon_mrgreen.gif" alt=":mrgreen:" />

    Please login or register to see this image.

    /emoticons/default_icon_mrgreen.gif" alt=":mrgreen:" />

    Please login or register to see this image.

    /emoticons/default_icon_mrgreen.gif" alt=":mrgreen:" />

    Please login or register to see this image.

    /emoticons/default_icon_mrgreen.gif" alt=":mrgreen:" />

    Please login or register to see this image.

    /emoticons/default_icon_mrgreen.gif" alt=":mrgreen:" />

    Please login or register to see this image.

    /emoticons/default_icon_mrgreen.gif" alt=":mrgreen:" />

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • ok

    scene is working ok

    lights turn on just fine when garage door opens at night

    what i don't understand is why the icon on the garage door don't show the ( open door state )

    nor the lights show on the web page that they are on!!!!!

    Link to comment
    Share on other sites

    • 0

    Have you logged off and on again? Sometimes interface is non responsive on HC2. timeout of some form?

    Also try configuring again if that does not work.

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