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 can I learn understand Blocks scenes?


Hajdu Levente
 Share

Question

13 answers to this question

Recommended Posts

  • 0
  • Inquirer
  • Hi

    first of all thank you for your reply. 

    I have bought a hc2 starter kit

    i have made several svenes but it must be learnd and understand i think. 

    I can make a scene i e that when main door sensor breached and safe then the hole light turns on and the after 2 minutes goes off. 

    I have made it with two scenes. 

    But when i wanted to associate with time that does not works. 

    I know that i have to make variables but i do not know and do not understand what is variable. 

    I would like to start with the basics and then learn more complicated scenes too. 

    I am testing now my hc2 starter in an apartament but if everything goes well nect year i would like to improve in my house and there i would like to create good scenes for lighting and everything. 

    Thanks in advance. 

    If you are good in blocks and you would take time to help me getting involve in blocks and lua too i would even pay for it or would be very thankfull somhow. 

    Link to comment
    Share on other sites

    • 0

    i will give it a try

    a variabele is just what it is a vaiabele.

    creatie a variable evening, with value 0 and 1 (example 0 = dark, 1 = light)

    create block scene, when time is 21:00 then change variable evening to 0

    another one: when time is 07:00 change variable to 1

    now when it's 21:00 hours the varaibele changes to 0 etc (dark)

     

    block scene

    when xx is breaced and variable = 0 then light on

    so when sensor breched and it's dark light goes on, the light will not go on when variable = 1, (light)

     

    sorrt for the fuzzie explaining

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • I got it. 

    I will try and get back. 

    I am waiting next lesson:)

     

     

     

    i read more five times and now i start to understand the variable importance or role inna block scene. 

    We giving variable so we can link on that variable to make something for us but we know when that variable aktiv or not.  

    Something like this?

     

    Edited by Hajdu Levente
    Link to comment
    Share on other sites

    • 0

    and also, you can create 1 scene and depending of the variable it's running or not.

    and more blockscenes can use the same variable

     

    example, i have a realtime rain measure device, so when it's raning my hc2 knows.

    so every day my windows are automaticly opening, but not if it rains, or when they open and it starts to rain they close etc etc\

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Here is how it is looks like.

    I give him a run and the light went off.

    so maybe it will work tomorrow morning too:)

     

    --[[
    %% autostart
    %% properties
    7 value
    %% events
    %% globals
    --]]

    local sourceTrigger = fibaro:getSourceTrigger();
    function tempFunc()
    local currentDate = os.date("*t");
    local startSource = fibaro:getSourceTrigger();
    if (
     ( (currentDate.wday == 2 or currentDate.wday == 3 or currentDate.wday == 4 or currentDate.wday == 5 or currentDate.wday == 6)  and  (tonumber(os.date("%H%M")) >= tonumber(string.format("%02d%02d", "06", "00")) and tonumber(os.date("%H%M")) <= tonumber(string.format("%02d%02d", "08", "30"))) and (math.floor(os.time()/60)-math.floor(1475982000/60))%1 == 0  and  tonumber(fibaro:getValue(7, "value")) == 0  and  fibaro:getGlobalValue("VarHoleLight") == "On" )
    )
    then
        fibaro:call(32, "turnOff");
        fibaro:setGlobal("VarHoleLight", "Off");
    end

    setTimeout(tempFunc, 60*1000)
    end
    if (sourceTrigger["type"] == "autostart") then
    tempFunc()
    else

    local currentDate = os.date("*t");
    local startSource = fibaro:getSourceTrigger();
    if (
     ( (currentDate.wday == 2 or currentDate.wday == 3 or currentDate.wday == 4 or currentDate.wday == 5 or currentDate.wday == 6)  and  (tonumber(os.date("%H%M")) >= tonumber(string.format("%02d%02d", "06", "00")) and tonumber(os.date("%H%M")) <= tonumber(string.format("%02d%02d", "08", "30")))  and  tonumber(fibaro:getValue(7, "value")) == 0  and  fibaro:getGlobalValue("VarHoleLight") == "On" )
    or
    startSource["type"] == "other"
    )
    then
        fibaro:call(32, "turnOff");
        fibaro:setGlobal("VarHoleLight", "Off");
    end

    end

     

     

     

     

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hi again,

    So I have made yesterday a few scene..:)

    i will attached them,

    I have made a scene which should turn off the light in the hole from 6 -9 at morning when i close the main door. i gave him a run and went okay.

    but i have a main door scene which turns on the light when breached and turns off the light when it is safe for 2 minutes.

    i wanted to make inaktive from 6-9 at morning as ai made a variable morning6 and morning9 then i added to the main door scene after the main door == breached and MoLiTiVa == morning 6 ... you will see in attached files.

    i have set the variables that at 6 a clock at morning goes to morning6 and at 9 a clock at morning goes to morning9

    but it won't worked for me

     

    we could figure out something to work for me. are not we?

    Here are all of my scene regarding the situation.

     

    Please login or register to see this attachment.

    Please login or register to see this attachment.

    Please login or register to see this attachment.

    Please login or register to see this attachment.

    Please login or register to see this attachment.

    Please login or register to see this attachment.

    Please login or register to see this attachment.

    Please login or register to see this attachment.

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hi again,

    here is what did i made, can you all please check if is there any problem or it should be any problem.

    Mentioning that at 6 a clock at morning light turns on and at 9 a clock at morning light turns off.

    My problem is that i really do not understand that repeat every 1 minutes situation. I left it as it is.

    I did not made both scenes with timing because i just realised that i can resolve the door opening light turning on situation with a block scene as if main door breached and hole light is off then turn on light on hole.

    with the closing and turning off i must put a time interval based block scene and an and main door is safe for 300 sec then turn light off.

    lets see what do you think. 

    Thank you

    Please login or register to see this attachment.

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0

    Block scenes are my favourite, but i would not call myselve an expert.

    you can do pretty decent ammount of stuff in them but there is no "else" condition for some reason. Limiting them in usability (you got to learn how to Lua for "else")

    usefullness of block scenes is mostly in that they are pratty stright forward. If you dont know what to do within than you should be able to mostly figure it out given enough time.

    annyways reason why am i bothering you with my reply is that there are two types of variables: numeric (hey fibaro can do mathematics too!) or predefined. Predefined i generally tend to use in stead of timers (months for example or quaters of years or something). Bit less usefull given that values's properties are usually defined by scenes they are used for, but waaaay simpler when you just want your scene to make semi-comprehensive sentence (invaluable for fixing it when you overlok something).

    Generaly i tend to have a scene that turns stuff on / sets %. and separate scene that turns things off, because having all conditions in one scene is complete mess.

    bessides i tend to mess up when things should be turned off rather than when they turn on.

    I recommand starting slow do small scale scenes (bathroom timed light, kettle in the morning etc.) see if you can complicate matters for yourselve with variables and go from there.

     

    BTW WE do not get HC2 starter kits here *jealous* we just have HC2 alone or HCL for controllers and HCL starter kit (containing battery devices + wall plug with obviously HCL)

     

    Regardless i bid the wellcome to Fibaro community and hope that you shall enjoy this curious system.

    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.

     Share

    ×
    ×
    • Create New...