cflurin / homebridge-mqtt

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

Lightbulb service glitchy color picker #71

Closed SebDominguez-zz closed 5 years ago

SebDominguez-zz commented 5 years ago

Hi, I'm experimenting a strange problem. If I setup a light with BOTH RGB+Temp setting, the color picker (where you can have 6 saved color, not the wheel) the input get ignored and the color isn't.

This is really difficult to explain so there is a screen recording showing the issue

IMAGE ALT TEXT HERE

this is the configuration that I'm using

{
    "name": "RGB and Temp Light",
    "service": "Lightbulb",
    "Brightness": "default",
    "Hue": "default",
    "ColorTemperature": "default",
    "Saturation": "default"
}

and If I set my light like that:

{
    "name": "RGB Light",
    "service": "Lightbulb",
    "Brightness": "default",
    "Hue": "default",
    "Saturation": "default"
}

or even:

{
    "name": "Temp Light",
    "service": "Lightbulb",
    "Brightness": "default",
    "ColorTemperature": "default",
    "Saturation": "default"
}

I don't have any problem...

cflurin commented 5 years ago

Hi, Which homebridge , hap-nodejs, homebridge-mqtt versions have you installed? Try homebridge with debug mode to see what is going on.

homebridge -D

or display the the messages from hombridge-mqtt:

homebridge/from/#

e.g.

{
    "name": "RGB and Temp Light",
    "service_name": "RGB and Temp Light",
    "characteristic": "ColorTemperature",
    "value": 496
}
SebDominguez-zz commented 5 years ago

homebridge 0.4.45 homebridge-mqtt 0.5.1 Not sure how to check hap-nodesjs version

Edit: Here's a new recording, the logs doesn't seems to show anything relevant...

IMAGE ALT TEXT HERE

There is the complete log of homebridge

