New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP-API #1219
Comments
Jan,
During my initial investigation into integrating Amazon Alexa into Homebridge, I wrote a some shim code from Alexa into the homebridge http API.
Take a look at the code here, and the OLD_README. This is a working example of what you are looking for.
https://github.com/NorthernMan54/homebridge-alexa/blob/master/OLD_README.md
Please note, that since I built this, I changed my approach and have added Alexa support directly into homebridge, by modifying the hap-nodejs web server.
…Sent from my iPad
On Mar 21, 2017, at 6:04 AM, Jan Mußenbrock ***@***.***> wrote:
Hi,
this is not an issue and I'm sorry to use this place for this question but I can't seem to find a board or something similar to post my question.
I wanted to ask If there is a way to communicate with homebridge via Http. I'd like to be able to make request with my Pebble smartwatch. I can only find plugins that make homebridge support making own Http-Requests but I can't find anything that help making it recieve them to set states etc.
Thank's in advance.
Jan
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hi @NorthernMan54, Can you give me a little more info? I'm not too familiar with homebridge plugins and node.js yet. Basically I'm looking for my accessories exposed via local URL. So I can call them with parameters like on/off for example. |
My plug in homebridge-http-webhooks can create various accessesories and receive http calls to switch states. |
Hi @benzman81, "accessories": [{
"accessory": "FakeBulb",
"name": "Test-Lampe",
"bulb_name": "Test-Lampe"
}] "platforms": [{
"platform": "ParticleIO",
"name": "Particle Devices",
"access_token": "xxxxx",
"cloud_url": "https://api.particle.io/v1/devices/",
"devices": [{
"name": "Particle",
"type": "lightbulb",
"device_id": "xxxxx",
"function_name": "onoff",
"args": "{STATE}"
}]
}, {
"platform": "cmdSwitch2",
"name": "CMD Switch",
"switches": [{
"name": "Playstation",
"on_cmd": "ps4-waker",
"off_cmd": "ps4-waker standby",
"state_cmd": "ps4-waker search | grep -i '200 Ok'",
"polling": true,
"interval": 5,
"manufacturer": "Sony Corporation",
"model": "CUH-1001A",
"serial": "XXXXXXXXXXX"
}]
}] |
@HansWurst90 You cant. If the plugin of the platform or accessesory does not support this, than you can not add this functionality. My plugin only works by itself, but lights are currently not supported. I would add an issue to the plugins github repository so that they add support for it. |
@benzman81 |
@HansWurst90 yes, it adds the ability to homebridge to add accessories to homekit for devices, that can send http calls on state change. |
Jan,
My code example leverages homebridge's undocumented http API that is exposed with the -I option on the homebridge startup command line. This is the same API that is used by HomeKit to discover and control your homebridge accessories.
You can explore this interface using the curl command. Later tonight when I'm home I will post some examples.
… On Mar 21, 2017, at 8:49 AM, Markus Krüger ***@***.***> wrote:
@HansWurst90 yes, it adds the ability to homebridge to add accessories to homekit for devices, that can send http calls on state change.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@NorthernMan54 allright. I'll do a little exploration 😄 |
Curl examples. This turns off the device at aid 2 iid 9
curl -X PUT http://127.0.0.1:51826/characteristics --header "Content-Type:Application/json" --header "authorization: 031-45-154" --data "{ \"characteristics\": [{ \"aid\": 2, \"iid\": 9, \"value\": 0}] }"
This is all the accessories
curl -X PUT http://127.0.0.1:51826/accessories --header "Content-Type:Application/json" --header "authorization: 031-45-154”
… On Mar 21, 2017, at 11:46 AM, Jan Mußenbrock ***@***.***> wrote:
@NorthernMan54 <https://github.com/NorthernMan54> allright. I'll do a little exploration 😄
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#1219 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AS5CmNl3F8yG5_5pqogr3fgJJVFFlCs-ks5rn_DigaJpZM4MjkbF>.
|
Thank you @NorthernMan54 |
@NorthernMan54 Thanks for those - using them and node-red I have a nice easy to use solution for combining Alexa-homebridge (while keeping the "official"/maintained version of homebridge and hap) |
Hi, |
@CapoD You want to be able to access homebridge without encryption but you don't want homebridge to be insecure 😟 ? |
@snowdd1 I do not see the contradiction. Maybe there is a hidden (secure) REST api or there are examples how you could implement a client that is able to access the home bridge like an iOS device. Unfortunately, I cannot find anything on this. |
I too would love to know if there was a secure option available @snowdd1. From what I can tell, the insecure argument is the only way to access the API at the moment. |
@snowdd1 any update on these new plugin apis? Also where did you find out about it? I can't seem to find it anywhere. |
Hi,
this is not an issue and I'm sorry to use this place for this question but I can't seem to find a board or something similar to post my question.
I wanted to ask If there is a way to communicate with homebridge via Http. I'd like to be able to make request with my Pebble smartwatch. I can only find plugins that make homebridge support making own Http-Requests but I can't find anything that help making it recieve them to set states etc.
Thank's in advance.
Jan
The text was updated successfully, but these errors were encountered: