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

Homebridge crashes when changing multiple device colours #207

Closed jacobpem closed 2 years ago

jacobpem commented 3 years ago

Describe the bug

hello I am new to github so I am sorry if this is in the wrong format. whenever I say to my HomePod set bedroom a colour they will all change to the colour but Homebridge will crash with a error that I will post on the Bottom of this report if I say to change a light individually then it will work just fine without a crash. these led strips that I am using are dream colour or addressable led strips. turning them on or off does not cause a crash Steps To Reproduce

to reproduce the error I just have to say to Siri set bedroom blue or any other colour Plugin Version

Version 1.0.0 Homebridge Config

{
    "bridge": {
        "name": "Homebridge 55B2",
        "username": "0E:5A:D3:AA:55:B2",
        "port": 51083,
        "pin": "614-67-263"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "name": "TuyaWebPlatform",
            "options": {
                "username": "thanks for the help",
                "password": "not going to tell you that lol",
                "countryCode": "44",
                "platform": "smart_life"
            },
            "defaults": [
                {
                    "id": "bf993f37906b6855db3gb3",
                    "device_type": "light",
                    "light_characteristics": [
                        "Brightness",
                        "Color"
                    ]
                },
                {
                    "id": "bf1bc579f617018d2a2j7h",
                    "device_type": "light",
                    "light_characteristics": [
                        "Brightness",
                        "Color"
                    ]
                }
            ],
            "scenes": true,
            "platform": "TuyaWebPlatform"
        },
        {
            "platform": "MagicHome-Platform",
            "lights": [
                {
                    "name": "Window LED Strip",
                    "ip": "192.168.1.229",
                    "setup": "RGBW",
                    "purewhite": false,
                    "timeout": 10000
                }
            ]
        },
        {
            "refreshToken": "eyJhbGciOiJIUzUxMiIsImprdSI6Ii9vYXV0aC9pbnRlcm5hbC9qd2tzIiwia2lkIjoiYzEyODEwMGIiLCJ0eXAiOiJKV1QifQ.eyJpYXQiOjE2MTQwMDg2OTcsInJlZnJlc2hfY2lkIjoicmluZ19vZmZpY2lhbF9hbm0000lkIiwicmVmcmVzaF9zY29wZXMiOlsiY2xpZW50Il0sInJlZnJlc2hfdXNlcl9pZCI6MTg00000MzUsInJuZCI6IjRnQWVFLUo2dklLM3pRIiwic20000lvbl9pZCI6IjI4NzQxMzI3LTA0ZGEtNDQ3Ny04Y2ZmLWFmZTc5NDUzODlkNCIsInR5cGUiOiJyZWZyZXNoLXRva2VuIn0.YH37Uj01Jc3Jp5zzM-EqtiXwYvk4iu3O2aih-ZwqVGR0000Q4568w7z4yHGWnMP3czjpjw43wWL3pHVI5vwjiQ",
            "platform": "Ring"
        }
    ]
}

Device Config

