How to set LightLevel to a Group?

Discussion in 'C-Bus Wired Hardware' started by Ingo, Jun 2, 2009.

  1. Ingo

    Ingo

    Joined:
    Dec 2, 2006
    Messages:
    290
    Likes Received:
    1
    Location:
    South Africa
    I was wondering if the below will ever be possible:

    if GetUnitParamStatus("Local Network", 16, ptLightLevel) then
    begin
    LightLevelRear := GetUnitParameter("Local Network", 16, ptLightLevel) / 13.2; { Get Light level in CBUS level }
    SetLightingLevel("Group 245 - LightLevel - Rear", LightLevelRear, "0s");
    Delay("00:02:10")
    end;

    I tried this, obviously, and it doesn't work because the variable LightlevelRear is a Real value and the SetLightingLevel expects an Integer value.

    The reason I am asking is that I want to set a CBus group and then have this group trigger something on the Comfort/Minder side. This also goes for a temperature sensor but it's a bit trickier seeing that the value returned will have a decimal in there somewhere.

    Ingo
     
    Ingo, Jun 2, 2009
    #1
  2. Ingo

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    You just need to use the "round" function to convert a real number to an integer. See the logic help file for details.
     
    Darren, Jun 3, 2009
    #2
  3. Ingo

    Ingo

    Joined:
    Dec 2, 2006
    Messages:
    290
    Likes Received:
    1
    Location:
    South Africa
    Thanks Darren, it works like a charm.

    Ingo
     
    Ingo, Jun 3, 2009
    #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.