One time Date/Time trigger

time

#1

I know the solution is probably starting me right in the face but for the life of me I can’t seem to figure out how to get a piston to trigger one time based on a Date/.Time combination. If i set it to “happens daily at” it trigger every day at that time, regardless of whether the date is from yesterday or last year. I am setting a date/time variable at one point and then triggering an action based on that variable. And I would rather not blank that variable after I’ve executed the function but I don’t want it to trigger tomorrow at the same time.


#2

Try using the ‘with location’ -> ‘wait for date & time’ and you can put in a future date.


#3

No, because I don’t want the piston to wait until that future time…that would make the piston HELLAAA huge. I have several different functions that all set a variable of when to turn something back on and then a single other function that turns the thing back on at the variable time. There really is no one-time date/time combo trigger?

Also, my idea of blanking out the variable doesn’t seem to work either. Do I have to set another boolean variable to see whether it has been used yet or not? This is really going to get complicated.


#4

Wait…can you just use the wait for at the beginning of a function without using an if? Does that work?


#5

testing it again, but it should… one min…


#6

Nope…doesn’t get subscribed to as trigger. DAMN! I spent so much time working on this thing too…like 3 days. And now it’s all useless.


#7

webcore

As a test, I did this and it did send me a notification at 2:47:10pm (obviously ignore the commented out stuff)


#8

I’ll try it again. It doesn’t have the little lightning bold next to it so I figured it wasn’t an actual trigger.


#9

I see what I did…hold on.


#10

By the way, after I saved the piston, I had to hit the “test” button in order to make it say “setting up scheduled job for …”

After hitting “test” button, then I get:

+1ms ╔Received event [Home].test = 1520539123207 with a delay of 0ms
+120ms ║RunTime Analysis CS > 15ms > PS > 28ms > PE > 74ms > CE
+123ms ║Runtime (42531 bytes) successfully initialized in 28ms (v0.3.000.20180224) (121ms)
+123ms ║╔Execution stage started
+129ms ║║Cancelling statement #10’s schedules…
+135ms ║║Executed virtual command waitForDateTime (2ms)
+138ms ║║Requesting a wake up for Fri, Mar 9 2018 @ 2:47:10 PM EST (in 85707.26s)
+166ms ║╚Execution stage complete. (43ms)
+183ms ║Setting up scheduled job for Fri, Mar 9 2018 @ 2:47:10 PM EST (in 85707.218s)
+189ms ╚Event processed successfully (189ms)

#11

LOL…well, then that’s not being triggered by the date/time then is it? That’s not very automated.

So, basically, the answer is “no”. There’s no way trigger an event at a specific date and time?


#12

It is being triggered by date/time. But it appears that simply saving it doesn’t run through the piston and re-evaluate it. Guess you gotta hit the “test” button. One of minions may be able to explain that part.


#13

But I’m not going to go in and hit the test button every time the variable gets reset. That defeats the purpose of having it do it automatically.


#14

right… I see where you’re going with this… I’ll play around a little more with it, maybe one of the other folks on the forum will jump in too…
Also just a note… In other pistons I have, I’ve added a blank dummy block at the bottom of the piston so it gets re-evaluated every hour…

Every hour at :00
with locaiton
do
end


#15

I could possibly look into that but either waiting or re-executing the piston would throw out my whole architecture. So, I’m REALLY not looking forward to either of those prospects.
I was so proud of my self too. Basically, I have IFFTTT read my Outlook 365 calendar and send me a webhooks message with the start and end time. Then I have google home speak to me 5 minutes before it starts and turn off a virtual switch that controls my voice alerts. Then, when the meeting is over, it turns the voice alerts virtual switch back on again. So, I’m parsing two arguments from the webcall to set the two variables. But, one of those two variables I also set with a bunch of other functions as well. So, having to move that all around is going to be a pain in the butt.


#16

Will this not work for you?

I forced the subscribe as it’s a condition not a trigger (even though my simple piston only has a condition so on it’s own it would subscribe anyway).


#17

That’s a condition, and I have other defined triggers in the same piston so I would have to move this off to it’s own piston but that might be the easiest thing to do at this point.


#18

Right, and thus why I mentioned forcing the subscription to make it act as a trigger. But without seeing your whole piston it was hard to see if it would work.


#19

I didn’t know you could do that, I’ve never played with subscription. So, if you set to always subscribe it would treat it as a trigger?


#20

Yes, that’s correct.