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

Question about scene for door sensor + light


Question

Posted

Hello all,

Ive been experimenting with the following but still havent found out how to fix this.

We have a door sensor (fibaro) and a light (through wallplug).

Right now i have:

Please login or register to see this code.

237 = Door sensor

161 = Wallplug

Basically, if door opens (breached, since open/closed is not an option) and light is off, then turn it on.... and turn it back off after 180 seconds.

There is 2 problems with this:

1) We need it so, when it was already on (due to another scene), it should stay on and not switch off

2) If the door now stays open, every 180 seconds it will go off and on again over and over.

Does anyone have any idea how to fix this?

Thank you

Please login or register to see this image.

/emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

13 answers to this question

Recommended Posts

  • 0
Posted

Remove %%autostart and remove 161 value, then it should work.

  • 0
Posted

Hi tcviper,

Try this:

Please login or register to see this code.

You need to create a global variable called wallPlugState - set it to '0' to begin with.

Now in any other scene when you turn the wall plug on, also change the global variable to '1' (and when it's turned off, set it to '0').

The scene will be triggered when the door is opened or closed - but it will only keep running if it is opened. It will also only run if it hasn't been started already.

When running, it will keep checking the door and if it is closed it will check to see if the time (since the door was closed) is greater than a set amount. Otherwise it will keep looping checking again every 10 seconds. Once the door is closed and it has been for a set amount of time, it will turn off the wallplug and the scene will end.

The wall plug will only turn off if the global variable wallPlugState is saying it can be (if its value is "0") - otherwise it is left on.

I hope this helps.

Happy Automating,

Adam Bewsher

  • 0
  • Inquirer
  • Posted

    Thank you for your answer, but what is the difference with what boerremk said?

    Also FYI, adding a global variable through the Variables panel in 4.017 beta doesnt do anything, when you click the ADD button nothing happens.

    • 0
    Posted

    If the only condition to switch the light is door open (i.e., no lux level threshold involved or any other criteria) you can also associate the door sensor to the relay switch through the parameter configuration. That will trigger the light on immediately after the door is open. Also set the light auto-switch off time to 180 secs (that will turn it off after that time, regardless of which way it was switched on).

    No lua scenes needed for that. And it will work even if, for any strange and extremely unusual reason, the HC2 is not listening...

    Please login or register to see this image.

    /emoticons/default_icon_wink.gif" alt=";-)" />

    Keep it simple.

    • 0
    Posted

    Hi tcviper,

    The two main differences are the loop and the global variable. The loop will keep checking the door and leave the wall plug on if the door is still open. The global variable will enable you to leave the state of the wall plug unchanged from another scene.

    Hi Brick,

    This works with the relay, but not the wall plug.

    Happy Automating,

    Adam Bewsher

    • 0
    Posted
    This works with the relay, but not the wall plug.

    Absolutely. I misread the initial statement and thought there was a relay switch governing the light. Sorry about that.

    Anyhow, the wall plug could still be directly associated to the door sensor (door open-->light on and/or door closed-->light off) but I'm afraid it will not be possible to timer the light off by the configuration parameters.

    • 0
  • Inquirer
  • Posted

    The thing is that, thats not the only thing im doing here, there is another scene that when the sun goes down those lights also need to go on and stay on untill a specific time at night (which works btw). So its and the door open/close and whatever i described above.

    Anyway i wish i could try your global variable thing but when i go to Add Variable and enter, Variable Name: wallPlugState and Value: 0 when I then want to press ADD nothing happens in 3 browsers i tried the same thing

    Please login or register to see this image.

    /emoticons/default_sad.png" alt=":(" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

    • 0
    Posted

    Downgrade from beta 4.017 to 3.590 and you will be able to use LUA code as well as variables properly...

    • 0
  • Inquirer
  • Posted

    Ill wait for the next beta

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

    • 0
    Guest David R
    Posted

    I will find this useful as this one of the first scenes I am going to try after I have installed my Fibaro.

    • 0
    Posted
    Ill wait for the next beta

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

    you really think you will reach that age?

    • 0
    Posted

    akatar, please stop, new beta 4.018 will be available soon

    • 0
    Posted

    A.Socha, just kidding,

    don't be a grumpy old man

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

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