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

Scene to activate lights after 1.00 AM


Question

Posted

I would like to know how to program in LUA to activate a light (through wall plug) when a movement is triggered by a PIR (motion sensor) after 1.00 AM. I presume this is a really simple thing, but I don't know how to program this.

6 answers to this question

Recommended Posts

  • 0
Posted

if (motion sensor is breached) and time is after 1.00am

then

activate a light

end

  • 0
Guest fat
Posted

I use a global variable to set morning, afternoon, evening and night times. After this code motion sensor to activate only if night time global variable is set

  • 0
Posted

Or just use code converted in blocks to check the time range.

  • 0
  • Inquirer
  • Posted

    I use a global variable to set morning, afternoon, evening and night times. After this code motion sensor to activate only if night time global variable is set

    Could you please mention an example for these global variables?

    • 0
    Guest fat
    Posted

    The global variable I have is morning, afternoon, evening and night. When sunrise hits the variable changes to morning. Midday sets the variable to afternoon. Sunrise sets global to evening and 10pm sets the variable to night

    I use the variable to trigger a light scene that is "If variable=night and motion sensor=breached then turn on light at 10% brightness for 90 seconds

    A Lua scene is created to set the variable and then I have used a basic block scene to control the light based on the variable and motion trigger

    • 0
    Posted (edited)

    I use this Lua Script:

    Please login or register to see this code.

    Edited by j.nowacki
    Please use code tags

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