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

hello @Sankotronic, is it possible to set the day times ( night, morning etc) to a static time, problem Ive got , running your VSL script my hall lights keep turning off earlier as i just use the morning, day, evening and night settings for it  and at night its turned off, so with the change of sunset time my time to night is gettgin earleir every day. thanks

 

Link to comment
Share on other sites

  • 0
  • Inquirer
  • 3 hours ago, Edb said:

    hello @Sankotronic, is it possible to set the day times ( night, morning etc) to a static time, problem Ive got , running your VSL script my hall lights keep turning off earlier as i just use the morning, day, evening and night settings for it  and at night its turned off, so with the change of sunset time my time to night is gettgin earleir every day. thanks

     

     

    Hi @Edb,

     

    Current version does not support fixed times, but you can still force sunrise and sunset times to be fixed. Open Main scene and find this part of code:

    Please login or register to see this code.

    and change code to this:

    Please login or register to see this code.

    Now with above code sunrise time is fixed to 7h morning and sunset time to 19h evening.

    Link to comment
    Share on other sites

    • 0

    thanks, that should solve the problem :)

    Edited by Edb
    Link to comment
    Share on other sites

    • 0

    It is not available in current version, but I'm preparing to publish new version of Main scene and Sunrise & Sunset VD that will have that option to make all times fixed.

     

    @Sankotronic, any idea on your timelines? A couple of months I choose not to install the current version, because a new one was coming. In the meantime I didn't Fibaro so much... But today I wanted to install the current version anyway, or should I wait a bit longer? Not to hurry you up, just for me to know...

    Edited by ckh
    Link to comment
    Share on other sites

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

     

     

    @Sankotronic, any idea on your timelines? A couple of months I choose not to install the current version, because a new one was coming. In the meantime I didn't Fibaro so much... But today I wanted to install the current version anyway, or should I wait a bit longer? Not to hurry you up, just for me to know...

     

    Hi @ckh,

     

    At the moment I have two groups for beta testing of new UHAS (Universal Home Automation System) and third that is not yet started, but will start it shortly. If you like I can add you to the third group so you will be able to see what I was working on for last several months. More about UHAS you can read here:

     

    Read that post of mine and then let me know what you have decided.

     

    Link to comment
    Share on other sites

    • 0

    @Sankotronic Nice, thanks for the update and invite. I would love to participate!! I'm a huge fan of your work, and curious to this new 'integrated systems'. Until now, I mostly choose to rewrite available scene's myself to make sure I understand what's going on and its tailor made to my home ;-)

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 1 minute ago, ckh said:

    @Sankotronic Nice, thanks for the update and invite. I would love to participate!! I'm a huge fan of your work, and curious to this new 'integrated systems'. Until now, I mostly choose to rewrite available scene's myself to make sure I understand what's going on and its tailor made to my home ;-)

     

    Great! I'm still testing few changes that I made to the STEP 1 installation of UHAS. You should get notification when I open third beta test group. Thank you!

     

    Link to comment
    Share on other sites

    • 0

    Hallo

    please i need help with integration this complete plugins

    I have all set up, but not function - see image

    i have dark, when is light day 

    do not posible setup other when button is not function see image

    what am I make wrong?

    and how turned off demo mode

     

    thank you very much for you response

    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
  • 3 hours ago, AZreklama said:

    Hallo

    please i need help with integration this complete plugins

    I have all set up, but not function - see image

    i have dark, when is light day 

    do not posible setup other when button is not function see image

    what am I make wrong?

    and how turned off demo mode

     

    thank you very much for you response

     

    Hello @AZreklama and welcome to Fibaro forum!!!

     

    Sorry to see that you have problems with scripts. From your screenshot I can see that there is problem with DemoMode global variable. Can you please check if you added it to variable panel lower section where predefined variables are and set it up with two values of your choice, can be "Ano" and "Ne", but then you need to properly set mapping in the Main scene at code line 192 to look like this:

    Please login or register to see this code.

    Also you will have to do same in Home Status VD for main loop and button that is used to change it's value.

     

    When you get this right so that in Main scene debug window doesn't show this line any more:

    Please login or register to see this code.

    Then we can see if there is anything else to setup!

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • @AZreklama,

     

    No problem. Just add it to the system and then if there are other problems just let me know so we can find solution!

     

    Enjoy! :-) 

     

    Link to comment
    Share on other sites

    • 0
    42 minutes ago, Sankotronic said:

    @AZreklama,

     

    No problem. Just add it to the system and then if there are other problems just let me know so we can find solution!

     

    Enjoy! :-) 

     

    Yes i have one problem

    it is not possible add icon to the weather state

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 44 minutes ago, AZreklama said:

    it is not possible add icon to the weather state

     

    It is possible but you need to follow  instructions here:

    And download icons here:

     

     

    Link to comment
    Share on other sites

    • 0
    14 hours ago, Sankotronic said:

     

    It is possible but you need to follow  instructions here:

    And download icons here:

     

    I have download all icons, and have write in LUA code       local popupImgUrl       = "http://10.0.1.19/fibaro/n_vicons/User1001.png" but do not function

     

     

    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
    On 21-7-2017 at 12:14 PM, Sankotronic said:

    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.

     

    I also ran to the same error:

    [DEBUG] 17:38:12: Main scene for time events version 1.2.5 - © 2016 Sankotronic
    [DEBUG] 17:38:12: line 461: attempt to perform arithmetic on local 'diffMinute' (a nil value).

    Q1 How do I avoid to use the save button in the global variable if I need to change manually a global?

    Q2 How do I repair? The sunrise&sunset VD did show the proper format.

     

     

     

    Edited by net
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 17 hours ago, net said:

     

    I also ran to the same error:

    [DEBUG] 17:38:12: Main scene for time events version 1.2.5 - © 2016 Sankotronic
    [DEBUG] 17:38:12: line 461: attempt to perform arithmetic on local 'diffMinute' (a nil value).

    Q1 How do I avoid to use the save button in the global variable if I need to change manually a global?

    Q2 How do I repair? The sunrise&sunset VD did show the proper format.

     

    Hi @net,

     

    Whenever you use Save button in global variable panel then Sunrise & Sunset variable get corrupted causing that error. After that you have to open Sunrise & Sunset VD for editing and press Save button so that VD can rebuild variable. After that you have to set your times again since after recovery default times are set.

     

    A1 - Main scene has two VD's Home status and Home Timers to change variables values manually and test scene so there is no need for changing them in variable panel. If any other global variable is in question, then it is quite easy to make VD and use that VD to change global variable. You can use code from Home Status and Timers VD as example how to do that. I have my HC2 for more than 2 years and I never needed to use Save button in global variable panel so it is doable.

     

    A2 - Oh, I already answered that question. Open for edit Sunrise & Sunset VD, press Save button, correct times.

     

    Link to comment
    Share on other sites

    • 0
    6 hours ago, Sankotronic said:

    I have my HC2 for more than 2 years and I never needed to use Save button in global variable panel so it is doable.

    OK, thank you.

    But while developing other scenes it is quite a long work-around.

     

    This corruption of global variables, and diffMinute error has puzzled  quite a few developers.

    I use the Main Scene of Time at this moment for Battery state, quite an important scene.

    Is a "reset button" on Sunrise&Sunset VD possible, or  a message (push,email) that the globalvariables are corrupt or that the Main Scene of Time has stopped, or even an autorestore function,

     

    BTW Is it safe to add or remove global variables?

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hi @net,

     

    For adding or deleting global variables there is no need for pressing Save button. To add variable click on ADD button, enter necessary data and it is saved when confirmed by clicking on OK button. Same is for deleting variables, just click on trash can icon and confirm deletion, no need for Save button afterwards. Save button is needed for manual changing value of the global variable, but that is not really good way for testing code since no scene will be triggered that way. So, at the end that Save button in global variable panel is just pain in the as.. :-P nothing more.

     

    Regarding global variable corruption. Developers of Home Center system did a mistake since they overlooked one very important feature of LUA and that is data tables. LUA is so good with data tables and is really pity that this tables can be stored in global variables but are corrupted by the system when Save button is pressed. Also for advanced home automation storing only simple numerical data and predefined variable data is just not enough. That is why my code is using data tables and if you use my code then you just have to stop pressing that Save button in global variable panel.

     

    There is one very good watchdog scene written by @lazer on French forum. I use it and I can warmly recommend it. Watchdog scene can restart scene or VD main loop if stopped and also send notification by e-mail or push message depending on scene settings.

     

     

     

    Link to comment
    Share on other sites

    • 0

    Something strange is happening...

    since 4 days I'm facing something strange with the scene. It seems that at certain hour during the night the scene is stopped for some reasons and alla variables are not updated. When I wake up.. HC2 is set as per night time mode.. not morning.. I immediately check the timer vd and all variables are wrong (seems freezed).. suddenly at 8:00 (around 8:00) the scene starts working and updates the variables.

    Actualy I think the problem starts from HC2 not the scene. Since firmware 4.150 I'm facing thousand of problems... the strange thing is that firmware updated was done 3 weeks ago.. while the problem with scene starts 4 days ago.

     

    Link to comment
    Share on other sites

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

    Something strange is happening...

    since 4 days I'm facing something strange with the scene. It seems that at certain hour during the night the scene is stopped for some reasons and alla variables are not updated. When I wake up.. HC2 is set as per night time mode.. not morning.. I immediately check the timer vd and all variables are wrong (seems freezed).. suddenly at 8:00 (around 8:00) the scene starts working and updates the variables.

    Actualy I think the problem starts from HC2 not the scene. Since firmware 4.150 I'm facing thousand of problems... the strange thing is that firmware updated was done 3 weeks ago.. while the problem with scene starts 4 days ago.

     

     

    Hi @alexpelli

     

    I think I know what is the problem, but I need to know what error message was shown in scene debug window? Can you please next time check and report here. Also first try to restart scene with RUN button. If it starts running without errors then this is a known problem with HC system. If you can't restart it with RUN button then report what error message here.

     

     

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