milo526 / homebridge-tuya-web

Hoobs and Homebridge plugin for Tuya devices using Home Assistant Tuya Web Api
MIT License
219 stars 95 forks source link

Invalid Characteristic Values #403

Closed jerle69 closed 2 years ago

jerle69 commented 2 years ago

Describe the bug

Installed several new Treatlife SL10 (A19) and while they work with this plugin, they do generate characteristic value boundary warnings.

Steps To Reproduce

Just use some SL10 bulbs from Treatlife, default settings.

@milo526/homebridge-tuya-web v1.1.1

Homebridge Config

   {
        "name": "TuyaWebPlatform",
        "options": {
            "username": "**SNIPPED***",
            "password": "**SNIPPED***",
            "countryCode": "1",
            "platform": "smart_life"
        },
        "scenes": false,
        "platform": "TuyaWebPlatform"
    },

Device Config

 Got credentials
{   'access_token': '**SNIPPED***',
    'expires_in': 864000,
    'refresh_token': '***SNIPPED***',
    'token_type': 'bearer'}
Getting devices
Got devices
{   'header': {'code': 'SUCCESS', 'payloadVersion': 1},
    'payload': {   'devices': [   {   'data': {   'brightness': '1000',
                                                  'color_mode': 'scene',
                                                  'color_temp': 28459,
                                                  'online': True,
                                                  'state': 'false'},
                                      'dev_type': 'light',
                                      'ha_type': 'light',
                                      'icon': 'https://images.tuyaus.com/smart/solution/143006/37e69c2be34b7642_cover.png',
                                      'id': 'ebd3ccceea46163fbdjfqy',
                                      'name': 'Foyer Lamp'},
                                  {   'data': {'online': True, 'state': False},
                                      'dev_type': 'switch',
                                      'ha_type': 'switch',
                                      'icon': 'https://images.tuyaus.com/smart/icon/ay14906729310721fNjn/1568862445415ffab0175.jpg',
                                      'id': '30648738e868e75cef52',
                                      'name': 'Kids Room Fan'},
                                  {   'data': {   'brightness': '1000',
                                                  'color_mode': 'scene',
                                                  'color_temp': 28459,
                                                  'online': True,
                                                  'state': 'false'},
                                      'dev_type': 'light',
                                      'ha_type': 'light',
                                      'icon': 'https://images.tuyaus.com/smart/solution/143006/37e69c2be34b7642_cover.png',
                                      'id': 'eb83f9a066c58474ae49tk',
                                      'name': 'Living Room Lamp'},
                                  {   'data': {'online': True, 'state': False},
                                      'dev_type': 'switch',
                                      'ha_type': 'switch',
                                      'icon': 'https://images.tuyaus.com/smart/icon/ay14906729310721fNjn/1568862445415ffab0175.jpg',
                                      'id': '00800254483fda809525',
                                      'name': 'Downstairs Bathroom Light'},
                                  {   'data': {'online': True, 'state': False},
                                      'dev_type': 'switch',
                                      'ha_type': 'switch',
                                      'icon': 'https://images.tuyaus.com/smart/icon/ay14906729310721fNjn/1568862445415ffab0175.jpg',
                                      'id': '30648738e868e758b89c',
                                      'name': 'Kids Room Fan Light'},
                                  {   'data': {   'brightness': '1000',
                                                  'color_mode': 'colour',
                                                  'color_temp': 12400,
                                                  'online': True,
                                                  'state': 'false'},
                                      'dev_type': 'light',
                                      'ha_type': 'light',
                                      'icon': 'https://images.tuyaus.com/smart/solution/143006/37e69c2be34b7642_cover.png',
                                      'id': 'ebd42520982e33b8f30yj1',
                                      'name': 'Master Bedroom Lamp'},
                                  {   'data': {   'brightness': '1000',
                                                  'color_mode': 'scene',
                                                  'color_temp': 28459,
                                                  'online': True,
                                                  'state': 'false'},
                                      'dev_type': 'light',
                                      'ha_type': 'light',
                                      'icon': 'https://images.tuyaus.com/smart/solution/143006/37e69c2be34b7642_cover.png',
                                      'id': 'eb58aa63ceab2b01a15nen',
                                      'name': 'Living Room Floor Lamp'},
                                  {   'data': {   'brightness': '1000',
                                                  'color_mode': 'colour',
                                                  'color_temp': 28459,
                                                  'online': True,
                                                  'state': 'false'},
                                      'dev_type': 'light',
                                      'ha_type': 'light',
                                      'icon': 'https://images.tuyaus.com/smart/solution/143006/37e69c2be34b7642_cover.png',
                                      'id': 'eb17e30fc3b1b7172bxwtk',
                                      'name': 'Kids Room Lamp'}],
                   'scenes': []}}

Additional Context

Status logs from homebridge:

