PatchworkBoy / homebridge-edomoticz

Domoticz Homebridge-Plugin
Other
118 stars 44 forks source link

Brightness Issue #136

Closed jannnfe closed 6 years ago

jannnfe commented 6 years ago

I use an RFLink to control my Milight devices. I have problems with the brightness and the colors. If I set 100% brightness in HomeKit this will not work. Likewise, HomeKit sometimes does not accept my set brightness and just resets it to its old state. How can I fix this error?

PatchworkBoy commented 6 years ago

When HomeKit doesn’t accept and resets to old state, this is usually due to a lack of acknowledgment to it’s command... if it doesn’t receive an acknowledgment then it reverts to the cached value. Do you have MQTT running and enabled in both Domoticz and homebridge-edomoticz?

As far as I’m aware the brightness problem is a known issue to do with translation between RGB dimming and HSV dimming or something similar (if memory serves this is inconsistent from device manufacturer to device manufacturer, and only affects specific devices), but I’d have to read thru all the commits done in my 2 year absence to know more. (I didn’t have any involvement in the writing of dimming code - twas all done by Ramon while I was out of action)

jannnfe commented 6 years ago

Thank you for your answer. I added MQTT to Domoticz. When switching a lamp Domoticz also sends a "domoticz/out" to my MQTT broker. As you discribed, does that mean that my broker is too slow? I hope someday someone looks again at the known problem with the brightness :) I really like the edomoticz plugin but it would be even better if the brightness would work reliably. Thank you and have a nice day :)

PatchworkBoy commented 6 years ago

Am just trying to confirm that MQTT is working at both ends. If you run DEBUG=* homebridge -D to launch homebridge (after first closing it, else you’ll end up with 2x copies running and the second will fail), do you see the line [eDomoticz] Successfully connected to MQTT broker. in the output?

jannnfe commented 6 years ago

Sorry for my late response. Yes I'am getting this output! :)

PatchworkBoy commented 6 years ago

Get me the JSON output for one of your milight devices in question please so I can trace how they’re being identified and handled within the plugin...

Ultimately I suspect little can be done as it’ll be a side effect of https://github.com/domoticz/domoticz/issues/1808

...which means HomeKit never knows what your current brightness and colour truly are. It can only ever know the last brightness and colour that was sat by Homekit itself. This is the common cause of all issues involving RGB / RGBW lights not behaving as expected.

jannnfe commented 6 years ago

This is the JSON output for one Bulb: {\n "Battery" : 255, "RSSI" : 12, "description" : "", "dtype" : "Lighting Limitless/Applamp", "id" : "00001BCE", "idx" : 21, "name" : "Stehlampe", "nvalue" : 1, "stype" : "RGBW", "svalue1" : "99", "switchType" : "Dimmer", "unit" : 2 }

PatchworkBoy commented 6 years ago

Yup... as above. RGB/RGBW support in Domoticz itself is partial. External apps and plugins can’t interact with them fully as a result. There’s also no way to identify if a Dimmable Light is actually a MiLight, as MiLight use 0-99 for brightness as opposed to the 0-100 that everyone else uses so there’s no way to write a handler in homebridge-edomoticz targeting only MiLight devices.

If it’s an issue involving RGBw/RGB lighting, basically, I can’t improve support any further until Domoticz improves the amount of information available via it’s APIs. Reading thru the commit history Ramon took them as far he could until the domoticz issue above became the limiting factor. Sorry!