Closed tvillingett closed 8 years ago
@tvillingett: Short answer: no it isn't possible
There are 3 different layers:
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.
I get it, not really feasible...
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
@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 ?
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
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).
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.
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.
Now the HAP-nodered node for Node-Red does this and works great along with homebridge-mqtt.
Sent with GitHawk
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)
Sorry - wrong place for post.
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?