View Full Version : Quick Question
AKsor
January 27th, 2011, 06:09 AM
I'm working on my lighting page in Netremote,.
I'm trying to get a sliding image visual indicator to display the current light level for each individual switch but I can't get it to work.
Is there a sliding image visual indicator example for Device Manager light control.
I was trying to use the DM.Lighting.Devices.<LoopIndex>\Level variable but i can't get it to work
Also how can you retrive the Level in LUA?
Help please
jwilson56
January 27th, 2011, 06:30 PM
Not sure I follow you.
Do you mean like this?
AKsor
January 28th, 2011, 01:59 PM
Hi John
What i mean is that you have a background image and a foreground image,
the foreground image slides to reveal the background image depending on the light level of the current light.
Its a cool effect I use it for my progress bar for my music page.
but for some reason I can't get it to work for the light level
jwilson56
January 28th, 2011, 03:27 PM
Sorry not done that.
AKsor
January 28th, 2011, 04:31 PM
How the heck can I access the DM.Lighting.Devices.x\Level variable from lua
I know if I place the above in {} brackets in a frame it will display the current level but how can you get this level into LUA?
jwilson56
January 28th, 2011, 04:43 PM
I use this for my light bulb display
local range = tonumber(NetRemote.GetVariable([[<<^^^>.1>\Level]]))
if range > 0 then
if range > 10 then
return false
else
return true
end
else
return false
end
AKsor
January 28th, 2011, 04:57 PM
I keep getting Nil for the response How does it know what variable to get with the <<^^^>.1>\lLevel
AKsor
January 28th, 2011, 05:05 PM
I assume that the first ^ is DM the second ^ is Lighting and the 3rd ^ is Devices
I'm still not an expert at lua but I guess the square brackets are delimiters?
jwilson56
January 28th, 2011, 05:36 PM
The frame is named
Fordrat8\ElkM1EZ8\Light 7 and the number of ^^^ is how many levels above that the named frame is at (frames within frames)?
I am not an expert at this either but that is what I found by playing around.
Try this example I created. It uses a LUA script to hide and unhide a frame
AKsor
January 31st, 2011, 03:55 PM
Got It working John
What I was doing wrong was trying to get the level from the wrong variable.
NetRemote.GetVariable(DM.Lighting.Devices.1 ..'\\Level)
instead of NetRemote.GetVariable(Homecontrol\X10\A5.. '\\Level')
Powered by vBulletin® Version 4.1.8 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.