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

Slow Response / Outside characteristics #388

Closed mikeyis closed 2 years ago

mikeyis commented 2 years ago

Describe the bug Plug in is complaining about slow responses from the devices, and that the characteristics are way outside of the default values.

Plugin Version 1.1.1.

Homebridge Config

{
            "name": "TuyaWebPlatform",
            "options": {
                "username": "REDACTED",
                "password": "REDACTED",
                "countryCode": "61",
                "platform": "tuya"
            },
            "defaults": [
                {
                    "device_type": "form"
                }
            ],
            "scenes": false,
            "platform": "TuyaWebPlatform",
            "_bridge": {
                "username": "REDACTED",
                "port": 51282
            }

Device Config

 Getting devices
Got devices
{   'header': {'code': 'SUCCESS', 'payloadVersion': 1},
    'payload': {   'devices': [   {   'data': {   'brightness': '1000',
                                                  'color_mode': 'white',
                                                  'color_temp': 5200,
                                                  'online': True,
                                                  'state': 'false'},
                                      'dev_type': 'light',
                                      'ha_type': 'light',
                                      'icon': 'https://images.tuyacn.com/smart/icon/ay1558866774161DZ6MV/1588126306eace14df45b.png',
                                      'id': '6cb75254be88e51368pxv1',
                                      'name': 'Couch Light Strip'},
                                  {   'data': {   'brightness': '700',
                                                  'color_mode': 'white',
                                                  'online': True,
                                                  'state': 'false'},
                                      'dev_type': 'light',
                                      'ha_type': 'light',
                                      'icon': 'https://images.tuyacn.com/smart/icon/ay1558866774161DZ6MV/15677351793b9684d7f33.png',
                                      'id': '0061700798f4abd3aa04',
                                      'name': 'Garage Light'},
                                  {   'data': {'online': True, 'state': False},
                                      'dev_type': 'switch',
                                      'ha_type': 'switch',
                                      'icon': 'https://images.tuyacn.com/smart/icon/ay1536534747810ekKBj/1565057230e592113ea93.png',
                                      'id': '6011338040f520f92d4d',
                                      'name': 'Air Purifier'},
                                  {   'data': {'online': True, 'state': False},
                                      'dev_type': 'switch',
                                      'ha_type': 'switch',
                                      'icon': 'https://images.tuyacn.com/smart/icon/ay1536534747810ekKBj/1565057230e592113ea93.png',
                                      'id': '4057642240f520f73938',
                                      'name': 'Air Purifier '},
                                  {   'data': {   'brightness': '1000',
                                                  'color_mode': 'white',
                                                  'color_temp': 36294,
                                                  'online': True,
                                                  'state': 'false'},
                                      'dev_type': 'light',
                                      'ha_type': 'light',
                                      'icon': 'https://images.tuyacn.com/smart/icon/ay1558866774161DZ6MV/1588126306eace14df45b.png',
                                      'id': '6cd09624a6db6f851amip0',
                                      'name': 'Bed Light Strip'},
                                  {   'data': {   'brightness': '1000',
                                                  'color_mode': 'white',
                                                  'color_temp': 1000,
                                                  'online': True,
                                                  'state': 'false'},
                                      'dev_type': 'light',
                                      'ha_type': 'light',
                                      'icon': 'https://images.tuyacn.com/smart/icon/ay1558866774161DZ6MV/157109412967c6f7a604b.png',
                                      'id': '3156262710521cc57eeb',
                                      'name': 'Balcony Light'}],
                   'scenes': []}}

Additional Context

[1/3/2022, 2:32:24 PM] [TuyaWebPlatform] [Balcony Light] Characteristic.Brightness - Characteristic 'Brightness' will receive value higher than allowed (544.4444444444445) since provided Tuya value (500) exceeds configured maximum Tuya value (100). Please update your configuration!
[1/3/2022, 2:32:24 PM] [@milo526/homebridge-tuya-web] This plugin generated a warning from the characteristic 'Brightness': characteristic was supplied illegal value: number 544.4444444444445 exceeded maximum of 100. See https://git.io/JtMGR for more info.
[1/3/2022, 2:32:24 PM] [TuyaWebPlatform] [Balcony Light] Characteristic.ColorTemperature - Characteristic 'ColorTemperature' will receive value lower than allowed mired (-1901) since provided Tuya kelvin value (36294) exceeds configured maximum Tuya kelvin value (2000). Please update your configuration!
[1/3/2022, 2:32:24 PM] [@milo526/homebridge-tuya-web] This plugin generated a warning from the characteristic 'Color Temperature': characteristic was supplied illegal value: number -1901 exceeded minimum of 140. See https://git.io/JtMGR for more info.
[1/3/2022, 2:32:27 PM] [TuyaWebPlatform] [Couch Light Strip] 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/3/2022, 2:32:27 PM] [@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/3/2022, 2:32:27 PM] [@milo526/homebridge-tuya-web] This plugin generated a warning from the characteristic 'Color Temperature': characteristic was supplied illegal value: number -1901 exceeded minimum of 140. See https://git.io/JtMGR for more info.
lucanaut commented 2 years ago

