ilcato / homebridge-Fibaro-HC2

Homebridge plugin for Fibaro Home Center 2 (and Home Center Lite ...)
Apache License 2.0
67 stars 27 forks source link

Fibaro RGBW - color change sometimes not work #135

Closed pixeldepth closed 5 years ago

pixeldepth commented 5 years ago

I have the same problem as described in issue #102. That issue is closed but unresolved. I noticed that, for all RGB devices all even color changes not works, while even changes works. Brigthness changes always works correctly. There is no defference between using iOS app / desktop OSX app or Siri on HomePod.

This is reproduction of my issue: I started with RGB light set to white: R: 255 G: 255 B:255 (in fibaro app) Then I opened light details on iOS Homekit app and sets color to red:

[1/31/2019, 11:36:17 PM] [FibaroHC2] Setting value to device:  92  parameter: Hue
[1/31/2019, 11:36:17 PM] [FibaroHC2] Setting value to device:  92  parameter: Saturation

After that light was still white, so then I picked blue color:

[1/31/2019, 11:37:29 PM] [FibaroHC2] Setting value to device:  92  parameter: Hue
[1/31/2019, 11:37:29 PM] [FibaroHC2] Setting value to device:  92  parameter: Saturation
[1/31/2019, 11:37:29 PM] [FibaroHC2] Command:  setG, value: 115, to: 92
[1/31/2019, 11:37:29 PM] [FibaroHC2] Command:  setR, value: 0, to: 92
[1/31/2019, 11:37:29 PM] [FibaroHC2] Command:  setW, value: 0, to: 92
[1/31/2019, 11:37:29 PM] [FibaroHC2] Command:  setB, value: 255, to: 92
[1/31/2019, 11:37:30 PM] [FibaroHC2] Command:  setG, value: 115, to: 92
[1/31/2019, 11:37:30 PM] [FibaroHC2] Command:  setW, value: 0, to: 92
[1/31/2019, 11:37:30 PM] [FibaroHC2] Command:  setB, value: 255, to: 92
[1/31/2019, 11:37:30 PM] [FibaroHC2] Command:  setR, value: 0, to: 92

This caused color change to blue, so next I try change color to violete and one more time no reaction:

[1/31/2019, 11:40:05 PM] [FibaroHC2] Setting value to device:  92  parameter: Hue
[1/31/2019, 11:40:05 PM] [FibaroHC2] Setting value to device:  92  parameter: Saturation

One more try - set color to cyan and it caused color change to cyan:

[1/31/2019, 11:40:50 PM] [FibaroHC2] Setting value to device:  92  parameter: Hue
[1/31/2019, 11:40:50 PM] [FibaroHC2] Setting value to device:  92  parameter: Saturation
[1/31/2019, 11:40:50 PM] [FibaroHC2] Command:  setR, value: 0, to: 92
[1/31/2019, 11:40:50 PM] [FibaroHC2] Command:  setB, value: 200, to: 92
[1/31/2019, 11:40:50 PM] [FibaroHC2] Command:  setG, value: 255, to: 92
[1/31/2019, 11:40:50 PM] [FibaroHC2] Command:  setW, value: 0, to: 92
[1/31/2019, 11:40:51 PM] [FibaroHC2] Command:  setR, value: 0, to: 92
[1/31/2019, 11:40:51 PM] [FibaroHC2] Command:  setB, value: 200, to: 92
[1/31/2019, 11:40:51 PM] [FibaroHC2] Command:  setG, value: 255, to: 92
[1/31/2019, 11:40:51 PM] [FibaroHC2] Command:  setW, value: 0, to: 92
ilcato commented 5 years ago

@pixeldepth, unfortunately I do not have a device currently installed and cannot test it directly. Can you show me also the case when you change the brightness?

pixeldepth commented 5 years ago

Examples of brightness change:

[2/1/2019, 12:17:50 PM] [FibaroHC2] Setting value to device:  92  parameter: Brightness
[2/1/2019, 12:17:50 PM] [FibaroHC2] Setting value to device:  92  parameter: On
[2/1/2019, 12:17:50 PM] [FibaroHC2] Command:  turnOn, to: 92
[2/1/2019, 12:17:51 PM] [FibaroHC2] Command:  setG, value: 148, to: 92
[2/1/2019, 12:17:51 PM] [FibaroHC2] Command:  setR, value: 148, to: 92
[2/1/2019, 12:17:51 PM] [FibaroHC2] Command:  setB, value: 148, to: 92
[2/1/2019, 12:17:51 PM] [FibaroHC2] Command:  setW, value: 148, to: 92

Another one:

[2/1/2019, 12:19:02 PM] [FibaroHC2] Setting value to device:  92  parameter: Brightness
[2/1/2019, 12:19:02 PM] [FibaroHC2] Setting value to device:  92  parameter: On
[2/1/2019, 12:19:03 PM] [FibaroHC2] Command:  setW, value: 64, to: 92
[2/1/2019, 12:19:03 PM] [FibaroHC2] Command:  setG, value: 64, to: 92
[2/1/2019, 12:19:03 PM] [FibaroHC2] Command:  setR, value: 64, to: 92
[2/1/2019, 12:19:03 PM] [FibaroHC2] Command:  setB, value: 64, to: 92
ilcato commented 5 years ago

I think I found the problem and fixed it. This repository contains the fix, are you able to test it before publishing on npm?

pixeldepth commented 5 years ago

I tested it and it's working correctly. You can publish it. Thank you very much.

ilcato commented 5 years ago

Done