Jump to content

Automatic Lightning System for HC3 (Motion/Average Lux)


Recommended Posts

22 hours ago, 10der said:

@10der another fix 

v1.2.090920.3

 

so, now you can use (or not use) 5 params in color.

r, g, b, w

or 

r, g, b, w, brightness 

 

level = "0,255,0,0,10",

 

 

MotionL.LUA 24.86 kB · 2 downloads

@chiel-s

 

Unfortunately not working. When i set the brightness of a hue light to 10% in the user interface of Homecenter and after that run your script, it resets back to 99% brigthness. Using the following code:

 

lighting = lighting or {

    Keuken = {
    name = "Keuken",
    sensors = {67,72,36,"statusTVPhilips"},
    minLux = 400,
    luxs = {69,38},
    powers = {31,32,27,26,29,28,23},
    timeout = 5,
    times = { 
        -- Normal light over day (like 2700k)
        ["06:00..02:00"] = 
        {
        	level = "250,202,8,0,150",
        },
        -- Dim light at night and make it orange
        ["02:00..06:00"] = 
        {
        	level = "255,128,0,0,20",
        }
  	 }
	}

}

 

Also good to know: the order of actions can have impact. Normally I turn the Hue light on and then set the brightness and colour. The other way around can be buggy. But colour seems to be working stable now in your script.

  • Thanks 1
Link to post
Share on other sites
  • Replies 54
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

