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


Recommended Posts

Posted

is there a easier way to increase light every 5 min with 5% value

 

for now i have :

 

local sunrise   = fibaro:getValue(1, "sunriseHour")
local sunset     = fibaro:getValue(1, "sunsetHour")

local time75     =  os.date("%H:%M", os.time()+75*60)
local time80     =  os.date("%H:%M", os.time()+80*60)
local time85     =  os.date("%H:%M", os.time()+85*60)  
local time90     =  os.date("%H:%M", os.time()+90*60)

 

if     (((sunset <= time90 and sunset >= time85) or (sunrise <= time90 and sunrise > time85))
       and tonumber(fibaro:getValue(lightItems, "value")) < lampValue05  )
              then fibaro:call(lightItems, "setValue", lampValue05)
                      elseif (((sunset <= time85 and sunset >= time80) or (sunrise <= time85 and sunrise > time80))
                      and tonumber(fibaro:getValue(lightItems, "value")) < lampValue10  )
                             then fibaro:call(lightItems, "setValue", lampValue10)
                                     elseif (((sunset <= time80 and sunset >= time75) or (sunrise <= time80 and sunrise > time75))
                                     and tonumber(fibaro:getValue(lightItems, "value")) < lampValue15  )
                                            then fibaro:call(lightItems, "setValue", lampValue15)

etc....

 

 

 

Posted

Don't understand exactly what you want to achieve, but I hope this will help.

 

If current time >= sunset then the light will increase +5 every 5 minutes, it will stop if light is set to 100

Please login or register to see this code.

You can also look at this:

Please login or register to see this link.

 

  • Topic Author
  • Posted

    i already achieve a script that allows me to activate the light 1 hour before sunset whit a light sensitive of 5%

    after that it will increase by 5 % evvery 5 min even as time is before sunrise

     

    only the script is verry long (but it works)

    try to simplify the script

    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" />

     

    and your script works gread. Thanks

     

    know a can change the value easier

     

    Thank you

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

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