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

How to specify a scene between certain times


Question

Guest David R
Posted

Hi people im new to fibaro and programming but Im learning slowly and was wondering how you would write code for eg...between 9pm and 6am let certain lights switch onto no more than 50%. Thanks

7 answers to this question

Recommended Posts

  • 0
Posted
Hi people im new to fibaro and programming but Im learning slowly and was wondering how you would write code for eg...between 9pm and 6am let certain lights switch onto no more than 50%. Thanks

Due to the limitation of the time trigger in the block code scene programming which does not allow you to set a trigger when "between 9pm and 6am every day i assume", you have to do it the long winded way :-

1) create a predefined variables (under panels -> variables) and call it lets say "Lights50" and create a value of "true" and "false" for it.

2) create a scene that will set that variable to true when you met the condition you wanted "at 9pm" and another scene that will set that variable to false when "6am"

3) create the final actual scene that will use that variable as the trigger instead "when variable Lights50 is true, set all lights to 50% else....."

Of course you can achieve this same functionality with a few lines of LUA (HC2 only) if you are so inclined to learn. Go to

Please login or register to see this link.

for the API.

Cheers !

  • 0
Guest David R
  • Inquirer
  • Posted

    Hi thanks for the help but wouldnt this turn the lights on at 9pm? what i want is to have them at 50% when the light is turned on manually

    • 0
    Posted
    Hi thanks for the help but wouldnt this turn the lights on at 9pm? what i want is to have them at 50% when the light is turned on manually

    The short answer is yes. You can however, modify the final scene to dim those lights to 50% instead. Since you are turning on the lights manually I assume before 9pm, the scripts will run and when the variables are set to true, those lights which have been turned on will now be dimmed to 50%.

    • 0
    Guest David R
  • Inquirer
  • Posted

    Hi thanks but i dont the lights coming on at 9. I think what i want cant be done in blocks and requires LUA

    • 0
    Posted
    Hi thanks but i dont the lights coming on at 9. I think what i want cant be done in blocks and requires LUA

    I think I understand what you meant. You want the system to automatically set any lights that you turned on to 50% (only when they are turned on but not off).

    You mentioned you wanted those condition to happen between 9pm and 6am. If no lights were turned on, then there is nothing to set. Correct ?

    If that is correct, then just add another condition to the scene :

    - if Lights50 = yes AND Light1 = ON then set Lights1 to 50%

    • 0
    Guest David R
  • Inquirer
  • Posted

    I will give that a try thanks. Basically after 9pm I have children so say they go the bathroom and turn the light on it turns to 50% rather than 100% waking them up. You follow?

    • 0
    Posted

    Yup, that's exactly what will happen if you do the above. No LUA needed.

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