Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot add Yeelight color 3 #10

Open
DaCarei opened this issue Mar 23, 2021 · 3 comments
Open

Cannot add Yeelight color 3 #10

DaCarei opened this issue Mar 23, 2021 · 3 comments

Comments

@DaCarei
Copy link

DaCarei commented Mar 23, 2021

Hello,
I'm having a problem to add this model : yeelink.light.color3 with yeelight_v2.
I followed mainly this issue : home-assistant/core#44540
Makolink in this article seems to have integrated yeelink.light.color3 so it might be possible to add mine also.
My bulb is currently working with Xiaomi home, I tried to put it on local control but this model doesn't seems to accept this option.

I have the token of the device and I tried with MIIO for yeelight, MIIO for Xiaomi and yeelight_v2.

The configuration.yaml has been modified as below : (token has been replaced by "xxx")
`yeelight_v2:
devices:
192.168.1.56:
name: "XiaomiBulb"
ssdp_fallback: True # Recommended, the default value is False
miio_token: "xxx" # if provided miio protocol is used (optional)

#logs
logger:
default: critical
logs:
custom_components.yeelight_v2: debug
custom_components.yeelight_v2.python_yeelight.yeelight.main: debug`

Here after the log error and the full log:

Log error :

Logger: custom_components.yeelight_v2.python_miio.miio.miioprotocol Source: custom_components/yeelight_v2/python_miio/miio/miioprotocol.py:239 Integration: YeelightV2 (documentation) First occurred: March 22, 2021, 2:44:11 PM (1 occurrences) Last logged: March 22, 2021, 2:44:11 PM Got error when receiving: timed out

Full log : (token has been replaced by "xxx")

`2021-03-22 14:43:54 DEBUG (MainThread) [custom_components.yeelight_v2] Importing configured 192.168.1.56
2021-03-22 14:43:58 DEBUG (MainThread) [custom_components.yeelight_v2] Device config options: {'name': 'XiaomiBulb', 'model': 'yeelink.light.color3', 'miio_token': 'xxx', 'transition': 350, 'use_music_mode': False, 'save_on_change': False, 'ssdp_fallback': True, 'nightlight_switch': False}
2021-03-22 14:44:00 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.python_yeelight.yeelight.main] Milo: True, SSDP: True
2021-03-22 14:44:00 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.python_yeelight.yeelight.main] miIO: Bulb<192.168.1.56:55443, type=BulbType.Unknown> > get_prop > ['power', 'main_power', 'bright', 'ct', 'rgb', 'hue', 'sat', 'color_mode', 'flowing', 'bg_power', 'bg_lmode', 'bg_flowing', 'bg_ct', 'bg_bright', 'bg_hue', 'bg_sat', 'bg_rgb', 'nl_br', 'active_mode']
2021-03-22 14:44:00 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.python_miio.miio.protocol] Unable to decrypt, returning raw bytes: b''

2021-03-22 14:44:00 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] Got a response: Container:
data = Container:
data = b'' (total 0)
value = b'' (total 0)
offset1 = 32
offset2 = 32
length = 0
header = Container:
data = b'!1\x00 \x00\x00\x00\x00\x07\xd0#\xb0\x00\x00,9' (total 16)
value = Container:
length = 32
unknown = 0
device_id = unhexlify('07d023b0')
ts = 1970-01-01 03:08:41
offset1 = 0
offset2 = 16
length = 16
checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16)
2021-03-22 14:44:00 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] Discovered 07d023b0 with ts: 1970-01-01 03:08:41, token: b'ffffffffffffffffffffffffffffffff'
2021-03-22 14:44:00 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.1.56:54321 >>: {'id': 1, 'method': 'get_prop', 'params': ['power', 'main_power', 'bright', 'ct', 'rgb', 'hue', 'sat', 'color_mode', 'flowing', 'bg_power', 'bg_lmode', 'bg_flowing', 'bg_ct', 'bg_bright', 'bg_hue', 'bg_sat', 'bg_rgb', 'nl_br', 'active_mode']}
2021-03-22 14:44:05 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] Retrying with incremented id, retries left: 1
2021-03-22 14:44:06 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.python_miio.miio.protocol] Unable to decrypt, returning raw bytes: b''
2021-03-22 14:44:06 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] Got a response: Container:
data = Container:
data = b'' (total 0)
value = b'' (total 0)
offset1 = 32
offset2 = 32
length = 0
header = Container:
data = b'!1\x00 \x00\x00\x00\x00\x07\xd0#\xb0\x00\x00,?' (total 16)
value = Container:
length = 32
unknown = 0
device_id = unhexlify('07d023b0')
ts = 1970-01-01 03:08:47
offset1 = 0
offset2 = 16
length = 16
checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16)
2021-03-22 14:44:06 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] Discovered 07d023b0 with ts: 1970-01-01 03:08:47, token: b'ffffffffffffffffffffffffffffffff'
2021-03-22 14:44:06 DEBUG (SyncWorker_2) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] 192.168.1.56:54321 >>: {'id': 102, 'method': 'get_prop', 'params': ['power', 'main_power', 'bright', 'ct', 'rgb', 'hue', 'sat', 'color_mode', 'flowing', 'bg_power', 'bg_lmode', 'bg_flowing', 'bg_ct', 'bg_bright', 'bg_hue', 'bg_sat', 'bg_rgb', 'nl_br', 'active_mode']}
2021-03-22 14:44:11 ERROR (SyncWorker_2) [custom_components.yeelight_v2.python_miio.miio.miioprotocol] Got error when receiving: timed out`

@Silvest89
Copy link
Owner

Unable to decrypt, returning raw bytes: b''

This means it couldn't decrypt the token. You sure you got the right token?

@DaCarei
Copy link
Author

DaCarei commented Mar 28, 2021

Thank you for your answer, I rechecked the token and it is correct.
Since you pointed the token, I thought it should be quoted like this : 'token' instead of "token".
But it didn't change the error log.

I tried to remove everything and reconfigure, most of the time I have the same error.
I just had "connection refused" before "timed out" :

Logger: custom_components.yeelight_v2.python_yeelight.yeelight.main
Source: custom_components/yeelight_v2/python_yeelight/yeelight/main.py:823
Integration: YeelightV2 (documentation)
First occurred: 9:55:24 PM (1 occurrences)
Last logged: 9:55:24 PM

[Errno 111] Connection refused

I rechecked the IP address but it is still the same.

@rytilahti
Copy link

@Silvest89 that error message about empty payload comes from the discovery so that's not relevant, rytilahti/python-miio#1008 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants