cflurin / homebridge-mqtt

Homebridge-mqtt is a Plugin for Homebridge.
Apache License 2.0
229 stars 38 forks source link

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

Closed tvillingett closed 8 years ago

tvillingett commented 8 years ago

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 commented 8 years ago

@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 commented 8 years ago

I get it, not really feasible...

timbru31 commented 6 years ago

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 commented 6 years ago

@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 commented 6 years ago

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. https://github.com/nfarina/homebridge/issues/1219#issuecomment-288243015 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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 5 years ago

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

Sent with GitHawk

ArnoldGoat commented 3 years ago

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 commented 3 years ago

Sorry - wrong place for post.