Jump to content
Guides for the Forum Read more... ×
Poradniki na Forum Read more... ×

Question

Main scene FTBE v 1.3.0

 

Hello everyone!

 

NEW version is OUT!

 

More about scene and download you can find here:

 

WHAT'S NEW:

 

  • 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 8
  • Thanks 3

Share this post


Link to post
Share on other sites

Recommended Posts

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

    As usual, your work is great Sankotronic.

    Scene and VD installed without issues and working nice, with one exception… I can’t realize what’s wrong, User Location is not calculated correctly, because in fact is not set for my SuperUser.

     

    Hi @MihaiC ,

     

    To have correct distance calculation you have to Configuration -> Access control and click on pencil on the right side of the username to edit. In edit user window you need to change how frequent GPS position of the user will be collected from No to for example 5min. Don't forget to click on Save button on the right side of the page. If you don't want calculate distance for power user then just remove its ID from the userID settings. if you don't want to use this feature at all then just leave curled brackets empty: userID = {}

     

     

    1 hour ago, Remi said:

    Thanks for the nice VD's.

     

    I have imported the Sunrise & sunset VD but I am wondering how to get the icon's?

     

    In your manual I see a screenshot like this:

     

    Hi @Remi ,

     

    Follow this instructions on Fibaro Knowledge Base: 

    Please login or register to see this link.

     

    As soon as you select VD main icon my code will take care to set all buttons icon automatically. No more blue boxes with my VD's :-) 

     

    Share this post


    Link to post
    Share on other sites
    • 0

    Hii @Sankotronic ,

     

    Sorry if I was unclear,

    I do know how to change icons.

    But I don't know where to find the icons of your VD.

     

    When I open the zip file with your Scene and VD's it look like this:

     

    Please login or register to see this image.

    /monthly_2018_11/Pic1.JPG.34eb475aba326899e0eebf807fd66829.JPG" alt="Pic1.JPG.34eb475aba326899e0eebf807fd66829.JPG" />

     

    And for each VD I see icons like this:

     

    Pic2.JPG.8ee202df15648b2186651b0993d450c7.JPG

     

    But for Sunrise & Sunset it seems the icons are missing:

     

    Pic3.JPG.22250b303b77eb1547a333d534e4c281.JPG

     

    So I am wondering where to find the icon's for Sunrise & Sunset?

     

     

    Share this post


    Link to post
    Share on other sites
    • 0
  • Inquirer
  • 1 hour ago, Remi said:

    Sorry if I was unclear,

    I do know how to change icons.

    But I don't know where to find the icons of your VD.

     

    Hi @Remi ,

     

    You can find icons for Sunrise & Sunset VD in my icon pack here: 

     

    Share this post


    Link to post
    Share on other sites
    • 0

    Hi @Sankotronic ,

     

    Thank you!

     

    I thought the icon would change with Sunset Sunrise.

    So if I understand it correctly its just one icon for the Sunrise/Sunset VD?

     

    Share this post


    Link to post
    Share on other sites
    • 0

    Hi @Sankotronic,

     

    Setting the frequency of getting GPS position of the Superuser was done before. It was 10 min and now I changed it to 5 min and I saved.

    In my iOS location settings, Fibaro app is set to use location in background, all the time.

    No changes, MC2 is still seeing me at 1.000 Km...

    In fact, this was my question, if this is a bug of Fibaro and how can be solved.

    Thanks.

     

     

    Share this post


    Link to post
    Share on other sites
    • 0
  • Inquirer
  • 6 minutes ago, Remi said:

    Hi @Sankotronic ,

     

    Thank you!

     

    I thought the icon would change with Sunset Sunrise.

    So if I understand it correctly its just one icon for the Sunrise/Sunset VD?

     

     

    Hi @Remi ,

     

    I'm developing several things at the same time so just didn't have enough time for this version to add that nice feature as I did for Home Timers VD. When I find time will do that and hopefully add also possibility to select fixed times for sunrise and sunset times.

     

    8 minutes ago, MihaiC said:

    Hi @Sankotronic,

     

    Setting the frequency of getting GPS position of the Superuser was done before. It was 10 min and now I changed it to 5 min and I saved.

    In my iOS location settings, Fibaro app is set to use location in background, all the time.

    No changes, MC2 is still seeing me at 1.000 Km...

    In fact, this was my question, if this is a bug of Fibaro and how can be solved.

    Thanks.

     

     

    Hi @MihaiC ,

     

    To be honest last time when I tested this feature of FTBE was on firmware 4.120 and was working fine, but I had to switch off GPS on Fibaro app because it was draining battery too fast. I can test it tomorrow and will know more where the problem is and will let you know.

     

    Share this post


    Link to post
    Share on other sites
    • 0
    Just now, Sankotronic said:

    Hi @MihaiC ,

     

    To be honest last time when I tested this feature of FTBE was on firmware 4.120 and was working fine, but I had to switch off GPS on Fibaro app because it was draining battery too fast. I can test it tomorrow and will know more where the problem is and will let you know.

     

     

    Thanks a lot. I'm on latest 4.520 and the upgrade went without any issues.

    Share this post


    Link to post
    Share on other sites
    • 0
  • Inquirer
  • Just now, MihaiC said:

     

    Thanks a lot. I'm on latest 4.520 and the upgrade went without any issues.

     

    My HC2's are also both on 4.520. Tomorrow I have to go to town so will be good opportunity to test this feature. Will take charger with me just in case :-) 

     

    Share this post


    Link to post
    Share on other sites
    • 0
  • Inquirer
  • Hi @MihaiC ,

     

    I started GPS location services, but after 24h my CH2 refused to work. I start getting e-mails about unauthorized logins and could not login anymore. After rebooting HC2 I end up with endless "Starting services". Now I'm trying to make it work again. :-( 

    Share this post


    Link to post
    Share on other sites
    • 0

    Hi @Sankotronic ,

    Hi, I updated your virtual devices and FTBE scene to version 1.3.0. Everything is great, but Home status v1.1 updates the main icon and does not update the device's button icons. I can not infer which part of the code does not set the global variable to the current main icon number. I attach screenshots and I am asking for a suggestion.

    Regards Darek

     

    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.

    Share this post


    Link to post
    Share on other sites
    • 0
  • Inquirer
  • 6 hours ago, dareszek said:

    Hi @Sankotronic ,

    Hi, I updated your virtual devices and FTBE scene to version 1.3.0. Everything is great, but Home status v1.1 updates the main icon and does not update the device's button icons. I can not infer which part of the code does not set the global variable to the current main icon number. I attach screenshots and I am asking for a suggestion.

     

    Hi @dareszek ,

     

    Main VD icon should be setup by the button "Zmien ikone" on the main tab of the VD. After main icon is set VD will set that same icon for all buttons. Only additional icons are set in the code f the main loop.

     

    Share this post


    Link to post
    Share on other sites
    • 0
    On 12/2/2018 at 5:12 PM, Sankotronic said:

    Hi @MihaiC ,

     

    I started GPS location services, but after 24h my CH2 refused to work. I start getting e-mails about unauthorized logins and could not login anymore. After rebooting HC2 I end up with endless "Starting services". Now I'm trying to make it work again. :-( 

    Hi @Sankotronic,

     

    I hope that you managed somehow to overpass your HC2 issues. In fact, what went wrong? System collapsed after pulling the GPS position from the mobile device?

    Sorry for all the troubles... ;(

    Share this post


    Link to post
    Share on other sites
    • 0

    @Sankotronic I was using FTBE 1.2.5 for a long time without VD sunrise and sunset.  Yesterday I have upgraded to 1.3.0 and added sunset sunrise 1.4.

     

    The reason I didn't use sunset and sunrise VD is that the time that define on the VD UI didn't work for me so I hardcoded the time for timeOfDay at the bottom of MTBE 1.2.5.

     

    In Sunset and Sunrise v1.4, Morning, Day and Night are set correctly, VSL1.4 is doing the right thing.  However, for Evening, I  believe in terms of Sunset and Sunrise VD it is the time of sunset.  I have set it to "You want at 17:30"

     

    I have created a scene to track the timeOfDay variable change, and found that at 17:30 it changes to Night, so all light suddently darken due to VSL settings.

     

    I have looked at the global variable panel, the value of SunsetTime  is 17:30, why VD change TimeOfDay to Night?

     

    If I use Timer 1.1 to change the period to Evening, it automatically changes back to Night.

     

    Can you please help me asap? because in MTBE 1.3.0 there seems to be no way to hard code the time I want for each TimeOfDay period.  Evening is the most important time as all family member are at home, please!!!

    Share this post


    Link to post
    Share on other sites
    • 0

    function doTimeOfDay()
      if(((TimeCurrent>=sunrisetime)and(TimeCurrent<daytime))or((useSleepState and hc:getGlobalValue(sleepState)==sleepStateMapping.Awake)and
        (TimeCurrent>=midnight)and(TimeCurrent<daytime)))then hc:setGlobal(timeOfDay,timeOfDayMapping.Morning)
      elseif((TimeCurrent>=daytime)and(TimeCurrent<sunsettime))then hc:setGlobal(timeOfDay,timeOfDayMapping.Day)
      elseif((TimeCurrent>=sunsettime)and(TimeCurrent<nighttime))then hc:setGlobal(timeOfDay,timeOfDayMapping.Evening)
      else hc:setGlobal(timeOfDay,timeOfDayMapping.Night)end hc:setGlobal(weekDay,weekDayMap[currentwday])
      if deBug and hc:getGlobalValue(timeOfDay)~=nil then
        logbug(xec,"Time of day set to: "..hc:getGlobalValue(timeOfDay).." - Day of week is "..weekDayMap[currentwday])
      else logbug(xec,"Missing global variable for Time Of Day - Day of week is "..weekDayMap[currentwday])end
    end
     

    Because my night time is set to 00:00, sunset is 17:30.  Perhaps 17:30 is treated as bigger than 00:00 so every if condition does not match and thus it goes to last statment hc:setGlobal(timeOfDay,timeOfDayMapping.Night) ? If so I will change night time to 23:59 and test again tomorrow.

    Edited by Sirhideo

    Share this post


    Link to post
    Share on other sites
    • 0

    To answer my own question, yes, 17:30 is bigger than 00:00 so noneof the conditions above matches so else statement matched.  I do not know how to overcome this except set Night to 23:59 (biggest number).  Maybe 24:00? Anyway, thanks.

    Edited by Sirhideo

    Share this post


    Link to post
    Share on other sites
    • 0
  • Inquirer
  • On 12/4/2018 at 7:16 PM, MihaiC said:

    Hi @Sankotronic,

     

    I hope that you managed somehow to overpass your HC2 issues. In fact, what went wrong? System collapsed after pulling the GPS position from the mobile device?

    Sorry for all the troubles... ;(

     

    Hi @MihaiC ,

     

    to be honest I don't know what really happened. I was trying to check GPS tracking on my test HC2 and noticed that day after I turned on GPS tracking it get stuck and could not login on local network any more. Reboot finished with never ending "Starting services" so resetting complete system was the only way to get it back on line. I think that firmware still have some problems with new embedded linux and communication with z-wave module can crash causing those services to never start up again.

     

    You don't have to be sorry because it is not you who caused troubles anyway :-) I'm sorry that I still haven't tested GPS tracking, but I'm still busy coding and just didn't find time to check it again.

     

    3 hours ago, Sirhideo said:

    To answer my own question, yes, 17:30 is bigger than 00:00 so noneof the conditions above matches so else statement matched.  I do not know how to overcome this except set Night to 23:59 (biggest number).  Maybe 24:00? Anyway, thanks.

     

    Hi @Sirhideo ,

     

    Unfortunately for now only solution is to set night to start at 23:59 until I change code and test it. I do have plan to do major upgrade of the Main scene in the following months by modifying UHAS compatible Main scene FTBE and accompanying VD's to standalone version. UHAS version has possibility to set fixed times for morning, day, evening and night and Main scene can do much more control.

     

    Thanks for reporting this problem.

     

    Share this post


    Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

    ×