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


Question

Posted (edited)

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 16
  • Thanks 6

Recommended Posts

  • 0
  • Inquirer
  • Posted
    3 minutes ago, Tor Magnus said:

    That does indeed look like it will fix it, however the gT/bT variables don't exist in the old version. Replaced that line with the line from the old script. Looks like it's ok now.

     

    Cheers,

    Tor Magnus

     

    Hi @Tor Magnus,

     

    Sorry for that, I forget to replace new code with old one. I corrected my previous post so it should now work. In new code I use this new globals for translations and some other really cool stuff but it depends on installing new Sunrise & Sunset VD and translation scene and VD. That will come after I solve some problems that occurred after upgrading HC to 4.130 :-( 

     

    • 0
    Posted
    On 12/11/2016 at 4:09 AM, Sankotronic said:

    1) Please first download "Sunrise & Sunset" VD and import to your HC.

    Hi @Sankotronic,

    I've got a very noob question, but how do I 'import' into my HC2?

    Thanks,

    Scott

    6 minutes ago, Scott said:

    Hi @Sankotronic,

    I've got a very noob question, but how do I 'import' into my HC2?

    Thanks,

    Scott

    Actually I figured it out looking at your Philips HUE Color & White ambience and White dimmable only v2.1m & v2.1b post; Devices > Add Virtual Device!

    • 0
    Posted

    @Sankotronic,

     

    I have noticed that no matter what I do each day my "Sunrise & Sunset" VD resets all of the time margins to default as defined in the below highlighted code taken from the VD. Is this by design or have I got a bug in my system??

     

    updateVar = true
        -- make first calculation
        sunrisetime  = fibaro:getValue(1, "sunriseHour");
        sunsettime   = fibaro:getValue(1, "sunsetHour");
        fibaro:setGlobal("SunriseTime", sunrisetime);
        fibaro:setGlobal("SunsetTime", sunsettime);
        marginDay    = "02:00";
        fibaro:setGlobal("MarginDay", marginDay);
        dayTime      = calculateTimeString(sunrisetime, marginDay);
        fibaro:setGlobal("DayTime", dayTime);
        marginNight  = "03:00";
        fibaro:setGlobal("MarginNight", marginNight);
        nightTime    = calculateTimeString(sunsettime, marginNight)
        fibaro:setGlobal("NightTime", nightTime);
        marginBlinds = "05:00";
        fibaro:setGlobal("MarginBlinds", marginBlinds);
        blindsTime   = calculateTimeString(sunrisetime, marginBlinds);
        fibaro:setGlobal("OpenBlindTime", blindsTime);

    • 0
  • Inquirer
  • Posted
    29 minutes ago, Robert Folbigg said:

    @Sankotronic,

     

    I have noticed that no matter what I do each day my "Sunrise & Sunset" VD resets all of the time margins to default as defined in the below highlighted code taken from the VD. Is this by design or have I got a bug in my system??

     

    updateVar = true
        -- make first calculation
        sunrisetime  = fibaro:getValue(1, "sunriseHour");
        sunsettime   = fibaro:getValue(1, "sunsetHour");
        fibaro:setGlobal("SunriseTime", sunrisetime);
        fibaro:setGlobal("SunsetTime", sunsettime);
        marginDay    = "02:00";
        fibaro:setGlobal("MarginDay", marginDay);
        dayTime      = calculateTimeString(sunrisetime, marginDay);
        fibaro:setGlobal("DayTime", dayTime);
        marginNight  = "03:00";
        fibaro:setGlobal("MarginNight", marginNight);
        nightTime    = calculateTimeString(sunsettime, marginNight)
        fibaro:setGlobal("NightTime", nightTime);
        marginBlinds = "05:00";
        fibaro:setGlobal("MarginBlinds", marginBlinds);
        blindsTime   = calculateTimeString(sunrisetime, marginBlinds);
        fibaro:setGlobal("OpenBlindTime", blindsTime);

     

    Hi @Robert Folbigg,

     

    Resetting of margin times should happen only when VD is saved and/or main loop is restarted. Same can happen after system reboot. To avoid resetting of this margin values because you are rebooting system every day or have watchdog that is restarting VD main loop then you should comment out this part.

     

    In new version of Sunrise & Sunset VD that I still have to publish, global variable is reinitialised only if found missing or corrupted.

    • 0
    Posted
    32 minutes ago, Sankotronic said:

     

    Hi @Robert Folbigg,

     

    Resetting of margin times should happen only when VD is saved and/or main loop is restarted. Same can happen after system reboot. To avoid resetting of this margin values because you are rebooting system every day or have watchdog that is restarting VD main loop then you should comment out this part.

     

    In new version of Sunrise & Sunset VD that I still have to publish, global variable is reinitialised only if found missing or corrupted.

     

    Thanks @Sankotronic,

     

    I do reboot my HC2 fairly often so that is most likely the cause, I will comment out the code for now and wait for your next version

    • 0
    Posted

    HI,

     

    will Your Scene also be able to calculate national holdays like Eastern or Christmas ? I know there is a Calender Scene available which does it. Would be nice to have it in one run.

    Thanks, Michael

    • 0
  • Inquirer
  • Posted
    1 hour ago, Bikemike55 said:

    HI,

     

    will Your Scene also be able to calculate national holdays like Eastern or Christmas ? I know there is a Calender Scene available which does it. Would be nice to have it in one run.

    Thanks, Michael

     

    Hi @Bikemike55 and welcome to Fibaro forum!

     

    I'm working on new version of main scene but I didn't plan to add bank holidays to it because there is very good scene for that coded by @DonQuichopp and you can find it here:

     

    • 0
    Posted

    Hello Mr. Sankotronic,

     

    First of all, I want to you thank you for such great scenes and VDs you prepared and published for all of us.

     

    I want to ask one question and maybe stupid one:

    Please login or register to see this link.

      -> Do I need to run this main scene by pressing button: "RUN" and keep it running all the time, so after that "PAUSE" button will appears and will remain all the time? 

     

    I am asking because I see that TimeOfDay is not switching automatically. This is causing an issue because during evening/night/morning time, lights are not working properly. For example: at 22:00 what should be evening time and lights should turn on, I recognized that TimeOfDay is set to "DAY" so lights are off. But once I will start this scene manually by pressing "RUN" button, then TimeOfDay is immediately switched to evening what is correct and light turn on. So working fine but I need to press "RUN" button. 

     

    Thank you in advance.

    • 0
  • Inquirer
  • Posted

    Hello @Jutos and welcome to Fibaro forum!

     

    Main scene should start automatically after saving it and it should run endlessly. Also it will start after rebooting HC2. If your copy of scene stops then there is probably some error that causes it to stop and you can check in debug window and share with me so we can find cause for it.

     

    • 0
    Posted

    Hello Sankotronic, 

     

    I checked debug and as there was no error message, so I double checked all VDs and find out that in VD "Sunrise & Sunset v1.3"  I can see only hours in some fields without minutes. I decided to reimport this VD once again and now main scene work automatically, as charm :)

    Once again thank you for this great scene.

    • 0
  • Inquirer
  • Posted
    13 hours ago, Jutos said:

    Hello Sankotronic, 

     

    I checked debug and as there was no error message, so I double checked all VDs and find out that in VD "Sunrise & Sunset v1.3"  I can see only hours in some fields without minutes. I decided to reimport this VD once again and now main scene work automatically, as charm :)

    Once again thank you for this great scene.

     

    Hi @Jutos,

     

    Using Save button in variables panel usually destroys some variables value and then this happens. If it happen again you don't need to reimport VD, just open Sunrise & Sunset VD for editing and press Save button so that Main loop is restarted and it will then reset global variables. Of course after that you will have to again adjust times.

    • 0
    Posted

    Hi,

     

    on the Timers VD I get an error by TimeOfDay:

     

    i Have an TimeOfDay predefined Variable created, maybe it must be with a small t?!

     

    I have TimeOfDay, maybe I need timeOfDay?!

     

    Regards

     

    Please login or register to see this code.

    Error Meesage: 

    [DEBUG] 09:29:00: Morning
    [ERROR] 09:29:00: line 42: attempt to compare nil with number

     

    Do you have an idea?!

    • 0
  • Inquirer
  • Posted
    5 minutes ago, RubberDuck said:

    Error Meesage: 

    [DEBUG] 09:29:00: Morning
    [ERROR] 09:29:00: line 42: attempt to compare nil with number

     

    Do you have an idea?!

     

    Hi @RubberDuck,

     

    Since you have set mapping for the TimeOfDay like this:

    Please login or register to see this code.

    then you also need to add global variable "TimeOfDay" with values "Morgen", "Tag", "Abend" and "Nacht" to variable panel. So please check predefined global variable what values you setup for it and if you setup in English then change them to correspond to your mapping setting in code.

     

    BTW - since you set:

    Please login or register to see this code.

    then global variable name must be with big T, actually same as the name inside quotes in above line.

     

    • 0
    Posted

    Okay,

    now it works :) So no I must look, for what this is good ;-) 

    I started now the Main Scene and I get this:

     

     

    [DEBUG] 10:00:50: Main scene for time events version 1.2.5 - © 2016 Sankotronic
    [DEBUG] 10:00:50: line 454: attempt to perform arithmetic on local 'diffMinute' (a nil value)
    [DEBUG] 10:05:19: Main scene for time events version 1.2.5 - © 2016 Sankotronic
    [DEBUG] 10:05:19: line 454: attempt to perform arithmetic on local 'diffMinute' (a nil value)

     

    You have an idea?!

    • 0
  • Inquirer
  • Posted
    13 minutes ago, RubberDuck said:

    Okay,

    now it works :) So no I must look, for what this is good ;-) 

    I started now the Main Scene and I get this:

     

     

    [DEBUG] 10:00:50: Main scene for time events version 1.2.5 - © 2016 Sankotronic
    [DEBUG] 10:00:50: line 454: attempt to perform arithmetic on local 'diffMinute' (a nil value)
    [DEBUG] 10:05:19: Main scene for time events version 1.2.5 - © 2016 Sankotronic
    [DEBUG] 10:05:19: line 454: attempt to perform arithmetic on local 'diffMinute' (a nil value)

     

    You have an idea?!

     

    Hi @RubberDuck,

     

    first you need to avoid using Save button in global variable panel. Also, did you install Sunrise & Sunset VD? If you did then check if times on this VD are shown properly in format "07:00". If not then open Sunrise & Sunset VD for editing and press Save button so that main loop can rebuild global variables. After that it should work properly but you will have to setup your times again since times will be reset to default settings.

     

    • 0
    Posted

    Okay, my Variables were broken.

     

    Now it works. So Now I must look what I can do with that :)

    • 0
  • Inquirer
  • Posted
    10 minutes ago, RubberDuck said:

    Okay, my Variables were broken.

     

    Now it works. So Now I must look what I can do with that :)

     

    Well I thought it is obvious :-) 

     

    Besides taking care of sunrise and sunset times, time of day, darkness, day of the week, month, season, etc. that every home automation needs to be aware of, it can also be used to start other scenes or VD's repeatedly or on schedule or even change global variable value that can again trigger one or series of events. Main scene in this way can save some resources on your HC2 because instead of having many scenes running all the time, you can have only one running all the time which then starts other scenes and/or VD's only when it is necessary.

     

    • 0
    Posted

    I have a question to the GPS. The battery is drain fast from the iPhone, when GPS localization is active on the Fibaro. Is there an other possibility to use this feature?!

     

    I want to check if my wife is at home, when not, I want to close automatically all Rollershutter.


    Thanks for your help

    • 0
  • Inquirer
  • Posted
    1 hour ago, RubberDuck said:

    I have a question to the GPS. The battery is drain fast from the iPhone, when GPS localization is active on the Fibaro. Is there an other possibility to use this feature?!

     

    I want to check if my wife is at home, when not, I want to close automatically all Rollershutter.


    Thanks for your help

     

    Hi @RubberDuck,

     

    It is same here, Fibaro app just drains phone battery when GPS localization is turned on. So, at the moment I have it switched off, and since there is no action regarding that from Fibaro developer team I even removed GPS tracking function from new version of Main scene FTBE.

     

    Since I'm busy with many other aspects of my new system, presence monitoring will have to wait. I do have some sketches using motion sensors, Netatmo welcome camera and possibly some other devices, but this is still in very early stage.

     

    You can search this forum for some quite nice solutions regarding presence detection.

    • 0
    Posted

    Hi,

     

    I have a Question to my Time in Fibaro:

     

    In the upper Right corner is the correct time. But when I run this Scene I get an time with difference of two hours?!

     

    What I do wrong?!

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