Automatic lights (Presence, motion, date, time)


#1

1) Give a description of the problem
Please help :slight_smile:
2) What is the expected behavior?
I would like to get automatic lighting when I come back from work.
Device: bed
It should only turn on if the arrival sensor is active, between 3:00 PM and 10:59 PM on working days and weekends. It has to switch off at 11:00 PM on weekdays and 12:00 AM on weekends
Device: lamp
It should only turn on if the arrival sensor is active, between 3:00 PM and 10:59 PM on working days and weekends. If the motion sensor does not detect motion for 3 minutes, it should turn off, and at 9:30 PM
3) What is happening/not happening?
Nothing happens.
4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
18.01.2019, 17:55:23 +731ms
+1ms â•”Received event [Czujnik ruchu jm].motion = active with a delay of 405ms
+87ms â•‘RunTime Analysis CS > 15ms > PS > 42ms > PE > 30ms > CE
+90ms â•‘Runtime (43583 bytes) successfully initialized in 42ms (v0.3.109.20181207) (88ms)
+91ms â•‘â•”Execution stage started
+101ms â•‘â•‘Comparison (string) :cf4a39c31cae6d9834f77ea26c4bbae1: is (string) :cf4a39c31cae6d9834f77ea26c4bbae1: = true (2ms)
+103ms â•‘â•‘Condition #2 evaluated true (6ms)
+117ms â•‘â•‘Comparison (time) 64523836 is_after (time) 54000000 = true (8ms)
+118ms â•‘â•‘Time restriction check passed
+120ms â•‘â•‘Condition #3 evaluated true (16ms)
+121ms â•‘â•‘Condition group #1 evaluated true (state did not change) (25ms)
+124ms ║║Cancelling statement #4’s schedules…
+133ms ║║Skipped execution of physical command [Oświetlenie za łóżkiem].on([]) because it would make no change to the device. (3ms)
+134ms ║║Executed [Oświetlenie za łóżkiem].on (5ms)
+147ms â•‘â•‘Comparison (time) 64523869 is_after (time) 86340000 = false (7ms)
+149ms â•‘â•‘Condition #13 evaluated false (11ms)
+151ms â•‘â•‘Condition group #6 evaluated false (state did not change) (13ms)
+163ms â•‘â•‘Comparison (time) 64523885 is_after (time) 82800000 = false (7ms)
+165ms â•‘â•‘Condition #30 evaluated false (11ms)
+166ms â•‘â•‘Condition group #29 evaluated false (state did not change) (13ms)
+183ms â•‘â•‘Comparison (time) 64523901 is_after (time) 54000000 = true (8ms)
+185ms â•‘â•‘Time restriction check passed
+187ms â•‘â•‘Condition #16 evaluated true (16ms)
+192ms â•‘â•‘Comparison (string) :cf4a39c31cae6d9834f77ea26c4bbae1: is (string) :cf4a39c31cae6d9834f77ea26c4bbae1: = true (2ms)
+194ms â•‘â•‘Condition #17 evaluated true (6ms)
+202ms â•‘â•‘Comparison (enum) active is (string) active = true (2ms)
+204ms ║║Cancelling condition #18’s schedules…
+205ms â•‘â•‘Condition #18 evaluated true (10ms)
+207ms ║║Cancelling condition #15’s schedules…
+208ms â•‘â•‘Condition group #15 evaluated true (state changed) (38ms)
+211ms ║║Cancelling statement #19’s schedules…
+220ms â•‘â•‘Skipped execution of physical command [Lampa jm].on([]) because it would make no change to the device. (4ms)
+221ms â•‘â•‘Executed [Lampa jm].on (6ms)
+238ms â•‘â•‘Comparison (time) 64523956 is_after (time) 54000000 = true (8ms)
+239ms â•‘â•‘Time restriction check passed
+241ms â•‘â•‘Condition #22 evaluated true (16ms)
+251ms â•‘â•‘Comparison (time) 64523973 is_before (time) 77400000 = true (7ms)
+253ms â•‘â•‘Time restriction check passed
+255ms â•‘â•‘Condition #23 evaluated true (12ms)
+260ms â•‘â•‘Comparison (enum) active stays_unchanged = true (0ms)
+262ms â•‘â•‘Condition #24 evaluated false (6ms)
+264ms â•‘â•‘Condition group #21 evaluated false (state did not change) (39ms)
+267ms â•‘â•šExecution stage complete. (177ms)
+269ms â•‘Setting up scheduled job for Fri, Jan 18 2019 @ 5:56:43 PM CET (in 79.77s)
+321ms â•šEvent processed successfully (321ms)
18.01.2019, 17:54:32 +975ms
+1ms â•”Received event [Czujnik ruchu jm].motion = inactive with a delay of 399ms
+84ms â•‘RunTime Analysis CS > 15ms > PS > 37ms > PE > 31ms > CE
+86ms â•‘Runtime (43581 bytes) successfully initialized in 37ms (v0.3.109.20181207) (84ms)
+88ms â•‘â•”Execution stage started
+99ms â•‘â•‘Comparison (string) :cf4a39c31cae6d9834f77ea26c4bbae1: is (string) :cf4a39c31cae6d9834f77ea26c4bbae1: = true (2ms)
+101ms â•‘â•‘Condition #2 evaluated true (7ms)
+116ms â•‘â•‘Comparison (time) 64473078 is_after (time) 54000000 = true (9ms)
+118ms â•‘â•‘Time restriction check passed
+120ms â•‘â•‘Condition #3 evaluated true (17ms)
+121ms â•‘â•‘Condition group #1 evaluated true (state did not change) (27ms)
+124ms ║║Cancelling statement #4’s schedules…
+134ms ║║Skipped execution of physical command [Oświetlenie za łóżkiem].on([]) because it would make no change to the device. (3ms)
+135ms ║║Executed [Oświetlenie za łóżkiem].on (5ms)
+150ms â•‘â•‘Comparison (time) 64473114 is_after (time) 86340000 = false (8ms)
+153ms â•‘â•‘Condition #13 evaluated false (14ms)
+155ms â•‘â•‘Condition group #6 evaluated false (state did not change) (15ms)
+169ms â•‘â•‘Comparison (time) 64473134 is_after (time) 82800000 = false (7ms)
+171ms â•‘â•‘Condition #30 evaluated false (12ms)
+172ms â•‘â•‘Condition group #29 evaluated false (state did not change) (14ms)
+189ms â•‘â•‘Comparison (time) 64473151 is_after (time) 54000000 = true (8ms)
+191ms â•‘â•‘Time restriction check passed
+193ms â•‘â•‘Condition #16 evaluated true (17ms)
+199ms â•‘â•‘Comparison (string) :cf4a39c31cae6d9834f77ea26c4bbae1: is (string) :cf4a39c31cae6d9834f77ea26c4bbae1: = true (2ms)
+201ms â•‘â•‘Condition #17 evaluated true (6ms)
+210ms â•‘â•‘Comparison (enum) inactive is (string) active = false (2ms)
+212ms ║║Cancelling condition #18’s schedules…
+213ms â•‘â•‘Condition #18 evaluated false (10ms)
+214ms ║║Cancelling condition #15’s schedules…
+215ms â•‘â•‘Condition group #15 evaluated false (state changed) (40ms)
+233ms â•‘â•‘Comparison (time) 64473194 is_after (time) 54000000 = true (9ms)
+234ms â•‘â•‘Time restriction check passed
+236ms â•‘â•‘Condition #22 evaluated true (17ms)
+248ms â•‘â•‘Comparison (time) 64473213 is_before (time) 77400000 = true (7ms)
+249ms â•‘â•‘Time restriction check passed
+251ms â•‘â•‘Condition #23 evaluated true (14ms)
+257ms â•‘â•‘Comparison (enum) inactive stays_unchanged = true (0ms)
+259ms â•‘â•‘Condition #24 evaluated false (7ms)
+261ms â•‘â•‘Condition group #21 evaluated false (state did not change) (41ms)
+264ms â•‘â•šExecution stage complete. (177ms)
+266ms â•‘Setting up scheduled job for Fri, Jan 18 2019 @ 5:56:43 PM CET (in 130.529s)
+278ms â•šEvent processed successfully (278ms)
18.01.2019, 17:54:17 +850ms
+1ms â•”Received event [Czujnik ruchu jm].motion = active with a delay of 404ms
+86ms â•‘RunTime Analysis CS > 14ms > PS > 46ms > PE > 26ms > CE
+88ms â•‘Runtime (43583 bytes) successfully initialized in 46ms (v0.3.109.20181207) (86ms)
+90ms â•‘â•”Execution stage started
+100ms â•‘â•‘Comparison (string) :cf4a39c31cae6d9834f77ea26c4bbae1: is (string) :cf4a39c31cae6d9834f77ea26c4bbae1: = true (2ms)
+102ms â•‘â•‘Condition #2 evaluated true (6ms)
+117ms â•‘â•‘Comparison (time) 64457954 is_after (time) 54000000 = true (8ms)
+118ms â•‘â•‘Time restriction check passed
+120ms â•‘â•‘Condition #3 evaluated true (17ms)
+121ms â•‘â•‘Condition group #1 evaluated true (state did not change) (26ms)
+124ms ║║Cancelling statement #4’s schedules…
+134ms ║║Skipped execution of physical command [Oświetlenie za łóżkiem].on([]) because it would make no change to the device. (3ms)
+135ms ║║Executed [Oświetlenie za łóżkiem].on (5ms)
+149ms â•‘â•‘Comparison (time) 64457989 is_after (time) 86340000 = false (7ms)
+150ms â•‘â•‘Condition #13 evaluated false (11ms)
+152ms â•‘â•‘Condition group #6 evaluated false (state did not change) (13ms)
+165ms â•‘â•‘Comparison (time) 64458005 is_after (time) 82800000 = false (8ms)
+167ms â•‘â•‘Condition #30 evaluated false (12ms)
+168ms â•‘â•‘Condition group #29 evaluated false (state did not change) (13ms)
+185ms â•‘â•‘Comparison (time) 64458022 is_after (time) 54000000 = true (8ms)
+186ms â•‘â•‘Time restriction check passed
+188ms â•‘â•‘Condition #16 evaluated true (16ms)
+194ms â•‘â•‘Comparison (string) :cf4a39c31cae6d9834f77ea26c4bbae1: is (string) :cf4a39c31cae6d9834f77ea26c4bbae1: = true (2ms)
+196ms â•‘â•‘Condition #17 evaluated true (6ms)
+204ms â•‘â•‘Comparison (enum) active is (string) active = true (2ms)
+206ms ║║Cancelling condition #18’s schedules…
+207ms â•‘â•‘Condition #18 evaluated true (9ms)
+208ms ║║Cancelling condition #15’s schedules…
+209ms â•‘â•‘Condition group #15 evaluated true (state changed) (38ms)
+212ms ║║Cancelling statement #19’s schedules…
+221ms â•‘â•‘Skipped execution of physical command [Lampa jm].on([]) because it would make no change to the device. (2ms)
+222ms â•‘â•‘Executed [Lampa jm].on (5ms)
+239ms â•‘â•‘Comparison (time) 64458076 is_after (time) 54000000 = true (7ms)
+240ms â•‘â•‘Time restriction check passed
+242ms â•‘â•‘Condition #22 evaluated true (16ms)
+253ms â•‘â•‘Comparison (time) 64458094 is_before (time) 77400000 = true (7ms)
+255ms â•‘â•‘Time restriction check passed
+256ms â•‘â•‘Condition #23 evaluated true (13ms)
+262ms â•‘â•‘Comparison (enum) active stays_unchanged = true (1ms)
+265ms â•‘â•‘Condition #24 evaluated false (8ms)
+267ms â•‘â•‘Condition group #21 evaluated false (state did not change) (40ms)
+270ms â•‘â•šExecution stage complete. (181ms)
+272ms â•‘Setting up scheduled job for Fri, Jan 18 2019 @ 5:56:43 PM CET (in 145.648s)
+282ms â•šEvent processed successfully (281ms)
18.01.2019, 17:53:43 +502ms
+1ms â•”Received event [Czujnik ruchu jm].motion = inactive with a delay of 406ms
+95ms â•‘RunTime Analysis CS > 16ms > PS > 40ms > PE > 38ms > CE
+97ms â•‘Runtime (43575 bytes) successfully initialized in 40ms (v0.3.109.20181207) (95ms)
+99ms â•‘â•”Execution stage started
+110ms â•‘â•‘Comparison (string) :cf4a39c31cae6d9834f77ea26c4bbae1: is (string) :cf4a39c31cae6d9834f77ea26c4bbae1: = true (2ms)
+112ms â•‘â•‘Condition #2 evaluated true (7ms)
+127ms â•‘â•‘Comparison (time) 64423616 is_after (time) 54000000 = true (8ms)
+128ms â•‘â•‘Time restriction check passed
+130ms â•‘â•‘Condition #3 evaluated true (17ms)
+132ms â•‘â•‘Condition group #1 evaluated true (state did not change) (26ms)
+135ms ║║Cancelling statement #4’s schedules…
+144ms ║║Skipped execution of physical command [Oświetlenie za łóżkiem].on([]) because it would make no change to the device. (3ms)
+145ms ║║Executed [Oświetlenie za łóżkiem].on (5ms)
+160ms â•‘â•‘Comparison (time) 64423652 is_after (time) 86340000 = false (8ms)
+162ms â•‘â•‘Condition #13 evaluated false (12ms)
+163ms â•‘â•‘Condition group #6 evaluated false (state did not change) (14ms)
+177ms â•‘â•‘Comparison (time) 64423669 is_after (time) 82800000 = false (8ms)
+179ms â•‘â•‘Condition #30 evaluated false (12ms)
+180ms â•‘â•‘Condition group #29 evaluated false (state did not change) (14ms)
+197ms â•‘â•‘Comparison (time) 64423686 is_after (time) 54000000 = true (8ms)
+199ms â•‘â•‘Time restriction check passed
+201ms â•‘â•‘Condition #16 evaluated true (17ms)
+207ms â•‘â•‘Comparison (string) :cf4a39c31cae6d9834f77ea26c4bbae1: is (string) :cf4a39c31cae6d9834f77ea26c4bbae1: = true (2ms)
+209ms â•‘â•‘Condition #17 evaluated true (6ms)
+217ms â•‘â•‘Comparison (enum) inactive is (string) active = false (2ms)
+220ms ║║Cancelling condition #18’s schedules…
+221ms â•‘â•‘Condition #18 evaluated false (10ms)
+222ms ║║Cancelling condition #15’s schedules…
+223ms â•‘â•‘Condition group #15 evaluated false (state changed) (40ms)
+240ms â•‘â•‘Comparison (time) 64423729 is_after (time) 54000000 = true (8ms)
+242ms â•‘â•‘Time restriction check passed
+244ms â•‘â•‘Condition #22 evaluated true (17ms)
+255ms â•‘â•‘Comparison (time) 64423748 is_before (time) 77400000 = true (7ms)
+257ms â•‘â•‘Time restriction check passed
+259ms â•‘â•‘Condition #23 evaluated true (14ms)
+264ms â•‘â•‘Comparison (enum) inactive stays_unchanged = true (1ms)
+267ms â•‘â•‘Adding a timed trigger schedule for condition 24
+270ms ║║Cancelling condition #24’s schedules…
+271ms â•‘â•‘Condition #24 evaluated false (11ms)
+273ms ║║Cancelling condition #21’s schedules…
+274ms â•‘â•‘Condition group #21 evaluated false (state changed) (47ms)
+277ms â•‘â•šExecution stage complete. (179ms)
+279ms â•‘Setting up scheduled job for Fri, Jan 18 2019 @ 5:56:43 PM CET (in 179.989s)
+289ms â•šEvent processed successfully (289ms)Preformatted text


#2

Start over…Use restrictions and triggers, for example:
Only When time is between (or after) “time”
IF presence sensor changes to present
with my_light
Do “turn on”

Then for you’re “lights off”, you could use a timer:
Everyday at 2300 but only on mon-fri
with my_light
Do “turn off”

edit: formatting


#4

I use the new application (smartthings). I did something like that, unfortunately not everything works as I expected. Lighting “lamp” does not turn off after 3 minutes of inactivity, only immediately. Have an idea what to fix? Thank you for your help! Do not look at the value of time, I set them for testing.


#5

Did you set your geolocation?


#6

Yes, I set. I found the cause of my problem. The reason was too simple to notice :smile: I changed the order and everything works fine.pulpit Thank you for help :beers: :