Lights on in morning but only during school days


#21

Very happy to report a successful morning run for both turning on at 6:45a and turning off at 7:20a. Next step is making sure it does not turn on May 28th and does turn on May 29th. Thanks for all the help. So far so good.


#22

Does your school offer a google calendar of school events that you can link to your personal google calendar?

If so, you could use IFTTT and webhooks to trigger your piston for school dates.

Or you could enter all the dates in you calendar manually and use IFTTT that way, or use gcal search to do the ‘web hooking’ for you by creating a virtual open/close sensor and use that as a trigger for dates not in school


#23

I love that idea on automating the calendar. I’ll have to look into it. At the moment the calendar I’ve been using is a pdf file they put online. Even if I find a more dynamic calendar, I wouldn’t be sure how to automate the data integration anyway but I’d love to make something like that work. At the moment I just resigned to have to update it manually once a year.


#24

I’m trying to do this. I’m going to add google calendar appointments at 5:30am every morning that its a no school day since I keep their school hours and activities in a google calendar anyway. Then hook up a momentary button in ST (that is connected to an “off school” routine via smartapp alexa helper) to google calendar start when activity with search starts via IFTTT.


#25

Most schools publish their school calendar as a shared ICS. I simply linked it to my google account and used the GCal SmartApp to look for ‘NO SCHOOL’ events (which is how our school marks days off). That triggers a simulated presence sensor and in turn the webcore piston fires in the morning and checks the presence sensor as a condition.
The beauty of it is that GCAL resets the presence sensor when the searched for phrase is no longer found which makes the entire process completely automated.

GCal is pretty flexible and combining with presence sensors is a good way to add dynamic logic to pistons


#26

I tried to duplicate your piston but its not working. Don’t mind the run time. Adjusting it to see if it make a difference. What am I missing?

5/30/2019, 12:39:59 PM +82ms
+1ms ╔Received event [Home].time = 1559245200000 with a delay of -918ms
+111ms ║RunTime Analysis CS > 18ms > PS > 57ms > PE > 36ms > CE
+114ms ║Runtime (45932 bytes) successfully initialized in 57ms (v0.3.10c.20190522) (113ms)
+115ms ║╔Execution stage started
+125ms ║║Comparison (time) 45599204 happens_daily_at (time) 45600000 = true (1ms)
+127ms ║║Time restriction check passed
+128ms ║║Cancelling condition #18's schedules...
+129ms ║║Condition #18 evaluated true (7ms)
+131ms ║║Cancelling statement #18's schedules...
+135ms ║║Requesting time schedule wake up at Fri, May 31 2019 @ 12:40:00 PM PDT
+154ms ║║Comparison (date) 1559199600000 is_not_between (date) 1558940400000 .. (date) 1558985413206 = false (13ms)
+155ms ║║Condition #4 evaluated false (17ms)
+157ms ║║Condition group #1 evaluated false (state did not change) (35ms)
+160ms ║╚Execution stage complete. (45ms)
+161ms ║Setting up scheduled job for Fri, May 31 2019 @ 12:40:00 PM PDT (in 86400.758s)
+169ms ╚Event processed successfully (169ms)

#27

Turns out I had to read the full list of responses. Modified the dates so if it was one day from 5/27/19 and 5/27/19 to 5/27/19 and 5/28/19

Working Piston