[12/15/2018, 4:18:36 PM] [mqtt] Number of cached Accessories: 3
[12/15/2018, 4:18:36 PM] [mqtt] Controller.start
[12/15/2018, 4:18:36 PM] [mqtt] clientId = homebridge-mqtt_e5c0f44a
[12/15/2018, 4:18:36 PM] [mqtt] Connecting..
[12/15/2018, 4:18:36 PM] Homebridge is running on port 51826.
[12/15/2018, 4:18:36 PM] [mqtt] connected (url = mqtt://127.0.0.1)
[12/15/2018, 4:18:36 PM] [mqtt] on.connect subscribe homebridge/to/#
[12/15/2018, 4:18:36 PM] [mqtt] on.connect homebridge-mqtt v0.5.1 started
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.getService_names
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.getService_names [iid 10] Temp Light 'On' 'Temp Light'
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.getService_names [iid 11] Temp Light 'Brightness' 'Temp Light'
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.getService_names [iid 12] Temp Light 'Saturation' 'Temp Light'
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.getService_names [iid 13] Temp Light 'Color Temperature' 'Temp Light'
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.get [iid 13] 'Temp Light' 'Temp Light' 'ColorTemperature'
[12/15/2018, 4:18:38 PM] [mqtt] buildTopic homebridge/from/get
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.get [iid 11] 'Temp Light' 'Temp Light' 'Brightness'
[12/15/2018, 4:18:38 PM] [mqtt] buildTopic homebridge/from/get
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.get [iid 10] 'Temp Light' 'Temp Light' 'On'
[12/15/2018, 4:18:38 PM] [mqtt] buildTopic homebridge/from/get
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.get [iid 12] 'Temp Light' 'Temp Light' 'Saturation'
[12/15/2018, 4:18:38 PM] [mqtt] buildTopic homebridge/from/get
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.getService_names
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.getService_names [iid 10] RGB Light 'On' 'RGB Light'
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.getService_names [iid 11] RGB Light 'Brightness' 'RGB Light'
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.getService_names [iid 12] RGB Light 'Hue' 'RGB Light'
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.getService_names [iid 13] RGB Light 'Saturation' 'RGB Light'
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.get [iid 10] 'RGB Light' 'RGB Light' 'On'
[12/15/2018, 4:18:38 PM] [mqtt] buildTopic homebridge/from/get
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.get [iid 12] 'RGB Light' 'RGB Light' 'Hue'
[12/15/2018, 4:18:38 PM] [mqtt] buildTopic homebridge/from/get
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.get [iid 13] 'RGB Light' 'RGB Light' 'Saturation'
[12/15/2018, 4:18:38 PM] [mqtt] buildTopic homebridge/from/get
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.get [iid 11] 'RGB Light' 'RGB Light' 'Brightness'
[12/15/2018, 4:18:38 PM] [mqtt] buildTopic homebridge/from/get
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.getService_names
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.getService_names [iid 10] RGB and Temp Light 'On' 'RGB and Temp Light'
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.getService_names [iid 11] RGB and Temp Light 'Brightness' 'RGB and Temp Light'
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.getService_names [iid 12] RGB and Temp Light 'Hue' 'RGB and Temp Light'
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.getService_names [iid 13] RGB and Temp Light 'Saturation' 'RGB and Temp Light'
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.getService_names [iid 14] RGB and Temp Light 'Color Temperature' 'RGB and Temp Light'
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.get [iid 13] 'RGB and Temp Light' 'RGB and Temp Light' 'Saturation'
[12/15/2018, 4:18:38 PM] [mqtt] buildTopic homebridge/from/get
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.get [iid 11] 'RGB and Temp Light' 'RGB and Temp Light' 'Brightness'
[12/15/2018, 4:18:38 PM] [mqtt] buildTopic homebridge/from/get
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.get [iid 14] 'RGB and Temp Light' 'RGB and Temp Light' 'ColorTemperature'
[12/15/2018, 4:18:38 PM] [mqtt] buildTopic homebridge/from/get
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.get [iid 10] 'RGB and Temp Light' 'RGB and Temp Light' 'On'
[12/15/2018, 4:18:38 PM] [mqtt] buildTopic homebridge/from/get
[12/15/2018, 4:18:38 PM] [mqtt] Accessory.get [iid 12] 'RGB and Temp Light' 'RGB and Temp Light' 'Hue'
[12/15/2018, 4:18:38 PM] [mqtt] buildTopic homebridge/from/get
[12/15/2018, 4:18:47 PM] [mqtt] Accessory.set [iid 12] 'RGB and Temp Light' 'RGB and Temp Light' 'Hue' 251
[12/15/2018, 4:18:47 PM] [mqtt] buildTopic homebridge/from/set
[12/15/2018, 4:18:47 PM] [mqtt] Accessory.set [iid 13] 'RGB and Temp Light' 'RGB and Temp Light' 'Saturation' 5
[12/15/2018, 4:18:47 PM] [mqtt] buildTopic homebridge/from/set
[12/15/2018, 4:18:49 PM] [mqtt] Accessory.set [iid 14] 'RGB and Temp Light' 'RGB and Temp Light' 'ColorTemperature' 500
[12/15/2018, 4:18:49 PM] [mqtt] buildTopic homebridge/from/set
[12/15/2018, 4:18:52 PM] [mqtt] Accessory.set [iid 12] 'RGB and Temp Light' 'RGB and Temp Light' 'Hue' 243
[12/15/2018, 4:18:52 PM] [mqtt] buildTopic homebridge/from/set
[12/15/2018, 4:18:52 PM] [mqtt] Accessory.set [iid 13] 'RGB and Temp Light' 'RGB and Temp Light' 'Saturation' 100
[12/15/2018, 4:18:52 PM] [mqtt] buildTopic homebridge/from/set
[12/15/2018, 4:18:53 PM] [mqtt] Accessory.set [iid 14] 'RGB and Temp Light' 'RGB and Temp Light' 'ColorTemperature' 500
[12/15/2018, 4:18:53 PM] [mqtt] buildTopic homebridge/from/set
[12/15/2018, 4:18:58 PM] [mqtt] Accessory.set [iid 12] 'RGB and Temp Light' 'RGB and Temp Light' 'Hue' 251
[12/15/2018, 4:18:58 PM] [mqtt] buildTopic homebridge/from/set
[12/15/2018, 4:18:58 PM] [mqtt] Accessory.set [iid 13] 'RGB and Temp Light' 'RGB and Temp Light' 'Saturation' 5
[12/15/2018, 4:18:58 PM] [mqtt] buildTopic homebridge/from/set
[12/15/2018, 4:19:00 PM] [mqtt] Accessory.set [iid 14] 'RGB and Temp Light' 'RGB and Temp Light' 'ColorTemperature' 500
[12/15/2018, 4:19:00 PM] [mqtt] buildTopic homebridge/from/set
[12/15/2018, 4:19:04 PM] [mqtt] Accessory.set [iid 12] 'RGB and Temp Light' 'RGB and Temp Light' 'Hue' 243
[12/15/2018, 4:19:04 PM] [mqtt] buildTopic homebridge/from/set
[12/15/2018, 4:19:04 PM] [mqtt] Accessory.set [iid 13] 'RGB and Temp Light' 'RGB and Temp Light' 'Saturation' 100
[12/15/2018, 4:19:04 PM] [mqtt] buildTopic homebridge/from/set
[12/15/2018, 4:19:12 PM] [mqtt] Accessory.set [iid 14] 'RGB and Temp Light' 'RGB and Temp Light' 'ColorTemperature' 160
[12/15/2018, 4:19:12 PM] [mqtt] buildTopic homebridge/from/set
[12/15/2018, 4:19:14 PM] [mqtt] Accessory.set [iid 14] 'RGB and Temp Light' 'RGB and Temp Light' 'ColorTemperature' 283
[12/15/2018, 4:19:14 PM] [mqtt] buildTopic homebridge/from/set
[12/15/2018, 4:19:15 PM] [mqtt] Accessory.set [iid 14] 'RGB and Temp Light' 'RGB and Temp Light' 'ColorTemperature' 149
[12/15/2018, 4:19:15 PM] [mqtt] buildTopic homebridge/from/set
[12/15/2018, 4:19:17 PM] [mqtt] Accessory.set [iid 14] 'RGB and Temp Light' 'RGB and Temp Light' 'ColorTemperature' 143
[12/15/2018, 4:19:17 PM] [mqtt] buildTopic homebridge/from/set
[12/15/2018, 4:19:19 PM] [mqtt] Accessory.set [iid 14] 'RGB and Temp Light' 'RGB and Temp Light' 'ColorTemperature' 495
[12/15/2018, 4:19:19 PM] [mqtt] buildTopic homebridge/from/set
[12/15/2018, 4:19:20 PM] [mqtt] Accessory.set [iid 14] 'RGB and Temp Light' 'RGB and Temp Light' 'ColorTemperature' 151
[12/15/2018, 4:19:20 PM] [mqtt] buildTopic homebridge/from/set
SebDominguez-zz commented 5 years ago

It seems that RGB light shouldn't be configured with both hue/sat and ColorTemperature as the resulting HomeKit device end up being glitchy.

cflurin commented 5 years ago

I'm not sure I understand your issue, In your log the values are sent by homebridge-mqtt. Actually you should be able to choose any optional characteristics.

/**
 * Service "Lightbulb"
 */

Service.Lightbulb = function(displayName, subtype) {
  Service.call(this, displayName, '00000043-0000-1000-8000-0026BB765291', subtype);

  // Required Characteristics
  this.addCharacteristic(Characteristic.On);

  // Optional Characteristics
  this.addOptionalCharacteristic(Characteristic.Brightness);
  this.addOptionalCharacteristic(Characteristic.Hue);
  this.addOptionalCharacteristic(Characteristic.Saturation);
  this.addOptionalCharacteristic(Characteristic.Name);
  this.addOptionalCharacteristic(Characteristic.ColorTemperature); //Manual fix to add temperature
};

What are you doing when you get the values from homebridge-mqtt? Which lightbulb device are you using? If you do it in node-red, post you simplified flow here.

SebDominguez-zz commented 5 years ago

I'm not doing anything with Mqtt actually, I'm just trying to demonstrate you with simple dummy lights that when we setup both color and temp features, the Home.app is acting wired (as shown in the recording) to fix this issue a light must be configured only with color nor temp.

In other words color and temp setting must be mutual exclusive. (According to my testing and experimenting with a lot of plugin / Homebridge implementation that apparently got this point wrong like home assistant and other Homebridge Plugin)

cflurin commented 5 years ago

I see! Did you try another HomeKit app like EVE? Anyway, It doesn't seem to be an homebridge-mqtt issue.

Search on homebridge / hap-nodejs repositories.

SebDominguez-zz commented 5 years ago

Didn't tried EVE. Now that I know how to avoid this glitch I'm sticking with Homebridge-mqtt.

Apparently Homeassistant developers don't consider this as a bug but a feature, so I'm just giving up on trying to make this glitchy software to works.

Since I'm not a Homebridge / hap-nodejs developers I don't have any clues on where to start to troubleshoot this problem.

Thanks you anyway for your plugin, it's the only Homebridge Plugin that have such flexibility that make working color lights a possibility.

Updating the readme regarding this unusual Home.app behavior might be a good idea.

nicoh88 commented 4 years ago

@SebDominguez-zz

Do you know if the problem has been solved?

We have the same problem as soon as we configure Characteristic.ColorTemperature next to Characteristic.Hue and Characteristic.Saturation. But without Characteristic.ColorTemperature natural colors are not possible. 😢