cflurin / homebridge-mqtt

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

Wemo platform #64

Closed crashflow closed 5 years ago

crashflow commented 6 years ago

I tried to get this to work with existing Wemo "outlets" but could not. The outlets were created using this plugin: https://github.com/rudders/homebridge-platform-wemo { "platform": "BelkinWeMo", "name": "WeMo Platform" }

Even if you use the same name and service name it will create a new outlet in homebridge and homekit.

Am I missing something?

Thanks

cflurin commented 6 years ago

Have a look here :https://github.com/cflurin/homebridge-mqtt/issues/8

lespatots commented 6 years ago

Sorry to chip into your thread but I need enlightenment too. My understanding is that this plug-in can not directly interface to real Homekit devices but that you can create virtual devices that Homekit can interface to. So I could copy a real lamp state to a virtual one and then I can use MQTT to transfer that to elsewhere (for display perhaps). Or I could create a virtual switch that is controlled by Node-red and that Homekit could act upon this with an automation? To do these things I need a Homekit hub?

cflurin commented 6 years ago

First you should understand how homebridge works. https://github.com/nfarina/homebridge

"Homebridge is a lightweight NodeJS server you can run on your home network that emulates the iOS HomeKit API"

As the name says homebridge is a bridge between HomeKit (iphone, ipad) and devices (sensors, switches, etc.). There are a lot of Plugins that you can install. One of them is homebridge-mqtt. With homebridge-mqtt you can add, remove, configure accessories at runtime. I like to use Node-red for all my stuff but you can also connect a device eg. using an ESP8266 or any system that has a MQTT API.

You don't need virtual devices but rather a tool on a Hardware like Raspberry Pi or ESP8266 to map data with the goal to use non HomeKit devices.

lespatots commented 6 years ago

Actually I have no problem interfacing various devices but what I really need is a simple interface between Node-Red and Homekit and there isn't one. So it seems the recommended workaround is using this plug-in and as far as I can tell the only way is creating virtual devices in Homekit and updating those from real devices or vice-versa.

cflurin commented 6 years ago

Still not clear what you mean by virtual device. Some more infos would be helpful. Please describe what you tried in node-red and in your HomeKit app (Home, EVE?).

As simple example such a Switch will do.

lespatots commented 6 years ago

I would like to generate a Node-red dashboard that shows the status of all my automated lights. Most lights are hue but some are not Homekit approved and some are driven by a Raspberry. There is no way to directly interface Homekit to Node-Red so I have choices. I could use Hue-Magic and read the light status or I could create a virtual light in Homekit which mirrors the status of a real lamp. That virtual light can update MQTT and thence Node-Red. In practice neither solution is good because of the large number of lamps. I could alternately add a virtual lamp to an Accessory Group and that would let me see the state of groups.

So a virtual device is an accessory created for the sole purpose of interfacing.

If I wanted to trigger a scene I could create a virtual switch which is set by MQTT and can be acted upon by Homekit to trigger the scene in Homekit.

Does that clarify? I don't really want to add/remove/configure devices at run time 'cos I don't see a use case? Is there one?

cflurin commented 6 years ago

As explained here :https://github.com/cflurin/homebridge-mqtt/issues/8 you can't access HomeKit accessories using homebridge-mqtt.

I also use philips hue lamps, they are connected with the hue bridge to HomeKit. Additionally I use node-red-contrib-huemagic to control the lamps and for the node-red-dashboard. As I said I use node-red for my home-automation and HomeKit as an additional "dashboard" and voice-control device. Except philips hue lamps all my devices (zwave, enocean, xiaomi, netatmo, esp8266) are connected to node-red running on several Raspberry PI's. On the main Rpi is the mqtt-broker running.

"Runtime" means you can add, remove, configure etc. the accessories without the need to restart homebridge as often you have to do using other plugins.