Support multiple services
wildbomb opened this issue · 1 comments
If I understand the current implementation correctly, it creates one accessory with one service and then adds all the characteristics it can autodetect based on the FHEM readings.
This works fine most of the time, but this could be improved to separate the characteristics into their correct corresponding services.
For example I'm bridging some LaCrosse thermometers (temperature + humidity). This plugin detects the temperature reading and creates a "Temperature Sensor" service with a "CurrentTemperature" and a battery characteristic. Later on it finds the humidity reading and instead of adding a second service ("Humidity Sensor"), it adds the "CurrentRelativeHumidity" to the temperature sensor service.
Apps like Eve can display this correctly, but for example the iOS 10 Home app will not take the relative humidity into consideration for statistics, display, etc. since it is not expecting a temperature sensor to have a humidity characteristic.
If I create a dummy device on FHEM to extract the humidity reading to a separate device, this plugin will correctly bridge it as a "Humidity Sensor" and the iOS 10 Home app will then show both a temperature and an humidity sensor.
yes. currently it is one service per device or one service per multiple devices with one or multiple characteristics per service but not multiple services per device.
grouping multiple characteristics into one service is the correct way. especially as there is a 100 services limit per bridge.
other homekit accessories like the eve energy or weather also combine multiple characteristics into one service.
that the current home app only displays the main/default characteristics is a bug on their side i would argue.
you can use a fhem readingsProxy to extract the value into a separate device and save the notify or use homebridgeMapping in a dummy to get the value from the real device.
there are some scenarios for multi purpose devices that have completely separate and contradicting services where it would make sense to separate them into different services. but i have currently no idea how to do this elegantly with a config option. with using a dummy or a readingsProxy already is quite easy to do this.