Rocket Launch Notifications via API


#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.


#40

Can you post your current piston please?

There are a handful of examples in this thread, and I’d like to see what you are working with.


#41


#42

Unfortunately, I am not. I quickly shifted over to a dedicated thread, where I’ve made a lot of improvements to the piston. (although I did remove the Florida section… That piston keeps track of all locations)


Thanks for the image…

What happens when “IF Time & Date happens daily at X” triggers? (line 89)

Without seeing a log, I would guess that maybe the GET request was sent, but the 20 sec wakeup afterwards cancelled the rest of the code?


#43

Here’s the log that ran this morning, for the launch today. NextLaunch appears to be set correctly. For whatever reason, I don’t think the Date & Time trigger is working. Everything else seems okay.

6/26/2020, 12:34:59 AM +65ms
+1ms ╔Received event [Home].time = 1593146100000 with a delay of -935ms
+105ms ║RunTime Analysis CS > 22ms > PS > 39ms > PE > 44ms > CE
+108ms ║Runtime (66011 bytes) successfully initialized in 39ms (v0.3.110.20191009) (106ms)
+109ms ║╔Execution stage started
+119ms ║║Cancelling statement #1's schedules...
+126ms ║║Sending external web request to: fdo.rocketlaunch.live/json/launches/next/5
+902ms ║║Executed virtual command httpRequest (775ms)
+906ms ║║Executed virtual command setVariable (2ms)
+918ms ║║Comparison (dynamic) FL is (string) FL = true (1ms)
+920ms ║║Condition #20 evaluated true (6ms)
+921ms ║║Condition group #19 evaluated true (state did not change) (7ms)
+923ms ║║Cancelling statement #21's schedules...
+928ms ║║Executed virtual command setVariable (3ms)
+935ms ║║Comparison (boolean) true is (boolean) true = true (1ms)
+937ms ║║Condition #26 evaluated true (5ms)
+938ms ║║Condition group #25 evaluated true (state did not change) (6ms)
+940ms ║║Cancelling statement #69's schedules...
+945ms ║║Executed virtual command setVariable (2ms)
+953ms ║║Calculating (datetime) 1593131700014 - (datetime) 1593146100016 >> (datetime) -14400002
+957ms ║║Calculating (decimal) -1.4400002E7 / (decimal) 3600000.0 >> (decimal) -4.000000555555555
+974ms ║║Calculating (date) 1593144000000 + (time) 72780000 >> (datetime) 1593216780000
+979ms ║║Executed virtual command setVariable (2ms)
+985ms ║║Executed virtual command setVariable (2ms)
+991ms ║║Executed virtual command setVariable (3ms)
+996ms ║║Executed virtual command setVariable (2ms)
+1002ms ║║Executed virtual command setVariable (2ms)
+1008ms ║║Executed virtual command setVariable (2ms)
+1014ms ║║Executed virtual command setVariable (3ms)
+1021ms ║║Calculating (string) Next FL launch is at + (string) 2020-06-26T20:13Z >> (string) Next FL launch is at 2020-06-26T20:13Z
+1024ms ║║Calculating (string) Next FL launch is at 2020-06-26T20:13Z + (string) which is >> (string) Next FL launch is at 2020-06-26T20:13Z which is
+1027ms ║║Calculating (string) Next FL launch is at 2020-06-26T20:13Z which is + (string) Fri, Jun 26 2020 @ 4:13:00 PM EDT >> (string) Next FL launch is at 2020-06-26T20:13Z which is Fri, Jun 26 2020 @ 4:13:00 PM EDT
+1030ms ║║Next FL launch is at 2020-06-26T20:13Z which is Fri, Jun 26 2020 @ 4:13:00 PM EDT
+1031ms ║║Executed virtual command log (1ms)
+1054ms ║║Calculating (string) Falcon 9 + (string) is scheduled to launch the >> (string) Falcon 9 is scheduled to launch the
+1059ms ║║Calculating (string) Falcon 9 is scheduled to launch the + (string) [Starlink-10 (57x), BlackSky Global 5 & 6] >> (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6]
+1063ms ║║Calculating (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] + (string) at >> (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at
+1068ms ║║Calculating (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at + (string) Kennedy Space Center >> (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center
+1072ms ║║Calculating (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center + (string) from pad >> (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center from pad
+1076ms ║║Calculating (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center from pad + (string) LC-39A >> (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center from pad LC-39A
+1079ms ║║Calculating (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center from pad LC-39A + (string)
+1079ms ║║ >> (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center from pad LC-39A
+1082ms ║║Calculating (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center from pad LC-39A
+1082ms ║║ + (string) A SpaceX Falcon 9 rocket will launch the Starlink-10 (57x) mission on Friday, June 26, 2020 at 8:18 PM (UTC). >> (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center from pad LC-39A
+1083ms ║║A SpaceX Falcon 9 rocket will launch the Starlink-10 (57x) mission on Friday, June 26, 2020 at 8:18 PM (UTC).
+1085ms ║║Calculating (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center from pad LC-39A
+1086ms ║║A SpaceX Falcon 9 rocket will launch the Starlink-10 (57x) mission on Friday, June 26, 2020 at 8:18 PM (UTC). + (string)
+1086ms ║║ >> (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center from pad LC-39A
+1086ms ║║A SpaceX Falcon 9 rocket will launch the Starlink-10 (57x) mission on Friday, June 26, 2020 at 8:18 PM (UTC).
+1088ms ║║Calculating (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center from pad LC-39A
+1088ms ║║A SpaceX Falcon 9 rocket will launch the Starlink-10 (57x) mission on Friday, June 26, 2020 at 8:18 PM (UTC).
+1089ms ║║ + (string) null >> (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center from pad LC-39A
+1089ms ║║A SpaceX Falcon 9 rocket will launch the Starlink-10 (57x) mission on Friday, June 26, 2020 at 8:18 PM (UTC).
+1089ms ║║null
+1092ms ║║Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center from pad LC-39A
+1092ms ║║A SpaceX Falcon 9 rocket will launch the Starlink-10 (57x) mission on Friday, June 26, 2020 at 8:18 PM (UTC).
+1092ms ║║null
+1093ms ║║Executed virtual command log (1ms)
+1106ms ║║Calculating (string) 🚀 + (string) Falcon 9 >> (string) 🚀 Falcon 9
+1110ms ║║Calculating (string) 🚀 Falcon 9 + (string) is scheduled to launch from >> (string) 🚀 Falcon 9 is scheduled to launch from
+1114ms ║║Calculating (string) 🚀 Falcon 9 is scheduled to launch from + (string) Falcon 9 is scheduled to launch from [Starlink-10 (57x), BlackSky Global 5 & 6]
+1119ms ║║Calculating (string) 🚀 Falcon 9 is scheduled to launch from >> (string) 🚀 Falcon 9 is scheduled to launch from
+1123ms ║║Calculating (string) 🚀 Falcon 9 is scheduled to launch from + (string) Kennedy Space Center >> (string) 🚀 Falcon 9 is scheduled to launch from Kennedy Space Center
+1126ms ║║Calculating (string) 🚀 Falcon 9 is scheduled to launch from Kennedy Space Center + (string) on >> (string) 🚀 Falcon 9 is scheduled to launch from Kennedy Space Center on
+1130ms ║║Calculating (string) 🚀 Falcon 9 is scheduled to launch from Kennedy Space Center on + (string) Fri, Jun 26 2020 @ 4:13:00 PM EDT >> (string) 🚀 Falcon 9 is scheduled to launch from Kennedy Space Center on Fri, Jun 26 2020 @ 4:13:00 PM EDT
+1133ms ║║Calculating (string) 🚀 Falcon 9 is scheduled to launch from Kennedy Space Center on Fri, Jun 26 2020 @ 4:13:00 PM EDT + (string) from pad >> (string) 🚀 Falcon 9 is scheduled to launch from Kennedy Space Center on Fri, Jun 26 2020 @ 4:13:00 PM EDT from pad
+1136ms ║║Calculating (string) 🚀 Falcon 9 is scheduled to launch from Kennedy Space Center on Fri, Jun 26 2020 @ 4:13:00 PM EDT from pad + (string) LC-39A >> (string) 🚀 Falcon 9 is scheduled to launch from Kennedy Space Center on Fri, Jun 26 2020 @ 4:13:00 PM EDT from pad LC-39A
+1138ms ║║Calculating (string) 🚀 Falcon 9 is scheduled to launch from Kennedy Space Center on Fri, Jun 26 2020 @ 4:13:00 PM EDT from pad LC-39A + (string) . >> (string) 🚀 Falcon 9 is scheduled to launch from Kennedy Space Center on Fri, Jun 26 2020 @ 4:13:00 PM EDT from pad LC-39A.
+1141ms ║║Executed virtual command setState (0ms)
+1144ms ║╚Execution stage complete. (1034ms)
+1145ms ║Setting up scheduled job for Sat, Jun 27 2020 @ 12:35:00 AM EDT (in 86399.791s)
+1152ms ╚Event processed successfully (1152ms)

#44

That last block does not like to re-evaluate until it is inside that block.
Here is the technique I used on my Rocket piston to force an update a bit early.


#45

Thanks!

So during the daily update at 00:35, I set the nle variable to be calculated, then updated the alert block. A couple of questions:

  • You mention updating nle hourly. Do I really need to do that?
  • You have the alert block running for nle or what I’m guessing is the same value of nle. Do I need to do that? Wouldn’t that make it alert twice?

#46

I put mine inside a block that runs every hour, although looking back, I do not remember why I did that, LOL

You may be able to get away with only running that line on the times where the API is updated.


Well, there are two triggers there.
One is {nle} (which translates to launchTime -30)
The other is launchTime -91, which is the magic element I used to force the real time to be updated.

Note: I am not sure it matters, but logically, the {nle} trigger needs to be before the -91 line


#47

So I had a bit of a failure today. The launch was scrubbed around 1pm ET. At T-30 minutes, it triggered this time (yay!). However, it grabbed the info for whatever the next launch it found was, and announced that. How would I prevent that?


#48

I sincerely apologize. This was addressed and solved over in my forked thread.

Basically, the workaround I added to the top trigger was something like this:

pic

This forces extra API pulls in the hours leading up to the launch.
(which should catch any new changes, and update the variables before the event)