Control HA using Windows Speech Recognition

I’m wondering has anyone tried controlling HA using Windows Speech Recognition (WSR)?

I came across WSR Macros. It seems I can customize the voice commands with it.

Potential possibilities are using “Run a Program” option…

From there, I can use a command line MQTT client for windows and use it to publish to certain topic with payload that will trigger and automation in HA. For example…

But I don’t know which command line MQTT client for windows to use.

Another possibilities is using Advanced option where I can input XML to create more complicated speech macros. But it seems to complicated to me.

Any advice/suggestion will be greatly appreciated. Thank you!

I have been meaning to look in to this for some time
http://www.electronhacks.com/2016/06/custom-cortana-mqtt-commands/

but I haven’t got around to it yet.

thanks. but cortana is not yet available in my location.

OK. I manage to make some progress here. I managed to install MQTT client on my PC and executed the macros which publish to the MQTT broker. Here is how I did it.

  1. Download mosquitto-1.4.14-install-win32.exe from https://mosquitto.org/download/ and install it on the PC.
  2. Download Win32 OpenSSL v1.0.2L Light from http://slproweb.com/products/Win32OpenSSL.html and install it. Do not select the v1.1x version. During installation, select Copy OpenSSL DDLs to: The OpenSSL binaries (/bin) directory.
  3. After installation, go to the installation directory (e.g. C:\OpenSSL-Win32\bin) and copy libeay32.dll and ssleay32.dll to the mosquitto installation directory.
  4. Go to ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/dll/x86/ and copy ‘pthreadVC2.dll’ to the mosquitto directory.
  5. Now, right click on WSR Macros in Windows System Tray and select New Speech Macro… and select Run a Program.
  6. Enter any phrase you would like to speak to trigger the command in the first field. E.g. Hello World
  7. In the second field, enter the path to mosquitto_pub.exe. E.g. C:\Program Files (x86)\mosquitto\mosquitto_pub.exe
  8. In the final field, enter the command line arguments. E.g. -h 192.168.1.123 -u yourusername -P yourpassword -t mypc/test -m "Hello World"

This will publish “Hello World” to this topic; mypc/test when you Hello World in WSR.