Is there a way to trigger a flow based on opening a specific program on windows?

Hi there Homey Community,

just a quick simple question.
Does anybody know of a way (even if it requires installation of a software on my pc) to trigger a flow when I open a specific program/app on my windows computer?
I searched the forum and around the web but can only find solutions for the other way around.

There are two parts to your question:

  1. How to start a flow from your PC
  2. How to initiate the flow

I use the excellent Micro Web Server app. One of its features is a simple way to activate a flow by calling a URL, and a flow card provided by the app. Works only on local network but that might be OK for your purposes. Otherwise, you will need to investigate other possibilities including the Homey API.

To call the URL there are a ton of options. Perhaps the simplest is to write a batch file or Powershell script to invoke your program and call the appropriate URL. You can then give it the same icon as your program and use it instead of calling the program directly.

Obviously calling the program direct bypasses the flow call.

Another alternative is to write some code that polls the list of programs running on your PC and calls the URL if found (there’s a task id that would prevent multiple alerts for the same program call). If the program starts and stops quickly, you might miss it between poll intervals.

There’s probably a Windows API that allows you to detect new program calls, but I’ve not looked into that.

Might give you some ideas.

Andy

1 Like

Thank you very much for the ideas.
Micro Web Server sounds promising.

I’ll see if I can make this work somehow.