VoxCommando
General Discussion => Off Topic (not related to VC) => Topic started by: IKROWNI on August 26, 2016, 01:24:56 PM
-
I was just playing around with HomeAssistant and was trying to find a way to create a button in home assistant using the command_line component that will trigger an event i made for my x10 fan module. I'm receiving the event through the tcp webserver for voxcommando but i keep getting it over and over again from a different port each time. which just keeps turning it on and off over and over.
The switch i created looks like this obviously port and ip are my machines ip address and port is the port used for the webserver in voxcommando
switch:
platform: command_line
switches:
fantoggle:
oncmd: "/usr/bin/curl -X GET http://myipaddress:PORT/api/VC.TriggerEvent&&fan.toggle"
mypc_off:
offcmd: "/usr/bin/curl -X GET http://myipaddress:PORT/api/VC.TriggerEvent&&fan.toggle"
Is there something i'm doing wrong here?
heres a screenshot (https://voxcommando.com/forum/proxy.php?request=http%3A%2F%2Fi.imgur.com%2Febnq99n.png&hash=7bf10fd8e604c12175088a77520542eca4c64121)
-
Looks like you are doing something wrong in HomeAssistant which is sending the request multiple times. Since I've never used HomeAssistant I can't tell you much more than that.
How many times is the event being sent per click?
If you are using a command line tool anyway you could always switch to using udpSender instead of curl, or is this running in a non-Windows system?
-
I installed curl for windows in order to double check and it works as expected. I get one and only one event.
By the way the -X Get is superfluous. This works for me:
curl "http://localhost:8009/api/VC.TriggerEvent&&fan.toggle"
Edit: Correction: I actually get 3 events, but only one "fan.toggle" event is generated. :D
-
I just got it running using
VoxCommando.exe -33000 "VC.TriggerEvent&&fan.off
i just had to add voxcommando into the environment variables to get this to run. All is well now if i run into any other issues ill try the other method you listed james. Thanks for the help!