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

[SOLVED]Motion Lux to turn On - Off Lights


Question

Posted (edited)

Good Morning / Good afternoon/ Good Evening / Masters. I just need your help. 

I got this error. 

[DEBUG] 19:21:38: line 15: attempt to compare nil with number

 

 

--[[
%% properties
%% 325 luxID
%% 395 lampID
%% globals
--]]
 
local luxID = 327 
local lampID = 328 
 
if (fibaro:countScenes() > 1) then
  fibaro:abort()
end
 
 if (lux< 400) then
      fibaro:call(lampID, "turnOn")
      fibaro:sleep(1000)
    end

    if (lux > 400) then
    fibaro:call(lampID, "turnOff")
      fibaro:sleep(1000)
    end

Edited by Unique tech

5 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 (edited)
14 hours ago, Unique tech said:

Good Morning / Good afternoon/ Good Evening / Masters. I just need your help. 

I got this error. 

[DEBUG] 19:21:38: line 15: attempt to compare nil with number

 

Hi @Unique tech,

 

above code is not complete, you are missing line which gets measured light level. Try this one:

Please login or register to see this code.

 

Edited by Sankotronic
  • 0
  • Inquirer
  • Posted
    1 hour ago, Sankotronic said:

     

    Hi @Unique tech,

     

    above code is not complete, you are missing line which gets measured light level. Try this one:

    Please login or register to see this code.

     

     

    [DEBUG] 11:44:48: line 15: attempt to compare nil with number

    I tried it but I got this

    yah working now. thanks sir. 

    • 0
  • Inquirer
  • Posted

    one problem. kill scene doesn't work. I want if only one time debug. when I lux <400 then lights shall turn On when I turn Off one of the light and  value of lux will so it doesn't trigger again. 

    • 0
    Posted
    2 hours ago, Unique tech said:

    one problem. kill scene doesn't work. I want if only one time debug. when I lux <400 then lights shall turn On when I turn Off one of the light and  value of lux will so it doesn't trigger again. 

     

    @Unique tech,

     

    Above scene will trigger every time when measured lux change. Light will be turned on every time when lux fall bellow 400. This is very very simple scene more to learn some basic LUA programming than for real use. To have really nice light automation you first need some basic stuff like:

    Main scene is taking care of some basic globals like time of day and Darkness which are important for controlling lights. To control lights then I can recommend:

    I can assist you with setting up above scenes and once all is done you will have completely automated lights up to your expectations.

     

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