Launch an app on a Windows PC

hey I am just trying to trigger a shortcut on a PC after I push a button (mqtt) is that possible?

yes, i put together one way with MQTT, Send an MQTT message from HA, and there’s a script that runs on your pc to carry out the actions. Launch an app on a Windows PC

I found it easier to use node red to carry out the actions,(Above) but it can all be done in HA

+1 for paho mqtt - minimal python script setup to run netflix in browser, launch plex media player below…

You’d run this on your HTPC and fill in the details to connect it to your MQTT broker e.g. mosquitto (installs in 5mins)

import paho.mqtt.client as mqtt
import subprocess
import ujson, webbrowser

MQTT_PORT = 1883

def on_connect(client, userdata, flags, rc):
    print("Connected with result code "+str(rc))


def extract_payload(payload):
        return ujson.loads(payload.decode())
    except Exception:
        return payload.decode()

def command_plex(data):
    if data.get("args") == "start":['C:\\Program Files\\Plex\\Plex Media Player\\PlexMediaPlayer.exe'])

def command_chrome(data):
    chrome_path = "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s"
    if data.get("args") == "start_netflix":

def router(data):
    if data.get("command") == "plex":
        return command_plex(data)
    elif data.get("command") == "chrome":
        return command_chrome(data)

def on_message(client, userdata, msg):
    channel = msg.topic.replace(f"{MQ_CHANNEL}/", "")
    data = extract_payload(msg.payload)
    print(f"Received message on channel: {channel}, message: {data}")

client = mqtt.Client()
client.on_connect = on_connect
client.on_message = on_message

client.username_pw_set(USERNAME, PASSWORD)

client.connect(MQTT_HOST, MQTT_PORT, 10)


publish MQTT data from home assistant as json payloads:

  - service: mqtt.publish
      payload: '{ "command": "plex", "args": "start" }'
      topic: SOME_CHANNEL_NAME/myhtpcname
  - service: mqtt.publish
      payload: '{ "command": "chrome", "args": "start_netflix" }'
      topic: SOME_CHANNEL_NAME/myhtpcname