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


  • 3

[SCENE] Main scene FTBE v1.3.4


Sankotronic

Question

Main scene FTBE v 1.3.4

 

Hello everyone!

 

NEW version is OUT!

 

More about scene and download you can find here:

 

WHAT'S NEW:

 

  • Main scene FTBE 1.3.4 - changed function for time of day calculation and added use of SleepState global to set time of day to morning when Awake  regardless of current time
  • Main scene FTBE 1.3.0 - cleaned some bugs, added some more checks to prevent scene from stop running due to errors. Optimized and compacted code, removed unnecessary comments. DemoMode only stops changing timers while user code and scheduled events will continue to execute. Darkness can now be changed by measured lux level or global variable that is set to lux value measured by light measuring devices placed outside. Scene is now running on setTimeout function instead on sleep for better timing and also aligns to 0 seconds or exact minute.
  • Sunrise & Sunset VD v1.4.0 - Modified main loop code to better handle global variables. Variables are now automatically repaired and are not reset to default settings after HC2 reboot. Added variable SunriseIcon to store VD icon ID and now when main icon for VD is set also all button icons are set automatically.
  • Home Status VD v1.1 - Added variable HomeStatIcon to store VD icon ID and now when main icon for VD is set also all button icons are set automatically. Added label that shows most important values on VD when closed.
  • Home Timers VD v1.1 - Added variable HomeTimersIcon to store VD icon ID and now when main icon for VD is set also all button icons are set automatically. Added label that shows most important values on VD when closed.

 

 

Please login or register to see this attachment.

 

 

NOTE - This version is compatible with previous versions so need to do any changes in your current code of other scenes and VD's.

 

REQUEST - If you like my work and found it useful please give me support by rating and writing short review. Thank you! :-)

 

PS

Dear friends from Slovakia you can find this scene and VD translated to your language here: 

Please login or register to see this link.

 

 

Edited by Sankotronic
Updated to new version
  • Like 17
  • Thanks 6
Link to comment
Share on other sites

Recommended Posts

  • 0

Hi @Sankotronic
FTBE scene (scheduled global variable) is not updating sunset time. Nevertheless the log contains the correct sunset time, the trigger time is wrong.
After stop and start of the scene (and / or reboot of the HC2) the sunset time is correct again.
Initiallity, I thought I made too many changes to the scene so I deleted the scene and created a new one. This is not solving the problem. Any idea what can be wrong?


Triggered scene. Sunset time is the time from a few days ago.

Please login or register to see this spoiler.

 

Link to comment
Share on other sites

  • 0

Hi @Sankotronic

 

i need your help, i already spent few hours trying to solve what is going on, but have no idea what is happening..  so, i do have a button in kitchen that changes global variable CookingState value so the light will be turned on when cooking.. so i set up your scene as follows:

 

local cookingState        = "CookingState"
local cookingStateMapping = {Yes="Yes", No="No"}

local useCookingState     = "Yes"

 

local dimRGBCooking   = {100}

 

extraGlobalName       = {"CookingState", "CinemaState"}

extraGlobalValue      = {"Yes", "Yes"}

 

So once the CookingState is set to Yes the light should be always on at 100, right? but when i change the CookingState by button lights does not turn on... this happens in the debug:

 

Please login or register to see this image.

/monthly_2019_04/image.png.dd889952f050641ef06e2ef4bc809f19.png" />

 

once motion is detected, light is turned on with cooking level etc. 

image.png.32d37c2286749292bcf1c27b2e4b07b2.png

 

when i turn the CookingState to No, light changes to Day time, turns off etc. so everything good. 

 

the only thing i am not able to figure out, why the light does not turn on when the CookingState is Yes without motion. and the same happens if my current lux is higher then luxMin, light does not turn on. Shouldn't the CookingState value force the light to turn on? thanks for help

 

