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


Simplfy Timer ?


samuel

Recommended Posts

How to simplfy the following timer? :

 

if (Mode == 'AUTO') then  
    log("Wait 120 minuter");

 

-- add this by 120 = 120 x  1 minute = 2 hours after one minute can check temp
for i=120,1,-1  
    do   
           -- 1 minute wait
          for i=60,1,-1 
              do 
                  fibaro:setGlobal("BathroomSetTemp", FloorBathroomTargetTemp);
                  fibaro:sleep(1000); 
          ;
          end
             log("Test Time Delay");           
end

Link to comment
Share on other sites

What logic are you trying to achieve?

 

How I read your current scene, it is setting the Global Var " BathroomSetTemp" every second (sleep 1000 means wait 1 second),  inside a loop of 60 (making one minute) which then outputs "Test Time Delay" at the end of each minute, which in itself loops for 120 (2 hours). The current code does not read anything to get the value of "FloorBathroomTargetTemp", so either this is being updated outside of this loop (which means this loop is doing nothing), or you need this loop to read something first before setting it. 

 

If you are just wanting it to sleep for 2hrs then use 

 

Please login or register to see this code.

 

Link to comment
Share on other sites

  • Topic Author
  • Understood. But in the meantime of sleep i still would like to execute some code,  With other words, I would like to set my floorheating to manual mode and wait for two hours, but in case i change the temperature again on the thermostat that the temperature will be change again to the set temperature. But with this code I think i am not able to do so: 

    Please login or register to see this code.

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