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

Trying to add another motion to this scene


adm942

Question

ACTIONS
 
trying to add anther motion to this but cant get it to work any ideas thanks 
local light = 223 --Porch Litghs
--local light1 = 
 
local motion2 = 192
 
 
local maxTime = 300  -- max time the sensor should be safe before turning off
local sleepTime = 5   -- time in seconds between each check of the sensor
 
fibaro.debug("","Turning on")
fibaro.call(light,"setValue"100)
 
--fibaro.call(light1,"turnOn")
 
local safeTime = 0
while safeTime < maxTime do
  fibaro.sleep(sleepTime*1000)            
     
  safeTime=safeTime+sleepTime             
      -- count up safeTime
  fibaro.debug("","Counting up safeTime ",
safeTime,"to maxTime ",maxTime)
  if fibaro.getValue(motion2, "value"
then -- motion breached
     safeTime=0                           
      -- reset safeTime
     fibaro.debug("","Reset")
  end
end 
 
fibaro.debug("","Turning off")
fibaro.call(light,"turnOff")
--fibaro.call(light1,"turnOff")
 
 
 
DECLARATIONS (Conditions/Triggers
 
{
  conditions = { {
      id = 192,
      isTrigger = true,
      operator = "==",
      property = "value",
      type = "device",
      value = true
    }, {
      isTrigger = true,
      operator = "==",
      property = "isNight",
      type = "global-variable",
      value = "true"
    } },
  operator = "all"
}
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

I use this Lua code for two motion sensors AND lux:

 

Please login or register to see this code.

 

 

Please login or register to see this code.

 

Link to comment
Share on other sites

  • 0

Hi Eddy, perfect scene and very useful.

I Do notice you have a global-variable for day or night time. Is this also running in another scene ?

Would be nice to have that too :)

 

Got it:

 

 

Edited by GeeMoney
Link to comment
Share on other sites

  • 0

Those are two simple block-scenes, like this: 

 

 

Please login or register to see this image.

/monthly_2023_03/image.png.854a441e359f6961ec9c6cf62c92d72b.png" />

 

image.png.edf485c4594da242f3130ea8bb8a2072.png

 

 

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