[OBSOLETE] Lighting Director

UPDATE: Version 1.2 released!

Hey guys and gals!!

I have made some huge improvements to the “Light Follows Me App”. Basically I have created one app that can house 4 “scenes”. This is really cool because I hate having so many apps that I can’t find the one I want so this takes all of my lighting rules and moves it into one app.

Each scene is independent of each other and can be triggered my motion. Each scene can be restriceted to run only when a certain lux value is below a customizable level. Then you can have that trigger turn on lights and even dim them to a certain level if you want. After motion stops you can choose to turn the scene off as well.

See the code below :smile:


9 Likes

I would love to give this a shot! i have motion sensors in each room with lights that I would love to come on at certain times!

1 Like

Love to try but I also use a LUX reading to control 2 zones; bright day and the living room or the kitchen don’t trigger. When you get that extra input I’ll jump in and try.

1 Like

Bumping so interested parties see my update at the top :smile:

I got around to implementing this today and I’m having no success with the LUX level being recognized. It’s 1000+ outside, I have it set to 400 and the lights come on. No matter what value I use the lights always come on. Went back to my Smart Nightlight code and the lights now stay off unless the LUX drops.
Ideas?

Logs please.

Without logs it’s really hard to help. I use this daily and it works fine for me.

Awesome! I’ll definitely try it out IF I can ever reconnect my Hues.

1 Like

Fair comment :slight_smile: Here’s the log from today, LUX is at 1000 when I tried this again.
There is probably a better method to upload a log file than to put it in a reply.

adff6e86-daa3-4646-97f4-4f0f9bc40f08 ‎10‎:‎26‎:‎51‎ ‎AM: debug Parse returned [Washer Multi was closed, Washer Multi was inactive, Washer Multi was 14°C, Washer Multi Battery was 50%, Washer Multi was -66 dBm, Washer Multi Signal (LQI) was: 100%]

21fb8883-59ba-4c66-b102-e7a6400096a9 ‎10‎:‎26‎:‎35‎ ‎AM: trace getPhrases(), state.welcomeIssue = null

655e252c-ffa2-4882-bf48-46066fca6de6 ‎10‎:‎26‎:‎31‎ ‎AM: trace read attr - raw: 5210010008080000204D, dni: 5210, endpoint: 01, cluster: 0008, size: 08, attrId: 0000, encoding: 20, value: 4d

