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

Question

Posted

Hi

 

Can anyone help me with a code to turn on lights when motion is trigger, then start a countdown to turn off the lights?

 

I also need them to start countinig from start if any new motion is detected.

 

Br

Kim 

6 answers to this question

Recommended Posts

  • 0
Posted

The topic has been moved from "

Please login or register to see this link.

" to "

Please login or register to see this link.

".

 

Temat został przeniesiony z "

Please login or register to see this link.

" do "

Please login or register to see this link.

".

  • 0
Posted

hi @kimstoroy,

what modules are you using?

I used a Fibaro motion sensor and a fibaro double relay switch.

The fibaro double relay switch has a parameter for automatic off. There you could set the timeout to turn the light off after a specified time.

 

You even don't need to code.

Just create a magic scene:

- when motion sensor is armed and tripped

- Turn on the light

 

The ligth will then automatically switch off after the timeout.

 

If you then want to go further you can convert the magic scene to lua and have a working basis already.

 

BR - Kro

 

  • 0
  • Inquirer
  • Posted

    Hi, am using 2 Fibaro dimmer 2 and 1 relay switch.

     

    The motions ensor is connected to a universal sensor, so it need to be some kind of LUA code i think.

     

    Br

    Kim

    • 0
    Posted

    most easy without scenes or coding is:

    use a fibaro pir,

    set off to 30 seconds (or the time you want to shut the light off)

    associate the relay switch to the pir

     

    • 0
  • Inquirer
  • Posted

    Yes, but the challenge is that i only want them to be activated when it`s dark outside, I have a Global value for that

    • 0
    Posted (edited)

    hi @kimstoroy,

    how about

    Please login or register to see this link.

     or

    Please login or register to see this link.

    tutorial.

     

    shouldn't really matter if using UBS or other motion sensor.

    Instead of light sensor you can use your global variable.

     

    When finished you can still convert it to LUA.

    The advantage will be, you'll have a working example already.

     

    BR

     

     

    Edited by kroeatschge

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