EIDT: i am sorry this post is here in topic for main scene FTBE, i am not sure why i was redirected here when i click on support for Very smart light scene :(

Edited by tomasko
Link to comment
Share on other sites

  • 0

@Sankotronic

 

How can I swap the two Icons for "Sunrise is at" and "Day starts at" in the "Sunrise & Set VD"? 

 

In my VD (and the picture from Andyhud) the clock symbol is next to the "Sunrise is at", and sun at "day start at".

 

Br, 

Frank

Link to comment
Share on other sites

  • 0
Guest andyhud

Question:

 

When we are using the Main FTBE Timer to trigger a "scene", obviously by default the scene itself needs a trigger, but in this case, we want the scene to "just run" when the Main FTBE triggers it.

 

To do this, I'm just setting a trigger in a scene to look like below (simple Block scene as an example) where I'm saying this scene can run any day of the week at any time. However the scene itself is set to "manual" so it doesnt run by itself, just runs when the Main FTBE triggers it. 

 

Is this the right approach?

 

Please login or register to see this attachment.

Please login or register to see this attachment.

Thanks

 

Andy

Link to comment
Share on other sites

  • 0
  • Inquirer
  • On 4/27/2019 at 10:30 PM, wpeeters said:

    FTBE scene (scheduled global variable) is not updating sunset time. Nevertheless the log contains the correct sunset time, the trigger time is wrong.
    After stop and start of the scene (and / or reboot of the HC2) the sunset time is correct again.
    Initiallity, I thought I made too many changes to the scene so I deleted the scene and created a new one. This is not solving the problem. Any idea what can be wrong?

     

    Hi @wpeeters,

     

    Sunrise and sunset times FTBE gets from HC2 location settings so if not correct then you should check your HC2 location settings.

    If sunrise and sunset trigger times are not correct then you should check your settings in Sunrise & Sunset VD and compare them since FTBE uses those settings from VD.

    I can't give you any further help if you changed FTBE scene code since I don't know what changes did you make. I can help only if we are talking about original FTBE scene code.

     

    On 4/27/2019 at 10:33 PM, tomasko said:

    i need your help, i already spent few hours trying to solve what is going on, but have no idea what is happening..  so, i do have a button in kitchen that changes global variable CookingState value so the light will be turned on when cooking.. so i set up your scene as follows:

     

    Hi @tomasko,

     

    You question is related to VSL scene and not FTBE scene so please can you ask your question in proper thread. This can be a bit confusing for other users. THANK YOU!

     

    17 hours ago, Frasev said:

    How can I swap the two Icons for "Sunrise is at" and "Day starts at" in the "Sunrise & Set VD"? 

     

    In my VD (and the picture from Andyhud) the clock symbol is next to the "Sunrise is at", and sun at "day start at".

     

    @Frasev,

     

    Yes of course you can change icons on VD to your liking.

     

    Link to comment
    Share on other sites

    • 0
    34 minutes ago, Sankotronic said:

     

    @Frasev,

     

    Yes of course you can change icons on VD to your liking.

      

     

    @Sankotronic,

    I'm sorry, my question were unclear. How can I change it? 

     

    Br, 

    Frank 

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 17 minutes ago, Frasev said:

     

    @Sankotronic,

    I'm sorry, my question were unclear. How can I change it? 

     

    Br, 

    Frank 

     

    And it is still unclear on what icons do you refer? Maybe a screenshot will make it easier for me to give proper answer.

     

    Link to comment
    Share on other sites

    • 0
    11 minutes ago, Sankotronic said:

     

    And it is still unclear on what icons do you refer? Maybe a screenshot will make it easier for me to give proper answer.

     

     

    Its a minor detail, but I like things correct, neat and clean (my wife even more ;) )

     

    2019-04-30_10-06-44.jpg.175fe553ad4017940be6c142d9454e8a.jpg

    Edited by Frasev
    Link to comment
    Share on other sites

    • 0

    To change the icons, you need to edit the main loop. In my set-up the values are around line 203.

    In your script, there are probably decimalvalues? for the icons, but you can write emojis directly.

    Regarding the order of icons, I have also changed the set-up. In my opinion the intention with the setup is to display a wake-up time for the house and then the sunrise-time. I do not use the wake-up time myself and therefore I sort of agree with you, even if the intention of the maker makes the display order correct.

    ...had to remove the emojis before posting here (symbol)

     

    My version: approx line 203 in the main loop

       logbug(evc,string.format(rgv,marginBlindsName))end
                                --MAIN LABEL
        hc:call(selfId,"setProperty","ui.Label1.value",'symbol'..sunrisetime..'symbol'..sunrise.. --hc:getGlobalValue(dayTimeName)
          'symbol'..sunset..'symbol'..sunsettime)--hc:getGlobalValue(nightTimeName))
        hc:call(selfId,"setProperty","ui.lblMarginBlinds.value",hc:getGlobalValue(marginBlindsName))

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 1 hour ago, Frasev said:

    Its a minor detail, but I like things correct, neat and clean (my wife even more ;) )

     

    You see that first time is not really time of the sunrise but it is time when morning will start. In your case since difference is 0 min it happens that morning starts at same time of sunrise.

     

    So for you morning starts at the same time when sunrise is. Also, you set that day starts 45 minutes after morning starts so day starts at 6:24, so that is not time for morning but for day and sun represents that correctly.

    You have a bit mixed up times so you are thinking that icons are set incorrect, but actually icons are correct, only your times are a bit strange for when day starts. Usually morning last a bit longer than 45 minutes, but then again it is entirely up to you when you want to start morning, day, evening and night.

     

    Just to make it clear, sunrise and sunset times are not shown on that label, but times when morning, day, evening and night starts.

    Link to comment
    Share on other sites

    • 0
    2 minutes ago, Sankotronic said:

     

    You see that first time is not really time of the sunrise but it is time when morning will start. In your case since difference is 0 min it happens that morning starts at same time of sunrise.

     

    So for you morning starts at the same time when sunrise is. Also, you set that day starts 45 minutes after morning starts so day starts at 6:24, so that is not time for morning but for day and sun represents that correctly.

    You have a bit mixed up times so you are thinking that icons are set incorrect, but actually icons are correct, only your times are a bit strange for when day starts. Usually morning last a bit longer than 45 minutes, but then again it is entirely up to you when you want to start morning, day, evening and night.

     

    Just to make it clear, sunrise and sunset times are not shown on that label, but times when morning, day, evening and night starts.

    Ahaa!!! :)

    Now it makes sence. I have read this before, somewere, but finally understood now! 

     

    Thank you for all the great work, and taking the time to reply a newb :)

    Link to comment
    Share on other sites

    • 0
    22 hours ago, Sankotronic said:

     

    Hi @wpeeters,

     

    Sunrise and sunset times FTBE gets from HC2 location settings so if not correct then you should check your HC2 location settings.

    If sunrise and sunset trigger times are not correct then you should check your settings in Sunrise & Sunset VD and compare them since FTBE uses those settings from VD.

    I can't give you any further help if you changed FTBE scene code since I don't know what changes did you make. I can help only if we are talking about original FTBE scene code.

     

     

     

    @Sankotronic
    hi, the problem is that all settings are correct. Sunset time is correctly set and visible in VD, debug of FTBE scene and in global variable section.

    Sorry for the confusion but FTBE is original scene. I only changed the user part.

    So everything seems to be ok. Except not the trigger. FTBE scene is triggering the global always on the initial time of the first run of the scene (after reboot or manually stop and start).

     

    Link to comment
    Share on other sites

    • 0
    On 4/30/2019 at 9:09 AM, Sankotronic said:

     

    Hi @wpeeters,

     

    Sunrise and sunset times FTBE gets from HC2 location settings so if not correct then you should check your HC2 location settings.

    If sunrise and sunset trigger times are not correct then you should check your settings in Sunrise & Sunset VD and compare them since FTBE uses those settings from VD.

    I can't give you any further help if you changed FTBE scene code since I don't know what changes did you make. I can help only if we are talking about original FTBE scene code.

     

     

     

    @Sankotronic
    I did another test and the result is confirming my thought something might be wrong with 'SCHEDULED GLOBAL VARIABLE CHANGE SETUP' in relation with sunsettime.
    Offcourse, it's still possible I'm doing something wrong but everything is working and no errors appear. 


    Just to summarize :

    - log of FTBE is showing correct sunsettime

    - VD Sunrise & set (version 1.4.0) is showing correct sunsettime

    - no errors in VD neither scene

    - no changes made in code (only in user part)

     

    I'm triggering my scene now by both 'SCHEDULED GLOBAL VARIABLE CHANGE SETUP' and 'SCHEDULED SCENES SETUP'.

    In the log of my scene you can see that the scene is triggered at two different times. 

    At correct sunsettime by FTBE 'SCHEDULED SCENES SETUP' ==> type is 'other source'

    At old sunsettime by  'SCHEDULED GLOBAL VARIABLE CHANGE SETUP' ==> type is 'global variable'

     

    My log file :

    Please login or register to see this spoiler.

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 4 hours ago, wpeeters said:

    I did another test and the result is confirming my thought something might be wrong with 'SCHEDULED GLOBAL VARIABLE CHANGE SETUP' in relation with sunsettime.
    Offcourse, it's still possible I'm doing something wrong but everything is working and no errors appear. 

     

    Hi @wpeeters ,

     

    for scheduled scene setup since you are using local variable sunsettime then you must add this line:

    Please login or register to see this code.

    in function function extraUserCodeFirst() so that local variable is updated.

    Same is for scheduled global variable. You have to add this line:

    Please login or register to see this code.

    in function  extraUserCodeFirst() so that local variable is updated.

    Link to comment
    Share on other sites

    • 0

    hi @Sankotronic,

    Thanks. I'll test it asap. I noticed this missing part in scheduled global variable.
    Maybe add it to documentation as well?

    Link to comment
    Share on other sites

    • 0

    Hi @wpeeters

     

    This is how I did it for some roller shutters. Maybe this example can help you. 

     

     

    SCHEDULED DEVICE SETUP
    -- Available commands: "turnOn", "turnOff", "open", "close", XX where
    -- XX is numerical value or level which for example turns on or dim dimmer
    -- at that level (0 to 100)
    local run_device_sched={
      {_id=168,command={"open"},hour={"08:50"},week={1,0,0,0,0,0,1},_global="",_value=""},
      {_id=168,command={"open"},hour={"07:30"},week={0,1,1,1,1,1,0},_global="",_value=""},
      {_id=168,command={"close"},hour={sunset},week={1,1,1,1,1,1,1},_global="",_value=""},     
      {_id=171,command={"open"},hour={"08:51"},week={1,0,0,0,0,0,1},_global="",_value=""},
      {_id=171,command={"open"},hour={"07:30"},week={0,1,1,1,1,1,0},_global="",_value=""},
      {_id=171,command={"close"},hour={sunset},week={1,1,1,1,1,1,1},_global="",_value=""}, 
      {_id=175,command={"open"},hour={"08:51"},week={1,0,0,0,0,0,1},_global="",_value=""},
      {_id=175,command={"open"},hour={"07:30"},week={0,1,1,1,1,1,0},_global="",_value=""},
      {_id=175,command={"close"},hour={sunset},week={1,1,1,1,1,1,1},_global="",_value=""}, 
    }
    -- DEVICES CONTROL BY TIMER OR SENSOR/GLOBAL VALUE CHANGE
    local device_control={
      {_id=0,command="",vditem={""},value="",delay_min="",color={r_bri="",g_hue="",b_sat="",w_ct=""},sensor={_id=0,value="",compare="<="},global={name="",value="",compare="="},flag=false},
    }
    -- EXTRA FUNCTION WHERE YOU CAN ADD YOUR CODE
    -- use this function to add code that will be executed before all other
    -- code in the loop
    function extraUserCodeFirst()
      run_device_sched[3].hour[1] = sunset
      run_device_sched[6].hour[1] = sunset
      run_device_sched[9].hour[1] = sunset
    end
     

     

     

    Edited by Sjekke
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hi @Sjekke ,

     

    Example that you provided is from UHAS compatible FTBE scene which is much more advanced than current version of FTBE scene standalone version.

    I just have to point that out to avoid confusion. :-) 

     

     

    • Like 1
    Link to comment
    Share on other sites

    • 0
    Just now, Sankotronic said:

    Hi @Sjekke ,

     

    Example that you provided is from UHAS compatible FTBE scene which is much more advanced than current version of FTBE scene standalone version.

    I just have to point that out to avoid confusion. :-) 

     

     

    Oh sorry ... my mistake ... I was to fast. (When I see the name @Sankotronic I automatically think UHAS ;D)

     

     

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