Trigger an action 5 minutes before "GCal Search" event


#21

What format does the time have to be in for the expression to be able to extract that information?


#22

Typically any standard date/time format would work. But randomly stuck in a message probably won’t do it.


#23

Would there be a way to only keep the last 8 characters which is the time?


#24

Is the message always the same?

right([device:attribute, 8)


#25

I do believe the message will always be the same.


#26

I’m going to refer to the entire expression you have above as $data just for simplicity.

Try this

addMinutes(time($data), -5)


#27

This is what I got. It seems to not retain the time correctly because it is showing present time.


#28

This seems to adjust the time and keep the date.


#29

Another one I made.


#30

Instead of trimming the last one by 15 can you just wrap it in another time() function?


#31

That seems to work too. How would I use this expression in the Piston. Have never used one before.


#32

The original intent was to trigger an alert 5 minutes before correct?

You can do a time happens daily (under virtual devices/time) and then change the value field to expression and plug the above in.


#33

I wanted to play a notification on speakers 5 minutes before the event. Is it normal to see the random number here? Thanks for all of your help by the way. All this is new to me.


#34

Does this seem right?


#35

That is just the converted time in milliseconds.

As for your piston. Currently it should execute everyday at that time. Since I don’t think this is what you wanted. There needs to be logo logic to limit it to the day it’s happening. Can you stick this in the original piston? Or does the presence sensor (GCal event) only activate at the exact time?


#36

What is logo?
I suppose I can add this to the original Piston.
The presence Sensor activates at the exact time of the event start.


#37

Sorry was supposed to say logic.

Also adding this to the original won’t work then. We are going to have to catch the date as well in order for this alert to work properly. I am about to fall asleep though. I’ll have to pick this back up in the morning


#38

Hey, thanks for everything. If I can donate let me know. Even if this doesn’t work out I have learned plenty.


#39

eventSummary attribute shows “No events found” when not scheduled. Thinking I can just add that to part of the condition.



#40

Perfect!! You are definitely learning!

As for donating there is a PayPal link at the top of the page. It all goes to Adrian. Minions are just here to help!!