Silvest89 / yeelight_v2

13 stars 1 forks source link

'Illegal Request' when performing saved scenes in HA #7

Open dennyha opened 3 years ago

dennyha commented 3 years ago

I have attached a a log below of an issue I am having when enabling a pre-saved scene in HA. The message pops up in HA after enabling it, something about an illegal request. I have noticed that any interplay with the scenes in HA seems to generate this same request. The models being used here are color4 and strip6 (being used as strip1).

The lights change to the scene ok but I am not sure what the error message is about (error -5006).

2021-01-31 09:27:28 DEBUG (SyncWorker_5) [custom_components.yeelight_v2.python_yeelight.yeelight.main] miIO: Bulb<192.168.0.71:55443, type=BulbType.Color> > set_power > ['on', 'smooth', 1000] 2021-01-31 09:27:28 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.python_yeelight.yeelight.main] miIO: Bulb<192.168.0.97:55443, type=BulbType.Color> > set_power > ['on', 'smooth', 1000] 2021-01-31 09:27:28 DEBUG (SyncWorker_5) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.71:54321 >>: {'id': 24, 'method': 'set_power', 'params': ['on', 'smooth', 1000]} 2021-01-31 09:27:28 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.97:54321 >>: {'id': 16, 'method': 'set_power', 'params': ['on', 'smooth', 1000]} 2021-01-31 09:27:28 DEBUG (SyncWorker_5) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.71:54321 (ts: 1970-01-01 00:11:47, id: 24) << {'id': 24, 'result': ['ok']} 2021-01-31 09:27:28 DEBUG (SyncWorker_5) [custom_components.yeelight_v2.light] Calling <function YeelightGenericLight.set_rgb at 0x7f206e6158b0> with ((255, 183, 123), 1000) {} 2021-01-31 09:27:28 DEBUG (SyncWorker_5) [custom_components.yeelight_v2.light] Setting RGB: (255, 183, 123) 2021-01-31 09:27:28 DEBUG (SyncWorker_5) [custom_components.yeelight_v2.python_yeelight.yeelight.main] miIO: Bulb<192.168.0.71:55443, type=BulbType.Color> > set_rgb > [16758651, 'smooth', 1000] 2021-01-31 09:27:28 DEBUG (SyncWorker_5) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.71:54321 >>: {'id': 25, 'method': 'set_rgb', 'params': [16758651, 'smooth', 1000]} 2021-01-31 09:27:28 DEBUG (SyncWorker_5) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.71:54321 (ts: 1970-01-01 00:11:47, id: 25) << {'id': 25, 'result': ['ok']} 2021-01-31 09:27:28 DEBUG (SyncWorker_5) [custom_components.yeelight_v2.light] Calling <function YeelightGenericLight.set_colortemp at 0x7f206e6159d0> with (None, 1000) {} 2021-01-31 09:27:28 DEBUG (SyncWorker_5) [custom_components.yeelight_v2.light] Calling <function YeelightGenericLight.set_brightness at 0x7f206e615790> with (204, 1000) {} 2021-01-31 09:27:28 DEBUG (SyncWorker_5) [custom_components.yeelight_v2.light] Setting brightness: 204 2021-01-31 09:27:28 DEBUG (SyncWorker_5) [custom_components.yeelight_v2.python_yeelight.yeelight.main] miIO: Bulb<192.168.0.71:55443, type=BulbType.Color> > set_bright > [80.0, 'smooth', 1000] 2021-01-31 09:27:28 DEBUG (SyncWorker_5) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.71:54321 >>: {'id': 26, 'method': 'set_bright', 'params': [80.0, 'smooth', 1000]} 2021-01-31 09:27:28 DEBUG (SyncWorker_5) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.71:54321 (ts: 1970-01-01 00:11:47, id: 26) << {'id': 26, 'result': ['ok']} 2021-01-31 09:27:28 DEBUG (SyncWorker_5) [custom_components.yeelight_v2.light] Calling <function YeelightGenericLight.set_flash at 0x7f206e615c10> with (None,) {} 2021-01-31 09:27:28 DEBUG (SyncWorker_5) [custom_components.yeelight_v2.light] Calling <function YeelightGenericLight.set_effect at 0x7f206e615d30> with (None,) {} 2021-01-31 09:27:28 DEBUG (SyncWorker_5) [custom_components.yeelight_v2.light] Calling <function YeelightGenericLight.set_default at 0x7f206e615af0> with () {} 2021-01-31 09:27:28 DEBUG (SyncWorker_5) [custom_components.yeelight_v2.python_yeelight.yeelight.main] miIO: Bulb<192.168.0.71:55443, type=BulbType.Color> > set_default > [] 2021-01-31 09:27:28 DEBUG (SyncWorker_5) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.71:54321 >>: {'id': 27, 'method': 'set_default', 'params': []} 2021-01-31 09:27:28 DEBUG (SyncWorker_5) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.71:54321 (ts: 1970-01-01 00:11:47, id: 27) << {'id': 27, 'error': {'code': -5006, 'message': 'illegal request'}} 2021-01-31 09:27:28 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.97:54321 (ts: 1970-01-02 12:29:32, id: 16) << {'id': 16, 'result': ['ok']} 2021-01-31 09:27:28 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.light] Calling <function YeelightGenericLight.set_rgb at 0x7f206e6158b0> with ((255, 183, 123), 1000) {} 2021-01-31 09:27:28 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.light] Setting RGB: (255, 183, 123) 2021-01-31 09:27:28 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.python_yeelight.yeelight.main] miIO: Bulb<192.168.0.97:55443, type=BulbType.Color> > set_rgb > [16758651, 'smooth', 1000] 2021-01-31 09:27:28 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.97:54321 >>: {'id': 17, 'method': 'set_rgb', 'params': [16758651, 'smooth', 1000]} 2021-01-31 09:27:28 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.97:54321 (ts: 1970-01-02 12:29:32, id: 17) << {'id': 17, 'result': ['ok']} 2021-01-31 09:27:28 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.light] Calling <function YeelightGenericLight.set_colortemp at 0x7f206e6159d0> with (None, 1000) {} 2021-01-31 09:27:28 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.light] Calling <function YeelightGenericLight.set_brightness at 0x7f206e615790> with (204, 1000) {} 2021-01-31 09:27:28 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.light] Setting brightness: 204 2021-01-31 09:27:28 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.python_yeelight.yeelight.main] miIO: Bulb<192.168.0.97:55443, type=BulbType.Color> > set_bright > [80.0, 'smooth', 1000] 2021-01-31 09:27:28 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.97:54321 >>: {'id': 18, 'method': 'set_bright', 'params': [80.0, 'smooth', 1000]} 2021-01-31 09:27:28 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.97:54321 (ts: 1970-01-02 12:29:32, id: 18) << {'id': 18, 'result': ['ok']} 2021-01-31 09:27:28 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.light] Calling <function YeelightGenericLight.set_flash at 0x7f206e615c10> with (None,) {} 2021-01-31 09:27:28 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.light] Calling <function YeelightGenericLight.set_effect at 0x7f206e615d30> with (None,) {} 2021-01-31 09:27:28 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.light] Calling <function YeelightGenericLight.set_default at 0x7f206e615af0> with () {} 2021-01-31 09:27:28 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.python_yeelight.yeelight.main] miIO: Bulb<192.168.0.97:55443, type=BulbType.Color> > set_default > [] 2021-01-31 09:27:28 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.97:54321 >>: {'id': 19, 'method': 'set_default', 'params': []} 2021-01-31 09:27:28 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.97:54321 (ts: 1970-01-02 12:29:32, id: 19) << {'id': 19, 'error': {'code': -5006, 'message': 'illegal request'}}