[1/30/2022, 9:10:58 AM] [TuyaWebPlatform] [Foyer Lamp] 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!
[1/30/2022, 9:10:58 AM] [@milo526/homebridge-tuya-web] This plugin generated a warning from the characteristic 'Brightness': characteristic was supplied illegal value: number 1100 exceeded maximum of 100. See https://git.io/JtMGR for more info.
[1/30/2022, 9:10:58 AM] [TuyaWebPlatform] [Foyer Lamp] Characteristic.ColorTemperature - Characteristic 'ColorTemperature' will receive value lower than allowed mired (-1352) since provided Tuya kelvin value (28459) exceeds configured maximum Tuya kelvin value (2000). Please update your configuration!
[1/30/2022, 9:10:58 AM] [@milo526/homebridge-tuya-web] This plugin generated a warning from the characteristic 'Color Temperature': characteristic was supplied illegal value: number -1352 exceeded minimum of 140. See https://git.io/JtMGR for more info.
[1/30/2022, 9:10:58 AM] [TuyaWebPlatform] [Living Room Lamp] 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!
[1/30/2022, 9:10:58 AM] [@milo526/homebridge-tuya-web] This plugin generated a warning from the characteristic 'Brightness': characteristic was supplied illegal value: number 1100 exceeded maximum of 100. See https://git.io/JtMGR for more info.
[1/30/2022, 9:10:58 AM] [TuyaWebPlatform] [Living Room Lamp] Characteristic.ColorTemperature - Characteristic 'ColorTemperature' will receive value lower than allowed mired (-1352) since provided Tuya kelvin value (28459) exceeds configured maximum Tuya kelvin value (2000). Please update your configuration!
[1/30/2022, 9:10:58 AM] [@milo526/homebridge-tuya-web] This plugin generated a warning from the characteristic 'Color Temperature': characteristic was supplied illegal value: number -1352 exceeded minimum of 140. See https://git.io/JtMGR for more info.
[1/30/2022, 9:10:58 AM] [TuyaWebPlatform] [Master Bedroom Lamp] 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!
[1/30/2022, 9:10:58 AM] [@milo526/homebridge-tuya-web] This plugin generated a warning from the characteristic 'Brightness': characteristic was supplied illegal value: number 1100 exceeded maximum of 100. See https://git.io/JtMGR for more info.
[1/30/2022, 9:10:58 AM] [TuyaWebPlatform] [Master Bedroom Lamp] Characteristic.ColorTemperature - Characteristic 'ColorTemperature' will receive value lower than allowed mired (-228) since provided Tuya kelvin value (12400) exceeds configured maximum Tuya kelvin value (2000). Please update your configuration!
[1/30/2022, 9:10:58 AM] [@milo526/homebridge-tuya-web] This plugin generated a warning from the characteristic 'Color Temperature': characteristic was supplied illegal value: number -228 exceeded minimum of 140. See https://git.io/JtMGR for more info.
[1/30/2022, 9:10:58 AM] [TuyaWebPlatform] [Living Room Floor Lamp] 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!
[1/30/2022, 9:10:58 AM] [@milo526/homebridge-tuya-web] This plugin generated a warning from the characteristic 'Brightness': characteristic was supplied illegal value: number 1100 exceeded maximum of 100. See https://git.io/JtMGR for more info.
[1/30/2022, 9:10:58 AM] [TuyaWebPlatform] [Living Room Floor Lamp] Characteristic.ColorTemperature - Characteristic 'ColorTemperature' will receive value lower than allowed mired (-1352) since provided Tuya kelvin value (28459) exceeds configured maximum Tuya kelvin value (2000). Please update your configuration!
[1/30/2022, 9:10:58 AM] [@milo526/homebridge-tuya-web] This plugin generated a warning from the characteristic 'Color Temperature': characteristic was supplied illegal value: number -1352 exceeded minimum of 140. See https://git.io/JtMGR for more info.
[1/30/2022, 9:10:58 AM] [TuyaWebPlatform] [Kids Room Lamp] 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!
[1/30/2022, 9:10:58 AM] [@milo526/homebridge-tuya-web] This plugin generated a warning from the characteristic 'Brightness': characteristic was supplied illegal value: number 1100 exceeded maximum of 100. See https://git.io/JtMGR for more info.
[1/30/2022, 9:10:58 AM] [TuyaWebPlatform] [Kids Room Lamp] Characteristic.ColorTemperature - Characteristic 'ColorTemperature' will receive value lower than allowed mired (-1352) since provided Tuya kelvin value (28459) exceeds configured maximum Tuya kelvin value (2000). Please update your configuration!
[1/30/2022, 9:10:58 AM] [@milo526/homebridge-tuya-web] This plugin generated a warning from the characteristic 'Color Temperature': characteristic was supplied illegal value: number -1352 exceeded minimum of 140. See https://git.io/JtMGR for more info.
milo526 commented 2 years ago

