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


  • 0

Lights automation [LUA][3.562+]


Question

Posted

Polska wersja:

Please login or register to see this link.

My idea for automation lights in the house. Example of usage...

The enter-room with dimmer. Every move event turn on the lights for 3 minutes and every open door event turn on the lights for 5 minutes. In the last counting minute the lights will dimm down to zero - softly.

Every move or opening the door event will restart counter to 3 or 5 minutes. Manualy turning on the lights will set counter to half hour and then any other event will not be able to set counter for lower time - manual control is a priority.

Summary:

- Automatic switching off lights after counting time.

- Extension of light time based on events (eg move, doors, etc.).

- Without interfering with the manual control.

- Each light has its own timer.

- Dimming light for a defined time.

- Easy access to functions from the scene.

and...

- Everything is based on one single virtual device,

- For presentation timer and counting using slider - one for each device.

- Switching the light in the scenes you can make in the traditional way, or...

- Or simply by setting the slider value (setting the timer) - nothing more!

- You can adjust the slider (timer) in many scenes together.

The whole is fully automated and is simple to implement!

And here's the recipe in a few steps:

1. Define a new virtual device with the following code as Main loop. Change only login and password for your HC2:

Please login or register to see this link.

2. Define the sliders for each device in your home that you want to control by timer. To do this, add a slider in the virtual device with content as below:

Please login or register to see this code.

Fields:

action must be always autoOff;

deviceId id of controlled device;

defaultTime (optionaly) - default timer when the switch is controling manualy;

defaultValue (optionaly) - default maximum dimmer value;

dimmTime (optionaly) - time of dimming on the switching off event;

NEW! wakeTime (optionaly) - wake up period in seconds if devcie is dead.

3. (Optionaly) For presentation on the home screen you can define two elements in that virtual device. One more slider witch id globalSlider and one label id globalLabel with title eg. Turning off:.

That's all.

Just a way to use this functionality in scenes:

Instead of selecting the turn on action, just select the action changes the slider to the virtual device to any value (in seconds). The light will turn on automaticly.

Good luck;)

And one more thing...

Please login or register to see this link.

to have new futures!

Update 1.3:

- added possibilites to set timer (slider) from scenes to any value (even lower than actual) by minused value (eg. -600).

Update 1.2:

- fixed slider values preview,

- added new parameter "wakeTime"

- few others.

Update 1.05:

- possibility to turn off by slider,

- possibility to controll time in any "direction" by main slider

- icons - with animation

Please login or register to see this image.

/emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

- bug fixes

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.

Please login or register to see this attachment.

Please login or register to see this attachment.

Recommended Posts

  • 0
Posted

