Rocket Launch Notifications via API


#20

It’s coming along pretty good, @SergL, but with the current wording, these variables will never be set:

pic

(GET requests do not linger in memory like variables do, so you either have to set those variables at 3:56AM, or make an additional request on the date & time in question… My choice would be the former)


#21

Ah gotya! I think I’m going to leave it on the date/time trigger because I believe than it would be the most accurate description.

I’m only looking for FL launches so if there is another one on the same day prior to FL it would populate those variables with that info instead of the FL one.

So I will add another get request to the top of the pile at the date/time trigger.

As always, most of this would not be possible without your help, thank you very much!!


#22

Glad to be able to help!


#23

Will you please post your updated piston? Thanks!


#24

Sure can. This will check everyday for the next launch in Florida and set that date and time as the piston state. From there it will take that date and time and trigger a notification at that time which will populate the variables and push out with all the available info. If you are home and have a speaker setup it will also speak that same push notification. If you are in FL the next one should be Wednesday I believe.


#25

I finally got a bit of freetime to play around with this one.
(I hope it’s OK that I started with your piston, @SergL)


Here are some the modifications I made:

  • I stored the URL in a variable so it’s easier for others to import
  • I created a customizable offset variable, so the final alert can come in a few min early
  • I captured Flight Data at both events.
    (I did not want to wait until the last minute to get this info)
  • I added a few comments up top to help
  • I tweaked all Piston States and Logs
  • I added Piston States to all events now (so you’ll see more info in advance)
  • I added more detailed logs at all events (even the long descriptions)
  • Once there’s no more FL launches in the list, the old variables are flagged
    (IE: {nextLaunch} will never point to a previous date)


Here is a sample log from two days in advance:

pic

(my hours are hidden in the pics for my privacy)


… and a sample Piston State:

pic


I am tempted to add a second alert to fire off at the real event… but I figured most people will want a bit of warning before the launch, so they’ll have time to grab their beer binoculars, or tune into the webcast, etc…


Edit:

I just tweaked the spoken phrase so it sounds more natural to me… Sample output:

NASA Alert… Falcon 9 is launching in 30 minutes. Crew Dragon Demo-2 (DM-2), at Kennedy Space Center on pad LC-39A. For the first time since the last flight of the Space Shuttle in 2011 … etc

(she continues to read both sentences)


When & where is the next rocket launch worldwide?
#26

Once again, you made something 1000% better!! I will be replacing mine with this one as it does everything I want and is WAY cleaner!!

Thank you!

edit, not sure if its because you worked off of a pervious one that was asking for a URL during import but that box still pops up even though you have it set as a variable.

edit #2, I am adding the nasa link as part of a text message option so that the user can click the link and follow on their device during launch, right out of the message.


#27

Just FYI. Sorry, I had created a piston for this myself last week and then I forgot to post it. Of course, @WCmore outshines mine by far but I did add one additional feature which is the time to launch.

This is the piston state:

and this is the log:

5/24/2020, 11:13:59 PM +154ms
+0ms	╔Received event [Las Vegas].time = 1590387240000 with a delay of -846ms
+118ms	║Checking Florida Launches
+1125ms	║ Next launch is at 2020-05-27T20:33Z which is Wed, May 27 2020 @ 1:33:00 PM PDT
+1125ms	║ [in 2 days, 14 hours, 18 minutes, and 59 seconds].
+1153ms	║ Launch will be a Falcon 9 from pad LC-39A
+1154ms	║For the first time since the last flight of the Space Shuttle in 2011, U.S. astronauts will go to orbit from American soil. As part of NASA's Commercial Crew Program, SpaceX's Falcon 9 will launch the Crew Dragon spacecraft to the International Space Station.
+1180ms	║Setting up scheduled job for Mon, May 25 2020 @ 11:14:00 PM PDT (in 86399.666s)
+1189ms	╚Event processed successfully (1188ms)

#28

This is freakin awesome. Thanks guys!


#29

For those interested in the next launch (regardless of the location), I have created a beefy piston over here.


#30

Can you see anything obvious as to why this didn’t notify me last night?