As stated in your logs

... Please update your configuration!

Every Tuya device is subtly different, I cannot get the required information from Tuya to automatically configure, it will be a trial-and-error to find the correct configuration for your devices.

jerle69 commented 2 years ago

Forgive my ignorance regarding the configuration; I was under the impression your plugin polled the device thresholds/attributes and set them accordingly. I'm unsure where to create custom device attributes in the config file. I'll go do some web research on Tuya.

milo526 commented 2 years ago

I'd advise you to start looking at the docs: https://github.com/milo526/homebridge-tuya-web#configure-devices

It is easiest to install the Config UI X plugin and use that to configure the devices.

jerle69 commented 2 years ago

Thanks for the clue!

gdotp01 commented 2 years ago

Thanks for the hint but I can’t see how to get this to work. The devices I have issues with are some gu10 bulbs which worked ok under version1.02 but have thrown this issue on all later versions. Using config Uk x your can’t change the characteristic values for bulbs only thermostats.

gdotp01 commented 2 years ago

Ok thanks I worked it out. The latest version allows the values to be set for lights and both minimum and maximum values need to be provided for them to take effect.

RuntyCascade commented 2 years ago

Same issue except that even with adding the min/max in config, i still get the issue

Logs: [15/02/2022, 09:11:45] [TuyaWebPlatform] [Living Room Can Light] Characteristic.Brightness - Characteristic 'Brightness' will receive value higher than allowed (1000) since provided Tuya value (1000) exceeds configured maximum Tuya value (100). Please update your configuration! [15/02/2022, 09:11:45] [TuyaWebPlatform] [Den Can Lights] Characteristic.Brightness - Characteristic 'Brightness' will receive value higher than allowed (500) since provided Tuya value (500) exceeds configured maximum Tuya value (100). Please update your configuration!

Config: { "name": "TuyaWebPlatform", "options": { "username": "****", "password": "****", "countryCode": "1", "platform": "tuya" }, "defaults": [ { "id": "****", "device_type": "dimmer", "min_brightness": "0", "max_brightness": "100", "dimmer_characteristics": [ "Brightness" ] }, { "id": "****", "device_type": "dimmer", "min_brightness": "0", "max_brightness": "100", "dimmer_characteristics": [ "Brightness" ] }

BooneTrails commented 2 years ago

I am having the same issue.

milo526 commented 2 years ago

Same issue except that even with adding the min/max in config, i still get the issue

Logs: [15/02/2022, 09:11:45] [TuyaWebPlatform] [Living Room Can Light] Characteristic.Brightness - Characteristic 'Brightness' will receive value higher than allowed (1000) since provided Tuya value (1000) exceeds configured maximum Tuya value (100). Please update your configuration! [15/02/2022, 09:11:45] [TuyaWebPlatform] [Den Can Lights] Characteristic.Brightness - Characteristic 'Brightness' will receive value higher than allowed (500) since provided Tuya value (500) exceeds configured maximum Tuya value (100). Please update your configuration!

Config: { "name": "TuyaWebPlatform", "options": { "username": "****", "password": "****", "countryCode": "1", "platform": "tuya" }, "defaults": [ { "id": "****", "device_type": "dimmer", "min_brightness": "0", "max_brightness": "100", "dimmer_characteristics": [ "Brightness" ] }, { "id": "****", "device_type": "dimmer", "min_brightness": "0", "max_brightness": "100", "dimmer_characteristics": [ "Brightness" ] }

Try setting the max_brightness to 1000?

RuntyCascade commented 2 years ago

Same issue except that even with adding the min/max in config, i still get the issue Logs: [15/02/2022, 09:11:45] [TuyaWebPlatform] [Living Room Can Light] Characteristic.Brightness - Characteristic 'Brightness' will receive value higher than allowed (1000) since provided Tuya value (1000) exceeds configured maximum Tuya value (100). Please update your configuration! [15/02/2022, 09:11:45] [TuyaWebPlatform] [Den Can Lights] Characteristic.Brightness - Characteristic 'Brightness' will receive value higher than allowed (500) since provided Tuya value (500) exceeds configured maximum Tuya value (100). Please update your configuration! Config: { "name": "TuyaWebPlatform", "options": { "username": "****", "password": "****", "countryCode": "1", "platform": "tuya" }, "defaults": [ { "id": "****", "device_type": "dimmer", "min_brightness": "0", "max_brightness": "100", "dimmer_characteristics": [ "Brightness" ] }, { "id": "****", "device_type": "dimmer", "min_brightness": "0", "max_brightness": "100", "dimmer_characteristics": [ "Brightness" ] }

Try setting the max_brightness to 1000?

Interesting, that may have stopped the invalid characteristic value. ill keep an eye on it.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.