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

not possible to get accessories defined outside homebridge-mqtt #8

Closed
tvillingett opened this issue Oct 17, 2016 · 11 comments
Closed

Comments

@tvillingett
Copy link

Is it possible in any way to get hold of, and control, other accessories, like lamps etc, that was not configured in the scope of homebridge-mqtt, but exists on the same homebridge, or same Home?

@cflurin
Copy link
Owner

cflurin commented Oct 17, 2016

@tvillingett:
Short answer: no it isn't possible

There are 3 different layers:

  1. Homekit with access to all accessories.
  2. Homebridge has only access to all accessories defined in the installed plugins.
  3. Plugin has access to the own accessories.

The MQTT API could be added to layer 2 (homebridge), this depends on the homebridge-developers. I don't think Apple will be willing to add a MQTT API to Homekit.

@tvillingett
Copy link
Author

I get it, not really feasible...

@timbru31
Copy link

timbru31 commented May 9, 2018

I'm a bit late to the party, but a (very) inconvenient way is to use the hidden API of homebridge in the insecure mode. E.g. http://your-ip:51826/accessories

If someone is interested I can share my blueprint for toggling Hue lamps via a Sonoff T1 that sends a custom MQTT message

@bohtho
Copy link

bohtho commented May 17, 2018

@timbru31 Interesting. Would be very interesting to expose the hidden API in insecure mode with just this MQTT plugin. Then everything in Homebridge would be available to query or at least read in Node-RED, regardless of which Homebridge plugin registered it ?

@timbru31
Copy link

timbru31 commented May 17, 2018

You don't even need this plugin to expose the API. Just start homebridge with the -I flag. ;)
Correct, every device is exposed via the raw HomeKit protocol/API (HAP).

See e.g. homebridge/homebridge#1219 (comment) and, https://github.com/oznu/hap-client or https://developer.apple.com//homekit/specification/ for more information about the HAP

edit here is my example Node-RED config: https://pastebin.com/sRFNSGXd

@bohtho
Copy link

bohtho commented May 17, 2018

I see. Well, if in insecure mode, it would be great if

topic: homebridge/to/get payload: {"name": "*"}

would return every accessory in the homebridge instance regardless of plugin via the hidden API (if available).

@timbru31
Copy link

Ah I see what you mean. Yeah that would be awesome. Using the raw HAP protocol is quite a pain.
Home Assistant offers a nice REST API, if you are just interested in MQTT and Node-RED it might be worth a shot, too.

@bohtho
Copy link

bohtho commented May 18, 2018

If any developers for the mqtt plugin would like inspiration, homebridge-config-x (Homebridge GUI plugin) does exactly this when Homebridge is run in insecure mode. Then a new tab is available with a graphical layout showing all accessories regardless of plugins, with states and the ability to manipulate them.

@bohtho
Copy link

bohtho commented Mar 10, 2019

Now the HAP-nodered node for Node-Red does this and works great along with homebridge-mqtt.

Sent with GitHawk

@ArnoldGoat
Copy link

I've just had a go with this: Home(iPadOS)->homebridge+websockets->homebrew program->wifi->flashed Sonoff->heater and it works. But if I want to extend this to lots of devices, it seems that there is just one global namespace. So I could have lounge-heater and office-heater, but I can't have 'heater' on its own within the scope of a room? Not sure how Siri could cope with all this. (Fwiw the homebrew program->wifi->flashed sonoff bit has been working for ages with a web browser control. The browser has a location hierarchy structure)

@ArnoldGoat
Copy link

Sorry - wrong place for post.

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

5 participants