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.

Light flows triggering only after the sun is down.

FloodnlFloodnl Member
edited April 2017 in Questions & Help
Hi all,

First of all my apologies, i know i've seen a flow screenshot somewere but after looking for 90+minutes i give up on finding it. (used google and the forum search) And since this is something i think everybody wants i do not understand why it's that hard to do..  or find info on it.  (might be my problem)

The "issue" is that i do not understand the way i can trigger a flow using Sun Events or Data & time cards.  


What do i want: 
The scenario i want to create is that if it's starting to get dark outside the trigger 'light's on' flow in my Kitchen is triggered by a motion sensor.  ( i do understand the Countdown app and will use that also afterwards but first i need to get my head around the darkness option)

What do i use:
KaKu motion sensor and KaKu lightswitch. 

What do you managed:
Well  it works, but the lights go on every moment of the day now.  
Also i used the:
 and 
cards and it solves that it triggers during the day but after midnight or late / early in the morning it won't turn on the light anymore. 




Thanks to @glijie ;

To get this working you need the following apps installed on Homey: 

Better Logic
Sun Events
CountDown

Now we going to set it all up: 

STEP 1. 
we first going to setup the apps in the Settings / Instellingen section of the desktop app 

Bottom left you click on 'Better Logic' and we going to add a variable so we have one that can be set True or False. 
Since we are going to set a sunset trigger i named it like Glije did Sunset and choose the 'Boolean" Variable type and make sure to check the option 'on' below. (make sure all red lines are set).  Now we going to add it by clicking the button 'Add variable' (blue line)




Countdown

Bottom left we click on 'CountDown' and we going to add a timer for your flow name it simple with your location of the lights in it.
and ofcourse add it with the Add timer button (blue line)




STEP 2.
we are now ready to make some flows.


Glije teached me here that we make 2 flows that can help us as a 'Sun down'  or 'Sun Up' trigger in other flows as well. 

This is my it's dark flow: 

Set 1 Sun Events card on Begin Sunset  and add a Better Logic card choose with the arrows the 'Set a variable' card and as name the boolean we made sunset and we want to set it on 'True'.  

So everytime the sunset is triggered this flow sets the Boolean of Better logic to True. 


We make the 2nd new flow, and add below your Sun Event  and again the Better Logic card with Set a variable but make sure to set it on 'False'

Now i choose End morning golden hour as my door is pointed north and the sun ends up all day on the back of the house. 
this is the event times of Sun Events you can also choose for  End Sunrise / Einde Zonsopgang


Sunevents trigger times
(do notice these automaticly change each day to match the event)






STEP 3.
now it's the fun part we going to make the light flow. 

We going to make a new flow (licht locatie aan)  were you add your motionsensor and lights. in the middle we set the Better Logic card 'is true' with the boolean 'Sunset'. Now on the right under the light we add a Countdown card that is set on 'Turn Hourglass around / Draai zandloper om' fill in the name of the timer we made in step 1 and behind it the number of seconds you want the timer run out (i prefer 60 some ppl 90 check whats best for you) 



Now only 2 flows are left the ones that trigger what happends if the Hourglass timer / Zandloper ran out. 

Make a new flow (zandloper aanwezig)  and add a Countdown card with 'Hourglass empty / Zandloper leeg' and add the timer we add in Step 1. (licht aan locatie huis) add your motion sensor and make sure its set on the card that says 'The motionsensor is on / De bewegingsmelder is aan) add the countdown card Turn hourglass around / Draai zandloper om. 



now we make the last flow (zandloper afwezig) and we set the first card the same the second card with the motionsensor we make sure we have the box top right checked / gevinked  so it says 'the motionsensor is off / De bewegingsmelder is uit' and on the right the light switch with turn off / zet uit. 



If all correct you should now have set the correct flows so you can have the lights turn on and off automaticly in rooms you do not spend much time. if the room you do this for occasionally has someone present for longer times you could think of using perhaps using something like this in it: 


(drawback is everytime you enter the room he asks you if you want to keep the light turned on or not. if you give no response it will respond to whats happening in the initial flow.) 

Comments

  • rtnartna Member
    First trigger the motion sensor, and condition: It's dark outside. Action: Lights on.

    This way the motion sensor is allways tiggered but the lights will only turn on when it's dark outside.
  • But how or were do i find the: condition: It's dark outside.
    Can you perhaps share a screen shot?   (i used snipping tool of MS)
  • RocodamelsheRocodamelshe Member
    edited April 2017
    Looks like ur using "Sun goes down" . That's an event that will last for like 1 second. Is there no event like "After sunset"?
  • Maybe this will help
    Create a flow for the motion sensor that activates the light, so IF motion is detected THEN switch on a light.
    Deactivate that flow
    Create a 2nd flow IF begin zonsondergang THEN activate the first flow.
    And a 3rd one at midnight or in the early morning to deactivate the first flow again.
  • rtnartna Member
    Or use a lightsensor like KaKu ABST-604.
  • FloodnlFloodnl Member
    edited April 2017
    Looks like ur using "Sun goes down" . That's an event that will last for like 1 second. Is there no event like "After sunset"?
    Yes there is but i've used most of them now to check: 



    This will indeed solve the during the day issue but it triggers an issue that during the night no lights go on
    also i have no idea what the 0 indicates. 

    ispaapen said:
    Maybe this will help
    Create a flow for the motion sensor that activates the light, so IF motion is detected THEN switch on a light.
    Deactivate that flow
    Create a 2nd flow IF begin zonsondergang THEN activate the first flow.
    And a 3rd one at midnight or in the early morning to deactivate the first flow again.
    Well i think if i have the correct trigger it can be used in 1 flow.  (currently have 3 flows for the Countdown app and having like 6 flows for 1 light trigger seems overkill but if needed i will)  
  • @Floodnl

    Make 2 flows like here under with Better logic




    then use these flows in all your flows where you need sunset to be true or false... for an example see here under



    This way you never mis a trigger.

    grtz

  • FloodnlFloodnl Member
    edited April 2017
    glijie said:
    @Floodnl

    Make 2 flows like here under with Better logic




    then use these flows in all your flows where you need sunset to be true or false... for an example see here under



    This way you never mis a trigger.

    grtz

    Waaaaauuuwwww :D awsome Glije.
    thanks a lot for the effort,  this is what i was looking for, much apprecaited for your time and effort spend answering my question (everybody thanks a lot). 

    i will add the full manual in the first post.
Sign In or Register to comment.