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 16
  • Thanks 6
Link to comment
Share on other sites

Recommended Posts

  • 0
  • Inquirer
  • Hi @emielstroeve ,

     

    Proper settings with removed comments:

    Please login or register to see this code.

    You forget to add settings for the push message chgGlobalPushFlag and chgGlobalPushMessage. How to do proper settings for scheduled global variable change is explained in User manual on page 17. :-) 

    Link to comment
    Share on other sites

    • 0

    yep, that was the problem. Scene is running fine and I'm just out of bed drinking my morning coffee, it actually is 'Morning' as we speak ? So it works fine!

     

    Many thanks for all your great work!

    Link to comment
    Share on other sites

    • 0

    (Solved)

    Hi
    I want to change the hours of change of the variables: morning - 6.00, day - 9.00, evening 17.00 and night - 22.30 ... can I change? Thanks

     

    Edited by wrongme
    Link to comment
    Share on other sites

    • 0

    Hi @Sankotronic!

     

    I've just read of your post at the beginning of these thread about one of your day.

    I'm just wondering a critical thing.

    When you've arrived home and you tap "I"m Home button" on your mobile device you mentioned some scenes were just running to prepare your house for arriving.

    What about "Disarming" devices, alarm, etc.?

    Do you use PIN secured scenes for disarming, or the scenes responsible for security settings just run and disarm the alarm system, disarm the device, etc.?

     

    Thank you!

    Link to comment
    Share on other sites

    • 0

    Hi @Sankotronic

     

    I am experiencing some behaviour of the Main Scene I cannot explain. I try to turn on the garden lights every morning, except the weekends, at 6 and turn them off at sunrise. Whilst this runs very smooth every day during weekends the lights are turn on at sunrise.

    Could you please point me in the right director for debugging the setup below?

     

    Million thanks!

     

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • On 1/22/2020 at 11:41 AM, krizso said:

    Hi @Sankotronic!

     

    I've just read of your post at the beginning of these thread about one of your day.

    I'm just wondering a critical thing.

    When you've arrived home and you tap "I"m Home button" on your mobile device you mentioned some scenes were just running to prepare your house for arriving.

    What about "Disarming" devices, alarm, etc.?

    Do you use PIN secured scenes for disarming, or the scenes responsible for security settings just run and disarm the alarm system, disarm the device, etc.?

     

    Thank you!

     

    Hi @krizso ,

     

    Sorry for the late answer. I'm busy with developing UHAS and sometimes just forget to check. At the moment I don't use those scenes anymore since I'm working on new versions that are UHAS compatible. But to answer to your question:

     

    Scene that disarms alarm is asking for PIN code of course. This is security issue and disarming alarms must be protected.

     

     

    On 2/8/2020 at 9:22 AM, Figlio said:

    I am experiencing some behaviour of the Main Scene I cannot explain. I try to turn on the garden lights every morning, except the weekends, at 6 and turn them off at sunrise. Whilst this runs very smooth every day during weekends the lights are turn on at sunrise.

    Could you please point me in the right director for debugging the setup below?

     

    Hi @Figlio ,

     

    I have inserted your scheduled scene settings into my copy of Main scene FTBE v1.3.4 and get this debug info:

    Please login or register to see this spoiler.

     

    Debug info looks OK and as it should be since you can see that sunrise and sunset times are updated correctly, so your settings are correct. You can also noticed that Battery check scene does not have line showing run time because it doesn't run on Monday and weekday flag is 0.

     

    Just in case i have still checked code and all looks OK. So I don't have any explanation why some lights are turning on at sunrise. Since you have two sets of lights Tuinlamp and Buitenlamp and you didn't point out which of them are turning at sunrise this is all I can write now. If you can be more specific I might do more checks.

     

    Link to comment
    Share on other sites

    • 0

    Hi @Sankotronic!

     

    5 minutes ago, Sankotronic said:

     

    Scene that disarms alarm is asking for PIN code of course. This is security issue and disarming alarms must be protected.

     

     

    So, you run a separate scene for disarming the house, don't you?

     

    Because, when I run a scene from LUA code it doesn't ask for PIN even the scene is PIN protected. I read that in some forum thread if you run a scene from LUA code these security things won't work, because the LUA codes run with administrator (superuser) rights.

    So I couldn't build an "Arrive home" scene that switch the lights on, open the blinds, and disarm the security devices with one button, because the system doesn't ask for PIN code and it would be a security problem.

    Or is any solution to run a scene from LUA and if this scene is PIN protected the system would ask for PIN to secure this scene?

     

    Thank you very much!

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hi @krizso ,

     

    Alarm disarming scene in my case is not called from any other code, but we have to run it manually from our mobile phone. So once it is run and PIN entered then this scene first disarms alarm and then runs other code to do lighting and what ever is necessary for our arrival.

     

    At this moment I'm not using those scenes, but when I come to that problem will see what are the options and how to code that part. Then I will be able to tell you more.

     

    What I want to achieve is complete automation which means I want my house to be really SMART. To achieve that I first need to solve problem with presence and tracking location of my family members which will of course work in 100% time. Unfortunately for now I didn't find such system since Fibaro app tracking is draining phone battery and is not always correct. I have also Netatmo Welcome cameras and their app also offers GPS tracking but again it is not reliable and works only 50% of time which is really sad. But then again Netatmo is OK only when leaving house, but arriving home is a bit problematic since camera to see me and set me to be present I have to enter the house, which is in case that I'm first to arrive home then in dark and alarm is still armed.

     

    I just know that presence would be best to be done with geofencing or anything that can track you in the way to detect leaving and arriving home so it can act on time without needing us to use mobile to do it manually.

     

    Oh, and I hope will find solution that does not require users to setup some extra devices like Raspberry PI or similar which can be quite difficult for most of not geeky  users.

     

     

    Link to comment
    Share on other sites

    • 0
    3 hours ago, Sankotronic said:

    Hi @krizso ,

     

    Alarm disarming scene in my case is not called from any other code, but we have to run it manually from our mobile phone. So once it is run and PIN entered then this scene first disarms alarm and then runs other code to do lighting and what ever is necessary for our arrival.

     

     

    Good idea!

     

    I'll think over of it.

     

    The presence issue is a very strange queastion as I could read in the Internet. In this world where everything knows the position of everything strange that Fibaro couldn't cop with this.

    I was using IFTTT and other presence device (that could be check by other device i.e RaspPi) but nothing works reliably.

     

    I'm wondering if somebody could come up a good solution for this.

     

    Thank you!

    Link to comment
    Share on other sites

    • 0
    On 1/5/2020 at 8:04 AM, wrongme said:

    (Solved)

    Hi
    I want to change the hours of change of the variables: morning - 6.00, day - 9.00, evening 17.00 and night - 22.30 ... can I change? Thanks

     

     

    Hi.  Could you please write down how you solved the problem with setting fixed times?  Well thank you

    Link to comment
    Share on other sites

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

     

    Hi.  Could you please write down how you solved the problem with setting fixed times?  Well thank you

     

    Hi @Longy ,

     

    To set fixed times open Main scene FTBE and go to code window. Scroll code down to function mainloop() and find this code lines:

    Please login or register to see this code.

    To set any or all of the times to fixed just replace code with the following one:

    Please login or register to see this code.

    sunrisetime is morning time, sunsettime is evening time and the rest is clear. Of course you can replace code only for times that you want to be fixed.

    UHAS version of this package has ability to setup any of the times as fixed with Sunrise & Sunset VD. Since I'm totally busy with developing UHAS I do not have plans to add this feature to standalone version for now.

     

    Link to comment
    Share on other sites

    • 0
    24 minutes ago, Sankotronic said:

     

    Hi @Longy ,

     

    To set fixed times open Main scene FTBE and go to code window. Scroll code down to function mainloop() and find this code lines:

    Please login or register to see this code.

    To set any or all of the times to fixed just replace code with the following one:

    Please login or register to see this code.

    sunrisetime is morning time, sunsettime is evening time and the rest is clear. Of course you can replace code only for times that you want to be fixed.

    UHAS version of this package has ability to setup any of the times as fixed with Sunrise & Sunset VD. Since I'm totally busy with developing UHAS I do not have plans to add this feature to standalone version for now.

     

     

    Thank you very much

    Link to comment
    Share on other sites

    • 0
    On 2/10/2020 at 9:26 AM, Sankotronic said:

     

    Hi @krizso ,

     

    Sorry for the late answer. I'm busy with developing UHAS and sometimes just forget to check. At the moment I don't use those scenes anymore since I'm working on new versions that are UHAS compatible. But to answer to your question:

     

    Scene that disarms alarm is asking for PIN code of course. This is security issue and disarming alarms must be protected.

     

     

     

    Hi @Figlio ,

     

    I have inserted your scheduled scene settings into my copy of Main scene FTBE v1.3.4 and get this debug info:

    Please login or register to see this spoiler.

     

    Hi @Sankotronic,

    thanks for looking into it. I ran some test over the past two weekends to see I could find the issue but I dont seem to be able to find it. Last thing I tried was to clean the scene that is responsible for turning the lights on. Now it is just a call TurnOn. Unfortunately it is still not working. Please find a screenshot of the events panel attached. It is the Tuinlamp that I want to turn off at sunrise (except for the weekends y shoud not turn on at all).

    any other ideas?

     

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0

    Hi guys,

     

    I'm trying to setup FTBE package on "brand new" HC2. Do I need to manually setup global variables like Darkness, TimeOfDay etc   before ?

    After importing all VDs and creating a scene I'm still missing them. 

    Edited by mikesz75
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • On 2/22/2020 at 11:13 AM, Figlio said:

    Hi @Sankotronic,

    thanks for looking into it. I ran some test over the past two weekends to see I could find the issue but I dont seem to be able to find it. Last thing I tried was to clean the scene that is responsible for turning the lights on. Now it is just a call TurnOn. Unfortunately it is still not working. Please find a screenshot of the events panel attached. It is the Tuinlamp that I want to turn off at sunrise (except for the weekends y shoud not turn on at all).

    any other ideas?

     

    Hi @Figlio ,

     

    Since I'm very busy coding and my mind is set to finish UHAS at this moment I don't have any more ideas what is wrong, but I'm sure you will eventually find solution.

     

    On 4/4/2020 at 9:50 PM, mikesz75 said:

    Hi guys,

     

    I'm trying to setup FTBE package on "brand new" HC2. Do I need to manually setup global variables like Darkness, TimeOfDay etc   before ?

    After importing all VDs and creating a scene I'm still missing them. 

     

    Hi @mikesz75 ,

     

    In user manual for Main scene FTBE chapter 2.2 is explained what global variables user need to add for system to work.

     

     

    Link to comment
    Share on other sites

    • 0

    Hi developer, thanks for your wonderfull scene. I use it since some time but each time the internet gets disconnected some variabels like "Darkness" and "Timeofday" are reset. 

     

    This forces some other scripts to run, i.e. middle in the night, internet is gone because of updates on server-side, variables get reset and some blinds gets opened. After internet is connected again, it changes the variables to correct values and i.e. blinds get closed again.

     

    Is this a known bug?

     

    EDIT: It is not a bug, it is a feature. Changing following lines has solved the problem:

    -- PART OF CODE FOR USERS TO EDIT AND SETUP
    -- set here default time for sunrise and sunset to use in case of flase reading
    -- from HC settings. Time must be in format "00:00"
    local def_sunrise= "07:00" 
    local def_sunset = "19:00"

    Edited by yuzo
    Solved
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • On 4/29/2020 at 8:34 PM, yuzo said:

    Hi developer, thanks for your wonderfull scene. I use it since some time but each time the internet gets disconnected some variabels like "Darkness" and "Timeofday" are reset. 

     

    This forces some other scripts to run, i.e. middle in the night, internet is gone because of updates on server-side, variables get reset and some blinds gets opened. After internet is connected again, it changes the variables to correct values and i.e. blinds get closed again.

     

    Hi @yuzo ,

     

    Even you find some kind of solution, still it is strange that Darkness and TimeOfDay are reset when internet connection is lost.  That is definitely not caused by FTBE scene directly, but possibly due to reboot or reset of the Home Center 2.

     

    Link to comment
    Share on other sites

    • 0
    On 5/1/2020 at 3:58 PM, Sankotronic said:

     

    Hi @yuzo ,

     

    Even you find some kind of solution, still it is strange that Darkness and TimeOfDay are reset when internet connection is lost.  That is definitely not caused by FTBE scene directly, but possibly due to reboot or reset of the Home Center 2.

     

     

    I see the problem in reading sunset and sunrise times. If HC2 has no internet, there is no value returned and than your defaults are used.

    Link to comment
    Share on other sites

    • 0
    On 3/8/2018 at 4:47 PM, Sankotronic said:

    local runSceneSchedName = {"Weekly battery check", "Open blinds after sunrise"} local runSceneSchedID = {jT.scene.Batt_check, jT.scene.Blinds_open};

    Hi Sankotronic and others,

     

    Beautiful work, thanks!

    What I don't understand in the quoted code, is when the scene ID is referenced to, why there is a need in the previous line to use the name of the scene. What does that name add?

    And it seems that the name "Weekly battery check" is different than the true name "Batt_check" of the scene. Is the name "Weekly battery check" actually a name that can be chosen freely? My HomeTable doesn't have the scene ID's in it, unless it is defined at the beginning of the code of HomeTable. I couldn't find an updated version of HomeTable that includes all ID's (but maybe there isn't). Referring to a scene with jT.scene. seems the preferable way, but in my case only works when I defined it initially.

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