PDA

View Full Version : Control Lighting Shedule Linked To Ambient Light?



NeoMorph
January 3rd, 2010, 03:45 PM
OK, so currently my lighting scenes are linked to whatever I am doing in the living room. If I'm watching TV for example it turns on the lights either side of the TV and turns off the main lights.

This has been fine for several years now but I was playing a computer game this afternoon and when I started it was light outside but when I finished it was dark. So I turn off the game and then realise... no lights in the living room DOH!

So what I was thinking was, when it is in TV/Game mode, girder could turn on the lights when it gets LittleDark (according to Ambient Light) in the living room. The opposite is also something that could be included... ie when I am watching TV in the morning and it starts to get light, Girder could automatically turn off the lights.

Now I thought it would be easy but with my brain stoned on painkillers due to the cold I just can't get my head around it. Sheduler only works on times and not on anything else. If it could be linked to AmbientLight it would be useful in quite a few cases... controlling security lighting for example.

So, has anyone else done something like this that I can maybe adapt?

Thanks in advance,

NeoMorph
January 3rd, 2010, 04:40 PM
I think I have cobbled together something that will work but I got to wondering what AmbientLight is actually linked to... Is it linked to the SunriseSunset times and if so WHICH one... there are 6 times listed starting with Astronomical etc.

Oh yeah and I forgot to mention that the light command should only trigger once per change of light level. For example, when the light drops to "Little Dark" it turns the lights on and when the lights rise to little light they should turn off. That is one command sent for turn on and one command sent for turn off.

I've added an example gml of the hackup of my automated lighting... if anyone can do it more elegantly (or simpler) then I would be very thankful. There is a shedule that triggers event "DecideLights" every 10 minutes. If there is a change in the InsideLight level and the living room is in use (variable LRactive) it triggers another event named "SetLightLR" which triggers the either the Turn On or Turn Off commands.

Like I said... bit of a bodge but it works. I just wish I could think straight. I bet it could all be done in one script box but my brain just isn't working right these days. :(

Mike C
January 3rd, 2010, 08:15 PM
ambient light is linked to sunrinse/sunset and then can also be modified using other sensors or conditions.

ie if its cloudy you can change ambient light

you shoud see darker or lighter events to control events. are they not there?

NeoMorph
January 3rd, 2010, 11:37 PM
I've never seen it change if it was cloudy... One thing I did note though was that even when I changed the clock to see it work... and it didn't change at all.. so I am baffled as to where it is changed.

Mike C
January 5th, 2010, 07:19 PM
changing the clock won't do anything until there is a timed event.

the idea of ambient light is to allow setting light levels in an area independantly of other area. the light levels are linked to sun light. you can have other inputs change light levels in an area as needed.

replace this file in the luascript\classes dir. this should generate events that indicating if the light level is getting brighter or darker.

NeoMorph
January 8th, 2010, 06:06 PM
Cheers Mike... have installed that ambientlight.lua and will have a nose at the log tomorrow. Should show me how it's working.

I swear my brain is turning to swiss cheese... I've forgotten 90% of the lua I learned back in 08. :(

Like they say "If you don't use it, you lose it!"