Skip to content
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

Closed
HansWurst90 opened this issue Mar 21, 2017 · 17 comments
Closed

HTTP-API #1219

HansWurst90 opened this issue Mar 21, 2017 · 17 comments

Comments

@HansWurst90
Copy link

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

@NorthernMan54
Copy link
Contributor

NorthernMan54 commented Mar 21, 2017 via email

@HansWurst90
Copy link
Author

HansWurst90 commented Mar 21, 2017

Hi @NorthernMan54,
thanks for the response. If I understand your code right Your using Alexa to trigger IFTTT-HTTP-Requests and Homebridge exposes the accessories. Is that correct?

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.

@benzman81
Copy link

My plug in homebridge-http-webhooks can create various accessesories and receive http calls to switch states.

@HansWurst90
Copy link
Author

Hi @benzman81,
that sounds promissing. I will give it try this afternoon.
I'm not sure if I understand the config, though.
How would I enable this accessory or these plattforms to be able to change them via HTTP?

"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"
        }]
    }]

@benzman81
Copy link

@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.

@HansWurst90
Copy link
Author

@benzman81
Then I don't seem to understand it. does your plugin add "virtual" accessories?

@benzman81
Copy link

@HansWurst90 yes, it adds the ability to homebridge to add accessories to homekit for devices, that can send http calls on state change.

@NorthernMan54
Copy link
Contributor

NorthernMan54 commented Mar 21, 2017 via email

@HansWurst90
Copy link
Author

@NorthernMan54 allright. I'll do a little exploration 😄

@NorthernMan54
Copy link
Contributor

NorthernMan54 commented Mar 21, 2017 via email

@HansWurst90
Copy link
Author

Thank you @NorthernMan54
I found the same commands yesterday evening but couldn't figure out which iid I had to use.
After your comment I gave it another try and it works. Now I only have to figure out the watch side of my whole idea. 😄

@lprhodes
Copy link

@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)

@CapoD
Copy link

CapoD commented Apr 13, 2017

Hi,
is there a possibility to access the REST API without having to allow insecure access with -I? The thing is that I would like to write a GUI application that allows my desktop computer to control stuff, but I do not want to make the Homebridge insecure.

@snowdd1
Copy link
Contributor

snowdd1 commented Apr 15, 2017

@CapoD You want to be able to access homebridge without encryption but you don't want homebridge to be insecure 😟 ?
That just is contradictory. The INSECURE option just does that - making the API accessible without the need for the original encryption.
There is a new API in the pipeline that will allow the implementation of manager and listener plugins, whatever the exact definition of those will be. I assume that manager plugins will have the ability to control the state of characteristics from other plugins - and that somebody will very soon implement a web interface plugin with that new API. Some of the guy around here have already nice web interfaces for their plugins.

@CapoD
Copy link

CapoD commented Apr 18, 2017

@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.
But according to your answer I just have to wait until the new api is released.
To put it in a nutshell, I am looking for a way to implement a GUI that brings HomeKit to the Desktop without violating security

@lprhodes
Copy link

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.

@jespertheend
Copy link

@snowdd1 any update on these new plugin apis? Also where did you find out about it? I can't seem to find it anywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants