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

Bath room ventilation


Question

Posted

Hi Folks,

 I would like to run my bath room fan 3 min. after I entered the room.

(that is no problem) 

(The trigger sensor is a Motion Sensor)

But, If I leave the room within the 3 min the fan should not start at all.

 

Has anyone a suggestion for it :?:

 

Cheers

 

 

 

18 answers to this question

Recommended Posts

  • 0
Posted

You've got a timewarp issue here ;-)

 

if you enter the room, the fan needs to start, but if you leave it shouldn't have started, when you entered.......

 

I measure humidity in the bathroom and when it increases I start the fan. When it's down to normal levels I switch it of

  • 0
  • Inquirer
  • Posted

    ha ha ;-)

    lets put on this way,

    the fan is not for the humidity but for some bad human smell :mrgreen:

     

    • 0
    Posted

    Have you tried setting a scene for this?

    • 0
  • Inquirer
  • Posted

    yes,

    but I'm struggling to stop/kill the scene if I leave within the 3 minutes

    any suggestion is very welcome

    • 0
    Posted

    I tried tweaking another code I have. (I'm not pro at this coding stuff)

    Perhaps this can work. remember to change the values of the modules.

     

     

     

    Please login or register to see this code.

     

    • 0
    Posted

    You start a blocksceen at once the motion eye recognized a movement. This is delayed with 3 min.

    Then you have to decied when it should stop, because you also start the stop command at the same moment, lets say delayed with 5 min. The fan runs for 2 min.

     

    But you better run a smell trigger because not every entry is worth a fan.

    • 0
    Posted

    Ok I read it once more (smell trigger isn't needed).

    You start a blocksceen starting the fan at once the motion eye recognized a movement. This is delayed with 3 min.

     

    You have to control the sleeptime of the motion trigger. Let say movement within 10sec after getting hot are ignored.

     

    New blocksceen

    Then you stop the fan delayed with 2 min. When you stayed just 1 min. No fan action. When you stayed 2 min - 1min fan. When you stay 4min 3 min fanaction.

    I hope the location have only one door.

     

     

    • 0
    Posted

    maybe use global variables.  And use a wait command to check for motion. 

    • 0
    Guest fat
    Posted

    Have you thought about using a door sensor to check if door has been closed for 3 minutes then fan is turned on? It might be easier to do this rather than use a motion sensor as you would get less false triggers

    • 0
  • Inquirer
  • Posted

    Thanks for you comments, and suggestions, I will play with it and let you know what comes out 

    • 0
  • Inquirer
  • Posted

    emielstroeve is right, it's a time-warp. :mrgreen:

     

    I tried a lot of different ways, but it always comes up that there is no trigger when I leave the room.

    So, for time being I made a button on the phone for it; may be later I will sponsor "The Button"

    thanks for your suggestions

    cheers

    • 0
    Posted

    Hi @vanni177

     

    I will soon have scene that will do what you need it to do, so start fan in bathroom only if you stay long enough, otherwise will not start. Actually it will do more than just that time-warp problem :-)

    • 0
    Posted

    I have a scene set up to do this for bathroom lighting, working with a door sensor and a motion sensor.

     

    Is the light switch in the bathroom on your Zwave network? It could be used as a trigger to kill the scene upon leaving the bathroom.

    • 0
  • Inquirer
  • Posted

    Hi @Sankotronic

    that would be perfect :-), please let me know.

    • 0
    Posted

    Hi @vanni177, will do soon. At moment I'm busy with VD for Smarter coffee. Finally our Angelina (our HA has name) will be able to prepare coffee in the morning for my wife and me!! Meanwhile testing smart light scenes and look pretty good.

    • 0
  • Inquirer
  • Posted

    Hi, I found an acceptable solution for my fan.

    It will be triggered by the light, (not the motion sensor). In the same time a variable will be set and the delay time starts. If the delay time is over the fan starts only if the light is still on.

    This prevents the fan to be on if you only short in the bathroom.

     

    It may help someone too.

    For me it's good enough ;-)

     

    The code is like:

     

    --[[
    %% properties
    320 value
    %% events
    %% globals
    --]]

    --BG_Fan_ON ID 121

    --print(os.date("%c, Start"))

    local startSource = fibaro:getSourceTrigger();
    local a
    a = 0
    --print(a)

    if (
        (tonumber(fibaro:getValue(320, "value")) > 0)            --Light WC
        )
      then
    --  print(os.date("%c, Light is ON"))
      setTimeout(function()
    --      print(os.date("%c, delay time done"))
          a = 1
    --      print(a)
          if (
              (tonumber(fibaro:getValue(320, "value")) > 0)        -- Light WC
              and a == 1
            )
            then
            fibaro:call(321, "turnOn");                           --Fan WC
    --        print(os.date("%c, Fan ON"))
          end
        end, 3*60*1000)                                            --delay time
      end
     

    • 0
    Posted

    Hi @vanni177,

     

    I'm glad you found solution. I also did write

    Please login or register to see this link.

    that can start any device after light is turned on longer than some specified time just forget to come back here and leave a post.

    • 0
    Posted

    Hi,

     

    I fix this one for my bathroom and it is working fine.

    It turn on my fan only when the light is on for 2 min, and the fan stops after 5 min.

     

    --[[
    %% autostart
    %% properties
    469 value
    %% globals
    --]]
    ---------------------------------Generic Scene Code------------------------------
    local trigger = fibaro:getSourceTrigger();
    local currentDate = os.date("*t")
    local now = string.format("%02u",currentDate.day).. "-" ..
       string.format("%02u", currentDate.month) .. ": Started by ";
      if   (trigger['type'] == 'property') then fibaro:debug(now .. 'device ' .. trigger['deviceID']);
      elseif (trigger['type'] == 'global') then fibaro:debug(now .. 'global variable ' .. trigger['name'])
      elseif (trigger['type'] == 'autostart') then fibaro:debug(now .. 'autostart configuration');
      elseif (trigger['type'] == 'other')  then fibaro:debug(now .. 'other source');
      else fibaro:debug(now .. 'unknown source:' .. trigger['type']);
      end
    local csc = fibaro:countScenes();
    if csc > 1 then fibaro:debug(csc .. " scenes running, abort this instance..."); fibaro:abort() end
    ---------------------------------------------------------------------------------
     

    local scene = 209 -- ID dieser Szene
    local Vent = fibaro:getGlobalValue("VentToilet");
    local switch = fibaro:getGlobalValue("LampToilet");
    local sensor = fibaro:getGlobalValue("SensorToilet");

    local starttimer = 40
    local runtimer = 125
    local venttimer = 300

    --if (fibaro:countScenes()>1) then
      --fibaro:debug('Kill second scene!');
      --fibaro:abort();
    --end
     
    if (tonumber(fibaro:getValue(sensor, "value")) > 0 ) then
        fibaro:call(switch, "turnOn");
        fibaro:debug("Licht is aan")
        timer = os.time();
        VentTimer = os.time()
        while os.time() - timer < starttimer do
            fibaro:sleep(1000);
           
           if (tonumber(fibaro:getValue(sensor, "value"))) > 0 then
                timer = os.time();
            end
           
            --local calc = timer - VentTimer
            --print(calc)
            if timer - VentTimer > runtimer then
              fibaro:call(Vent, "turnOn");
            end
        end
       
        fibaro:call(switch, "turnOff");
         
    end

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