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

on motion, turn on (hue) light for x minutes


Question

Posted

Hi All,

 

I'm currently a Homey user, but i want more stability in my (mostly) Z-wave based automation, so i decided to switch to a HC2 soon.

 

So i'm reading a lot of websites, watching youtube clips and most of them cover the advanced configuration of HC2.

However i cannot find a short description of how i can turn on a couple of lights for like 5 minutes when there is movement detected.

Maybe this is so straightforward in the interface, but i cannot check it, cause i don't have a HC2 yet.

 

Anyone care to tell me how something simple like this can be achieved in HC2?

I have a programming background and are not afraid of some LUA programming, but this seems like quite a standard function, so i hope it won't involve any advanced configuration...

5 answers to this question

Recommended Posts

  • 0
Posted (edited)

Please login or register to see this link.

 

I thought about getting a homey. Is it that unstable?

Edited by djashjones
  • 0
Posted

You can do it multiple ways... a block scene,

 

Please login or register to see this image.

/monthly_2019_08/image.png.1f59009153165b8792e43ddb87bb7981.png" />

 

You can also write LUA scene too. below scene does 2 things for me.. firstly, it checks if the correct variables are set for night time etc, and also if the light is off.. then when I open the door, the door sensor will report that it has a breach and the light will be switched on for 5 mins.. you can customise it to the nth degree...

 

--[[
%% autostart
%% properties
22 value
74 value
%% weather
%% events
%% globals
DayTimeSet
--]]
if (fibaro:countScenes()>1) then
  fibaro:debug('Kill second scene!');
  fibaro:abort();
end
local currentDate = os.date("*t");
local startSource = fibaro:getSourceTrigger();
if (
 ( (string.format("%02d", currentDate.hour) .. ":" .. string.format("%02d", currentDate.min) >= "04:00")  and  fibaro:getGlobalValue("DayTimeSet") == "FALSE" and  fibaro:getGlobalValue("NightLights") == "True")
and
 ( tonumber(fibaro:getValue(22, "value")) == 0 )
and
 ( tonumber(fibaro:getValue(74, "value")) > 0 )
or
startSource["type"] == "other"
)
then
    fibaro:call(22, "turnOn");
    fibaro:call(34, "turnOn");
    fibaro:debug('Turn On');
    fibaro:debug('Wait Now');
    setTimeout(function()
          fibaro:call(22, "turnOff");
        fibaro:call(34, "turnOff");
        fibaro:debug('Turn Off');
    end, 300000)

end

 

  • 0
Posted

@WirelessCable most simple is:

set breach time in the pir at 5 min, so every time the pir sees movement the timer (in the pir) starts over

block scene

if pir breach, lights on

 

if pir save, lights off

 

  • 0
  • Inquirer
  • Posted

    Thanks for the fast replies! Seems like i can make more then 90% of my triggers with the block builder, that look promising!

     

    what if a scene gets triggered for a second time when the scene hasn't ended yet (a timer is still running)?

    for example; when movement is detected, turn on the light.

    after 5 minutes, turn the light off.

     

    if the pir goes off (like after 1 minute), and detects movement again, will it still trigger at the 5 minutes from the start, or will the scene restart the timer at 5 minutes? (sometimes when we are watching tv in our living room, we can sit still for a while ;))

     

    @djashjones Homey can do a lot of things, but i don't feel z-wave is its strength. i have occasional (a couple of times per week) drops of packets, that makes it quite annoying. (lights should turn off when i leave home for example) I tried a lot of things with repeaters and more z-wave devices, but it looks like it's something with homey.

     

    • 0
    Posted

    @WirelessCable, you will prolong time of light turned on by breaching  PIR in case you have light on scene and light off scene.

     

    Yes, scene will be triggered multiple times, but light will turn off after 5 minutes of PIR not reading any movement.

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