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

Doorbird IR Light LUA scene


Question

Posted

I could use some help creating a LUA scene for the IR Light on the Doorbird D10 doorbell.

My problem is that since the Doorbird uses a light sensor to toggle the IR lights on when the area is dark and there is a streetlamp in the field of view of the camera, the IR Light never comes on at night.

I have included the QA for the doorbird IR light, but the Doorbird toggles back to the sensor after 3 minutes, so my captured video at night is very poor.

I have attached a flow chart of what I am trying to accomplish with the LUA to trigger the IR Light on at sunset, and after delaying 180 seconds, test to see if a user created enumerated variable (LUX) is equal to 'Night'. If it is, then I want to loop back to the hub.call (line 1 of the ACTIONS). If the variable (LUX) is not equal to 'Night', then end the scene. Here is the code I have so far, but I am sure it is very wrong for doing the loop back.

 

hub.call(552, 'turnOn')

hub.setTimeout(180000, function()

hub.getGlobalVariable('LUX')

if 'LUX' == 'Night' then

goto 1

else

end)

 

If anyone can help me with this, it sure would be great.

Thanks.

Please login or register to see this attachment.

2 answers to this question

Recommended Posts

  • 0
Posted (edited)

I will try to help. It's not necessary to use global variable. Cancel any process which update it (if you have one).
I assume that this is a scene triggered by "after sunset" condition.
To be honest the trigger should be dawn and dusk (dark time). But it need to create user own function to compute the proper time. But for simplicity, let's stay with sunset and sunrise - to be more precise in function IsAfterDarkNow(afterSet, beforeRise) you can set parameters.
This task needs some programming skills and understanding how scenes in HC works. Try this code. It's not tested by me, should work, no warranty :)

 

You will see what's happening reading the messages on the www console. If OK, you can remove it later.

It's a scene code and - again - I assume that this is executed every sunset (by setting proper trigger in scene).

Please login or register to see this code.

Edited by Łukasz997
  • 0
Posted

Good morning, does it resolve your problem? Any feedback?

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