6/3/2020, 12:34:59 AM +220ms
+0ms ╔Received event [Home].time = 1591158900000 with a delay of -781ms
+139ms ║RunTime Analysis CS > 29ms > PS > 60ms > PE > 51ms > CE
+143ms ║Runtime (65927 bytes) successfully initialized in 60ms (v0.3.110.20191009) (142ms)
+144ms ║╔Execution stage started
+155ms ║║Cancelling statement #1's schedules...
+162ms ║║Sending external web request to: fdo.rocketlaunch.live/json/launches/next/5
+1426ms ║║Executed virtual command httpRequest (1264ms)
+1433ms ║║Executed virtual command setVariable (4ms)
+1447ms ║║Comparison (dynamic) FL is (string) FL = true (1ms)
+1449ms ║║Condition #20 evaluated true (6ms)
+1450ms ║║Condition group #19 evaluated true (state did not change) (8ms)
+1453ms ║║Cancelling statement #21's schedules...
+1459ms ║║Executed virtual command setVariable (3ms)
+1467ms ║║Comparison (boolean) true is (boolean) true = true (2ms)
+1468ms ║║Condition #26 evaluated true (4ms)
+1469ms ║║Condition group #25 evaluated true (state did not change) (6ms)
+1472ms ║║Cancelling statement #69's schedules...
+1480ms ║║Executed virtual command setVariable (4ms)
+1488ms ║║Calculating (datetime) 1591144500704 - (datetime) 1591158900705 >> (datetime) -14400001
+1493ms ║║Calculating (decimal) -1.4400001E7 / (decimal) 3600000.0 >> (decimal) -4.000000277777778
+1509ms ║║Calculating (date) 1591156800000 + (time) 86280000 >> (datetime) 1591243080000
+1516ms ║║Executed virtual command setVariable (4ms)
+1523ms ║║Executed virtual command setVariable (4ms)
+1530ms ║║Executed virtual command setVariable (3ms)
+1538ms ║║Executed virtual command setVariable (3ms)
+1545ms ║║Executed virtual command setVariable (3ms)
+1552ms ║║Executed virtual command setVariable (4ms)
+1559ms ║║Executed virtual command setVariable (3ms)
+1566ms ║║Calculating (string) Next FL launch is at + (string) 2020-06-03T23:58Z >> (string) Next FL launch is at 2020-06-03T23:58Z
+1570ms ║║Calculating (string) Next FL launch is at 2020-06-03T23:58Z + (string) which is >> (string) Next FL launch is at 2020-06-03T23:58Z which is
+1573ms ║║Calculating (string) Next FL launch is at 2020-06-03T23:58Z which is + (string) Wed, Jun 3 2020 @ 7:58:00 PM EDT >> (string) Next FL launch is at 2020-06-03T23:58Z which is Wed, Jun 3 2020 @ 7:58:00 PM EDT
+1576ms ║║Next FL launch is at 2020-06-03T23:58Z which is Wed, Jun 3 2020 @ 7:58:00 PM EDT
+1578ms ║║Executed virtual command log (2ms)
+1592ms ║║Calculating (string) Falcon 9 + (string) is scheduled to launch the >> (string) Falcon 9 is scheduled to launch the
+1597ms ║║Calculating (string) Falcon 9 is scheduled to launch the + (string) [Starlink-8] >> (string) Falcon 9 is scheduled to launch the [Starlink-8]
+1601ms ║║Calculating (string) Falcon 9 is scheduled to launch the [Starlink-8] + (string) at >> (string) Falcon 9 is scheduled to launch the [Starlink-8] at
+1605ms ║║Calculating (string) Falcon 9 is scheduled to launch the [Starlink-8] at + (string) Cape Canaveral AFS >> (string) Falcon 9 is scheduled to launch the [Starlink-8] at Cape Canaveral AFS
+1609ms ║║Calculating (string) Falcon 9 is scheduled to launch the [Starlink-8] at Cape Canaveral AFS + (string) from pad >> (string) Falcon 9 is scheduled to launch the [Starlink-8] at Cape Canaveral AFS from pad
+1613ms ║║Calculating (string) Falcon 9 is scheduled to launch the [Starlink-8] at Cape Canaveral AFS from pad + (string) SLC-40 >> (string) Falcon 9 is scheduled to launch the [Starlink-8] at Cape Canaveral AFS from pad SLC-40
+1616ms ║║Calculating (string) Falcon 9 is scheduled to launch the [Starlink-8] at Cape Canaveral AFS from pad SLC-40 + (string)
+1617ms ║║ >> (string) Falcon 9 is scheduled to launch the [Starlink-8] at Cape Canaveral AFS from pad SLC-40
+1620ms ║║Calculating (string) Falcon 9 is scheduled to launch the [Starlink-8] at Cape Canaveral AFS from pad SLC-40
+1620ms ║║ + (string) A SpaceX Falcon 9 rocket will launch the Starlink-8 mission on Wednesday, June 3, 2020 at 11:58 PM (UTC). >> (string) Falcon 9 is scheduled to launch the [Starlink-8] at Cape Canaveral AFS from pad SLC-40
+1620ms ║║A SpaceX Falcon 9 rocket will launch the Starlink-8 mission on Wednesday, June 3, 2020 at 11:58 PM (UTC).
+1623ms ║║Calculating (string) Falcon 9 is scheduled to launch the [Starlink-8] at Cape Canaveral AFS from pad SLC-40
+1623ms ║║A SpaceX Falcon 9 rocket will launch the Starlink-8 mission on Wednesday, June 3, 2020 at 11:58 PM (UTC). + (string)
+1623ms ║║ >> (string) Falcon 9 is scheduled to launch the [Starlink-8] at Cape Canaveral AFS from pad SLC-40
+1623ms ║║A SpaceX Falcon 9 rocket will launch the Starlink-8 mission on Wednesday, June 3, 2020 at 11:58 PM (UTC).
+1626ms ║║Calculating (string) Falcon 9 is scheduled to launch the [Starlink-8] at Cape Canaveral AFS from pad SLC-40
+1626ms ║║A SpaceX Falcon 9 rocket will launch the Starlink-8 mission on Wednesday, June 3, 2020 at 11:58 PM (UTC).
+1626ms ║║ + (string) null >> (string) Falcon 9 is scheduled to launch the [Starlink-8] at Cape Canaveral AFS from pad SLC-40
+1626ms ║║A SpaceX Falcon 9 rocket will launch the Starlink-8 mission on Wednesday, June 3, 2020 at 11:58 PM (UTC).
+1626ms ║║null
+1630ms ║║Falcon 9 is scheduled to launch the [Starlink-8] at Cape Canaveral AFS from pad SLC-40
+1630ms ║║A SpaceX Falcon 9 rocket will launch the Starlink-8 mission on Wednesday, June 3, 2020 at 11:58 PM (UTC).
+1630ms ║║null
+1631ms ║║Executed virtual command log (2ms)
+1644ms ║║Calculating (string) 🚀 + (string) Falcon 9 >> (string) 🚀 Falcon 9
+1649ms ║║Calculating (string) 🚀 Falcon 9 + (string) is scheduled to launch from >> (string) 🚀 Falcon 9 is scheduled to launch from
+1653ms ║║Calculating (string) 🚀 Falcon 9 is scheduled to launch from + (string) Falcon 9 is scheduled to launch from [Starlink-8]
+1657ms ║║Calculating (string) 🚀 Falcon 9 is scheduled to launch from >> (string) 🚀 Falcon 9 is scheduled to launch from
+1661ms ║║Calculating (string) 🚀 Falcon 9 is scheduled to launch from + (string) Cape Canaveral AFS >> (string) 🚀 Falcon 9 is scheduled to launch from Cape Canaveral AFS
+1665ms ║║Calculating (string) 🚀 Falcon 9 is scheduled to launch from Cape Canaveral AFS + (string) on >> (string) 🚀 Falcon 9 is scheduled to launch from Cape Canaveral AFS on
+1669ms ║║Calculating (string) 🚀 Falcon 9 is scheduled to launch from Cape Canaveral AFS on + (string) Wed, Jun 3 2020 @ 7:58:00 PM EDT >> (string) 🚀 Falcon 9 is scheduled to launch from Cape Canaveral AFS on Wed, Jun 3 2020 @ 7:58:00 PM EDT
+1672ms ║║Calculating (string) 🚀 Falcon 9 is scheduled to launch from Cape Canaveral AFS on Wed, Jun 3 2020 @ 7:58:00 PM EDT + (string) from pad >> (string) 🚀 Falcon 9 is scheduled to launch from Cape Canaveral AFS on Wed, Jun 3 2020 @ 7:58:00 PM EDT from pad
+1675ms ║║Calculating (string) 🚀 Falcon 9 is scheduled to launch from Cape Canaveral AFS on Wed, Jun 3 2020 @ 7:58:00 PM EDT from pad + (string) SLC-40 >> (string) 🚀 Falcon 9 is scheduled to launch from Cape Canaveral AFS on Wed, Jun 3 2020 @ 7:58:00 PM EDT from pad SLC-40
+1678ms ║║Calculating (string) 🚀 Falcon 9 is scheduled to launch from Cape Canaveral AFS on Wed, Jun 3 2020 @ 7:58:00 PM EDT from pad SLC-40 + (string) . >> (string) 🚀 Falcon 9 is scheduled to launch from Cape Canaveral AFS on Wed, Jun 3 2020 @ 7:58:00 PM EDT from pad SLC-40.
+1681ms ║║Executed virtual command setState (0ms)
+1683ms ║╚Execution stage complete. (1540ms)
+1708ms ║Setting up scheduled job for Thu, Jun 4 2020 @ 12:35:00 AM EDT (in 86399.072s)
+1717ms ╚Event processed successfully (1717ms)

#31

I have no idea which piston (from which of the three threads) you are using… LOL


#32

The one I replied to. :wink:

cj7d

FWIW, it did work for the Crew Dragon test.


#33

That piston is scheduled to run once daily, (with no notifications)

The alert should happen 30 min prior to {nextLaunch}…
Did that variable get set properly?


#34

The next thing in the log is the check on the next day. Shouldn’t there have been a scheduled job -30 minutes from the launch in the log that I posted?


#35

What I meant was, did {nextLaunch} get set properly up top in the “define” section??


#36

Not sure, I’ll keep an eye out next time. Right now it shows next launch as 6/5. Should that be correct?


#37

The next Florida launch date is currently targeted for June 12, 2020 (UTC). (no time given yet)

Here is a direct link to the API, for reference.


#38

And it now has that correct date. But back on 6/6, it showed the next launch as 6/5. I guess I’ll just see what happens on the 12th.


#39

I forgot to reply to this, but it didn’t work for the launch on the 12th. I know that you have your other huge rocket piston, but are you still using this one at all?

Every time I’ve noticed, nextLaunch is set, but it fails to notify me.