5b131275-59b4-4c28-bbb5-801e70971440 ‎10‎:‎26‎:‎30‎ ‎AM: trace read attr - raw: 062E010008080000204D, dni: 062E, endpoint: 01, cluster: 0008, size: 08, attrId: 0000, encoding: 20, value: 4d

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace Getting solution event data for switchState:on

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: debug EVENT: Living Room VDB is on

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace setSolutionEvent()

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: info SUMMARY EVENT data: [[icon:indicator-dot-orange, iconColor:#49a201, default:true, value:Some lights are on]]

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace state data of Lights & Switches: {“devices”:[{“id”:“e2e46380-7442-4677-a067-91e1990030d8”,“value”:“on”}],“name”:“on”,“value”:“on”,“backgroundColor”:"#79b821",“icon”:“st.Lighting.light13-icn”,“unixTime”:1426438238911}

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace states of Lights & Switches: [state: on]

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace state data of Lights & Switches: {“devices”:[{“id”:“29e9f3c1-edba-4693-8ce0-b3cfc53c2b4a”,“value”:“off”}],“name”:“off”,“value”:“off”,“backgroundColor”:"#e8e9eb",“icon”:“st.Lighting.light10-icn”,“unixTime”:1426433642642}

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace states of Lights & Switches: [state: off]

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace state data of Lights & Switches: {“devices”:[{“id”:“8db44f83-2cfa-4bdd-af58-03bb633a1851”,“value”:“off”}],“name”:“off”,“value”:“off”,“backgroundColor”:"#e8e9eb",“icon”:“st.Lighting.light10-icn”,“unixTime”:1426433731439}

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace states of Lights & Switches: [state: off]

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace state data of Lights & Switches: {“devices”:[{“id”:“67c1580a-d8b9-4983-b0e5-f80e83b4037e”,“value”:“off”}],“name”:“off”,“value”:“off”,“backgroundColor”:"#e8e9eb",“icon”:“st.Lighting.light13-icn”,“unixTime”:1416972502685}

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace state data of Lights & Switches: {“devices”:[{“id”:“67c1580a-d8b9-4983-b0e5-f80e83b4037e”,“value”:“off”}],“name”:“off”,“value”:“off”,“backgroundColor”:"#e8e9eb",“icon”:“st.Lighting.light13-icn”,“unixTime”:1426433135519}

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace states of Lights & Switches: [state: off, summary: off]

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace state data of Lights & Switches: {“devices”:[{“id”:“8c0aebd5-c8fd-4290-a711-98ce3d78cffb”,“value”:“on”},{“id”:“8b5ad5e4-279a-4c64-8d73-01e79c410e08”,“value”:“off”}],“name”:“on”,“value”:“1 on 1 off”,“backgroundColor”:"#79b821",“icon”:“st.Lighting.light11”,“unixTime”:1426440386309}

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace states of Lights & Switches: [state: 1 on 1 off]

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace state data of Lights & Switches: {“devices”:[{“id”:“d3bcd501-7ca9-4f7f-99cd-d2b0c5b11127”,“value”:“off”}],“name”:“off”,“value”:“off”,“backgroundColor”:"#e8e9eb",“icon”:“st.Lighting.light10-icn”,“unixTime”:1426440192311}

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace states of Lights & Switches: [state: off]

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace state data of Lights & Switches: {“devices”:[{“id”:“60a9a142-306d-49f3-b6db-2d616055a521”,“value”:“off”}],“name”:“off”,“value”:“off”,“backgroundColor”:"#e8e9eb",“icon”:“st.Outdoor.outdoor15-icn”,“unixTime”:1426202065872}

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace states of Lights & Switches: [state: off]

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace state data of Lights & Switches: {“devices”:[{“id”:“54f9b14c-4fcc-4a9c-89a4-446f2b0fa623”,“value”:“off”}],“name”:“off”,“value”:“off”,“backgroundColor”:"#e8e9eb",“icon”:“st.Bath.bath20-icn”,“unixTime”:1416978121836}

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace state data of Lights & Switches: {“devices”:[{“id”:“54f9b14c-4fcc-4a9c-89a4-446f2b0fa623”,“value”:“off”}],“name”:“off”,“value”:“off”,“backgroundColor”:"#e8e9eb",“icon”:“st.Bath.bath20-icn”,“unixTime”:1426440198568}

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace states of Lights & Switches: [state: off, summary: off]

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace state data of Lights & Switches: {“devices”:[{“id”:“878d2e15-9606-4b58-8390-4534b5a7a703”,“value”:“off”}],“name”:“off”,“value”:“off”,“backgroundColor”:"#e8e9eb",“icon”:“st.Appliances.appliances17”,“unixTime”:1416969952709}

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace state data of Lights & Switches: {“devices”:[{“id”:“878d2e15-9606-4b58-8390-4534b5a7a703”,“value”:“off”}],“name”:“off”,“value”:“off”,“backgroundColor”:"#e8e9eb",“icon”:“st.Appliances.appliances17”,“unixTime”:1426433675623}

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace states of Lights & Switches: [state: off, summary: off]

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace state data of Lights & Switches: {“devices”:[{“id”:“b814b16b-bf45-436f-8cd6-d97d3ea294f0”,“value”:“off”}],“name”:“off”,“value”:“off”,“backgroundColor”:"#e8e9eb",“icon”:“st.Lighting.light13-icn”,“unixTime”:1426433642323}

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace states of Lights & Switches: [state: off]

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace state data of Lights & Switches: {“devices”:[{“id”:“8a6d826f-fc1e-49e7-9c74-6cabf9f7f197”,“value”:“off”}],“name”:“off”,“value”:“off”,“backgroundColor”:"#e8e9eb",“icon”:“st.Lighting.light10-icn”,“unixTime”:1426440307386}

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace states of Lights & Switches: [state: off]

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace state data of Lights & Switches: {“devices”:[{“id”:“ea90845c-dc65-4a05-ab82-a99635008ef6”,“value”:“off”}],“name”:“off”,“value”:“off”,“backgroundColor”:"#e8e9eb",“icon”:“st.Electronics.electronics13-icn”,“unixTime”:1426313514911}

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace states of Lights & Switches: [state: off]

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace state data of Lights & Switches: {“devices”:[{“id”:“fc3af9c0-afb3-4ee5-91c5-052fc12112cd”,“value”:“off”}],“name”:“off”,“value”:“off”,“backgroundColor”:"#e8e9eb",“icon”:“st.Lighting.light13-icn”,“unixTime”:1423418766923}

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace states of Lights & Switches: [state: off]

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace state data of Lights & Switches: {“devices”:[{“id”:“be056d81-6ecd-4e2e-8f0a-5f6727596269”,“value”:“off”}],“name”:“off”,“value”:“off”,“backgroundColor”:"#e8e9eb",“icon”:“st.Lighting.light10”,“unixTime”:1416968514717}

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace state data of Lights & Switches: {“devices”:[{“id”:“be056d81-6ecd-4e2e-8f0a-5f6727596269”,“value”:“off”}],“name”:“off”,“value”:“off”,“backgroundColor”:"#e8e9eb",“icon”:“st.Lighting.light10”,“unixTime”:1426434623455}

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace states of Lights & Switches: [state: off, summary: off]

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: debug STATE EVENT: Living Room VDB is 1 on 1 off, data:[devices:[[id:8c0aebd5-c8fd-4290-a711-98ce3d78cffb, value:on], [id:8b5ad5e4-279a-4c64-8d73-01e79c410e08, value:off]], name:on, value:1 on 1 off, backgroundColor:#79b821, icon:st.Lighting.light11, unixTime:1426440386309]

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: trace getSolutionStateData()

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: debug setSolutionState()

3f826cc7-6a48-4eb3-9a86-29e5771a414e ‎10‎:‎26‎:‎26‎ ‎AM: debug switchHandler(Living Room VDimmer, switch:on)

655e252c-ffa2-4882-bf48-46066fca6de6 ‎10‎:‎26‎:‎27‎ ‎AM: debug LR Left Light switch is on

655e252c-ffa2-4882-bf48-46066fca6de6 ‎10‎:‎26‎:‎27‎ ‎AM: trace catchall: 0104 0006 01 01 0000 00 5210 00 00 0000 0B 01 0100

dcb07fa3-cc75-4bac-a3f5-1fff29760f80 ‎10‎:‎26‎:‎27‎ ‎AM: debug event happened zw device: 0C, command: 4203, payload: 00

655e252c-ffa2-4882-bf48-46066fca6de6 ‎10‎:‎26‎:‎27‎ ‎AM: debug On command was sent maybe from manually turning on? : Parse returned LR Left Light switch is on

655e252c-ffa2-4882-bf48-46066fca6de6 ‎10‎:‎26‎:‎27‎ ‎AM: debug The bulb was sent a command to do something just now…

655e252c-ffa2-4882-bf48-46066fca6de6 ‎10‎:‎26‎:‎27‎ ‎AM: trace on/off: 1

655e252c-ffa2-4882-bf48-46066fca6de6 ‎10‎:‎26‎:‎27‎ ‎AM: trace read attr - raw: 52100100080800002000, dni: 5210, endpoint: 01, cluster: 0008, size: 08, attrId: 0000, encoding: 20, value: 00

5b131275-59b4-4c28-bbb5-801e70971440 ‎10‎:‎26‎:‎26‎ ‎AM: debug LR Right Light switch is on

5b131275-59b4-4c28-bbb5-801e70971440 ‎10‎:‎26‎:‎26‎ ‎AM: trace catchall: 0104 0006 01 01 0000 00 062E 00 00 0000 0B 01 0100

91c5bd94-a6f4-47fe-9ddc-94adf90af2d6 ‎10‎:‎26‎:‎26‎ ‎AM: trace Deleting scheduled job ‘delayTurnOffA’ for InstalledSmartApp: 91c5bd94-a6f4-47fe-9ddc-94adf90af2d6

91c5bd94-a6f4-47fe-9ddc-94adf90af2d6 ‎10‎:‎26‎:‎25‎ ‎AM: debug Motion Detected Running ‘Living Room’

5b131275-59b4-4c28-bbb5-801e70971440 ‎10‎:‎26‎:‎26‎ ‎AM: debug On command was sent maybe from manually turning on? : Parse returned LR Right Light switch is on

5b131275-59b4-4c28-bbb5-801e70971440 ‎10‎:‎26‎:‎26‎ ‎AM: debug The bulb was sent a command to do something just now…

5b131275-59b4-4c28-bbb5-801e70971440 ‎10‎:‎26‎:‎26‎ ‎AM: trace on/off: 1

5b131275-59b4-4c28-bbb5-801e70971440 ‎10‎:‎26‎:‎26‎ ‎AM: trace read attr - raw: 062E0100080800002000, dni: 062E, endpoint: 01, cluster: 0008, size: 08, attrId: 0000, encoding: 20, value: 00

dcb07fa3-cc75-4bac-a3f5-1fff29760f80 ‎10‎:‎26‎:‎26‎ ‎AM: debug event happened

5682a459-b786-46aa-b252-d1afe72a0ad5 ‎10‎:‎26‎:‎26‎ ‎AM: info switchOnHandler Event: on

dcb07fa3-cc75-4bac-a3f5-1fff29760f80 ‎10‎:‎26‎:‎26‎ ‎AM: debug event happened

dcb07fa3-cc75-4bac-a3f5-1fff29760f80 ‎10‎:‎26‎:‎26‎ ‎AM: debug event happened

7ab61593-4ae8-4b9f-8a9d-5b1a72305354 ‎10‎:‎26‎:‎26‎ ‎AM: debug event happened

59f16131-8051-4b6c-b9a2-690b2fc1ca92 ‎10‎:‎26‎:‎26‎ ‎AM: debug Parse returned [[value:idle, name:thermostatOperatingState, isStateChange:true, displayed:true, linkText:Thermostat, descriptionText:Thermostat thermostat operating state is idle]]

8c0aebd5-c8fd-4290-a711-98ce3d78cffb ‎10‎:‎26‎:‎26‎ ‎AM: info on

8c0aebd5-c8fd-4290-a711-98ce3d78cffb ‎10‎:‎26‎:‎26‎ ‎AM: info on

8c0aebd5-c8fd-4290-a711-98ce3d78cffb ‎10‎:‎26‎:‎26‎ ‎AM: info Step Size: 5

8c0aebd5-c8fd-4290-a711-98ce3d78cffb ‎10‎:‎26‎:‎26‎ ‎AM: info setLevel 30

66880af8-34ed-4e44-9097-2a8f63741c79 ‎10‎:‎26‎:‎24‎ ‎AM: debug Motion active

f34237f4-b4ff-49fc-9577-f157a45d0db5 ‎10‎:‎26‎:‎24‎ ‎AM: trace motionHandler, anyOff: Living Room VDimmer

f34237f4-b4ff-49fc-9577-f157a45d0db5 ‎10‎:‎26‎:‎24‎ ‎AM: trace motionHandler, othersActive: false

f34237f4-b4ff-49fc-9577-f157a45d0db5 ‎10‎:‎26‎:‎24‎ ‎AM: trace motionHandler(motion: active) turnOffAfter: 5 min

dcb07fa3-cc75-4bac-a3f5-1fff29760f80 ‎10‎:‎26‎:‎24‎ ‎AM: debug event happened zone status 0x0031 – extended status 0x00

7ab61593-4ae8-4b9f-8a9d-5b1a72305354 ‎10‎:‎26‎:‎24‎ ‎AM: debug event happened zone status 0x0031 – extended status 0x00

c71d4598-4157-4ea0-aebc-d21afea5c414 ‎10‎:‎26‎:‎24‎ ‎AM: debug Parse returned Living Room Motion detected motion

10:26:45 AM: info Waiting on events…

10:26:45 AM: info For past logs for individual things go to the My Devices section, find the device and click on the Events link on the device information page.

10:26:45 AM: info This console provides live logging of your SmartThings.

Alright guys!

I am in the process of completely re-writing this. I am going to have dynamic pages so essentially you could add an unlimited amount of scenes.

This might take a little bit but… i want to have a rough beta version out by the weekend.

Wish me luck :wink:

Just ordered my Fibaro motion sensors and looking forward to the new app once I get then setup.

@Mike_Maxwell just came out with an awesome App/Virtual Device Combo. Basically what i was triyng to do with this app but IMO much better lol. Check it out guys!!!

2 Likes

Updated to verion 1.0

Lux issue fixed. Give it whirl!

Would go great in tandem with @Mike_Maxwell’s “YASA”

@tslagle13 Hi Tim, I have a sensor that is set to turn on if the lux is below 100. But the lux is at 110 and it keeps turning on. I tried to move the lux on threshold to 200 and 300 with the same results. I am using the Fibaro Motion Sensor. Any suggestions on how to fix? Thanks!

Did you update the code and publish it?

Yes sir. I am testing right now with the native ST apps to try an determine if it is me. I will post an update shortly. Thanks for the awesome app.

I am going to say right now this might be me. I say this because my polling of the lux value seems very long. Can anyone recommend an advance device setting for the lux polling rate for the Fibaro Motion Sensor? Thanks

Something was wrong…

Not sure what. I think the cloud is getting in the way of efficient code processing right now.

So i re worked the code a little… lets hope this does the trick. Updated to 1.1

Another update. Renamed it too. This app is giving me tons of trouble. But im determined to make it work!!! lol

Keep finding these little issues. But i think its pretty close now.

My question to you guys, is what, if anything, would you like to see added or tweaked?

Tim. I noticed something tonight where the lux sensors were toggle between slots 1 and 5(I think 5). For example if in Slot 1 I had the lux set to family motion and then went into slot five the family motion lux sensor would be set. If I changed the lux sensor in slot 5 from family room motion to entryway motion then slot 1 was set entryway motion for a lux sensor.

Yep, you sure are correct about that!

Fixed.

Thanks for your patience guys!