milo526 / homebridge-tuya-web

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

Brightness exceeds maximum value #446

Closed mcs32066 closed 2 years ago

mcs32066 commented 2 years ago

Describe the bug

Controlling smart bulbs. Getting this error message for every bulb. This seems to be preventing or greatly delaying dimming and turning bulbs on or off.

[5/22/2022, 9:02:50 PM] [TuyaWebPlatform] [Living room corner] Characteristic.Brightness - Characteristic 'Brightness' will receive value higher than allowed (272.22222222222223) since provided Tuya value (255) exceeds configured maximum Tuya value (100). Please update your configuration! [5/22/2022, 9:02:50 PM] [@milo526/homebridge-tuya-web] This plugin generated a warning from the characteristic 'Brightness': characteristic was supplied illegal value: number 272.22222222222223 exceeded maximum of 100. See https://homebridge.io/w/JtMGR for more info. [5/22/2022, 9:02:50 PM] [TuyaWebPlatform] [Recliner Light] Characteristic.Brightness - Characteristic 'Brightness' will receive value higher than allowed (272.22222222222223) since provided Tuya value (255) exceeds configured maximum Tuya value (100). Please update your configuration!

Steps To Reproduce This happens every time HB is restarted and every time I change the status of a bulb - power or brightness.

Plugin Version

@milo526/homebridge-tuya-web v1.1.2

Homebridge Config

