Can't get garage light to turn off after doors closed


#1

1) Give a description of the problem
2nd if statement doesn’t work

2) What is the expected behaviour?
When any garage door opens AND the light is off, turn the light on. 1 minute after all the doors are closed, turn the light off

3) What is happening/not happening?
Light turns on as expected, but never turns off

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full
1/5/2020, 5:33:35 PM +995ms
+1ms ╔Received event [Garage Door Matt].contact = closed with a delay of 96ms
+89ms ║RunTime Analysis CS > 17ms > PS > 40ms > PE > 33ms > CE
+92ms ║Runtime (39603 bytes) successfully initialized in 40ms (v0.3.110.20191009) (89ms)
+92ms ║╔Execution stage started
+107ms ║║Comparison (enum) closed changes_to (string) open = false (1ms)
+108ms ║║Cancelling condition #8’s schedules…
+109ms ║║Condition #8 evaluated false (13ms)
+110ms ║║Cancelling condition #1’s schedules…
+111ms ║║Condition group #1 evaluated false (state changed) (15ms)
+112ms ║╚Execution stage complete. (20ms)
+113ms ╚Event processed successfully (113ms)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


Help with Garage Door Auto Close
#2

I only want this to fire when the garage light is off as the door opens so if I’m working in the garage and open a door, the lights don’t turn off on me


#3

Hi there @mpcluever
Change the second part (only when)
instead try this

IF any of the contact sensors changes to closed
AND
IF all contact sensors are closed
Then (TCP set to NEVER)
With 
Switch 4 
Wait 1 minute
Turn OFF

I normally test my suggestions and then post but I don’t have 3 contact sensors avail to test this…
But I’m pretty sure about it.


#4

It still doesn’t turn the light off

1/5/2020, 6:48:56 PM +376ms
+1ms ╔Received event [Garage Door Matt].contact = closed with a delay of 655ms
+75ms ║RunTime Analysis CS > 14ms > PS > 31ms > PE > 30ms > CE
+77ms ║Runtime (39716 bytes) successfully initialized in 31ms (v0.3.110.20191009) (76ms)
+78ms ║╔Execution stage started
+92ms ║║Comparison (enum) closed changes_to (string) open = false (0ms)
+94ms ║║Cancelling condition #8’s schedules…
+95ms ║║Condition #8 evaluated false (13ms)
+96ms ║║Cancelling condition #1’s schedules…
+97ms ║║Condition group #1 evaluated false (state changed) (15ms)
+99ms ║╚Execution stage complete. (21ms)
+100ms ╚Event processed successfully (100ms)


#5

almost there;=)
LINE #27 IF block is in your first IF block…
You need to seperate the as a SECOND (new) IF BLOCK

END your contact says CHANGES… it should be CHANGES TO CLOSED


#6

End you need to set your TCP to NEVER


#7

Getting closer. It turns the light off, but it ALWAYS turns the light off, even if the light was on as the door opens. I need it to stay on if the light is on as a door opens.


#8

Almost almost there:)))
Don’t use ELSE…

Just create a seperate IF block


#9

It still turns the light off even if the light is on as the door opens. I really appreciate the help!

The little programming I know makes me think there’s nothing in that 2nd IF to say the light was on at the start.


#10

1 - Do you close the door behind you after entering the room???
2 - Do you have any other automation that you forgot, dealing with this room’s light?


#11

No other automation for this light. I only want the light to turn off if it was already off as the door opened. If I’m in the garage working and a door opens, I don’t want the light turning off in the middle of me working on a project. I don’t understand the question about closing the door behind me.


#12

There is nothing in this piston makes lights go OFF, IF a door opens…
That’s what i’m trying to understand.

I can’t understand this so sorry…


#13

I want the lights to come on when I open the garage door in the morning before work and again as I come home and shut off a minute after the doors are all closed again. I DO NOT want the light to turn off if I’m working on something in the garage with the light on and I open and close a door. As I said, I only want the light to turn off IF IT WAS OFF WHEN THE DOOR OPENED. If the light is ON when the door opened, leave the light on.
I thought webcore would be able to do this, but it sounds like it’s not. It’s too complex for the Smartthings app. Thanks for your help!


#14

Ok I’m getting it better now… Thank you for the explanation.
You want 2 different scenarios (Behaviour) for the same setup.

That is doable, don’t loose your hope with Webcore yet:))) (maybe I was not the right person, but you’ll see tons of pros around here who can help you for sure) @WCmore, @guxdude, @Pantheon @orangebucket just few names off the top of my head and plus webcore minions)

Same setup changing a behaviour according to the real life situation requires a trigger. Your St system must have that to change what it’s supposed to do.

Here is an example from my house: (i’m giving you an example so that hopefully you’ll stick around with WebCore)

My whole house changes behaviour without me doing anything by using
a) time as a trigger
b) Motion detectors as a trigger
c) Open close sensors as a trigger
d) Simulated switches as a trigger
e) Alexa as a trigger
f) Presence sensors as a trigger

  • If I walk in the house between 4.00am and 7.00am the lights are dimmed to 10%, So nobody wakes up.
    (time is the trigger)
    But same lights are 100% after 6.00pm (Again time is the trigger)

  • Our bedroom uses motion sensors as a trigger.
    If walk in lights ON, IF no motion lights OFF
    this works great BUT if you just stay in bed to watch something, this setup must change because light on and off constantly is annoying.
    So we use Alexa as a trigger “Alexa bedroom lights ON” that triggers a simulated switch which changes a variable in Webcore and motion sensors are by passed.

  • The garage is our office.
    If i leave the house and forget to turn off the lights, computers etc in the garage, webcore checks my presence sensor, if i’m away turns off everything BUT if my wife is still in the office there must be a motion. So, if I leave but still motion in the garage, I get a text message asking if the office should be OFF or not. etc. Here presence sensor and motion sensors combined as a trigger.

Buttom line, you do have a solution. Just a trigger and some variables you’ll be good to go.


#15

Ill do some more fiddling with it. This is my first script in webcore and you’ve already helped a ton.


#16

Give this a try… I only tested it a couple of times. It might take a cycle or two to populate the variable correctly. Or you can manually edit it to false to start with.


#17

GREAT SUCCESS!! This seems to be doing what I need! Thanks again for the nudge in the right direction.


#18

I guess one question, the piston above uses a global Boolean variable set to False. I can’t seem to get the 2nd half to work turning the light off assigning the variable in the piston itself. Not a big deal, just curious why? I wouldn’t think it would need a global variable.


#19

Got it. I didn’t change my variable calls to NOT be looking for a global variable that no longer existed. I think this version is exactly what I needed.