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.

Switch based on LUX ?

Hi,

I have multiple Philips Hue Motion Sensors (which work great with Homey), but is it also possible to use the LUX value of a Motion Sensor in flows? For example : I want the lights in my bedroom to switch on automatically on motion, but only when LUX is < 10.


Comments

  • JPeJPe Member
    edited August 2017

    you need the trigger from the moving and the "Helderheid" copy from the Tags-puldown.
  • bvdbosbvdbos Member
    edited August 2017
    This is not good, this triggers whenever the luminance changes regardless of movement. Trigger should be movement, condition "Luminance < 12" with indeed the luminance-tag from the pulldown menu...
  • JPeJPe Member
    that is what I try to say in my comment "you need the trigger from the moving", sorry being unclear  :'(
  • EternityEternity Member
    edited August 2017
    This is what I have made, using 3 flows.


    Flow 1 



    Flow 2 (ignore the SK-OP3 zet AAN... not needed for your purpose!)


    Flow 3 (ignore the SK-OP3 zet UIT... not needed for your purpose!)


  • Why the variable?
    Flow 1 : if motion detected and lux < 10 : turn on light(s) and set hourglass
    Flow 2 : if hourglass empty : turn off light(s)
  • Eternity said:
    This is what I have made, using 3 flows.


    Flow 1 


    Thanks for the screenshots. For whatever reason, if i pick the "Logic" item in the flow editor, i cannot specify "Helderheid" there.... any idea?
  • EternityEternity Member
    edited August 2017
    @bvdbos
    Yes, you are right. Initially I had this setup with extra card for different purposes. Need to clean up the flows (and see if I can reduce the amount of flows by using the OR and ELSE capabilities). 

    @dennis91
    Perhaps it is named differently with Philips Hue sensors?
    In my case the lux values are generated by Aeotec multisensors. In the flow editor I select 'Tags' and type 'helder' in the search area to find all my sensor / lux tags:



  • An even simpler solution - without the 'zandloper' - is this:


    Just set a delay in the action card, thats matches your needs:

  • Eternity said:
    An even simpler solution - without the 'zandloper' - is this:

    Just set a delay in the action card, thats matches your needs:


    The simple solution will still turn off the lights if motion is detected for a second time. This might not be an issue depending on the use case, so it is just a matter of preference.  

    I'd like to propose a solution with a timer instead of a variable. It is a bit simpler, but still flexible:
    1) WHEN motion detected AND lux < 10 THEN set timer hallway to 300
    2) WHEN timer hallway = 300 AND lamp is off THEN turn lamp on
    3) WHEN timer hallway = 0 AND lamp is on THEN turn lamp off

    If you have a wall switch with a sensor, you can override the timer when the wall switch is used to ensure the lights stays on or is forced off. 
    4) WHEN hallway switch changes AND lamp is on THEN turn lamp off ELSE turn lamp on
    5) WHEN hallway switch changes THEN set timer block-motion to 60
    Change 1 to: WHEN motion detected AND lux < 10, block-motion is not running THEN set timer hallway to 300

    I don't have the timer app installed at the moment as I recently moved to a new place and I'm still in the process of installing all the sensors, so I haven't tried this one out myself yet. I'm also upgrading some switches from KAKU (receiver only) to Fibaro (sender and receiver) so I can do all of this with a single Fibaro switch and any motion sensor.  

    So much fun stuff to do with Homey  ;)

  • EternityEternity Member
    edited August 2017
    So, it looks like this:




    BTW
    The 'manual override' is also part of the App "State Control". Bit complicated to set up, but works nicely too! I had to use that, as my Fibaro switches only have 'ON' or 'OFF' flow cards in the IF section, no 'has changed'.
  • I also want to switch lights when someone enters a zone (hall, bathroom, toilet, etc). Can someone tell me what devices I need?

    Only motion sensors can work indeed, but then I need to work with timers as above mentioned. I also want my physical light switches to know that lights are on or off. And when someone uses these light switches, Homey should also be aware of this. What do I need for this?

    And even more advanced, I want a zone to know when someone enters or leaves. Do I need door sensors also then?

    Would be nice if you can tell me which devices I need and how the flow(s) will look like. Thx in advance!
  • I am using a NeoMotionSensor (NeoCoolCam). I want to create a flow that turns on two lights when there is motion and the lux level is below 30 lux.

    In the tags I see a tag for the sensor. But in the "and" section I cannot drag the tag to the better logic part. I had the placeholder for the tag once, but could not drag it there then either. The better logic icon looks somewhat different too: not just + - × : but also the = symbol are shown.

    I do not need to declare variables first in the better logic setup right? What am I missing?

    My flow is (or shoud be):
    Motion detected ==> Helderheid (lux level) below 30 and lights off ==> turn on lights.

    I just cannot get the darn "Helderheid" tag in the better logic portion...
  • RocodamelsheRocodamelshe Member
    edited October 2017
    Just use the "normal" logic card for that.
    And dragging and dropping takes some practice!
  • Ah, got it. Hehe...
  • WRosWRos Member
    edited October 2017
    Switch based on Lux.
    I've made 4 flow for it.
    Start detection
    Stop detection
    Reset Timer
    Calculate dimming level 
     
    Start Detection:

    If: there is motion detection activated.
    And: timer isnt running AND lux in lower than 15
    Then: Switch on the licht with the calculated dimming parameter AND start Timer.

    Stop Detection:

    If: Timer is empty
    And: there isn't any motion detection anymore
    Then: Switch light off

    Reset Timer:

    Reset timer when there is motion.

    Now the real trick:

    Calculate dimming level:

    with this formula the dimming level gets a nice value when Lux is between 0 and 15: 
    {{round(sqrt(Helderheid*Helderheid/250+0.1),2)}}


  • Great flow example!

    I have a problem with the last flow.  You have typed "Bijkeuken...." in the first field":





    but shouldn't this be the created TAG?


    Thanks for sharing!
  • @Eternity you can't use a tag in the name input, you need to type it
  • @Eternity I declare a new variable: BijkeukenLichtNiveau.
    A better name for the explanation: CalculatedDimmingLevel
  • Cheers! 
  • EternityEternity Member
    edited October 2017
    Hmm, my first attempt to do some calculations and not very succesful at it...

    As a test I have created a Better logic number variable with the name 'waarde'.


    If I make a test flow and test it with this card, it does not update the variable. I tried various formats:
    {{5*5}}
    {{ 5* 5 }}
    {{ 5 + 5 }}

    The flow works - green ticks - but the variable stays 0






    What am I doing wrong ?
  • @Eternity
    Maybe you should try to use the correct app 's cards when calculating :wink:

    Logic is not ( != ) better logic
  • EternityEternity Member
    edited October 2017
  • @Eternity
    The thing you did with logica was working. (I think) You looked for the changes in the Better Logic settings. The default logic value are only presented in the tag area where you building the flows.
    I had made a fault in the formula. Forgot to use the "round" function.

    The formula is now: {{round(sqrt( Helderheid*Helderheid/250+0.1),2)}}
Sign In or Register to comment.