This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.

lighting script /flow

Hi Guys,

Currently I use fibaro fc2 and want to switch over to Homey. On my Fibaro I have a light script running that controles the lighting in the bathroom. Fibaro lighting swith and a Fibaro motion detector.

This script works with variable.
Morning (06:00/12:00)
Daytime (12.00/18:00)
Evening (18:00/24:00)
Night (24:00/06:00).

When it is daytime and motion is detected then the lighting is switched on at 100% for 10 minutes. If there is movement within this 10-minute, The lights on extends with 10 minutes.

The other settings are:
Evening light strength 50% and time 5 minutes
Night light strength 30% and time 1 minute

Now the question is, can Homey do this within one flow or must I create more than one flow. What it the best way to setup these flow(s) with Homey.

Comments

  • You need 4 flows for this to work. One for every timeframe. Luckily you can copy flows nowadays so you can make the first one and only change the times in the others. Basicaly the flow would look something like this:  


  • RocodamelsheRocodamelshe Member
    edited May 2017
    These lights will go off after 10 minutes. If u keep moving for 10 minutes they still go off. Best use timers with the countdown app me guess. Maybe try this example.
  • Thanks guys I will give it a try.
  • @Rocodamelshe  I set a bolean for Light on /Lightoff. How can I best setup the flow with time slot and lights density

    First I make 2 flows: 
    - When motion is detected then set Variable light on on true
    - When there is no motion then set Variable light off on true

    Next step is something like this?
    When: Variable is set Lights on
    And: Time is 18.00 - 24.00
    Then: Switch on light at density 40%

    Will this flow keep running when motion is detected and automatically switch off the lights when there is no motion?
  • RocodamelsheRocodamelshe Member
    edited May 2017
    Best use timers with the countdown app
    Then make the flows like stated in the link:

    Flow 1: When motion is detected-----And Time is 18.00 - 24.00 -----Set boolean "Lights-on" to true.
    Flow 2: When a variable changed----And boolean "Lights-on" is true----Stop countdowntimer "lights-on", put lights to 40%.
    Flow 3: When motion stops-----Nothing here-----Set Boolean "Lights-on" to false.
    Flow 4: When a variable changed-----And boolean "Lights-on" is false-----Turn countdowntimer "Lights-on", 600 sec.
    Flow 5: When countdowntimer is empty-----Nothing here-----Turn lights off.

    Ow, and we use variable with the Better Logic app and just 1: In my example it is called "Ligths-on".
    We use that to be true or false.

  • RocodamelsheRocodamelshe Member
    edited May 2017
    So flow 2 will look like:



    Variable name "Lights-on" is "Keuken" in this example.
    Countdown timer "Ligths-on" is "Plintlamp"in this example.
  • @rocodamelshe sorry for the late reply. Yesterday I tried your suggestion. It works. Thank you!
  • Awesome, thanx for sharing. 
Sign In or Register to comment.