normen / homebridge-milighthub-platform

Homebridge plugin to control MiLight Hub
6 stars 0 forks source link

Color Temperature Characteristic Warning #12

Closed papaloewe66 closed 2 years ago

papaloewe66 commented 3 years ago

My homebridge shows following Error message:

[homebridge-milighthub-platform] Error: at ColorTemperature.Characteristic.characteristicWarning (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2038:105) at ColorTemperature.Characteristic.validateUserInput (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1946:16) at ColorTemperature. (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1499:21) at step (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:143:27) at Object.next (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:124:57) at /usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:117:75 at new Promise () at Object.__awaiter (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:113:16) at ColorTemperature.Characteristic.handleGetRequest (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/dist/lib/Characteristic.js:656:24) at ColorTemperature. (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2103:22)

My System:

This Error seems not to effect the usage. The lights run perfect :-)

normen commented 3 years ago

Thanks. Can you give a bit more context? Like when does the message appear exactly, what are your settings, do you use HTTP or MQTT etc.

papaloewe66 commented 3 years ago

Hi Norman, I use http. I have some not completed mqtt setting.

After I recogniced the Error message, I changed homebridge into debug mode. This error come without any user interaction. I would say it appears 3 to 4 times a hour in a time gap between 1 to 30 minutes. The massage is always the same.

User interaction does not show any error. [29/03/2021, 18:48:40] [MiLightHubPlatform] Setting abc - milight/1/rgb_cct/1 { color_temp: 153 } [29/03/2021, 18:48:44] [MiLightHubPlatform] Setting abc - milight/1/rgb_cct/1 { saturation: 24, hue: 218 } [29/03/2021, 18:48:44] [MiLightHubPlatform] Setting abc - milight/1/rgb_cct/1 { commands: [ 'set_white' ] } [29/03/2021, 18:48:45] [MiLightHubPlatform] Setting abc - milight/1/rgb_cct/1 { saturation: 1, hue: 270 }

normen commented 3 years ago

Is there really no other warning messages before or after? Just that error? Because technically that code where the error appears isn't in this plugin, it's in homebridge.. Also, do you have rgbcct mode enabled?

papaloewe66 commented 3 years ago

you are rights. I did not copy the complete sequence.. my mistake

[29/03/2021, 20:21:55] [Hue] abc: request 84818: 200 OK [29/03/2021, 20:21:58] [homebridge-milighthub-platform] This plugin generated a warning from the characteristic 'Color Temperature': characteristic was supplied illegal value: number 140 exceeded minimum of 153. See https://git.io/JtMGR for more info. [29/03/2021, 20:21:58] [homebridge-milighthub-platform] Error: at ColorTemperature.Characteristic.characteristicWarning (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2038:105) at ColorTemperature.Characteristic.validateUserInput (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1946:16) at ColorTemperature. (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1499:21) at step (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:143:27) at Object.next (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:124:57) at /usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:117:75 at new Promise () at Object.__awaiter (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:113:16) at ColorTemperature.Characteristic.handleGetRequest (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/dist/lib/Characteristic.js:656:24) at ColorTemperature. (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2103:22) [29/03/2021, 20:21:58] [Hue] abclamp: set homekit transition control to ""

papaloewe66 commented 3 years ago

PS.: Yes I use RGBCCT. If is a setting for the device. If this means 'enable rgbcct mode', than yes.

normen commented 3 years ago

As the manual says, technically RGBCCT mode isn't supported by HomeKit. This whole message is just a warning though so you can just ignore it, as you say things will continue to work as they always did. I'll leave this open in case theres ways to avoid this message.

papaloewe66 commented 3 years ago

Thanks for taking care

dotsam commented 3 years ago

Hey there, I had this issue in my MiLight Homebridge plugin too. What's happening here is that even though we're setting a new min/max value, HAP-NodeJS sets the initial value to the original "default value" which is derived from the original minimum, not the new one.

So when defining the characteristic, simple use updateValue() to set it to something within your new range: https://github.com/dotsam/homebridge-milight/commit/dae7285c6af25dcdccad6f9e3e34174737b28ed7

douginoz commented 2 years ago

I think I'm getting the same error. I don't see that stack trace but perhaps it's only displayed on the command line while I'm only using the web gui. At any rate, I receive constant

[1/18/2022, 7:43:03 PM] [homebridge-milighthub-platform] This plugin generated a warning from the characteristic 'Color Temperature': characteristic was supplied illegal value: number 140 exceeded minimum of 153. See https://git.io/JtMGR for more info.

[1/18/2022, 7:43:03 PM] [homebridge-milighthub-platform] This plugin generated a warning from the characteristic 'Color Temperature': characteristic was supplied illegal value: number 140 exceeded minimum of 153. See https://git.io/JtMGR for more info.

entries in my log file. I've been ignoring them for the past 6-7 months but I'm currently trying to resolve a problem with my lights that are controlled by milight. The lights stay as "Updating" in my iphone Home app, often for hours. At some point they become available, and work perfectly fine; but any time I have to restart Homebridge, they become 'Updating' for hours. No other devices are doing this.

I'm controlling 2 lights. According to my "milight-hub' web instance, they are type 'FUT091/B2'. They are warm white/cool white lights, not RGB+CCT or RGBW etc.

I've tried enabing debug in the plugin but the additional info isn't of any use - POST and GET commands are logged.

homebridge-milighthub-platform v0.4.2 Configuration is all defaults. I've tried enabling 'RGB+CCT mode enabled' but there's no change.

I don't suppose the log messages are important and probably not related to the 'Updating' delays, but they're the only thing that's showing up in the logs that seem out of the ordinary.

douginoz commented 2 years ago

Update: I separated out this plugin into it's own bridge and everything's working normally again. There's no delays, no 'Updating', etc. So it appears to have been slowing the main HB bridge for some reason.

normen commented 2 years ago

Yeah, we really have to rip out the getters in the code to avoid any waiting on the homebridge side at all, thats the plan anyway. @Zer0x00, did you make any attempts at that? We have to streamline where the updates are sent to homebridge, they should definitely not be in the applyDesignatedState, or at least at the very end of it 😅

normen commented 2 years ago

Actually we can remove the whole http dedup stuff by simply checking the light states in an interval and not bothering homebridge.

With mqtt all this is basically working, even with backchannels..

normen commented 2 years ago

I just published a v0.4.3 that at least removes the getters so homebridge should never really have to wait for the plugin.

normen commented 2 years ago

For the Color Temperature I'll have to refer to @Zer0x00 as I don't have any RGB/CCT lamps in my setup currently and can't try the workaround presented by @dotsam (thanks for that!).

normen commented 2 years ago

I just pushed a v0.4.11 that includes the suggested workaround for this issue, maybe somebody can try if it works.

Zer0x00 commented 2 years ago

Unfortunately I don't have any time to work on this but will see if I can work on this if I have more time.

normen commented 2 years ago

Unfortunately I don't have any time to work on this but will see if I can work on this if I have more time.

Most issues should be fixed, I also changed a lot of stuff though so I guess any feature branches will be broken.

normen commented 2 years ago

I suppose these issues are no more so I'm closing this.