Open mkormendy opened 4 years ago
That looks like a great feature. It’s a long time since I’ve looked at Home Assistant and I wasn’t aware of it.
I agree, it would be great to support this for Homebridge.
Did anyone ever make a start looking at this? I think this would greatly improve the usability of the plugin.
I think I might start taking a look at this later in the week (once I've finished tinkering with bridging BTLE blinds to MQTT).
To start a discussion, the basic steps I think are needed are:
What big gaping holes in this plan do others see?
@dhutchison Already completed, take a look at homebridge-tasmota it automatically handles most common device types. I created it in the summer, after these issues were raised.
I was just going to say that @NorthernMan54 has an auto discovery implementation in the wild!!
@NorthernMan54 is that specific to devices that came from tasmota or is it much more generic than the name suggests?
It is more generic that the name suggests, as the code is using the home assistant mqtt discovery messages. Technically any device that generates home assistant discovery mqtt messages is supported.
The currently supported devices match what I have in my home, but pull requests for more devices are gladly accepted.
Ta, I shall take a proper look through it later in the week.
From a skim it looks like a few of the device types I have are not supported in your plugin, I'll take a look through how you have done the discovery config parsing though. Personally I'd rather try to add discovery to Mqttthing, with it's wider service type support, than try to add service types to another plugin, but we'll see how I get on with that :)
A complication in doing this in mqttthing is that it's not a platform plugin, and I believe changing it to be (which I have considered) would break compatibility with existing configurations.
Automatic configuration would be great if it can be done though. I have considered writing a new 'version 2' if I can ever find the time.
That is a worry that I need to confirm.
I just don't know with the homebridge API if one module can expose two types of plugins, or if the solution is to make a second "auto-discovery" plugin that uses the existing one as a dependency for all the single accessory logic.
I'll start taking a look in a few days and report back initial findings.
One of the most loved features for Home Assistant is its MQTT Autodiscovery.
https://www.home-assistant.io/docs/mqtt/discovery/
Since this plugin for homebridge attempts to be a catch-all for MQTT device communication/operation. I'd be interested in seeing discussion around a larger project to port over the MQTT Autodiscovery implementation from Home Assistant to this plugin.
Thoughts?