Same happening to me.

[1/3/2022, 9:09:08 AM] [TuyaWebPlatform] [Garage recessed 3] Characteristic.Brightness - Characteristic 'Brightness' will receive value higher than allowed (600) since provided Tuya value (550) exceeds configured maximum Tuya value (100). Please update your configuration!
[1/3/2022, 9:09:08 AM] [@milo526/homebridge-tuya-web] This plugin generated a warning from the characteristic 'Brightness': characteristic was supplied illegal value: number 600 exceeded maximum of 100. See https://git.io/JtMGR for more info.
[1/3/2022, 9:09:08 AM] [@milo526/homebridge-tuya-web] Error: 
    at Brightness.Characteristic.characteristicWarning (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2074:105)
    at Brightness.Characteristic.validateUserInput (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1986:16)
    at Brightness.Characteristic.updateValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1415:20)
    at LightAccessory.setCharacteristic (/usr/local/lib/node_modules/@milo526/homebridge-tuya-web/src/accessories/BaseAccessory.ts:272:55)
    at BrightnessCharacteristic.updateValue (/usr/local/lib/node_modules/@milo526/homebridge-tuya-web/src/accessories/characteristics/brightness.ts:112:22)
    at LightAccessory.updateState (/usr/local/lib/node_modules/@milo526/homebridge-tuya-web/src/accessories/BaseAccessory.ts:420:9)
    at LightAccessory.updateAccessory (/usr/local/lib/node_modules/@milo526/homebridge-tuya-web/src/accessories/BaseAccessory.ts:413:10)
    at TuyaWebPlatform.refreshDeviceStates (/usr/local/lib/node_modules/@milo526/homebridge-tuya-web/src/platform.ts:192:41)
    at TuyaWebPlatform.discoverDevices (/usr/local/lib/node_modules/@milo526/homebridge-tuya-web/src/platform.ts:314:16)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
[1/3/2022, 9:09:08 AM] [TuyaWebPlatform] [Garage recessed 3] Characteristic.ColorTemperature - Characteristic 'ColorTemperature' will receive value higher than allowed mired (570) since provided Tuya kelvin value (1000) is lower then configured minimum Tuya kelvin value (7142.857142857143). Please update your configuration!
[1/3/2022, 9:09:08 AM] [@milo526/homebridge-tuya-web] This plugin generated a warning from the characteristic 'Color Temperature': characteristic was supplied illegal value: number 570 exceeded maximum of 500. See https://git.io/JtMGR for more info.
[1/3/2022, 9:09:08 AM] [@milo526/homebridge-tuya-web] Error: 
    at ColorTemperature.Characteristic.characteristicWarning (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2074:105)
    at ColorTemperature.Characteristic.validateUserInput (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1986:16)
    at ColorTemperature.Characteristic.updateValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1415:20)
    at LightAccessory.setCharacteristic (/usr/local/lib/node_modules/@milo526/homebridge-tuya-web/src/accessories/BaseAccessory.ts:272:55)
    at ColorTemperatureCharacteristic.updateValue (/usr/local/lib/node_modules/@milo526/homebridge-tuya-web/src/accessories/characteristics/colorTemperature.ts:116:22)
    at LightAccessory.updateState (/usr/local/lib/node_modules/@milo526/homebridge-tuya-web/src/accessories/BaseAccessory.ts:420:9)
    at LightAccessory.updateAccessory (/usr/local/lib/node_modules/@milo526/homebridge-tuya-web/src/accessories/BaseAccessory.ts:413:10)
    at TuyaWebPlatform.refreshDeviceStates (/usr/local/lib/node_modules/@milo526/homebridge-tuya-web/src/platform.ts:192:41)
    at TuyaWebPlatform.discoverDevices (/usr/local/lib/node_modules/@milo526/homebridge-tuya-web/src/platform.ts:314:16)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
VE5CE commented 2 years ago

I am also having this issue.

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.

mikeyis commented 2 years ago

Bump so it doesn’t go stale :)

gdotp01 commented 2 years ago

I've updated to the latest version and seeing a similar issue.

image

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.

mikeyis commented 2 years ago

Bump so it doesn’t go stale :)

sdflyguy commented 2 years ago

Same issue here. Everything working just fine before the latest update.

gdotp01 commented 2 years ago

1.0.2 is the last version that worked for me. Every one since has shown the error.

milo526 commented 2 years ago

Hey all, Every tuya lamp is subtly different, therefor they require different configurations that you will need to set in your configuration (as specified by the error printed to your consoles 🙈) Please update your configurations according to your specific needs (in most cases this will sadly be trial and error. If the plugin since throws an error like since provided Tuya kelvin value (36294) exceeds configured maximum Tuya kelvin value (2000)., you will need to update the maximum kelvin value in the configuration for this lamp to be at least 36294.

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.