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

Secret door bell, LUA help needed


BrbuggyB

Question

Hi everyone,

 

I have 2 door bells:

  1. A normal door bell, that triggers a scene that turns a few lights on and off in my house to alarm us somebody is at the door
  2. A secret button that opens the door, using a Danalock V3

Both door bell buttons are connected to the same Fibaro Universal Binary Sensor. 

 

The first (normal) door bell works just fine. The second one is unreliable, and is the one I would like some help with. The LUA-code of the scene that is triggered by the secret button is as follows (I will explain below):

Please login or register to see this code.

 

What I want the scene to do:

If the secret bell is long-pressed (ID 238, scene activation 22), and the following conditions are met:

  • Variable SecretBellState = operational (this variable can be helpful if I want to stop the scene from working in some circumstances)
  • Time of day should not be "night"
  • My phone or my girlfriends phone is in WiFi range (I check this in my Ubiquiti Unifi controller in another scene)

Then open the door.

 

This mostly works fine, but now and then the door suddenly opens, without anybody pushing the secret button. This could be because:

  1. My LUA skills are still growing ?
  2. The physical button (outside) is short circuiting because of moist/dirt, creating a false scene activation.

 

I have a few questions I would like some help with:

  • Can my LUA code be improved?
  • I can not find pushing the button (IN2 on the UBS) in the event panel. Is this logged anywhere? That would help me eliminate a faulty/dirty button.
  • Can I log when a scene is triggered somehow?

 

Any assistence is much appreciated.

Everything is running on a HC2, all firmware is up to date.

 

Cheers!

Edited by BrbuggyB
typos and clarifications
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Hello,

Its not you or some defective elements I gues.

Your LUA I cant check, I run ER but you should add some debug lines.

First you need to (Auto) calibrate your lock and check if the state of Dana is properly shown in your HC2.

Also switch off if stick key in automatic motor.

I can not acknowledge for HC2 because I am running now HC3

But your error sounds familiar.

Succes

//Sjakie

Link to comment
Share on other sites

  • 0
  • Inquirer
  • 3 hours ago, Sjakie said:

    First you need to (Auto) calibrate your lock and check if the state of Dana is properly shown in your HC2.

    Also switch off if stick key in automatic motor.

    Hi Sjakie, thanks for your reply. I know it is not my Danalock, because when I disable this secret door bell scene, the issue of the randomly opening doors is not there.

    What do you mean by "I run ER"? I have to look into getting debug lines in my LUA code (never have before). Do these debug lines get written to some kind of log?

    Thanks

    Edited by BrbuggyB
    Link to comment
    Share on other sites

    • 0

    I would try: write a simple new scene, that has the secret doorbell press as the only trigger, and that turns on a certain light.  Then see if the random door openings co-incide with the light turning on. If that happens,  try replacing the switch (even temporarily) to see if the problem goes away. 

    • Like 1
    Link to comment
    Share on other sites

    • 0

    Another thought: the doorbell wiring may be too close to some other mains wiring, and some transient currents are being induced that trigger the device. The solution to that is to separate the cables.

     

    Also, I am interested in your integration with Unifi,  could you post detail on how you do that please?

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • @Tim__ I totally missed your question. If you're still interested in the integration with unifi in HC2, check out

    Please login or register to see this link.

    .

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