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

Hello Sankotronic... first of all Thank you Very Much for the great support here in the forum.. specially for new users as me.

As regards the scene... I spent most of the night checking the situation..

- at 00:00 scene was running

- at 01:00 scene was running

- at 02:00 scene was running

- few hours sleeping

- at 07:00 scene was running but variables and VD was set at wrong parameters

- at 08:00 scene was running and variables and vd set at correct parameters

To be honest I don't think it's a scene problem but HC2. Unfortunately I had the bad idea to upgrade from 4.140 to 4.150 and since that moment I start to have many problems, in particular:

- 503 error messages (3-4 times per day... now reduced to 1 with 4.154)

- heating pannel errors and instability (wrong control of temperatures and rooms)

- danfoss valves instable communication

Las Sunday I decided to restore the HC2 and I'm back to you 4.056... and then system upgrade to 4.150. Then I made I mistake because instead of making a z-wave mesh reconfiguration I restored the z-wave.. and I missed all devices.. finally I was obliged to re--includes all devices (I spend a full day).

Now.. my idea is to restore again the HC2 and through fibaro support upgrade to 4.140 and re-include all devices. I hope this will solve all problems.

Thank you for your support

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Hi @alexpelli,

     

    That error that randomly causes Main scene to stop is definitely something with system but that is an old problem for dozen firmwares back. Can you make screenshot of Sunrise & Sunset VD to see your settings please? That wrong time at the morning is caused either by settings of times or there is still some hidden bug that causing it. With detailed description of your settings I can find what causing wrong parameters.

     

    Problems that you have can be caused by single device in z-wave network. Tat is difficult to trace since there is no tools for that but I'm convinced that Fibaro support can help you with that. I have main scene running on HC2 with firmware 4.152 and have no problems, but on that box I have just few devices included for testing.

     

    My other HC2 that is controlling our house had problems in the past two years with lags in the device responses, dead devices, deleted devices by the system, but I never did complete recovery. In all this cases restoring last backup solved problem or I lost some time monitoring devices and excluding problematic ones. But Fibaro support is very helpful just sometimes you need to be patient because they still have limited resources and user number is growing all around the world.

    Link to comment
    Share on other sites

    • 0

    Hi Sankotronic... I spent the weekend to restore the HC2.. I didn't removed the devised... simply restored. it seems the scenes are working good and probably I solved the 503 error message. I have updated to 4.154 and it seems the HC2 is more stable now.

    Thank you for your support

    Link to comment
    Share on other sites

    • 0

    Hi all,

     

    When I copy/paste the content of the provided download file (lua) in a scene, and run the scene I get bellow error message;

    [DEBUG] 16:27:20

    [DEBUG] 16:27:20: line 454: attempt to perform arithmetic on local 'diffMinute' (a nil value)

     

    When I search for al local variable called "diffMinute" I cannot find it.

    Anybody who could help me with this?

     

    Sorry guys, I posted this question too early. The answer was to be found in this post thread

    Found it searching on error "line 454".

     

    Issue solved by re-saving my VD for sunset.

    Problem solved!

     

    Edited by julesmartens
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hi, @julesmartens

     

    Just don't use Save button in global variable panel any more. To correct error open Sunrise & Sunset VD for editing and press save button to rebuild global variable.

    • Like 1
    Link to comment
    Share on other sites

    • 0

    Hi Zoran,

     

    I've got quite some Zwave items installed in our house and intent to control my lights, shutters, sprinklers(in future), and burglar alarm.

    When I compare my hobby programming with yours, you do a much much better job. Compliments!

     

    So I copied quite some of your code of which the majority can be implemented with ease learning a lot 'reading' your code. 

    Currently I'm working with the main scene for time based control. I have almost setup all, except for the HomeTable global variable you mention.


    You indicate it can safe me lots of time but I have no clue what its purpose exactly is, so I also dont know which device ID's I should list in there.

    Could you explain a little more, what the function is? and how to use it? (Do I have to type in my device IDs  in there or is it looked up automatically? 

     

    Note that I have created the HomeTable as predifined variable with "value1" as only option set.

    I tried to search for "json.decode(fibaro:getGlobalValue("HomeTable"))" in the code but could not find it, so did no touch it.

    Still everything seems to work. So I'm al little puzzeled here.

     

    Thanks in advance for your help!

     

    Regards,

    Jules

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 2 hours ago, julesmartens said:

    Hi Zoran,

     

    I've got quite some Zwave items installed in our house and intent to control my lights, shutters, sprinklers(in future), and burglar alarm.

    When I compare my hobby programming with yours, you do a much much better job. Compliments!

     

    So I copied quite some of your code of which the majority can be implemented with ease learning a lot 'reading' your code. 

    Currently I'm working with the main scene for time based control. I have almost setup all, except for the HomeTable global variable you mention.


    You indicate it can safe me lots of time but I have no clue what its purpose exactly is, so I also dont know which device ID's I should list in there.

    Could you explain a little more, what the function is? and how to use it? (Do I have to type in my device IDs  in there or is it looked up automatically? 

     

    Note that I have created the HomeTable as predifined variable with "value1" as only option set.

    I tried to search for "json.decode(fibaro:getGlobalValue("HomeTable"))" in the code but could not find it, so did no touch it.

    Still everything seems to work. So I'm al little puzzeled here.

     

    Thanks in advance for your help!

     

    Regards,

    Jules

     

    Hi Jules,

     

    more about HomeTable how to create it and use it you can find here:

     

    Link to comment
    Share on other sites

    • 0

    OK i install Main Scene & Timers

     

    but with Home Status smth wrong.......that should be? After press Change in SleepState / Present State nothing happend

     

    ?

    Please login or register to see this attachment.

     

     

    After add some scene that also should be? Dont think so.......

     

    Please login or register to see this attachment.

     

     

    :/

     

    Edited by fingusio
    Link to comment
    Share on other sites

    • 0

    Buenos días @Sankotronic, me gustaría crear la siguiente escena con LUA, pero no sé hacer hacerlo:

     

    1- Tengo un sensor de movimiento y un relé para encender las luces, pongo el movimiento para detectar los autos en el medio del garaje, la llave está alejada del movimiento, cuando el movimiento detecta movimiento en la noche enciende la luz 3 minutos, el problema surge cuando quiero encender la luz de la llave, es decir, enciendo la luz de la llave, voy al depósito y sigo el movimiento, y después de 3 minutos se apaga y permanezco oscuro en el garaje hasta que vuelva a pasar el movimiento. Mi pregunta es: ¿puedo generar una escena que cuando enciendo la luz de la tecla desactive la escena en movimiento?

     

    2- Tengo una puerta Windows que activa una luz en el patio por 5 minutos, el problema es cuando quiero estar más de 5 minutos en el patio tengo que volver a abrir la puerta, y si quiero dejar la puerta abierta y hago clic en la aplicación que apago a los 5 minutos también.

    Edited by Javier Carelli
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hello @Javier Carelli,

     

    Unfortunately my post for Very Smart Lights scene is deleted so I can give you only link to Download section where you can download that scene but instructions are not complete due to failed transfer:

     

    • Thanks 1
    Link to comment
    Share on other sites

    • 0

    @Sankotronic Hi!

     I ve got a question, trying to launch 2 scheduled scenes...

    Please login or register to see this code.

     

    and there is a error... what im doing wrong ? :(

     

    Please login or register to see this attachment.



    error is shown when 

    Please login or register to see this code.

     

    Edited by drivex
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hi @drivex,

     

    You have used curled brackets where is not necessary that is why you get that error. Here is example how to setup scheduled scenes:

    Please login or register to see this code.

    As you can see from above example only runSceneSchedHour and runSceneSchedWeek use additional curled brackets because one scene can have more than one scheduled hour and week has seven days so they are put inside curled brackets.

     

    Hope this helps.

    Enjoy coding! :-)

     

     

     

    • Like 1
    Link to comment
    Share on other sites

    • 0

    First off, thank you for your work. This program is very professionally written.

    However, I would change the logic a bit.

    The bedroom is the main room responsible for changing the value of some global variable that represents the time of day. This global variable can have the values: Day, Night, Morning, and Evening. Depending on this variable’s value, we can control the way the lights work in the house.

    Let’s assume each bedroom has an overhead light with 2 modes of illumination (strong and weak), a door, a bed with RGBW light strips under it, curtains, a lamp near the bed, and a false ceiling with built-in lights. Lets also assume that we have a door sensor, a motion detector, some switches (one for each light), and automatic curtains.

    During the day (when the global variable is set to “Day”), we will not need lights, so the lighting should begin when the global variable is set to “Evening” – this occurs when another variable determines that it is sunset.

    So, how does the lighting work in the bedroom during “Evening”?

    If motion is detected AND the door is open -> turn on all overhead lights (strong illumination).  If motion is detected, and the door is closed -> turn off part of the overhead lights (weak illumination), or instead turn off the overhead lights, and turn on the built-in lights in the fake ceiling.

    Also at sunset time we going to close curtains.

     

    Now, how would we change the global variable from “Evening” to “Night”?

    Because you’re not likely to go to bed at the exact same time every night, switching to “Night” mode will have to be done manually. We can do this by turning the lamp near the bed off. However, in “Night” mode, not all lights need to be turned off. Why? Well, what if you need to go to the bathroom, or you wanted to get a drink from the kitchen, or maybe you heard your child crying? But, turning on the lights may be disruptive to others. Therefore, what I would do is install two different motion sensors: an upper motion detector under the ceiling, and a lower motion detector under the bed. When in night mode, when motion is detected from under the bed (you getting up), an RGBW stripe under the bed can be turned on, illuminating where you need to go, and not disturbing anyone else. (Something similar can be done throughout all of the rooms that you would need to pass through). For convivence, lights in the bathrooms and hallways should work independently of the global variable.

    Next, lets discuss changing the global variable from “Night” to “Morning” and “Day”.

    Let’s say that you wake up every day, except Saturdays and Sundays, at the same time to go to work. Therefore, “Morning” would begin at the same time each day -- let’s say 

    Please login or register to see this link.

    . However, depending on the season, 

    Please login or register to see this link.

     may still mean that it is dark outside. In a virtual device, you have made it possible to prescribe a constant time adjustment for opening curtains, but because this time is constanly changing, I don’t think this is correct.

    So, if 

    Please login or register to see this link.

     it is dark, we do not need to open the curtains. Instead, we need to turn on the lights. I would write something like this: if Sunrise time > 

    Please login or register to see this link.

    , change global variable to “Morning” 

    Please login or register to see this link.

    . The lights should work just like the would in the evening, with the exception that the bedside lamp should not change the global variable back to “Night” mode. If however, Sunrise time <= 

    Please login or register to see this link.

    , open the curtains 

    Please login or register to see this link.

    , and bypass the “Morning” mode and move straight into “Day”. As I briefly mentioned earlier, when the global variable is set to “Day”, we assume that no lights need to be turned on. 

    This system would also work with a plant watering system. Instead of watering the plants at lunch time, where the sun is shining the brightest, the plants can be watered in the evening. Which is even better because the water droplets on the plants will not act as a magnifying lens for the sun and burn the plants.

    This is how I would change the logic, but unfortunately, I am not a programmer, and you can write a program much better than I could. 

    Edited by IKCN
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hello @IKCN,

     

    Thank you very much for your detailed description. I'm currently working on UHAS™ (Universal Home Automation System) where I will incorporate flexibility and yet user setup simplicity as much as it is possible. You can follow latest news on UHAS™ here:

     

     

    I didn't post news there for some time because coding is taking all my available time, but I will soon add some news on latest development.

     

     

    Link to comment
    Share on other sites

    • 0

    Thank you @Sankotronic!

    I saw your code. You are professional. You can make a great product.

    When you’ll programming outside lighting... There are two ways to install: use Light Sensor (for example Aeotec multisensor) and you can use Sunset / Sunrise. If you use the global variable Sunset / Sunrise, then you can use constant delay time an about 30 minutes after/before. 

     If you use Light Sensor, then there are "pitfalls". At night, during a thunderstorm, lightning is triggered the senusor and the light begins to blink. In my opinion you need to program a “non reaction delay” of 15-20 seconds.

    I finishing the reconstruction of the cabinet for iRobot 980. This is also "appliances" isn’t? :) When the robot start working the door must open. When the work is finished the door closes. 

    I tried to make the door open/close movement based on the motion sensor, but it does not work well (everything happens too quickly and the door does not have time to open). Probably I have to use Fibaro wall plug (power measurement) and Fibaro door / window sensor(door status).

    If people building the alarm system on the HC2, then you need to consider that the Fibaro motion sensors are triggered by the movement of the robot. In this regard you can not use the standard scheduling of the robot if alarm system armed, since the alarm will fire. 

    The robot on the base (the battery is charged) consumes an about 3.7 watts. When the robot runs and not on the base  consumption 0.5-0.6 watts.

    Please login or register to see this attachment.

    Edited by IKCN
    Link to comment
    Share on other sites

    • 0

    hi @Sankotronic, recently I have setup schedule VD but missing something on setup.  I have read through the code and couldn't find any issue, maybe syntax error.  Would you please correct me?  those HomeTable names are correct.

     

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    • 0

    @Sirhideo, you are missing an input for second VD in runVDSchedPushMessage

     

    Please login or register to see this code.

     

    Edited by jompa68
    Wrong syntax
    Link to comment
    Share on other sites

    • 0
    21 minutes ago, Sirhideo said:

    @jompa68 Thank you! Unfortunately after adding more empty push message still has something missing...

    Give me your setup in PM and i can check it for you.

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