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

Motion in combination with light


Question

Posted

Hi Guys,

I have a motion/light sensor.

If light <7 lux and motion switch on light and switch off after 10 minutes.

Lua scene has included to reset the timer

Then light is switched on and the minimum lux level is not present anymore.>>> Light switch off after 10 min.

How to  solve this?

10 answers to this question

Recommended Posts

  • 0
Posted

Hi

 

actually a new forum users do search by forum and when if gtt no result do create post here

for example I know at least 5 (five) posts here about motion lights 

ok?

  • 0
  • Inquirer
  • Posted

    I have read them all but non is having the combination I am searching for.

    Thanks

    • 0
    Posted
    20 minutes ago, Sjakie said:

    I have read them all but non is having the combination I am searching for.

    Thanks

    So you gave up on EventRunner, eh? :-) 

    Rules like these are easily expressed...

    Please login or register to see this code.

     

    • Thanks 1
    • 0
  • Inquirer
  • Posted

    Hi,thanks.

    If I read this scene properly my lights still goes of if:

    lights are turned on result lux is >7 this makes lights goes off

    Or am I wrong?

    • 0
    Posted
    2 minutes ago, Sjakie said:

    Hi,thanks.

    If I read this scene properly my lights still goes of if:

    lights are turned on result lux is >7 this makes lights goes off

    Or am I wrong?

    First rule:  if motion is breached AND lux is lower than 7 THEN the lamp is turned on

    which was my interpretation of your sentence "If light <7 lux and motion switch on light and switch off after 10 minutes."

    actually, the second part, "switch off after 10 minutes" is baked into the second rule..

    Second rule: if lamp is on AND lux is lower than 7 for 10 minutes THEN lamp is turned off

    which was my interpretation of your sentence "Then light is switched on and the minimum lux level is not present anymore.>>> Light switch off after 10 min."

    which also cover the case if someone switch on the light manually and the lux is lower than 7 the light is turned off after 10min.

    because the rule is triggered both on lamp changing value (being switched on) or lux changing value.

     

    Natural language is usually a terrible specification language. Especially if it's for home automation where triggers are asynchronous :-) 

    Better then to specify what you want in a "logic" formalism, like the rules above.

    • 0
  • Inquirer
  • Posted

    Okay,

    Your rules reads easy.

    I am just thinking to extend.

    --]]

    HouseAlarm----------Disarm
    GastBoLichtAan-- Dark  (Means outside lux level below certain level, to cover dusk)
    --]]

    local    BewegingsmelderEetkamer        =    145 (motion)
    local    LichtsterkteEetkamer        =    147  Lux level diningroom)
    local    VerlichtingSpotKeuken        =    217  (Lamp Kitchen)

    local   timer  = reset

     

    rule   ("Housealarm:Dark&GastBoLichtaan:Aan")

    rule   ("BewegingsmelderEetkamer:breached&LichtsterkteEetkamer <7) =>VerlichtingSpotKeuken:on")

    rule  (("BewegingsmelderEetkamer:breached)  =>  reset timer)

    rule   ("for00:10,VerlichtingSpotKeuken:isOn) =>VerlichtingSpotKeuken:off")

     

    Lets see if my way of expressing in rules is okay

     

     

    Please login or register to see this code.

    • 0
    Posted
    12 minutes ago, Sjakie said:

    Okay,

    Your rules reads easy.

    I am just thinking to extend.

    --]]

    HouseAlarm----------Disarm
    GastBoLichtAan-- Dark  (Means outside lux level below certain level, to cover dusk)
    --]]

    local    BewegingsmelderEetkamer        =    145 (motion)
    local    LichtsterkteEetkamer        =    147  Lux level diningroom)
    local    VerlichtingSpotKeuken        =    217  (Lamp Kitchen)

    local   timer  = reset

     

    rule   ("Housealarm:Dark&GastBoLichtaan:Aan")

    rule   ("BewegingsmelderEetkamer:breached&LichtsterkteEetkamer <7) =>VerlichtingSpotKeuken:on")

    rule  (("BewegingsmelderEetkamer:breached)  =>  reset timer)

    rule   ("for00:10,VerlichtingSpotKeuken:isOn) =>VerlichtingSpotKeuken:off")

     

    Lets see if my way of expressing in rules is okay

    It's still very unclear what you want to achieve.

    What is HouseAlarm and GastBoLichtAan ? and why do you declare an invalid scene header with them?

    And what do you try to achieve with the first rule? 

    And what do you want to achieve with  "reset timer" in the third rule?

    • 0
  • Inquirer
  • Posted

    Hi, thanks for responding.

    HouseAlarm is a variable scene only should work if state is Disarm

    GastBoLichtAan is a varible what is trggering a certain level of Lux.

    The invalid scene header was to add something to make it more? clear for you

    first rule is scene only active if house is disarmed (to be sure it will not have an inter action with the armed scedule for the house

    third rule reset timer>>if there is movement  after starting the scene it should reset the time, fa 10 min, to keep the light on

    • 0
    Posted (edited)
    1 hour ago, Sjakie said:

    Hi, thanks for responding.

    Please login or register to see this code.

    I interpret that 'GastBoLichtAan' is the lux value deciding when it's considered dark? You can use globals directly in rules prefixed with $.

    You only want to run the rules when HouseAlarm=='Disarm'. There are many ways to do that, but one way is to define sections of rules and enable/disable them depending on variable changing state. I have winter, summer, spring, weekdays and weekend rules in the same scene...

    ...you really have long variable names in the Netherlands :-) 

     

    Edited by jgab
    forgot to add 217 to scene header
    • 0
  • Inquirer
  • Posted

    Hello,

    thanks for the lesson.

    My names are long yes, now since I know how to archive so I will understand it later too I made them just a sentence short.

    All beginning is difficult.

    Yes the time of the year or months I need to implement also but not all at the same time.

    I just fixed (I hope ) that HC2 is setting my house temperature. Its working for one day now so I am hope full, hehehe. I created a week schedule, short absence and holiday. If this isworking I will set the original app on let say 5 degrees to prevent any damage in very cold weather if HC2 does not do its job.

    This scene I need to extend with some months when the heating should operate.

    We are progressing

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