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

Block scene with override switch?


Question

Posted

Hi, I know this probably seems a simple question but I just cannot seem to find a solution so hoping someone can assist.

I have a simple block scene for turning on a light via motion and lux level then turns off after 15seconds. What I would also like is to be able to override this by a toggle switch so the light stays on until the switch is turned back. Currently using the switch it just activates the scene and the light goes out after 15seconds. 

Can this be done in the block scene ?

12 answers to this question

Recommended Posts

  • 1
  • Inquirer
  • Posted

    Hi

    Is anyone able to offer any advice on this please?

    • 0
    Posted (edited)

    Please login or register to see this code.

    Edited by PitCock
    • 0
  • Inquirer
  • Posted

    Hi

    I currently have a toggle switch connected to S1 of the dimmer and switching this operates the light at full brightness until the sensor picks you up. Then the scene kicks in and the light turns off after the set 15seconds. Is there anyway to make switching the switch holts the scene until switched back? 

    • 0
    Posted

    You could prevent the block scene to kick in (with an extra condition). But if you manually turn on the light, after the block scene is already doing his work, and is counting down the wait time, you are  screwed ?

    • 0
    Posted

    Although it would neater to do all this in LUA, would it be possible to solve this using a global variable?

     

    When the switch is turned on, it triggers a block scene that sets the "SwitchFlag" variable to 1. Similarly when switch is turned off, it triggers a block scene that sets the "SwitchFlag" variable to 0.

     

    Then, in the start of your block scene you set a condition that "SwitchFlag" must be 0 in order for the scene to complete. 

     

    Not tested but I think you should be able to make this work?

    • 0
    Posted

    In the start condition of the block scene, you could check if the light is already on. If so, then don’t start the scene. (So the condition is: light = off and movement is detected)
     

    The only reason the light is already on, is that you manually turned it on. 
     

    That is half the solution. If the block scene is already running, then you are too late to interfere. 
     

    BTW I should use a Lua scene, so you can leave the light on, if there is still motion. That way the light won’t turn off, if you are still in the room. There are several examples of a Lua scene on the forum. Copy - Paste 

     

     

     

    • 0
  • Inquirer
  • Posted

    Thanks for this, I like the idea of the switchflag, how do I set this up in the scenes? Would it be two scenes, one for on and one for off or both covered within the one scene?

    • 0
    Posted

    Yes, you'll have a couple of scenes. Here are the steps:

    1. Create the Global Variable: Panels -> Variables -> Add -> "SwitchFlag" -> Save

    2. Create new block scene for setting the flag: Scenes -> Add Scene -> Block Scene

    Add blocks for the if condition: [MyLight] [==] [ON] [0 secs].  (You will then see that your switch is listed as the triggering device a couple of lines above the blocks.)

    Add blocks for the action to change the variable: [Then]     [SwitchFlag] [==] [1]

    Name as SwitchFlagOn, set it to run automaticaaly (ie all the time) and Save

    3. Do the same for SwitchFlagOff; this time the action to change the variable is:    [SwitchFlag] [==] [0]

     

    Test it - flick the switch and see what happens to the variable in the variables panel (you may need to reload the page after you change switch state)

     

    Now, in your motion sense scene, you just have to check the value of the variable. ie SwitchFlag must be 0 in order for the motion scene to run.

     

    Good luck.  Let us know if you get it working!

     

    • 0
  • Inquirer
  • Posted

    Fantastic! Yes this works a treat, many thanks I wouldn't of being able to work that one out!!

    The only strange thing is once the switch is turned back off, there is quite a long time before the motion scene starts working again. I`m wondering would this be to do with the settings within the motion sensor?

    Doing this has given me the confidence to do another scene, just created one for my living/kitchen area where, when triggered, the main lights go out, the blinds close and the TV turns on along with the kitchen unit lights for ambience. - And it all worked :)  The only thing to figure out now is how to get this to work via Alexa as this scene does not appear on the app?

    Once again many thanks.

    • 0
    Posted

    Glad you got it working! It was someone on here who gave me the pointer about the variable set up. 

     

    I don't use Alexa so can't help with that question sorry, but I can say that all my scenes appear in my app. (Hc2 with android).

    • 0
    Posted (edited)

    @eboy I am sorry.  but the current implementation of "blocks" has too much restriction and what you can do via 2 lines with pure LUA, you should dancing around blocks or sometims 2 blocks.

    what am i hinting you. trying to learn LUA if you want to develop somthing like you wish. it's not difficult.  trust me.

    on the left hand cuz i know alternative systems which provide nice UI with block - Fibaro block is very bad implementation.

    see the difference 

    simple motion - lights

    Please login or register to see this image.

    with switch override

    7FxkC2DSVM.png

     

    nice? yeah!

     

     

     

     

    Edited by 10der
    • 0
  • Inquirer
  • Posted

    Hi

    Yes I agree LUA would be best and I would like to thank you for encouraging me to try. It is something I would like to learn one day although feel it may be beyond me as even creating the blocks I need help :)  But never say never with the excellent support on here!!

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