dennyha commented 3 years ago

Getting a lot of these illegal requests now, node red doesn't like it at all as it throws API errors.

Any idea why this is happening?

2021-02-04 21:16:43 DEBUG (SyncWorker_8) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.101:54321 (ts: 1970-01-01 00:08:32, id: 6) << {'id': 6, 'result': ['ok']} 2021-02-04 21:16:43 DEBUG (SyncWorker_8) [custom_components.yeelight_v2.light] Calling <function YeelightGenericLight.set_brightness at 0x7f64f9734280> with (43, 45000) {} 2021-02-04 21:16:43 DEBUG (SyncWorker_8) [custom_components.yeelight_v2.light] Setting brightness: 43 2021-02-04 21:16:43 DEBUG (SyncWorker_8) [custom_components.yeelight_v2.python_yeelight.yeelight.main] miIO: Bulb<192.168.0.101:55443, type=BulbType.Color> > set_bright > [16.862745098039216, 'smooth', 45000] 2021-02-04 21:16:43 DEBUG (SyncWorker_8) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.101:54321 >>: {'id': 7, 'method': 'set_bright', 'params': [16.862745098039216, 'smooth', 45000]} 2021-02-04 21:16:43 DEBUG (SyncWorker_0) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.99:54321 (ts: 1970-01-01 00:08:32, id: 6) << {'id': 6, 'result': ['ok']} 2021-02-04 21:16:43 DEBUG (SyncWorker_0) [custom_components.yeelight_v2.light] Calling <function YeelightGenericLight.set_brightness at 0x7f64f9734280> with (43, 45000) {} 2021-02-04 21:16:43 DEBUG (SyncWorker_0) [custom_components.yeelight_v2.light] Setting brightness: 43 2021-02-04 21:16:43 DEBUG (SyncWorker_0) [custom_components.yeelight_v2.python_yeelight.yeelight.main] miIO: Bulb<192.168.0.99:55443, type=BulbType.Color> > set_bright > [16.862745098039216, 'smooth', 45000] 2021-02-04 21:16:43 DEBUG (SyncWorker_0) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.99:54321 >>: {'id': 7, 'method': 'set_bright', 'params': [16.862745098039216, 'smooth', 45000]} 2021-02-04 21:16:43 DEBUG (SyncWorker_4) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.102:54321 (ts: 1970-01-01 12:22:16, id: 6) << {'id': 6, 'result': ['ok']} 2021-02-04 21:16:43 DEBUG (SyncWorker_4) [custom_components.yeelight_v2.light] Calling <function YeelightGenericLight.set_brightness at 0x7f64f9734280> with (105, 45000) {} 2021-02-04 21:16:43 DEBUG (SyncWorker_4) [custom_components.yeelight_v2.light] Setting brightness: 105 2021-02-04 21:16:43 DEBUG (SyncWorker_4) [custom_components.yeelight_v2.python_yeelight.yeelight.main] miIO: Bulb<192.168.0.102:55443, type=BulbType.Color> > set_bright > [41.17647058823529, 'smooth', 45000] 2021-02-04 21:16:43 DEBUG (SyncWorker_4) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.102:54321 >>: {'id': 7, 'method': 'set_bright', 'params': [41.17647058823529, 'smooth', 45000]} 2021-02-04 21:16:43 DEBUG (SyncWorker_0) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.99:54321 (ts: 1970-01-01 00:08:32, id: 7) << {'id': 7, 'result': ['ok']} 2021-02-04 21:16:43 DEBUG (SyncWorker_0) [custom_components.yeelight_v2.light] Calling <function YeelightGenericLight.set_flash at 0x7f64f9734700> with (None,) {} 2021-02-04 21:16:43 DEBUG (SyncWorker_0) [custom_components.yeelight_v2.light] Calling <function YeelightGenericLight.set_effect at 0x7f64f9734820> with (None,) {} 2021-02-04 21:16:43 DEBUG (SyncWorker_0) [custom_components.yeelight_v2.light] Calling <function YeelightGenericLight.set_default at 0x7f64f97345e0> with () {} 2021-02-04 21:16:43 DEBUG (SyncWorker_0) [custom_components.yeelight_v2.python_yeelight.yeelight.main] miIO: Bulb<192.168.0.99:55443, type=BulbType.Color> > set_default > [] 2021-02-04 21:16:43 DEBUG (SyncWorker_0) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.99:54321 >>: {'id': 8, 'method': 'set_default', 'params': []} 2021-02-04 21:16:43 DEBUG (SyncWorker_8) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.101:54321 (ts: 1970-01-01 00:08:32, id: 7) << {'id': 7, 'result': ['ok']} 2021-02-04 21:16:43 DEBUG (SyncWorker_8) [custom_components.yeelight_v2.light] Calling <function YeelightGenericLight.set_flash at 0x7f64f9734700> with (None,) {} 2021-02-04 21:16:43 DEBUG (SyncWorker_8) [custom_components.yeelight_v2.light] Calling <function YeelightGenericLight.set_effect at 0x7f64f9734820> with (None,) {} 2021-02-04 21:16:43 DEBUG (SyncWorker_8) [custom_components.yeelight_v2.light] Calling <function YeelightGenericLight.set_default at 0x7f64f97345e0> with () {} 2021-02-04 21:16:43 DEBUG (SyncWorker_8) [custom_components.yeelight_v2.python_yeelight.yeelight.main] miIO: Bulb<192.168.0.101:55443, type=BulbType.Color> > set_default > [] 2021-02-04 21:16:43 DEBUG (SyncWorker_8) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.101:54321 >>: {'id': 8, 'method': 'set_default', 'params': []} 2021-02-04 21:16:43 DEBUG (SyncWorker_4) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.102:54321 (ts: 1970-01-01 12:22:16, id: 7) << {'id': 7, 'result': ['ok']} 2021-02-04 21:16:43 DEBUG (SyncWorker_4) [custom_components.yeelight_v2.light] Calling <function YeelightGenericLight.set_flash at 0x7f64f9734700> with (None,) {} 2021-02-04 21:16:43 DEBUG (SyncWorker_4) [custom_components.yeelight_v2.light] Calling <function YeelightGenericLight.set_effect at 0x7f64f9734820> with (None,) {} 2021-02-04 21:16:43 DEBUG (SyncWorker_4) [custom_components.yeelight_v2.light] Calling <function YeelightGenericLight.set_default at 0x7f64f97345e0> with () {} 2021-02-04 21:16:43 DEBUG (SyncWorker_4) [custom_components.yeelight_v2.python_yeelight.yeelight.main] miIO: Bulb<192.168.0.102:55443, type=BulbType.Color> > set_default > [] 2021-02-04 21:16:43 DEBUG (SyncWorker_4) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.102:54321 >>: {'id': 8, 'method': 'set_default', 'params': []} 2021-02-04 21:16:43 DEBUG (SyncWorker_0) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.99:54321 (ts: 1970-01-01 00:08:32, id: 8) << {'id': 8, 'error': {'code': -5006, 'message': 'illegal request'}} 2021-02-04 21:16:43 DEBUG (SyncWorker_8) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.101:54321 (ts: 1970-01-01 00:08:32, id: 8) << {'id': 8, 'error': {'code': -5006, 'message': 'illegal request'}} 2021-02-04 21:16:43 DEBUG (SyncWorker_4) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.0.102:54321 (ts: 1970-01-01 12:22:16, id: 8) << {'id': 8, 'error': {'code': -5006, 'message': 'illegal request'}}