Remote Triggers Questions: What needs to be true locally, i.e. firewalls etc? Multiple URL params? Also what's the response page displaying (0)?

So I'm playing with the Remote Trigger and have some questions I don't see addressed in the Wiki:

  1. What needs to be true locally for this to work? Based on previous forum discussion:

    The trigger happens by connecting to a Stairways web server, and by Keyboard Maestro keeping in touch with the Stairways web server

    It sounds like this is a pull/polling thing? Where the KM engine on my local machine is outbound checking the server on some "every X" frequency? Vs some sort of push from server to client?

  2. If so, how frequent is the poll? i.e. Is there an "always assume at least a 5 second delay" sort of situation?

  3. Any known issues with inbound/outbound firewalls? If it's polling only I assume that as long as KM has not been blocked somehow (i.e. LittleSnitch or something like that) it should just work? i.e. If I can hit the domain then it should work? Or does it depend on some other process or URL (that might be blocked even though KM isn't)?

  4. If there's any sort of inbound push thing do ports need to be opened at router level? (I assume not since this is explicitly called out as not the same as local web server). What about the system firewall? KM didn't trigger any request for incoming, so again I assume not.

  5. The TriggerValue, is that a flat value or expecting a key|value pair? If it's the latter can you string multiple, i.e. ?value1=X&value2=Y

  6. And finally when I hit the URL I get a blank page with a 0. Is that an indicator, like a success/fail maybe?

Again, just to be clear, all these questions are about the Remote Trigger, nor Public Web etc.


1 Like

Basically, both source and target need to be able to access the Internet.

It's not polling, it's a long lived connection that waits for a response form the server that comes when a trigger is made. So there is no frequency/polling period.

Not really. It is possible for some routers to drop the memory of the connection even though it is live. There is a keep alive flag which sends a small packet periodically to avoid this issue, but since every system is different it is impossible to know whether it works perfectly everywhere.

No, it's an outbound https request (both by Keyboard Maestro and whatever client you use to trigger it) which generally works in pretty much any environment.

It is a flat value which must be properly URL encoded. It will be decoded and placed in the TriggerValue token, and then how you process parts of it is up to you.

0 means that the server notified zero instances of Keyboard Maestro (which would mean definitely no macros fired). Normally it will be “1” when it notifies a single instance of Keyboard Maestro, however “1” does not absolutely guarantee that the macro will fire, but normally that would be the case. Other network issues could prevent the notification from making it to Keyboard Maestro for example.

Because of the way the Remote Trigger works it should “just work” in almost every case. It does depend on our server, so there is an extra point of failure, as well as the Internet functioning all the way from the source of the trigger to our server and back to Keyboard Maestro. But compared to the Public Web trigger it will work more generally in more cases in the modern NAT world - the Public Web trigger is more how you would do things in the pre-NAT, pre-firewall, pre-port mapping world.

Thanks for the info, I've already got some nice uses up and running!

And thanks for the point about processing the trigger value... I was kinda bummed about it not being multiple parameters, but I didn't even consider that I can basically mash stuff together however I want and then parse it in the macro - thanks for pointing that out!

1 Like