News:

VoxCommando works with Amazon Echo, Domoticz, EventGhost, Google Assistant, IFTTT, iTunes, J.River Media Center, Kodi, MediaMonkey, Nest, Philips Hue, Vera, Wemo, and the list keeps growing!

Main Menu

VC-TCP.exe - trigger events to VC's TCP Simple Web Server

Started by PegLegTV, February 28, 2018, 07:02:31 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

PegLegTV

I've created a simple little exe file with AutoHotKey for communicating with Voxcommando through the TCP simple web server, this works great when you are running more then one Voxcommando on the same network and you only want to communicate with one specific instance from a script or another program like Windows Task Scheduler

Code used in the VC-TCP.exe

Quote;uses HTTP Get to connect to TCP Server
VCpath = http://%1%/api/%2%
oHttp := ComObjCreate("WinHttp.Winhttprequest.5.1")
oHttp.open("GET", VCpath)
oHttp.send()
VCStatus = Done
return

in order to use this you will need to enable the TCP Plugin and in the TCP Plugin enable Simple Web Server and set the port number you would like to use.

Message Formatting
VC-IP:PORT "TTS.Speak&&Hello, How are you"

VC-IP = the IP address of the computer you want to communicate with
PORT = the Port you set in the TCP Plugin under Simple Web Server

VC-TCP.exe examples
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.4.0-->
<command id="630" name="VC-TCP.exe examples" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="VC-IP:Port &quot;VC.TellVox&amp;&amp;what you want to tell VC&quot;&#xD;&#xA;&#xD;&#xA;VC-IP:Port &quot;TTS.Speak&amp;&amp;what you want VC to say&quot;&#xD;&#xA;&#xD;&#xA;VC-IP:Port &quot;VC.Triggerevent&amp;&amp;Event&amp;&amp;Payload 1&amp;&amp;Payload 2&amp;&amp;Payload 3&quot;">
  <action>
    <cmdType>Launch.Hidden</cmdType>
    <params>
      <param>{Path.VC}\VC-TCP.exe</param>
      <param>192.168.1.10:6300 "VC.Triggerevent&amp;&amp;Test.Event&amp;&amp;Payload 1&amp;&amp;Payload 2&amp;&amp;Payload 3"</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Launch.Hidden</cmdType>
    <params>
      <param>{Path.VC}\VC-TCP.exe</param>
      <param>192.168.1.10:6300 "TTS.Speak&amp;&amp;Hello, how are you"</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Launch.CMD</cmdType>
    <params>
      <param>VC-TCP.exe 192.168.1.10:6300 "VC.Triggerevent&amp;&amp;Test.Event&amp;&amp;Payload 1&amp;&amp;Payload 2&amp;&amp;Payload 3"</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
</command>


more examples on action Formatting

PegLegTV

I forgot to add an example of using VC-TCP.exe with Launch.CMD

Message Formatting
VC-TCP.exe VC-IP:PORT "VC.Triggerevent&&Test.Event&&Payload 1&&Payload 2&&Payload 3"

I also updated the command group above with an example

PegLegTV

this morning I woke up to Windows Defender marking VC-TCP.exe as infected with a Trojan "Trojan:Win32/Fuery.A!cl", I have submitted the program for review, I will update when I here back

jitterjames

Welcome to the world of big antivirus.  :biglaugh

Utter nonsense.

PegLegTV

here's the final results, it has been cleared and no threats found.

Commercial Photography

QuoteWelcome to the world of big antivirus.  :biglaugh

Utter nonsense.

yeah no kidding