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
  • 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 :-) 

     

    Link to comment
    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?

     

     

    Link to comment
    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: 

     

    Link to comment
    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?

     

    Link to comment
    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.

     

     

    Link to comment
    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.

     

    Link to comment
    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.

    Link to comment
    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 :-) 

     

    Link to comment
    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. :-( 

    Link to comment
    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.

    Link to comment
    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.

     

    Link to comment
    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... ;(

    Link to comment
    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!!!

    Link to comment
    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
    Link to comment
    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
    Link to comment
    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.

     

    Link to comment
    Share on other sites

    • 0

    Hi @Sankotronic

     

    Could you please let me know how does the Sunrise time determine? After 1 month of Sunrise & set VD running I see the time of sunrise keep changing itself.  Actually the change does reflect my geographic location.  However, time also determines how the VSL run (TimeofDay Global), which causes a very, very very big problem here.

     

    My Parent wake up at 6:00am everyday.  Up to today the Sunrise time has changed to 7:05. If I set it -59 max, it would be 6:06.  From 6:00 - 6:06 am TimeOfDay is still Night, and means only a few Hue VDs on in my house (VSL).  They are old and not good to walk without enough light.

     

    The change of Sunrise time automatically also affect other time, and therefore... sometime Night becomes 00:00 again... which re-raise my previous problem...

     

    I understand you are very busy.  If you need too much time to change the code of Sunrise & set VD, could you please attach MTBE 1.2.5 so I can hardcode those time back to the scene?

     

    Thanks

    Edited by Sirhideo
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hi @Sirhideo ,

     

    Current version of Sunrise & Sunset VD does not have fixed times so sunrise and sunset are changing of course. I will in time publish new version that will have possibility to set fixed times for changing time of day. Until then you can either find part of code in Main scene that reads sunrise and sunset time and change it to fixed time. Another solution is to change brightness of lights for night in VSL scene. Since I'm not at home at the moment this is the best I can do.

     

    Link to comment
    Share on other sites

    • 0
    Guest dacianova

    Hi,

    I'm new here, and please be patient with me. I do not know programming but I'm trying to learn.
    I bought a HC2 this week and you can do a lot with him. I like a lot of VD section.
    I installed FTBE Main Scenes but I have a problem and I can not find it.
    I created the scene with the LUA language, I changed Global Variables in my language but I have an error and I do not know how to find it solved.I get the message from the attached picture.
    What am I doing wrong?

     

    Thank you

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hi @dacianova ,

     

    In User Manual section 4.1 - Global variable settings is explained what global variables need to be added to the system for Main scene to work. This variables are:

     

    Darkness

    WeekDay

    Month

    SeasonState

    TimeOfDay

    DemoMode

     

    Their possible values are by default:

     

    Darkness = 0 or 1,

    SleepState = Sleep or Awake,

    WeekDay = Sunday, Monday, Tuesaday....Saturday etc.

     

    I suggest that you add them with original names, and if you setup values in your language then you have to correct those values that are inside quotes in scene code mentioned in User Manual section 4.1. If you change names of months and weekdays you need to do that also in code for

     

    weekDayMapping

    weekDayMap

    monthMapping

    monthMap

     

    I wish I can explain better. From your screenshot it is clear that DemoMode is turned On="Yes" and that you are missing global variables Darkness and/or TimeOfDay.

     

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