Convert Cbus level to percentage

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by Damaxx, May 30, 2010.

  1. Damaxx

    Damaxx

    Joined:
    May 12, 2008
    Messages:
    229
    Likes Received:
    47
    I am hoping someone can enlighten me on where I am going wrong.

    Using homegate logic I am trying to get the current level of a lighting group and convert it to a percentage into a defined variable.

    I have read and tried the LevelToPercent(_level_) as stated in the help file but to no avail.

    Can someone please give me an example of the correct usage of this function as I am missing something no doubt blatantly obvious. :confused::confused:

    Thanks
     
    Damaxx, May 30, 2010
    #1
  2. Damaxx

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    Code:
    Group1Level := LevelToPercent(GetLightingLevel("Group 1"));
     
    Darren, May 31, 2010
    #2
  3. Damaxx

    Damaxx

    Joined:
    May 12, 2008
    Messages:
    229
    Likes Received:
    47
    Thanks again Darren. I am going to give up trying to program of a night. Obviously logic code and beer don't mix.
    I am sure I tried that last night but had no luck. must have been doing something wrong because I tried it then and it work to perfection.

    How many beers do I owe you now?
     
    Damaxx, May 31, 2010
    #3
  4. Damaxx

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    I discovered that a few years ago. I could get away with it when I was younger :(

    None. It is all part of the service...
     
    Darren, Jun 1, 2010
    #4
  5. Damaxx

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,397
    Likes Received:
    26
    Location:
    Adelaide, South Australia
    Whoever sent in the chocolates did a favour though!

    They was yumbly :)
     
    ashleigh, Jun 2, 2010
    #5
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.