PDA

View Full Version : Convert Cbus level to percentage


Damaxx
30 May 10, 07:14 PM
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

Darren
31 May 10, 10:20 AM
Group1Level := LevelToPercent(GetLightingLevel("Group 1"));

Damaxx
31 May 10, 04:38 PM
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?

Darren
01 Jun 10, 06:46 PM
Obviously logic code and beer don't mix.
I discovered that a few years ago. I could get away with it when I was younger :(

How many beers do I owe you now?
None. It is all part of the service...

ashleigh
02 Jun 10, 09:51 AM
Whoever sent in the chocolates did a favour though!

They was yumbly :-)