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
  • Hi @Sirhideo ,

     

    here is corrected code and with removed comments:

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    • 0

    Since update 4.180 I´m getting this error after reboot and scene stops working.

     

    Please login or register to see this image.

    /monthly_2018_05/fibaro.png.467cd6e98e4df190a6cb68f0f33390c2.png" alt="fibaro.png.467cd6e98e4df190a6cb68f0f33390c2.png" /> 

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 4 minutes ago, TurboWannaBe said:

    Since update 4.180 I´m getting this error after reboot and scene stops working.

     

    Please login or register to see this link.

     

     

    Hi @TurboWannaBe ,

     

    if I can believe to debug line then there is a problem with calculating sunrisetime or/and sunsettime. Can you please check if format is OK, times should look like "10:12". Since I'm working on UHAS and new versions of all of my scripts I can't reproduce this error any more, but just check that time formats are correct.

    Link to comment
    Share on other sites

    • 0

    I've been trying to get VSL going and I think I'm 99% there. I've seen that @Sankotronic mentioned some aspects went missing when admins moved the topic and that he is busy with the UHAS development. At this stage my main questions relate to MainScene. Hopefully somebody can point me in the right direction with the bits I'm missing.

     

    One of the key aspects that is not clear to me is how some of the "modules interact", specifically MainScene and ACWUT. Below some questions:

    1. Should ACWUT be started in  "Automatic"?

    2. I think the answer to the above is yes, but why do I then need to put ACWUT in MainScene?

    3. Which devices do I then start from ACWUT and which from MainScene?

    4. I think I should set "useDevices=false" in ACWUT and use it just to change "SleepMode" between Sleep and Awake (i.e. SleepMode=true)? 

     

    Lastly I have VSL configured for one of my rooms, but it does not switch the "lights on". If I run it manually, I just get the following:

     

    Please login or register to see this image.

    /monthly_2018_05/image.png.9e4fc7f762e09057f39212d8c1acfa4d.png" alt="image.png.9e4fc7f762e09057f39212d8c1acfa4d.png" /> 

     

    5. I think I might be missing a "Good morning" and "Good night" scene that should be called from MainScene? Can somebody post an example of their "Good Morning" and "Good Night" scene (which I think should set the Sleepstate to "Sleep")?

     

    Thank you @Sankotronic, @AutoFrank, @jompa68 and all the other forum members for your excellent work

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hello @nicopret ,

     

    Here are answers to your questions regrding Main scene FTBE:

    1. I don't use @jompa68 ACWUT scene which is much sophisticated than mine. My scene just checks current time and starts good morning scene if it is time for wake up
    2. If @jompa68 ACWUT scene has autostart and it is running in loop then you are right, there is no need to add it to Main scene repeating scene schedule.
    3. I use only Main scene to schedule control of scenes and devices, but if there is some devices or scenes that you want to run at alarm time then you can use ACWUT scene
    4. That is entirely up to you and your needs.
    5. I'm running good night scene manually using remote controls since we almost never go to sleep at same times. Good morning scene is run either by Alarm Clock or if Alarm clock is not set then manually with remotes

     

    VSL scene if run manually then will turn off all lights and stop running. For details how to set it up the best is in this moment if you can send me your VSL scene setting part to private message and describe how you want it to control your lights and I will try to help you the best I can.

     

    Link to comment
    Share on other sites

    • 0

    Thank you so much @Sankotronic that helps a lot. I will highly appreciate some advice on VSL. What will work best for you for private message?

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 7 minutes ago, nicopret said:

    Thank you so much @Sankotronic that helps a lot. I will highly appreciate some advice on VSL. What will work best for you for private message?

     

    Just attach original code to private message as LUA or TXT document (please do not paste it to message). You can send private message by bringing mouse pointer above my avatar and then click on Message in lower left corner of the small window that opens.

    Link to comment
    Share on other sites

    • 0

    Hi @Sankotronic

     

    Thank you so much for your kind gesture and your phenomenal work. Attached as requested. I basically want to switch lights on/off with time of day settings, movement or light levels.

    Do I enable the VSL scene to run automatically? I think the answer is yes, since my understanding from your post is that if it is run manually from another scene it will switch the lights off.

     

    Thank you and regards,

     

    Nico

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0

    Hi @Sankotronic

     

    I finally managed to get VSL working. Yipee! Once again thank you for your brilliant work and help in pointing me in the right direction. One of the key aspects I did not realise was that VSL scene needs to be in auto run mode and that I had to force a to change (for example change Night to Morning) in one of the VD (Home Status or Timers) to trigger an event that causes VSL to run. This helped me to troubleshoot the last few bits I still needed to configure in VSL.

    Link to comment
    Share on other sites

    • 0

    Hi @Sankotronic

     

    Since firmware upgrade to 4.180 I'm facing a strange situation. Every time the variable "time of day" changes the lights, controlled by very smart light 1.4.2 and not are switched off.

    Have you never experienced the same problem?

    Thank you

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 23 hours ago, alexpelli said:

    Hi @Sankotronic

     

    Since firmware upgrade to 4.180 I'm facing a strange situation. Every time the variable "time of day" changes the lights, controlled by very smart light 1.4.2 and not are switched off.

    Have you never experienced the same problem?

    Thank you

     

     

    Hi @alexpelli ,

     

    I do need some more information, since I do not understand what problem do you have? Does above sentence means that lights are not switched off when TimeOfDay changes do Light? If that is the case, then can you check global variable TimeOfDay settings and also usage of the light sensor?

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • On 7/12/2018 at 6:50 PM, alexpelli said:

    thank you @Sankotronic for your answer.... the opposite... the lights are switched off when TimeOfDay changes... I cannot understand why.

     

    Hi @alexpelli ,

     

    I really like to help, but giving me so little information doesn't give me choice but to try to guess. Since I'm working on UHAS I don't have time to guess. Is it possible for you to be more specific or copy part of the scene with settings? That would really speed up process of finding problem and solving it.

     

    Link to comment
    Share on other sites

    • 0

    Hello Sankotronic,

     

     I have the problem that the scene hangs up at irregular intervals and the following error occurs:: 

    [DEBUG] 09:07:13: [1;31m2018-07-26 09:07:13.797490 [ fatal] Unknown exception: /opt/fibaro/scenes/115.lua:454: attempt to perform arithmetic on local 'diffMinute' (a nil value)

     

    The section in your script (ver. 1.2.5) is "-- function to calculate time by adding hours and minutes (positive or negative)"

    To "fix" the error, I have to start/save the corresponding VD and the scene. But what can I do to avoid this error?

     

    Also i have another problem with the scene and then the following error occurs:

     

    [DEBUG] 20:02:42: [1;31m2018-07-26 20:02:42.816635 [ fatal] Unknown exception: /opt/fibaro/scenes/115.lua:860: bad argument #1 to 'pairs' (table expected, got number)
     

    For this error it is the section "- New FUNCTION For MSFTBEVC by Sankotronic -" for the calculation of bank holidays

     

    Can you help me please with this things? Thank you

     

     

     

    Link to comment
    Share on other sites

    • 0

    Same here, 4.504 BETA 

     

    [DEBUG] 05:00:33: Darkness: 0 Sunset: 20:32 (set:20:29) Sunrise: 05:00 (set:05:00) TimeOfDay: Morning
    [DEBUG] 05:01:32: [1;31m2018-07-26 05:01:32.763409 [ error] API: Host not found (authoritative)
    [DEBUG] 05:01:32: [1;31m2018-07-26 05:01:32.764215 [ error] API: Host not found (authoritative)
    [DEBUG] 05:01:32: [1;31m2018-07-26 05:01:32.764949 [ error] API: Host not found (authoritative)
    [DEBUG] 05:01:32: [1;31m2018-07-26 05:01:32.765365 [ error] API: Host not found (authoritative)
    [DEBUG] 05:01:32: [1;31m2018-07-26 05:01:32.765671 [ error] API: Host not found (authoritative)
    [DEBUG] 05:01:32: [1;31m2018-07-26 05:01:32.765955 [ error] API: Host not found (authoritative)
    [DEBUG] 05:01:32: [1;31m2018-07-26 05:01:32.766268 [ error] API: Host not found (authoritative)
    [DEBUG] 05:01:32: [1;31m2018-07-26 05:01:32.766580 [ error] API: Host not found (authoritative)
    [DEBUG] 05:01:32: [1;31m2018-07-26 05:01:32.766852 [ error] API: Host not found (authoritative)
    [DEBUG] 05:01:32: [1;31m2018-07-26 05:01:32.767533 [ fatal] Unknown exception:

     

    LOG:

    [DEBUG] 04:58:32: Scheduled scene BatteryCheckrun time[1][1] is: 00:00h; current time is: 04:58h
    [DEBUG] 04:58:32: Scheduled scene HC2reboot weekday flag is: 0
    [DEBUG] 04:58:32: Scheduled global wasCleaned weekday flag is: 1
    [DEBUG] 04:58:32: Scheduled global wasCleaned run time[1][1] is: 00:00h; current time is: 04:58h
    [DEBUG] 04:58:32: Darkness: 1 Sunset: 20:32 (set:20:29) Sunrise: 05:00 (set:05:00) TimeOfDay: Night
    [DEBUG] 04:59:31: Day time: 10:30, Night time: 23:29, Time to raise blinds: 10:00
    [DEBUG] 04:59:32: Time of day set to: Night - Day of week is Thursday
    [DEBUG] 04:59:32: Season is Summer, Month is July
    [DEBUG] 04:59:32: Scheduled scene BatteryCheck weekday flag is: 1
    [DEBUG] 04:59:32: Scheduled scene BatteryCheckrun time[1][1] is: 00:00h; current time is: 04:59h
    [DEBUG] 04:59:32: Scheduled scene HC2reboot weekday flag is: 0
    [DEBUG] 04:59:32: Scheduled global wasCleaned weekday flag is: 1
    [DEBUG] 04:59:32: Scheduled global wasCleaned run time[1][1] is: 00:00h; current time is: 04:59h
    [DEBUG] 04:59:32: Darkness: 1 Sunset: 20:32 (set:20:29) Sunrise: 05:00 (set:05:00) TimeOfDay: Night
    [DEBUG] 05:00:32: Day time: 10:30, Night time: 23:29, Time to raise blinds: 10:00
    [DEBUG] 05:00:32: Time of day set to: Morning - Day of week is Thursday
    [DEBUG] 05:00:33: Season is Summer, Month is July
    [DEBUG] 05:00:33: Scheduled scene BatteryCheck weekday flag is: 1
    [DEBUG] 05:00:33: Scheduled scene BatteryCheckrun time[1][1] is: 00:00h; current time is: 05:00h
    [DEBUG] 05:00:33: Scheduled scene HC2reboot weekday flag is: 0
    [DEBUG] 05:00:33: Scheduled global wasCleaned weekday flag is: 1
    [DEBUG] 05:00:33: Scheduled global wasCleaned run time[1][1] is: 00:00h; current time is: 05:00h
    [DEBUG] 05:00:33: Darkness: 0 Sunset: 20:32 (set:20:29) Sunrise: 05:00 (set:05:00) TimeOfDay: Morning
    [DEBUG] 05:01:32: [1;31m2018-07-26 05:01:32.763409 [ error] API: Host not found (authoritative)
    [DEBUG] 05:01:32: [1;31m2018-07-26 05:01:32.764215 [ error] API: Host not found (authoritative)
    [DEBUG] 05:01:32: [1;31m2018-07-26 05:01:32.764949 [ error] API: Host not found (authoritative)
    [DEBUG] 05:01:32: [1;31m2018-07-26 05:01:32.765365 [ error] API: Host not found (authoritative)
    [DEBUG] 05:01:32: [1;31m2018-07-26 05:01:32.765671 [ error] API: Host not found (authoritative)
    [DEBUG] 05:01:32: [1;31m2018-07-26 05:01:32.765955 [ error] API: Host not found (authoritative)
    [DEBUG] 05:01:32: [1;31m2018-07-26 05:01:32.766268 [ error] API: Host not found (authoritative)
    [DEBUG] 05:01:32: [1;31m2018-07-26 05:01:32.766580 [ error] API: Host not found (authoritative)
    [DEBUG] 05:01:32: [1;31m2018-07-26 05:01:32.766852 [ error] API: Host not found (authoritative)
    [DEBUG] 05:01:32: [1;31m2018-07-26 05:01:32.767533 [ fatal] Unknown exception:
    Edited by drivex
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hi @Cannon_82 ,

     

    Both problems are related with destroying content of the global variables used by the scene. Make sure that you are not using Save button in variables panel or that you are using API call that do that same thing. If you need some external devices to change some global variable on HC2 then try to use scene that will do that when started by external device. Every time when Save button is used in variables panel HC destroys content of all global variables that contain values different than numerical if they are added in upper panel, or string if they are added in lower panel.

     

    Hi @drivex ,

     

    [error] API: Host not found is new to me. I use FTBE scene and I don't have such errors. To be able to help maybe you can send me a copy of scene on private message so I can check what causes that error.

    Please attach it as a LUA or TXT document. Thank you.

     

    Edited by Sankotronic
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hi @drivex ,

     

    Can you please next time attach TXT or LUA source document because it takes a lot of space when code is pasted into message and is difficult to copy it to HC.

    Anyway I have installed Sunrise & Sunset VD v1.3.1, also Home Timers VD 1.0.1 and pasted your copy of Main scene to my test HC2 that is now on FW 4.504 beta.

    Of course I had to manually add global variables: Darkness, DemoMode, TimeOfDay, WeekDay, Month, SeasonState and SleepState, after that I run your scene and this is debug window:

     

    Please login or register to see this image.

    /monthly_2018_08/2018-08-01_11-42-16.jpg.3eae597f0a73492878d00b39f674222c.jpg" width="511" alt="2018-08-01_11-42-16.jpg.3eae597f0a73492878d00b39f674222c.jpg" />

     

    As you can see I don't have any strange API errors with your Main scene code. Since I can't replicate problem which you have I can't really pin point out where the problem is.

     

    Maybe there are users or admins that know more about [ error] API: Host not found (authoritative) ??

     

     

    Link to comment
    Share on other sites

    • 0

    Hi @Sankotronic

     

    No problem at all, thought that it will be faster. Error is still coming in random situations. 

    Additionally I still receive a lot of emails about blocked connection to my hc2 , but it is not related to this topic at all.

    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

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