See example below. I use global variable for my TV and my Sonos in the kitchen. Make sure to use 0 (off) and 1 (on) as value for the gobal variables.   Keuken = { name = "Keuken", sen

Hi,   I want to share my automatic lightning system with the community. It controls my lights in a room based on motion sensors and average lux in the room. It’s build for HC3.   G

Thanks!! What a great script  It is working! Now I get it, you can combine the TV as a "motion sensor" in the room configuraton. Brilliant.   Keuken = { name = "Keuken", sensors = {67

Posted Images

On 9/10/2020 at 1:58 PM, chiel-s said:

 

Unfortunately not working. When i set the brightness of a hue light to 10% in the user interface of Homecenter and after that run your script, it resets back to 99% brigthness. Using the following code:

 

lighting = lighting or {

    Keuken = {
    name = "Keuken",
    sensors = {67,72,36,"statusTVPhilips"},
    minLux = 400,
    luxs = {69,38},
    powers = {31,32,27,26,29,28,23},
    timeout = 5,
    times = { 
        -- Normal light over day (like 2700k)
        ["06:00..02:00"] = 
        {
        	level = "250,202,8,0,150",
        },
        -- Dim light at night and make it orange
        ["02:00..06:00"] = 
        {
        	level = "255,128,0,0,20",
        }
  	 }
	}

}

 

Also good to know: the order of actions can have impact. Normally I turn the Hue light on and then set the brightness and colour. The other way around can be buggy. But colour seems to be working stable now in your script.

 

@10der,

When i remove the level settings, the lights do not react. When i set level = 20 (integer), lights do not react.

They only react when I set for i.e. level = "250,202,8,0,150", but the brightness is always 99% for all hue lights in the room.

 

Hope this helps.

 

Cheers,

Chiel

 

 

 

 

Edited by chiel-s
Link to post
Share on other sites

@chiel-s ask autgor of HUE to fix own QA.

I do not want dancing around ugly QA.

with my REAL color conroller (Fibaro LEd strip) works like a charm

with my QA with type "color conroller" work like a charm.

idk what happened with HUE QA

 

sorry

Link to post
Share on other sites
  • 4 weeks later...

Really nice QA.. Is it possible to use Profile and GlobalVariable as part of the dependencies also?

Link to post
Share on other sites
17 minutes ago, Ace02 said:

Really nice QA.. Is it possible to use Profile and GlobalVariable as part of the dependencies also?

Yes you can 

just provide global name instead of I’d 

Link to post
Share on other sites
3 minutes ago, 10der said:

Yes you can 

just provide global name instead of I’d 

Arh, this is perfect.. like

sensors = {194199, SleepState=Awake, Profile=1 }..
 
I have an outside light which has no Sensor or anything.. How do I get this to only turn on and off at specific times (sunset..23:55) and (04:30..Sunrise)?
I have tried not entering sensors, but the scene the only turns the light off..
Link to post
Share on other sites

@Ace02 ahh stop! i am wrong!

you are asking about profile.

no.

this feature now in development

 

image.png.cebc8fd12db77f48d21f9dbb9f05e228.png

Link to post
Share on other sites

Okay, no profile yet.. :-) But I can use the GlobalVariable?

 

i tried this for my outside light, but does not seem to work:

Udelys = {
       name = "Udelys",
        sensors = {},
        luxs = {},
        minLux = 99999,
        powers = {175},
        level = 25,
        times = {
        ["$Sunset..23:55"] = { level=25 },
        ["04:30..$Sunrise"] = { level=25 }
        }
    },
What am i doing wrong with this one.. It only turns my light of.
Link to post
Share on other sites

I

 

 

not

 

know

 

 

what

 

 

you

 

want

 

 

s

o

r

r

y

 

Link to post
Share on other sites

I don't know why my post looks like this.. 😕

I'm trying to accomplice two things.

1. to use globalvariable and profile in your QA - Profile not possible at the moment OK.. Is the globalvariable put in like this: Sensor=( 192, globalvarible=value )??

2. I want my outside light to only react on time.. I have tried removing all sensors from the scene like in above post, leaving only Powers and Time variables.. But it does not seem to work that way.. How can i do this in order for it to work?

  • Thanks 1
Link to post
Share on other sites

well.

here is source with profile.

 

you can use profile in times 

how to set profile?

it's not teh same profile what fibaro use

just call 

fibaro.call(QAid, "setProfile", "MyTestProfile")

from scene for example

or clear

fibaro.call(QAid, "setProfile", "")

 

about using global var for turing on of

 

lighting = {
     Test = {
         name = "Test",
         debugMode = true,
         sensors = {'Test'},
         luxs = {},
         powers = {989},
         timeout = 60 * 1
    },
 

 

 

image.thumb.png.07ee620a43702a31b21d66eb03165410.png

 

 

21:32 | October 06, 2020 loaded 1 lighting rules
21:32 | October 06, 2020 started...

 

image.thumb.png.2e2a25f3eb5378df75dbeafe47373038.png

 

21:33 | October 06, 2020 Test Sensor breached
21:33 | October 06, 2020 Test [on : 99]
QA

QA-motion-lights.LUA

Link to post
Share on other sites

Thanks so much.. I will try my luck with this.. looks really promissing.. :-)

Link to post
Share on other sites
1 hour ago, Ace02 said:

Okay, no profile yet.. :-) But I can use the GlobalVariable?

 

i tried this for my outside light, but does not seem to work:

Udelys = {
       name = "Udelys",
        sensors = {},
        luxs = {},
        minLux = 99999,
        powers = {175},
        level = 25,
        times = {
        ["$Sunset..23:55"] = { level=25 },
        ["04:30..$Sunrise"] = { level=25 }
        }
    },
What am i doing wrong with this one.. It only turns my light of.

 

 

See example below. I use global variable for my TV and my Sonos in the kitchen. Make sure to use 0 (off) and 1 (on) as value for the gobal variables.

 

Keuken = {
    name = "Keuken",
    sensors = {67,72,36,"statusTVPhilips","statusSonosKeuken"},
    minLux = 100,
    luxs = {69,38},
    powers = {31,32,27,26,29,28,23},
    times = { 
       
        ["06:00..20:00"] = 
        {
        	 -- Normal light over day (like 2700k)
        	level = "250,202,8,0,150",
        	-- Timeout of 5 minutes
        	timeout = 60 * 5,        	
        },
        
        ["20:00..00:00"] = 
        {
        	 -- Normal light over day (like 2700k)
        	level = "250,202,8,0,150",
        	-- Timeout of 20 minutes
        	timeout = 60 * 20,
        },
        
        ["00:00..02:00"] = 
        {
        	 -- Normal light over day (like 2700k)
        	level = "250,202,8,0,150",
        	-- Timeout of 5 minutes
        	timeout = 60 * 5,
        },

        -- Dim light at night and make it orange
        ["02:00..06:00"] = 
        {
        	level = "255,128,0,0,20",
        	-- Timeout of 1 minute
        	timeout = 60 * 1,
        },
           
  	 }
},

 

 

  • Thanks 2
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...