Author Topic: homekit via homebridge  (Read 2412 times)

0 Members and 1 Guest are viewing this topic.

JoshK

  • Jr. Member
  • **
  • Posts: 32
  • Karma: 3
    • View Profile
homekit via homebridge
« on: March 28, 2016, 10:04:35 AM »
https://github.com/nfarina/homebridge

have this triggering events in vc via http plugin for homebridge and vc's API

what is the correct method for responding to http get requests with variable data from vc?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: homekit via homebridge
« Reply #1 on: March 28, 2016, 02:08:45 PM »
I'm not 100% clear on what you are asking.

If you are asking how you can query VC for information like to retrieve {LastResult} using the simple web server, the answer is that VC is not really set up to do that right now, although you might be able to find a workaround.  If you call an action that returns a result it will be returned as XML.  The problem is finding the action that returns the result that you want.

Can you please explain a bit more clearly and in more detail what you want to do?

I may be able to offer a solution using the current VC version and I may also be able to add something to the TCP plugin to make it easier in the future.
« Last Edit: March 28, 2016, 03:18:47 PM by jitterjames »

JoshK

  • Jr. Member
  • **
  • Posts: 32
  • Karma: 3
    • View Profile
Re: homekit via homebridge
« Reply #2 on: March 29, 2016, 09:53:54 AM »
I see the response -
<action>
  <actionString>vc.tellvox&&turn on balcony lights</actionString>
  <Success>True</Success>
  <Result></Result>
</action>


how do I load anything into the <result> field?

short explanation - I use VC to control a CBUS system, It can set commands however it cannot query the system to know what lights are on etc (feedback from cbus was too hard). however vc can keep track of what lights it's turned on and off.
homebridge triggers events in vc via the web api, I need to trigger an event that will respond with the current lighting status, ie, 1, or 0.


jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: homekit via homebridge
« Reply #3 on: April 03, 2016, 03:38:25 PM »
Well, it's not very elegant but one way would be to do this:

Code: [Select]
http://127.0.0.1:8009/api/results.replace&&1&&1
any action that actually returns a result will give you the result (LastResult) in the xml.  It's just that things like VC.TellVox or OSD.ShowText actions don't return a result.

JoshK

  • Jr. Member
  • **
  • Posts: 32
  • Karma: 3
    • View Profile
Re: homekit via homebridge
« Reply #4 on: June 14, 2016, 09:04:45 AM »
I can get the result back in XML using http://127.0.0.1:8009/api/results.replace&&{LastResult}&&{var.bedroomlights}

but I unfortunately need just the variable returned, not the XML.

Anyway this would be possible?


jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: homekit via homebridge
« Reply #5 on: June 14, 2016, 09:45:47 AM »
No, you take the variable you need from the xml.