News:

There is now a ChangeLog page on the wiki
New developments are added at the bottom of the page.

Main Menu

triggering events in vox from homeassistant

Started by IKROWNI, August 26, 2016, 01:24:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

IKROWNI

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


jitterjames

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?

jitterjames

#2
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

IKROWNI

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!