{
    "bridge": {
        "name": "Homebridge FEC6",
        "username": "XX:XX:XX:XX:XX:XX",
        "port": XXXXX,
        "pin": "XXX-XX-XXX"
    },
    "accessories": [
        {
            "accessory": "VizioSoundbar",
            "name": "Soundbar",
            "address": "192.168.1.54:9000"
        }
    ],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "auth": "form",
            "theme": "dark-mode-blue",
            "tempUnits": "f",
            "lang": "auto",
            "platform": "config"
        },
        {
            "name": "TuyaWebPlatform",
            "options": {
                "username": "XXXXXXXXXXX@GMAIL.COM",
                "password": "XXXXXXXXXXXXXXXX",
                "countryCode": "1",
                "platform": "tuya",
                "pollingInterval": 600
            },
            "defaults": [
                {
                    "device_type": "form"
                }
            ],
            "scenes": true,
            "platform": "TuyaWebPlatform"
        },
        {
            "platform": "BroadlinkRM",
            "name": "BroadlinkRM",
            "options": {
                "pollingInterval": 60
            },
            "hidewelcomemessage": true,
            "accessories": [
                {
                    "name": "Bedroom Humidity",
                    "type": "humiditySensor"
                },
                {
                    "name": "Bedroom temperature",
                    "type": "temperatureSensor"
                },
                {
                    "name": "Bedroom Air",
                    "type": "switch",
                    "host": "24:DF:A7:34:B2:6E",
                    "data": {
                        "on": "260050000001249213371311141113111411131213121237131213361436131114111337133712121337131114111311141113121312123713121336143613361436133713371212130005630001254914000d05000000000000",
                        "off": "260050000001249213371311141113111411131213121237131213361436131114111337133712121337131114111311141113121312123713121336143613361436133713371212130005630001254914000d05000000000000"
                    }
                },
                {
                    "name": "Bedroom Air Mode",
                    "type": "switch",
                    "host": "24:DF:A7:34:B2:6E",
                    "stateless": true,
                    "data": {
                        "on": "260068000001249214361312131212121312121213121237131213361436131213121237133712121337133614121237133712121312123713121311143613121312123911371212130005620001264913000c450001264913000c450001254914000c440001264913000d050000000000000000000000000000"
                    }
                },
                {
                    "name": "Bedroom Air Speed",
                    "type": "switch",
                    "host": "24:DF:A7:34:B2:6E",
                    "stateless": true,
                    "data": {
                        "on": "2600500000012592133614111411141114111411141114361312133713361312131213371336141114361312131213361436131213121336141213361337131213121336143613121300055d0001264913000d05000000000000"
                    }
                },
                {
                    "name": "Bedroom Temp Down",
                    "type": "switch",
                    "host": "24:DF:A7:34:B2:6E",
                    "stateless": true,
                    "data": {
                        "on": [
                            {
                                "data": "2600500000012591143613121312131213121312131213371312133613371312131213361436131213121336141114361312131213121337133613121337131213361436133614111400055c0001274814000d05000000000000",
                                "pause": 0.3
                            },
                            {
                                "data": "2600500000012591143613121312131213121312131213371312133613371312131213361436131213121336141114361312131213121337133613121337131213361436133614111400055c0001274814000d05000000000000"
                            }
                        ]
                    }
                },
                {
                    "name": "Bedroom Temp Up",
                    "type": "switch",
                    "host": "24:DF:A7:34:B2:6E",
                    "stateless": true,
                    "data": {
                        "on": [
                            {
                                "data": "2600500000012492133711141114111413121312131213371312113813371312131211381238111411381214113811141114131213121337111413361114113913361238113813131100055e0001274913000d05000000000000",
                                "pause": 0.3
                            },
                            {
                                "data": "2600500000012492133711141114111413121312131213371312113813371312131211381238111411381214113811141114131213121337111413361114113913361238113813131100055e0001274913000d05000000000000"
                            }
                        ]
                    }
                },
                {
                    "name": "Living Room Air",
                    "type": "switch",
                    "host": "A0:43:B0:54:44:6E",
                    "data": {
                        "on": "260050000001249213371311141113111411131213121237131213361436131114111337133712121337131114111311141113121312123713121336143613361436133713371212130005630001254914000d05000000000000",
                        "off": "260050000001249213371311141113111411131213121237131213361436131114111337133712121337131114111311141113121312123713121336143613361436133713371212130005630001254914000d05000000000000"
                    }
                },
                {
                    "name": "Living Room Air mode",
                    "type": "switch",
                    "host": "A0:43:B0:54:44:6E",
                    "stateless": true,
                    "data": {
                        "on": "260068000001249214361312131212121312121213121237131213361436131213121237133712121337133614121237133712121312123713121311143613121312123911371212130005620001264913000c450001264913000c450001254914000c440001264913000d050000000000000000000000000000"
                    }
                },
                {
                    "name": "Living Room Air Speed",
                    "type": "switch",
                    "host": "A0:43:B0:54:44:6E",
                    "stateless": true,
                    "data": {
                        "on": "2600500000012592133614111411141114111411141114361312133713361312131213371336141114361312131213361436131213121336141213361337131213121336143613121300055d0001264913000d05000000000000"
                    }
                },
                {
                    "name": "Living Room Temp Down",
                    "type": "switch",
                    "host": "A0:43:B0:54:44:6E",
                    "stateless": true,
                    "data": {
                        "on": [
                            {
                                "data": "2600500000012591143613121312131213121312131213371312133613371312131213361436131213121336141114361312131213121337133613121337131213361436133614111400055c0001274814000d05000000000000",
                                "pause": 0.3
                            },
                            {
                                "data": "2600500000012591143613121312131213121312131213371312133613371312131213361436131213121336141114361312131213121337133613121337131213361436133614111400055c0001274814000d05000000000000"
                            }
                        ]
                    }
                },
                {
                    "name": "Living Room Temp Up",
                    "type": "switch",
                    "host": "A0:43:B0:54:44:6E",
                    "stateless": true,
                    "data": {
                        "on": [
                            {
                                "data": "2600500000012492133711141114111413121312131213371312113813371312131211381238111411381214113811141114131213121337111413361114113913361238113813131100055e0001274913000d05000000000000",
                                "pause": 0.3
                            },
                            {
                                "data": "2600500000012492133711141114111413121312131213371312113813371312131211381238111411381214113811141114131213121337111413361114113913361238113813131100055e0001274913000d05000000000000"
                            }
                        ]
                    }
                },
                {
                    "name": "Alcove Speakers",
                    "type": "switch",
                    "host": "A0:43:B0:54:44:6E",
                    "data": {
                        "on": [
                            {
                                "data": "260050000001289411141114111411141114111411141114113911391238113911391139113911391114111411141114111411141139111412381238113911391139113911141139110005360001274b12000d05000000000000",
                                "pause": 9
                            },
                            {
                                "data": "2600500000012a91151014111411141114111411141115111435153515351436153614361435153614111337143515111435151014361536133714111312133714111436141114111300053200012c4814000d05000000000000",
                                "pause": 0.5
                            },
                            {
                                "data": "2600500000012a91151014111411141114111411141115111435153515351436153614361435153614111337143515111435151014361536133714111312133714111436141114111300053200012c4814000d05000000000000",
                                "pause": 0.5
                            },
                            {
                                "data": "2600500000012993141114111411141114111312141113121436133713381336133713371337133713371411141114111337143613371411141213361436133714111312131213371400053100012a4a13000d05000000000000"
                            }
                        ],
                        "off": [
                            {
                                "data": "260050000001289411141114111411141114111411141114113911391238113911391139113911391114111411141114111411141139111412381238113911391139113911141139110005360001274b12000d05000000000000"
                            }
                        ]
                    }
                },
                {
                    "name": "Alcove Mute",
                    "type": "switch",
                    "host": "A0:43:B0:54:44:6E",
                    "data": {
                        "on": "2600500000012893141114111411131214111312141114111436143614361436143614361436143614111411141114361411141114361412133713371337131213361436141114371300053200012a4914000d05000000000000",
                        "off": "2600500000012893141114111411131214111312141114111436143614361436143614361436143614111411141114361411141114361412133713371337131213361436141114371300053200012a4914000d05000000000000"
                    }
                },
                {
                    "name": "Living Room TV",
                    "type": "switch",
                    "host": "A0:43:B0:54:44:6E",
                    "stateless": true,
                    "data": {
                        "on": "2600500000012693111411141138121312131213121312141138113911141139113813371139113911141114111411381213121312131213123811391139111411381238113911381200050b0001254c12000d05000000000000"
                    }
                },
                {
                    "name": "Bedroom TV",
                    "type": "switch",
                    "host": "24:DF:A7:34:B2:6E",
                    "stateless": true,
                    "data": {
                        "on": "2600500000012693111411141138121312131213121312141138113911141139113813371139113911141114111411381213121312131213123811391139111411381238113911381200050b0001254c12000d05000000000000"
                    }
                },
                {
                    "name": "Bedroom Mute",
                    "type": "switch",
                    "host": "24:DF:A7:34:B2:6E",
                    "data": {
                        "on": "26004800000125931436143614111312131213121312131213121312133713361535143614361436141114361411131214111312131213121337141114361436133615351436143614000d050000000000000000000000000000",
                        "off": "26004800000125931436143614111312131213121312131213121312133713361535143614361436141114361411131214111312131213121337141114361436133615351436143614000d050000000000000000000000000000"
                    }
                },
                {
                    "name": "Turn up the alcove",
                    "type": "switch",
                    "host": "A0:43:B0:54:44:6E",
                    "stateless": true,
                    "data": {
                        "on": [
                            {
                                "data": "2600500000012594121312131238121312131213121312131238123811141139113911381238123811141139111411141114111411141114123811141139113812381238123811391100050c0001274b10000d05000000000000",
                                "pause": 0.3
                            },
                            {
                                "data": "2600500000012594121312131238121312131213121312131238123811141139113911381238123811141139111411141114111411141114123811141139113812381238123811391100050c0001274b10000d05000000000000"
                            }
                        ]
                    }
                }
            ]
        },
        {
            "platform": "DelayedSwitches",
            "name": "DelayedSwitches",
            "switches": [
                {
                    "name": "30M timer",
                    "defaultDelay": 1800
                }
            ]
        }
    ],
    "disabledPlugins": [
        "homebridge-my-roku-tv-plugin",
        "homebridge-delayed-switches",
        "homebridge-roku-tv-plugin",
        "homebridge-vizio-soundbar",
        "homebridge-tuya-platform"
    ]
}