Getting credentials Got credentials { 'access_token': 'EUheu1523123793769aVN1PS0WBGhqwAU', 'expires_in': 864000, 'refresh_token': 'EUheu1523123793769aVN1PJsiKV8ARTF', 'token_type': 'bearer'} Getting devices Got devices { 'header': {'code': 'SUCCESS', 'payloadVersion': 1}, 'payload': { 'devices': [ { 'data': { 'brightness': '92', 'color_mode': 'white', 'color_temp': 4600, 'online': True, 'state': 'false'}, 'dev_type': 'light', 'ha_type': 'light', 'icon': 'https://images.tuyaeu.com/smart/product_icon/dj.png', 'id': '47232500600194f52645', 'name': 'Wall light 2'}, { 'data': { 'brightness': '500', 'color_mode': 'colour', 'online': True, 'state': 'false'}, 'dev_type': 'light', 'ha_type': 'light', 'icon': 'https://images.tuyaeu.com/smart/icon/ay1541056239985fDGjj/1561975454c420a16d4a5.png', 'id': '35500521483fda4193e3', 'name': 'Desk'}, { 'data': {'online': True, 'state': False}, 'dev_type': 'switch', 'ha_type': 'switch', 'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg', 'id': 'bf4c1ada1ded14f158vc7z', 'name': 'Speakers'}, { 'data': { 'color_mode': 'scene', 'online': True, 'state': 'false'}, 'dev_type': 'light', 'ha_type': 'light', 'icon': 'https://images.tuyaeu.com/smart/icon/ay1535688520667EMyk6/160238127190477af6b75.png', 'id': 'bf993f37906b6855db3gb3', 'name': 'Led Strip Lights'}, { 'data': { 'brightness': '69', 'color_mode': 'white', 'color_temp': 4600, 'online': True, 'state': 'false'}, 'dev_type': 'light', 'ha_type': 'light', 'icon': 'https://images.tuyaeu.com/smart/product_icon/dj.png', 'id': '50450440e09806d4096d', 'name': 'Table lamp'}, { 'data': {'online': True, 'state': False}, 'dev_type': 'switch', 'ha_type': 'switch', 'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg', 'id': 'bf6578423faab7ea66m0nv', 'name': 'Lazer light'}, { 'data': {'online': True, 'state': False}, 'dev_type': 'switch', 'ha_type': 'switch', 'icon': 'https://images.tuyaeu.com/smart/icon/1523600701ylvxt2tq9kkxvgu55ezttvs4i_0.jpg', 'id': '21138270807d3a6f1db9', 'name': 'Kitchen floor'}, { 'data': { 'brightness': '92', 'color_mode': 'white', 'color_temp': 4600, 'online': True, 'state': 'false'}, 'dev_type': 'light', 'ha_type': 'light', 'icon': 'https://images.tuyaeu.com/smart/product_icon/dj.png', 'id': '47232500600194f55c16', 'name': 'Wall light 1'}, { 'data': { 'brightness': '500', 'color_mode': 'colour', 'color_temp': 36294, 'online': True, 'state': 'false'}, 'dev_type': 'light', 'ha_type': 'light', 'icon': 'https://images.tuyaeu.com/smart/icon/ay1541056239985fDGjj/1591062212b79b47dd7ea.png', 'id': 'bf2c75490e7f07495eqijm', 'name': 'Office bulb 2'}, { 'data': { 'brightness': '500', 'color_mode': 'colour', 'color_temp': 36294, 'online': True, 'state': 'false'}, 'dev_type': 'light', 'ha_type': 'light', 'icon': 'https://images.tuyaeu.com/smart/icon/ay1541056239985fDGjj/1591062212b79b47dd7ea.png', 'id': 'bf4429e28ccc797227jek0', 'name': 'Office bulb 1'}, { 'data': { 'color_mode': 'scene', 'online': True, 'state': 'false'}, 'dev_type': 'light', 'ha_type': 'light', 'icon': 'https://images.tuyaeu.com/smart/icon/ay1535688520667EMyk6/160238127190477af6b75.png', 'id': 'bf1bc579f617018d2a2j7h', 'name': 'Bed'}, { 'data': {'online': True, 'state': False}, 'dev_type': 'switch', 'ha_type': 'switch', 'icon': 'https://images.tuyaeu.com/smart/icon/1523600701ylvxt2tq9kkxvgu55ezttvs4i_0.jpg', 'id': '21138270807d3a6f72ec', 'name': 'Kitchen strip'}, { 'data': { 'brightness': '92', 'color_mode': 'colour', 'online': True, 'state': 'false'}, 'dev_type': 'light', 'ha_type': 'light', 'icon': 'https://images.tuyaeu.com/smart/icon/1529996712tvrx4u0h67r_0.png', 'id': '37304065b4e62d5095d1', 'name': 'Tv strip'}, { 'data': { 'brightness': '92', 'color_mode': 'white', 'color_temp': 4600, 'online': True, 'state': 'false'}, 'dev_type': 'light', 'ha_type': 'light', 'icon': 'https://images.tuyaeu.com/smart/product_icon/dj.png', 'id': '50450440f4cfa21f9ca2', 'name': 'Wall light 3'}], 'scenes': []}} !!! NOW REMOVE THIS FILE, SO YOUR CREDENTIALS (username, password) WON'T LEAK !!!

Additional Context

Screenshot_2021-02-20_at_15 47 40

stale[bot] commented 3 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.

milo526 commented 3 years ago

Gonna need some more time to look into this but I will be working on this!

milo526 commented 3 years ago

Have you been able to reproduce this error?

I do not seem to be able to reproduce this on my client.

If you can reproduce this; could you then please post the log as text instead of an image. It is really hard to read at the moment.

milo526 commented 2 years ago

Closing since there has not been any response to inquiries and no further reports of this problem.