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
  • Inquirer
  • 22 hours ago, Sjekke said:

    (When I see the name @Sankotronic I automatically think UHAS ;D)

     

    :-D 

     

    18 minutes ago, wpeeters said:

     thanks anyway. But I can confirm it is working now.

     

    Enjoy coding :-)

    Link to comment
    Share on other sites

    • 0

    Having issues with Main scene and Holiday lights.  If I setup just one button, but enter 2 times of day, I will get error

    [DEBUG] 23:47:09: Main scene FTBE version 1.3.3 - © 2016-2019 Sankotronic
    [DEBUG] 23:47:09: Scheduled VD Holiday Lights number if time and buttons mismatch. Please chcek. Scene is stopped!

     

    If I setup up the same button twice ("2", "2") and 2 times of day, there are no errors, but the second press of the button never happens? (in the pratical world I can get the Holiday Lights VD to turn on, but not to turn off). 


    Any thoughts on how to fix this?

     

    It's strange I get the error message above as I am following the tutorial presicely.

     

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hi @drchip ,

     

    You need to setup time for each button of the VD you add to setup so scheduled VD setup should look like this:

    Please login or register to see this code.

     

    If you want to setup more than one VD for schedule and both have two different times to press button then:

    Please login or register to see this code.

    Hope this helps

    Enjoy! :-)

    Edited by Sankotronic
    typos
    Link to comment
    Share on other sites

    • 0

    Hi

     

    I've installed your scene.

     

    It starts without problem.

     

    I'va problem when I add a scene.

     

    I have some scenes for activate alarm via IFTTT, foscam cam, hue light and Nanoleaf.

     

    I try to add my scene but I receive this error:

    [DEBUG] 12:36:17: Main scene FTBE version 1.3.3 - © 2016-2019 Sankotronic

     

    [DEBUG] 12:36:17: Repeating scene setup error! Missing argument. Please check. Scene is stopped!

     

     

    This is my conf:

     

    -- TIME BASED SCENES AND VD SETUP
    -- REPEATING SCENES SETUP
    -- here you can setup scenes that will be executed at predefined interval
    -- in minutes. Lowest value is every 1 minute and longest interval is up to
    -- you. 24h = 1440m, 1week = 10080m, 30d = 43200m etc.
    -- enter scene names that will run repeatedly every X minutes separated
    -- by comma. This is needed for debugging and can be used to send push
    -- notification
    local runSceneRepeatName       = {"In Casa"}
    -- enter scene IDs that will run repeatedly every X minutes separated
    -- by comma.
    local runSceneRepeatID         = {"9"}
    -- enter at which interval time in minutes will scenes run separated
    -- by comma.
    local runSceneRepeatTime       = {1}
    -- enter here flag for sending push message when scene is executed
    -- 1 for sending message, 0 no messages
    local runSceneRepeatPushFlag   = {""}
    -- enter here message content that will be sent to you when scene is
    -- executed. If above flag is 0 for any of the scenes then just put
    -- empty "" for it.
    local runSceneRepeatPushMessage = {}
    -- for each scene enter variable with name "count" (must be all same name)
    -- separated by comma. This is used to count interval at which scene will
    -- be started and is neccessary for proper execution!
    local runSceneRepeatCount       = {}
    -- enter here "Yes" for each scene if you want them to run immediatelly when
    -- this scene starts running after reboot or saving or enter "No" if you
    -- want scene to run after defined interval after scene is restarted
    local runSceneAtStart           = {"Yes"}

     

    Where "9" is my Scene ID. Where do I wrong?

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • On 12/19/2019 at 11:47 AM, MarcoTorino71 said:

    I try to add my scene but I receive this error:

    [DEBUG] 12:36:17: Main scene FTBE version 1.3.3 - © 2016-2019 Sankotronic

     

    [DEBUG] 12:36:17: Repeating scene setup error! Missing argument. Please check. Scene is stopped!

     

     

    Hi @MarcoTorino71 ,

     

    if you more carefully read instructions in code you will find that runSceneRepeatPushFlag must be set to either 0 not to send notification or 1 to send it. Then runSceneRepeatPushMessage you left empty and must be some message text or empty "". runSceneRepeatCount is also missing "count" setting. So, settings should look like this:

     

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    • 0
    3 hours ago, Sankotronic said:

     

    Hi @MarcoTorino71 ,

     

    if you more carefully read instructions in code you will find that runSceneRepeatPushFlag must be set to either 0 not to send notification or 1 to send it. Then runSceneRepeatPushMessage you left empty and must be some message text or empty "". runSceneRepeatCount is also missing "count" setting. So, settings should look like this:

     

    Please login or register to see this code.

     

     Hi @Sankotronic

     

    OK. I change the parameters and I have not any error... but... All my devices got unreachable! I use your VD and Scenes for HUE, Netatmo and Nanoleaf.

     

    I receive this error :

     

    Nanoleaf:

     

    DEBUG] 12:23:20: ERROR - Could not connect to Nanoleaf Aurora.
    [DEBUG] 12:23:20: ERROR - Please setup authorization token (?)
    [DEBUG] 12:23:20: VD updated
    [DEBUG] 12:23:30: ERROR - Could not connect to Nanoleaf Aurora.
    [DEBUG] 12:23:30: ERROR - Please setup authorization token (?)
    [DEBUG] 12:23:30: VD updated

     

    Hue Lamp:

     

    AvvioStopCancella [DEBUG] 12:24:47: Standalone Philips HUE AIO VD version 3.1 - (c) 2018-19 Sankotronic
    [DEBUG] 12:24:47: Found VD ID: [36] HUE Preview - role: HUE Setup1
    [DEBUG] 12:24:47: HUE bulb ID: 3 is NOT existing. Model: unknown, Type: unknown
    [DEBUG] 12:24:47: Checking VD icons

     

    Hue Preview:

     

    [DEBUG] 12:25:15: Philips HUE bridge authorization username is missing
    [DEBUG] 12:25:15: Please setup authorization username (?)
    [DEBUG] 12:25:15: VD updated
    [DEBUG] 12:25:25: Philips HUE bridge authorization username is missing
    [DEBUG] 12:25:25: Please setup authorization username (?)
    [DEBUG] 12:25:25: VD updated

     

    I restore from backup and hue, Netatmo and nanoleaf works

    Please login or register to see this attachment.

    Edited by MarcoTorino71
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hi @MarcoTorino71 ,

     

    Authorization keys are stored ing global variables after connection to HUE bridge or light panels. All my work stores data formatted in tables to global variables. That reduces need for great number of global variables, but brings one problem. HC2 global variables can loose all table formatted data if Save button is used in global variable panel. All my VD's and Scenes will rebuild global variable table structure but still stored data will be lost. I recommend that after generating authorization keys you copy them and store them in some document on your computer. Also you can then copy this keys to VD main loop so even if global variable is destroyed key will be available after rebuilding global variables.

     

    With all my work I also provide User manuals where I try to explain all details how to install my work and also DO and DON'T. One of very important DON'T is using Save button in global variable panel after manually changing global variable value.

     

    Link to comment
    Share on other sites

    • 0
    On 12/25/2019 at 9:45 AM, Sankotronic said:

    Hi @MarcoTorino71 ,

     

    Authorization keys are stored ing global variables after connection to HUE bridge or light panels. All my work stores data formatted in tables to global variables. That reduces need for great number of global variables, but brings one problem. HC2 global variables can loose all table formatted data if Save button is used in global variable panel. All my VD's and Scenes will rebuild global variable table structure but still stored data will be lost. I recommend that after generating authorization keys you copy them and store them in some document on your computer. Also you can then copy this keys to VD main loop so even if global variable is destroyed key will be available after rebuilding global variables.

     

    With all my work I also provide User manuals where I try to explain all details how to install my work and also DO and DON'T. One of very important DON'T is using Save button in global variable panel after manually changing global variable value.

     

    Hi @Sankotronic

     

    Ok. I understood.

     

    Just a question: how can I find the authorization code? So I can write it!

    Link to comment
    Share on other sites

    • 0

    I'm still having problems with setting TimeOfDay to Morning regardless of Sunrise time. I've set useSleepState to true, but the variable isn't used at all in the lua code.... I've also tried the mentioned midnight setting to say 03:00 and changing Awake and Sleep, but no change in TimeOfDay. And midnight is also unused in the lua code....

     

    What am I doing wrong???

     

    <edit> I did hard-code sunrise to "06:00" and that does work, but that shouldn't be the solution, I guess....

    Edited by emielstroeve
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hi @emielstroeve ,

     

    Can you please elaborate what you need to achieve and then I will check for the solution?

    Link to comment
    Share on other sites

    • 0

    hi @Sankotronic thanks for the reply.

     

    I would like to achieve that when the presence detector detects motion (it will set SleepState to Awake), the TimeOfDay will go to Morning, regardless of the Sunrise time.

     

    cheers,

    emiel

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 2 minutes ago, emielstroeve said:

    hi @Sankotronic thanks for the reply.

     

    I would like to achieve that when the presence detector detects motion (it will set SleepState to Awake), the TimeOfDay will go to Morning, regardless of the Sunrise time.

     

    cheers,

    emiel

     

    Hi @emielstroeve ,

     

    I have checked and found that Main scene FTBE does not check SleepState as intended. I have corrected code, but give me one day to test it to make sure it is working OK. As soon as I test the code will provide it here and update in download section.

     

    Thank you for reporting!

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 32 minutes ago, emielstroeve said:

    no problem, glad you found something! 

     

    Hi @emielstroeve ,

     

    I have tested it. It is like this:

    1. If useSleepState is set to false then Morning will start at sunrise time regardless of the SleepState value
    2. if useSleepState is set to true then Morning will be set between midnight "00:00" and sunrise time if SleepState is set to Awake, otherwise Night will be set until sunrise time

    In other words After midnight if useSleepState is true and SleepState is Awake then time of day will be set to Morning and will stay set to Morning until SleepState is set to Sleep.

     

    If that is not acceptable then we have to define one more time that will be set between midnight "00:00" and sunrise time so that Morning is set only if SleepState is set to Awake and current time is between that NEW time and sunrise time. If you want to add this NEW time then let me know how would you calculate it to be between midnight and sunrise time.

     

    Link to comment
    Share on other sites

    • 0

    hi @Sankotronic that is exactly what I would like to use. But it doesn't work that way overhere.... If I set useSleepState to true, Night turn into Morning at sunrise even when I set SleepState froom Sleep to Awake. In my lua useSleepState isn't used at all (in the code), the only appearance is when the variable is set to true or false. 

     

    So are we using the same versions?? My version is 1.3.3

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hi @emielstroeve ,

     

    Yes I have checked Main scene FTBE v1.3.3 and have made corrections so latest version is v1.3.4 and you can get it from link bellow:

     

    Please login or register to see this attachment.

     

    Let me know if that is working for you. I will also update download section, but don't know when it will be approved by admins since I don't see them much around forum anymore.

     

    NOTE

    useSleepState is by default set to false so don't forget to change this settings to activate usage of SleepState.

    Link to comment
    Share on other sites

    • 0

    I've added this to the scene:

     

    Please login or register to see this code.

    And I'm getting this response when running the scene (useSleepState is set to True):

     

    Please login or register to see this image.

    /monthly_2019_12/image.png.9ff169e3d04cd74c28dcaef38b1d20d2.png" />

     

     

    SleepState is set to 'Awake' 

    Edited by emielstroeve
    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...