Device Config

Getting credentials Got credentials { 'errorMsg': 'Get accesstoken failed. Username or password error!', 'responseStatus': 'error'} Traceback (most recent call last): File "main.py", line 35, in payload = {"accessToken": auth_response["access_token"]} KeyError: 'access_token' 

I have confirmed and reset my password. I get the above response from replit.com. It indicates an issue with line 35, so I do not believe it is the UID/pw I copied and pasted in.

The smart bulbs worked previously AND still work, but get errors. Randomly they do not turn on / off, and randomly I cannot change the brightness.

Additional Context

Thank you.

milo526 commented 2 years ago

Please read the following wiki article to find out how to configure your devices to solve this problem.

https://github.com/milo526/homebridge-tuya-web/wiki/Something-will-receive-higher-or-lower-value-than-allowed

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.

mcs32066 commented 2 years ago

If you have a few minutes, I could use some help understanding. I have gone through the fix, and split the old and new to try to follow it, but can't seem to understand where to insert the coding for the brightness factors.

I'm receiving these errors, so it would appear that my bulbs (all of them get the same error with the same numbers. I believe they are all FEIT brand bulbs) should likely be using a 0-255 scale (I hope I have that correct).

[6/12/2022, 11:25:23 PM] [TuyaWebPlatform] [Living room corner] Characteristic.Brightness - Characteristic 'Brightness' will receive value higher than allowed (272.22222222222223) since provided Tuya value (255) exceeds configured maximum Tuya value (100). Please update your configuration!

If you do not have the time I understand. Either way I appreciate your work and the time you put in.

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.