Programming problem with lux levels

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by jdriver, Sep 27, 2014.

  1. jdriver

    jdriver

    Joined:
    Oct 24, 2013
    Messages:
    4
    Likes Received:
    0
    Location:
    UK
    We have a 'common or garden' lux sensor operating outside, and I wish to set up some logic to make it close the curtains when 'darkish' and open them when 'lightish', within certain time paramaters.
    I know the lux sensor works as it returns live light level to my Wiser mobile app. What isn't working however is my logic. It seems correct to me, but it isn't working, the actions being controlled only by the time, and not by the lux level. (I wrote this code by copying and editing what the logic wizard provided.)
    What have I done wrong?

    {In the morning open the curtains if it is after 7:00am and light, or at 9:00am regardless of light}
    once ((GetLightingLevel("External Lux Level") >= 15%) and (Time > "07:00:00")) OR (Time > "09:00:00") then
    begin
    if LivingCurtainFlag = ON then
    begin
    LivingCurtainFlag := OFF;
    Delay ("00:00:01");
    PulseCBusLevel("LONGHEADS", "Lighting", "Lounge Curtains", 100%, "4s", "0:00:08", 0%);
    PulseCBusLevel("LONGHEADS", "Lighting", "Dining Curtains", 100%, "4s", "0:00:08", 0%);
    end;
    end;
     
    jdriver, Sep 27, 2014
    #1
  2. jdriver

    Goran C Forum Member

    Joined:
    Jun 7, 2012
    Messages:
    28
    Likes Received:
    0
    Location:
    Adelaide
    Within PICED refer to the Logic Help GetUnitParameter function.

    You will first need to create a monitor component matching the unit address and parameter to be able to read the light level lux into your PICED logic.

    You can then create a variable and assign it the value returned from this monitor component via the GetUnitParameter function.

    You can then refer to this variable in your logic
     
    Goran C, Sep 29, 2014
    #2
  3. jdriver

    Roosta

    Joined:
    Nov 22, 2011
    Messages:
    560
    Likes Received:
    1
    Location:
    Australia
    Actually Goran C, if jdriver is using the broadcast function within the PE cell to send the current lux level via group address "External Lux Level" then no monitor component is necessary.. You can just use the GetLightingLevel command..

    Jdriver,

    have you set the PE cell to broadcast onto the "External Lux Level" group address?

    What is LivingCurtainFlag?

    Also are you aware of what lux level '15%' is and what lux level you are trying to achieve as a switch point?

    You say it is working by time and not by lux level but how have you tested this? The logic engine is simplistic in that it goes step by step by step, so if the time parameters are working then one would assume the logic engine has been given the 'ok' by External Lux Level >= 15% to get to the time aspect, hopefully that makes sense..

    Cheers..
     
    Last edited by a moderator: Sep 29, 2014
    Roosta, Sep 29, 2014
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.