Turn on lights when door opens


#1

1) Give a description of the problem
I want my lights to turn on for 15 minutes when my door opens but it always fails

2) What is the expected behaviour?
1.Turn garden lights on from sunset till 00:00
2. turn off garden lights after 00:00
3. turn on garden lights when door opens from 00:00 till sunrise
4. turn lights back off after 15 minuts
5. after sunrise do nothing with the lights when door opens

3) What is happening/not happening?
lights do not turn on at sunset, do not turn off at 00:00

**4) Post a Green Snapshot of the piston![image|45x37]

5) Attach logs after turning logging level to Full
28-6-2020 00:52:08 +635ms
+0ms ╔Received event [Seppe & Jaimy’s Home].test = 1593298328632 with a delay of 2ms
+72ms â•‘RunTime Analysis CS > 20ms > PS > 21ms > PE > 31ms > CE
+75ms â•‘Runtime (38296 bytes) successfully initialized in 21ms (v0.3.10f.20190822) (73ms)
+76ms â•‘â•”Execution stage started
+115ms ║║Comparison (time) 3128717 is_between (time) 0 … (datetime) 1593315360000 = true (9ms)
+116ms â•‘â•‘Time restriction check passed
+118ms ║║Cancelling condition #2’s schedules…
+119ms â•‘â•‘Condition #2 evaluated true (38ms)
+127ms â•‘â•‘Condition #3 evaluated false (7ms)
+128ms â•‘â•‘Condition group #1 evaluated false (state did not change) (47ms)
+144ms ║║Comparison (time) 3128767 is_between (datetime) 1593374700000 … (time) 86340000 = false (8ms)
+146ms ║║Cancelling condition #9’s schedules…
+147ms â•‘â•‘Condition #9 evaluated false (15ms)
+148ms ║║Cancelling condition #8’s schedules…
+149ms â•‘â•‘Condition group #8 evaluated false (state changed) (17ms)
+159ms â•‘â•‘Comparison (time) 3128785 is_after (datetime) 1593315360000 = false (5ms)
+160ms ║║Cancelling condition #15’s schedules…
+161ms â•‘â•‘Condition #15 evaluated false (11ms)
+163ms ║║Cancelling condition #14’s schedules…
+164ms â•‘â•‘Condition group #14 evaluated false (state changed) (13ms)
+166ms â•‘â•šExecution stage complete. (91ms)
+168ms â•šEvent processed successfully (168ms)
27-6-2020 23:20:48 +437ms
+1ms ╔Received event [Seppe & Jaimy’s Home].test = 1593292848434 with a delay of 2ms
+92ms â•‘Runtime (38215 bytes) successfully initialized in 24ms (v0.3.10f.20190822) (89ms)
+93ms â•‘â•”Execution stage started
+173ms â•‘â•‘Executed [Tuinlampen].on (4ms)
+184ms â•‘â•šExecution stage complete. (91ms)
+186ms â•šEvent processed successfully (186ms)
27-6-2020 23:13:11 +218ms
+0ms â•”Received event [Achterdeur].contact = closed with a delay of 71ms
+52ms â•‘Runtime (38202 bytes) successfully initialized in 15ms (v0.3.10f.20190822) (51ms)
+53ms â•‘â•”Execution stage started
+106ms â•‘â•‘Executed [Tuinlampen].on (3ms)
+109ms â•‘â•šExecution stage complete. (55ms)
+110ms â•šEvent processed successfully (110ms)
27-6-2020 23:13:07 +489ms
+0ms â•”Received event [Achterdeur].contact = open with a delay of 86ms
+53ms â•‘Runtime (38200 bytes) successfully initialized in 16ms (v0.3.10f.20190822) (51ms)
+54ms â•‘â•”Execution stage started
+102ms â•‘â•‘Executed [Tuinlampen].on (3ms)
+104ms â•‘â•šExecution stage complete. (51ms)
+105ms â•šEvent processed successfully (105ms)
27-6-2020 23:08:42 +210ms
+1ms â•”Received event [Achterdeur].contact = closed with a delay of 81ms
+62ms â•‘Runtime (38202 bytes) successfully initialized in 20ms (v0.3.10f.20190822) (61ms)
+63ms â•‘â•”Execution stage started
+119ms â•‘â•‘Executed [Tuinlampen].on (3ms)
+122ms â•‘â•šExecution stage complete. (59ms)
+123ms â•šEvent processed successfully (123ms)
27-6-2020 23:08:40 +166ms
+1ms â•”Received event [Achterdeur].contact = open with a delay of 82ms
+61ms â•‘Runtime (38200 bytes) successfully initialized in 16ms (v0.3.10f.20190822) (58ms)
+62ms â•‘â•”Execution stage started
+121ms â•‘â•‘Executed [Tuinlampen].on (4ms)
+124ms â•‘â•šExecution stage complete. (62ms)
+125ms â•šEvent processed successfully (125ms)
27-6-2020 23:06:13 +382ms
+1ms â•”Received event [Achterdeur].contact = closed with a delay of 73ms
+50ms â•‘Runtime (38202 bytes) successfully initialized in 15ms (v0.3.10f.20190822) (48ms)
+51ms â•‘â•”Execution stage started
+215ms â•‘â•‘Executed [Tuinlampen].on (116ms)
+218ms â•‘â•šExecution stage complete. (167ms)
+219ms â•šEvent processed successfully (219ms)
27-6-2020 23:06:11 +202ms
+1ms â•”Received event [Achterdeur].contact = open with a delay of 86ms
+58ms â•‘Runtime (38200 bytes) successfully initialized in 20ms (v0.3.10f.20190822) (56ms)
+59ms â•‘â•”Execution stage started
+112ms â•‘â•‘Executed [Tuinlampen].on (3ms)
+114ms â•‘â•šExecution stage complete. (55ms)
+115ms â•šEvent processed successfully (115ms)
27-6-2020 23:04:35 +997ms
+1ms â•”Received event [Achterdeur].contact = closed with a delay of 87ms
+54ms â•‘Runtime (38202 bytes) successfully initialized in 16ms (v0.3.10f.20190822) (52ms)
+55ms â•‘â•”Execution stage started
+105ms â•‘â•‘Executed [Tuinlampen].on (4ms)
+108ms â•‘â•šExecution stage complete. (52ms)
+109ms â•šEvent processed successfully (109ms)
27-6-2020 23:04:28 +709ms
+1ms â•”Received event [Achterdeur].contact = open with a delay of 98ms
+50ms â•‘Runtime (38200 bytes) successfully initialized in 15ms (v0.3.10f.20190822) (48ms)
+51ms â•‘â•”Execution stage started
+116ms â•‘â•‘Executed [Tuinlampen].on (3ms)
+118ms â•‘â•šExecution stage complete. (67ms)
+119ms â•šEvent processed successfully (119ms)
27-6-2020 23:02:48 +897ms
+1ms â•”Received event [Achterdeur].contact = closed with a delay of 78ms
+61ms â•‘Runtime (38202 bytes) successfully initialized in 23ms (v0.3.10f.20190822) (59ms)
+62ms â•‘â•”Execution stage started
+115ms â•‘â•‘Executed [Tuinlampen].on (3ms)
+117ms â•‘â•šExecution stage complete. (55ms)
+118ms â•šEvent processed successfully (118ms)
27-6-2020 23:02:47 +689ms
+1ms â•”Received event [Achterdeur].contact = open with a delay of 84ms
+61ms â•‘Runtime (38200 bytes) successfully initialized in 21ms (v0.3.10f.20190822) (59ms)
+62ms â•‘â•”Execution stage started
+118ms â•‘â•‘Executed [Tuinlampen].on (4ms)
+120ms â•‘â•šExecution stage complete. (58ms)
+121ms â•šEvent processed successfully (121ms)
27-6-2020 23:02:47 +277ms
+1ms â•”Received event [Achterdeur].contact = closed with a delay of 72ms
+59ms â•‘Runtime (38202 bytes) successfully initialized in 20ms (v0.3.10f.20190822) (57ms)
+60ms â•‘â•”Execution stage started
+116ms â•‘â•‘Executed [Tuinlampen].on (3ms)
+118ms â•‘â•šExecution stage complete. (58ms)
+120ms â•šEvent processed successfully (120ms)
27-6-2020 23:02:33 +907ms
+1ms â•”Received event [Achterdeur].contact = open with a delay of 92ms
+50ms â•‘Runtime (38200 bytes) successfully initialized in 16ms (v0.3.10f.20190822) (48ms)
+51ms â•‘â•”Execution stage started
+101ms â•‘â•‘Executed [Tuinlampen].on (5ms)
+103ms â•‘â•šExecution stage complete. (52ms)
+104ms â•šEvent processed successfully (104ms)
27-6-2020 23:02:33 +373ms
+1ms â•”Received event [Achterdeur].contact = closed with a delay of 81ms
+59ms â•‘Runtime (38202 bytes) successfully initialized in 21ms (v0.3.10f.20190822) (57ms)
+60ms â•‘â•”Execution stage started
+109ms â•‘â•‘Executed [Tuinlampen].on (4ms)
+111ms â•‘â•šExecution stage complete. (52ms)
+112ms â•šEvent processed successfully (112ms)
27-6-2020 23:02:20 +508ms
+1ms â•”Received event [Achterdeur].contact = open with a delay of 115ms
+46ms â•‘Runtime (38206 bytes) successfully initialized in 16ms (v0.3.10f.20190822) (45ms)
+48ms â•‘â•”Execution stage started
+98ms â•‘â•‘Executed [Tuinlampen].on (3ms)
+100ms â•‘â•šExecution stage complete. (53ms)
+102ms â•šEvent processed successfully (101ms)


#2

It sounds like you want to cover both scenarios…

I’d probably start with something like this:

IF Sensor's contact changes to open
Then
    IF Time is between 12am and Sunrise
    Then with Light (TCP set to Never)
        Turn on 
        Wait 15 minutes
        Turn off
    END IF
END IF

Every day at Sunset
    Turn on light
END EVERY

Every day at 12am
    Turn off light
END EVERY

Every day at Sunrise
    Turn off light
END EVERY

Side Note:

I would recommend using the Preset option for sunrise and sunset instead of using system variables like you did.


#3

Thank you ffor your reply!
i set everything up and i will test it tonight.


#4

That will probably work. I tend to use “EVERY DAY AT” instead of “IF TIME HAPPENS DAILY AT”, because that keeps the logic compartmentalized at the time of execution.


#5

Can you expand on that a bit please?


#6

“EVERY DAY AT X” only runs that one block at that time. That’s it. Nothing Else.

On the other hand… “IF TIME HAPPENS DAILY AT” runs thru the entire code, top to bottom, and executes anything not blocked by conditions.


#7

Yes…yes…image
I should have remembered that…