ITS à fibaro dimmer.

  • 0
  • Inquirer
  • Posted
    ITS à fibaro dimmer.

    Good, you have to delete one slider. Parameters are ok.

    • 0
    Posted

    Great it's working now.

    What if I want to start more then one light? Normally if there is a breach in my livingroom (and lux is to low) I switch several lights on. So Do I need to create several virtual devices per room (with several lights) to achieve this (so it automatically switch of my lights)?

    Thanks for the great work on the script!

    • 0
  • Inquirer
  • Posted

    You can put in the same virtual device more sliders. One slider=one light.

    • 0
    Posted

    Great. What about the dimmlevel of a light, is that possible to set?

    • 0
  • Inquirer
  • Posted
    Great. What about the dimmlevel of a light, is that possible to set?

    In what situation exactly?

    • 0
    Posted

    I want to dimm my lights when this virtual device goes on. Now when the virtual devices runs the dimm level is 100% and I want different dim levels per light.

    • 0
  • Inquirer
  • Posted
    I want to dimm my lights when this virtual device goes on. Now when the virtual devices runs the dimm level is 100% and I want different dim levels per light.

    Delete "defaultValue" and "dimmTime".

    Please login or register to see this code.

    • 0
    Posted

    Ok. And how can I set the DIMM level?

    • 0
  • Inquirer
  • Posted
    Ok. And how can I set the DIMM level?

    In normal way: by setting dimm level of device, before setting of slider.

    • 0
    Posted

    Sorry for the amount of questions. But what do you mean? With a 'normal'scene I can select the percentage of dimm level per light.

    Now when the scene runs that 'starts' the virtual device all my lights go to the 100%. If I setup my light back to 50% of dimmlevel and run the scene again my lights go again to 100%.

    Do I miss the point

    Please login or register to see this image.

    /emoticons/default_wink.png" alt=";)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" /> ?

    Update:

    Found it

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

    "defaultValue": 60,

    • 0
    Guest shapa
    Posted

    Hi

    Some small idea (it could be a nice add-on): to be able to configure "delayed start".

    I.e. for some devices (like heaters, fans, etc) - to switch them on only after a few minutes of presence, otherwise to ignore.

    Real scenario: short visit to bathroom should not switch on fan, but longer one (for an obvious reasons

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />) ) - is a must.

    • 0
    Posted

    What are the posibility to add two virtual devices of this type? I tried it:

    If I add a second virtual device (but with a heater or other light) for example they are doing the same thing. My lights of the first virtual devices goes on when the other lights goes off on the other virtual device.

    I want to have different times per device. If I add different times per light on the same virtual device, how does the global turning off event works?

    • 0
    Posted
    Polska wersja:

    Please login or register to see this link.

    My idea for automation lights in the house. Example of usage...

    The enter-room with dimmer. Every move event turn on the lights for 3 minutes and every open door event turn on the lights for 5 minutes. In the last counting minute the lights will dimm down to zero - softly.

    Where can I change the 3 or 5 minutes values?

    • 0
  • Inquirer
  • Posted

    Where can I change the 3 or 5 minutes values?

    You have to build normal scene for that. Example:

    Please login or register to see this link.

    • 0
    Posted

    I finally got it up and running.

    I made the same mistake

    Please login or register to see this image.

    /emoticons/default_icon_redface.gif" alt=":oops:" /> :

    I added the globalSlider in the virtual device.

    btw the codeswap didnt help.

    Thanks

    But thx

    Please login or register to see this image.

    /emoticons/default_icon_mrgreen.gif" alt=":mrgreen:" />

    • 0
  • Inquirer
  • Posted

    I made the same mistake

    Please login or register to see this image.

    /emoticons/default_icon_redface.gif" alt=":oops:" /> :

    I added the globalSlider in the virtual device.

    But thx

    Please login or register to see this image.

    /emoticons/default_icon_mrgreen.gif" alt=":mrgreen:" />

    The globalSlider is needed? Strange! I have to check the code. Thanks for feedback

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

    • 0
    Posted

    My problem is that most of the time i want the dimm level around 50% and that works great with defaultvalue but sometimes like when cleaning i want to use 100% and i double click my switch it goes directly to 100% but then dimm down to 50%

    shouldn´t the dimming with either app or switch overide the automatic value?

    Thanks

    • 0
  • Inquirer
  • Posted
    My problem is that most of the time i want the dimm level around 50% and that works great with defaultvalue but sometimes like when cleaning i want to use 100% and i double click my switch it goes directly to 100% but then dimm down to 50%

    shouldn´t the dimming with either app or switch overide the automatic value?

    Thanks

    That is not so easy. The script has to be rewriten for that. Right now I don't have time for making new version, but I promise, it will be possible in new version.

    • 0
    Posted

    Strange things happened to me.. when main loop is active since some minutes and my aeon multi and everspring motion sensors call the virtual device all seems to go slow, motion sensor stuck (they stop on motion detection active status) and i cannot turn off any light using the slides or the on/off function on the fibaro interface. The only way to unlock is to save the virtual device again, disable the active scene who call the virtual device, turn off the light with the hardware switch and wait few minutes or restart fibaro.

    Nothing happen in the debug window.

    P.S. I'm on 3.571

    Any ideas?

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