Author Topic: triggering events in vox from homeassistant  (Read 2718 times)

0 Members and 1 Guest are viewing this topic.

IKROWNI

  • $upporter
  • Sr. Member
  • *****
  • Posts: 146
  • Karma: 2
    • View Profile
triggering events in vox from homeassistant
« 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


jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: triggering events in vox from homeassistant
« Reply #1 on: August 26, 2016, 02:08:44 PM »
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

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: triggering events in vox from homeassistant
« Reply #2 on: August 26, 2016, 02:39:19 PM »
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
« Last Edit: August 26, 2016, 02:42:19 PM by jitterjames »

IKROWNI

  • $upporter
  • Sr. Member
  • *****
  • Posts: 146
  • Karma: 2
    • View Profile
Re: triggering events in vox from homeassistant
« Reply #3 on: August 26, 2016, 02:53:20 PM »
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!