-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Brightness does not match #149
Comments
Hey; thank you for the report! Do you know if the happens for the full brightness range? Furthermore your configuration, logs and screenshots seem to be of 3 different lights 😛. Could you dump more log than just the few lines, Preferably from the start of homebridge up until the point that the error occurs. That should catch all the get and set events. |
Yes, this happens no matter what the brightness is set. I copied the logs from the UI and kept having trouble with the logs rolling. I’ll get the right ones posted. |
Updated with full logs attached as well as a filtered sample. From what I see in the logs it seems like its actually retrieving the correct Brightness value, but HK still shows 100%. BTW - there was a very brief discussion about this on Discord several months back. Just now getting around to opening that issue. :) |
Hi @milo526 I created a PR for you about this issue, take a look please when you can. |
I experience the same issue. Regardless of the settings of the actual dimmer, homekit could jump to either 100%, or... 11 e.g. Most of the time it doesn't state the actual brightness. Untill I change it in home itself. But upon reloading home, it might flip to a random brightness, but without influencing the dimmer. |
I’m experiencing the same kind of problem, but with a zigbee light module. Brightness settings in tuya app are responsive, but through HomeKit and Homebridge not. After setting brightness in tuya app this isn’t displayed in HK or HB either. |
Also experiencing this issue with a dimmer switch, wonder if 08f2236 is a fix? I'll give it a shot on my install. |
It could very well be that it is a fix for your specific device - however we concluded that it is not a proper general fix sadly. |
Hmm.. wonder if this could be something added as a config file flag then, as a patch until something more permanent. Then if users are seeing incorrect brightness for a specific device they could set the device's config to |
The original idea was to make the max brightness configurable, that seems to be the best possible fix. Just didn't have the time yet to fix that |
I see, I'll give it a shot if I get the chance soon! |
About the issue @milo526 I continued our work, just need your little guidance its inside the PR description, lets make an effort to end this issue |
Thanks folks for flagging this. I have the same problem. The root cause is a math mismatch in dimmer ranges from the Tuya APIs and the plugin implementation. @AlexPinhasov thanks a lot for proposing a fix through config. I think there might be an easier, config-less fix. The Tuya API provides an brightness range (default 1-255, but can change), that should be used to scale values back and forth with the HomeKit expected range (1-100). We don't need to assume a 255 default, or even dig up one from configured settings. We could just use the range value returned from their APIs. Here's some more references:
@milo526 also in #2 above, see MIN_BRIGHTNESS = 10.3. That's the magic number apparently of the minimum brightness value that does not turn off the light. ;) My 2 cents, you can fix this by making the math logic in https://github.com/milo526/homebridge-tuya-web/blob/master/src/accessories/characteristics/brightness.ts for setValue() and updateValue() match the one in light.py above. The trick will be getting access to the "bright_value" range for that specific light. I wonder if the data payload from getDeviceState() at https://github.com/milo526/homebridge-tuya-web/blob/master/src/api/service.ts contains that max range? HTH. You all are rockstars. This will fix dimmability consistently for everyone using TuyaWeb. |
You can see this problem clearly flagged by Homebridges new characteristic range warnings (>= Homebridge 1.3.1 release). E.g. for me... [2/23/2021, 10:02:13 AM] [@milo526/homebridge-tuya-web] This plugin generated a warning from the characteristic 'Brightness': characteristic was supplied illegal value: number 392 exceeded maximum of 100. See https://git.io/JtMGR for more info. |
Thank you for you explanations and looking into this bamodio! One important thing to notice though is that the documentation you link to is not documentation for the API that this plugin is using (the TuyaHa project however is useful, that one does use the same API, many of the current features are influenced by their research). |
Ugh... You are right @milo526 . Digging in deeper I see we use /homeassistant/skill. From Fiddler responses, I don't see an indication of ranges from that API. That's a bummer. Unless there's an obvious different /homeassistant API mapping elsewhere, I'm not sure it'll be trivial to get the dynamic valid range. From https://www.home-assistant.io/integrations/tuya/ though, there's two options for brightness ranges. 1-255, 10-1000. I can see from my devices that they are all in the 1000 range scale. I wonder if the config can be set once, globally for all Tuya lights, or if we need to do it per light in this plugin. It looks like going with a config value might still be the best thing possible. E.g. both a "min_brightness" and "max_brightness". I wonder if we can do it once globally at the plugin level vs per device. |
More digging... See https://github.com/home-assistant/core/blob/c4b3cf0788de7ad3a5d97d8051b2b638537e7dfb/homeassistant/components/tuya/light.py#L36. TUYA_BRIGHTNESS_RANGE0 = (1, 255) BRIGHTNESS_MODES = { Some indication that those are the only "two official range modes", whatever that means.
Offers configurability, on a per device basis, on the brightness range mode, so one or the other. Final food for thought. Might be good to provide multiple levels of overrides, for configurability, e.g.
In my case, if I could only setup #2 once at the plugin level, assuming this is a working solution, I don't have to do it for way too many entries. |
I hope that the newest pre-release (v1.1.0-0) solves these issues (or at least enables you to solve them) It adds new configuration options (per device) for the min and max brightness as well as a warning when your brightness is not configured correctly. If you are able to install the pre-release, please do so and let me know how it goes! If you have other (non-brightness related) issues with the pre-release, please post them in the discussion #276 |
I'm a confused noob having the same/similar issue. When I have Siri to set the hall lamp to 25%, Home/Homekit reports it as 10%, when I have Siri to set the hall lamp to 30%, Home/Homekit reports it as 12%. I'm running Tuya Web 1.0.1 published 3/25/2021 and my smart bulb are Merkury/Geeni bulbs that's connected to TuyaSmart. Setting a bulb to 10% (in this example using the Grandfather Clock Light), TuyaSmart app (on an ios device) reports it as 11%, Home/Homekit show 19% as shown in "5/18/2021, 10:16:37 PM [TuyaWebPlatform] [Grandfather Clock Light] Characteristic.Brightness - [SET] 19" portion of the log (even after waiting 10+ minutes and closing Home/Homekit and reopening it). Below is the portion of the Hoobs log at the point of setting the bulb to 10% from an off state, as well as a couple screenshots of the plugin config screen/settings (with my email and pass blacked out) 5/18/2021, 10:08:03 PM [TuyaWebPlatform] [Hall Lamp] - Creating new debounced promise Plugin Config settings/screenshot: |
@milo526 I have a few updates after testing.
|
@jthorpein You are running the current release v1.0.1, for which this is a known issue. I think Hoobs doesn't give the functionality to install an alternate release, such as beta or pre-release. You'll have to wait until this fix gets published from the main branch. |
hoobs users can install the pre-release version via the hoobs terminal (this assumes the plugin is already installed)
|
I'm assuming that you run this in the terminal window?? (noob to all this) |
Mine are set as lights, not a dimmer. |
With the pre-release (v1.1.0-0) i am able to receive the brightness correctly. In my case min: 10, max: 1000. The problem now is that i cant send the correct brightness. A brightness of 70% sends ~700 but tuya expected ~70. |
Hi I have installed the newest version 1.1.0-0 but i am not sure what the values should be in min and max so help with brightness? This plugin generated a warning from the characteristic 'Brightness': characteristic was supplied illegal value: number 550 exceeded maximum of 100. See https://git.io/JtMGR for more info. Many thanks Danny |
Same here. Regardless if I set my dimmers to 'dimmer' or to 'light" with brightness, similar errors and behaviour. |
This has been solved on the https://github.com/tuya/tuya-homebridge plugin by tuya. It works flawlessly there now. |
now getting more errors im afraid [14/12/2021, 13:17:22] [TuyaWebPlatform] [Kitchen Plinth] Characteristic.ColorTemperature - Characteristic 'ColorTemperature' will receive value lower than allowed mired (56) since provided Tuya kelvin value (8341) exceeds configured maximum Tuya kelvin value (2000). Please update your configuration! |
I am getting a similar characteristic warning every 5 minutes or so ill just post it here if it helps solve the issue: [15/12/2021, 15:24:56] [TuyaWebPlatform] [Star Projector] Characteristic.Brightness - Characteristic 'Brightness' will receive value higher than allowed (281.1111111111111) since provided Tuya value (263) exceeds configured maximum Tuya value (100). Please update your configuration! |
I’m having the same issue |
I am having issues with brightness and color |
I updated to 1.1.1 and I still see the same issue as befor: [12/22/2021, 9:43:34 PM] [TuyaWebPlatform] [Entrance] Characteristic.Brightness - Characteristic 'Brightness' will receive value higher than allowed (1100) since provided Tuya value (1000) exceeds configured maximum Tuya value (100). Please update your configuration! |
I found a way to fixed the brightness issue, by overwritting the device type from light to dimmer:
I'm using TuyaWebPlatform @milo526/homebridge-tuya-web v1.1.1. My device is on the SmartLife. Hope this help |
This worked for me! Thank you so much for your help :) |
I second that! Overriding the
|
Please read the wiki regarding this issue: https://github.com/milo526/homebridge-tuya-web/wiki/Something-will-receive-higher-or-lower-value-than-allowed Not all devices behave the same, simply changing the value as you stated will break the plugin for many different people. |
Describe the bug I get "Characteristic.Brightness - Characteristic 'Brightness' will receive value higher than allowed (804.040404040404) since provided Tuya value (797) exceeds configured maximum Tuya value (100). Please update your configuration!" spam every minute. I used the debug discovery python script to determine max and min values for the bulbs when using the smart life app. (it was 10-1000). But when I update the values in the config to 10-1000, I get no more spam, but the light only dims around the 10% to 1% range in the home app. Steps To Reproduce Plugin Version Homebridge Config {
"name": "TuyaWebPlatform",
"options": {
"username": "REDACTED",
"password": "REDACTED",
"countryCode": "REDACTED",
"platform": "smart_life",
"pollingInterval": 2000
},
"defaults": [
{
"id": "REDACTED",
"device_type": "light",
"min_brightness": "10",
"max_brightness": "1000",
"min_kelvin": "1000",
"max_kelvin": "36294",
"light_characteristics": [
"Brightness",
"Color",
"Color Temperature"
]
},
{
"id": "REDACTED",
"device_type": "light",
"min_brightness": "10",
"max_brightness": "1000",
"min_kelvin": "1000",
"max_kelvin": "36294",
"light_characteristics": [
"Brightness",
"Color",
"Color Temperature"
]
}
],
"scenes": false,
"_bridge": {
"username": "0E:5C:86:76:56:C8",
"port": 41715
},
"platform": "TuyaWebPlatform"
}
|
I've followed the instructions here: https://github.com/milo526/homebridge-tuya-web/wiki/Something-will-receive-higher-or-lower-value-than-allowed but it doesn't seem to fix it. Can someone help? I get this error message:
And I have this in my plugin config:
(I've also tried using the Tuya ID instead of the Name, but same issue.) |
Describe the bug
Brightness level in HomeKit is not accurate. This occurs using Outdoor Dimmers.
Steps To Reproduce
Steps to reproduce the behavior:
Plugin Version
v0.7.0 (has been occurring on all previous versions, just now taking the time to open an issue)
Homebridge Config
Device Config
Additional Context
I have two of these outdoor dimmers, by default they show up as lights with color control & brightness, but they don't do color. I am using override to make them a Dimmer and only control brightness. The issue occurs whether I use the override or not.
Logs
Full Logs Attached.
HBTuya.log.txt
Relevant Devices are "Maggie's Lamp" and "Dining Lamp" which are the same model outdoor dimmer plug.
Example - Filtered on "Dining Lamp", Device
Images
Example 1: "Maggie's Lamp"
Tuya - 54%
Home - 100%
Example 2: "Dining Lamp"
The text was updated successfully, but these errors were encountered: