Open selsoh opened 3 years ago
Try to execute git submodule update --recursive --remote to make sure you get the latest changes of the submodules Somehow the submodules got stuck at a specific sha commit
I still had to update this repo to point to latest changes. So this
git clone --recursive git@github.com:Silvest89/yeelight_v2.git
Caused you to pull a specific sha commit of the submodules (not the latest change)
submodule update --recursive --remote
This will update and point the submodules to latest remote. So you can either execute this or just delete the folder and clone again =)
I pushed the fix. So the clone will pull the latest changes now as well
First time working with submodules ^^
They’re lasting longer now but still stop working after a few minutes
I’m getting this error after each interaction
2021-01-18 16:48:35 ERROR (SyncWorker_6) [custom_components.yeelight_v2.python_yeelight.yeelight.main] timed out
and this as it stops working I think
2021-01-18 16:55:20 ERROR (SyncWorker_0) [custom_components.yeelight_v2.python_yeelight.yeelight.main] [Errno 9] Bad file descriptor
Also curious if a delay of up to 5 seconds for the bulb to respond to an interaction is normal. Or possibly caused by the timeouts.
They are on different vlans right? Have you tried putting the bulbs and ha server on the same vlan ? What basically is is that the get_prop is kinda broken in firmware 0031 (breaks after a few times) and the fallback uses SSDP, SSDP across VLANs requires you to multicast it.
Yeelight released beta firmware 0033 for color4 last week, have you tried updating to it? This should fix the get_prop so you don't even need the SSDP
I will be working on the miio protocol today, so you can finally say bye to LAN control. Which is buggy as hell.
Alright, thanks. I'll give those a shot.
Buggy for sure, I'm looking forward to trying out that miio protocol.
Alright, thanks. I'll give those a shot.
Buggy for sure, I'm looking forward to trying out that miio protocol.
Yeah, it might also be a security protection to only respond to broadcast packets on the same subnet.
If you've multiple VLAN's/subnets and you're in control over the router in between, then I'd setup masquerading for the outgoing routing interface of the VLAN/subnet where the Xiaomi devices reside.
This basically means changing the source address in the UDP packet headers to the IP address of routing interface. If you want to know more about this, just inform yourself about packet masquerading and/or SNAT.
I had to do it for miio to work accross subnets. Miio works excellent, all command behave as they should so will be pushing it soon, eg the same way Xiaomi/Yeelight communicates.
Just getting the miio-tokens is an extra step to use the protocol.
@selsoh I just fixed a bug in regards to your color4 bulb, the interaction should now also only have a delay for the first time interacting. Miio protocol has also been implemented.
I also updated the README regarding VLAN
Can you delete the folder and execute this again?
git clone --recursive git@github.com:Silvest89/yeelight_v2.git
I was actually about to report earlier today on what I've tested so far. Sorry I wasn't able to get back to you sooner.
Three days ago, I moved the bulbs to the same subnet as my HA server with firewall restrictions on the bulbs to only allow connections to, and from the HA server. They were still timing out.
Then earlier today, I saw you've implemented the miio protocol and gave that a go (along with the setup above). Interactions became very snappy and I was hopeful that everything would be good. But they eventually stopped receiving messages despite not giving any errors in the log.
I've now updated after seeing your comment, let the bulbs run for about 15 minutes and it seems they have stopped responding again. This was without changing anything from my previous setup (firewall+miio).
I tried again without miio tokens and got this error after about 15 minutes.
2021-01-22 05:56:49 ERROR (SyncWorker_6) [custom_components.yeelight_v2.python_yeelight.yeelight.main] [Errno 104] Connection reset by peer
Also, I'd like to ask how one can get into the firmware beta. I've only searched briefly and was mostly seeing people posting their Mi IDs in the forum.
You sure they are using miio ? I added debug logs to see if miio is enabled or not.
Yeah you post your Mi Id and they will add you when they see it :P
You got discord or anything?
I think I do. Here's the log, I've hidden the tokens just in case I'm supposed to. And yeah, I have discord.
@selsoh Give me your discord id then I'll add you.
I'm also having similar issues with my color4.
2021-01-30 08:31:34 ERROR (SyncWorker_4) [custom_components.yeelight_v2.python_yeelight.yeelight.main] timed out
2021-01-30 08:32:01 DEBUG (SyncWorker_7) [custom_components.yeelight_v2.python_yeelight.yeelight.main] Milo: False, SSDP: True
2021-01-30 08:32:01 DEBUG (SyncWorker_7) [custom_components.yeelight_v2.python_yeelight.yeelight.main] LAN Control: Bulb<192.168.*.*:****, type=BulbType.Color> > {'id': 2, '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-01-30 08:32:05 ERROR (SyncWorker_7) [custom_components.yeelight_v2.python_yeelight.yeelight.main] timed out
2021-01-30 08:32:31 DEBUG (SyncWorker_4) [custom_components.yeelight_v2.python_yeelight.yeelight.main] Milo: False, SSDP: True
2021-01-30 08:32:31 DEBUG (SyncWorker_4) [custom_components.yeelight_v2.python_yeelight.yeelight.main] LAN Control: Bulb<192.168.*.*:**** type=BulbType.Color> > {'id': 3, '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-01-30 08:32:34 ERROR (SyncWorker_4) [custom_components.yeelight_v2.python_yeelight.yeelight.main] timed out
2021-01-30 08:33:01 DEBUG (SyncWorker_7) [custom_components.yeelight_v2.python_yeelight.yeelight.main] Milo: False, SSDP: True
2021-01-30 08:33:01 DEBUG (SyncWorker_7) [custom_components.yeelight_v2.python_yeelight.yeelight.main] LAN Control: Bulb<192.168.*.*:****, type=BulbType.Color> > {'id': 4, '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-01-30 08:33:04 ERROR (SyncWorker_7) [custom_components.yeelight_v2.python_yeelight.yeelight.main] timed out
2021-01-30 08:33:31 DEBUG (SyncWorker_4) [custom_components.yeelight_v2.python_yeelight.yeelight.main] Milo: False, SSDP: True
2021-01-30 08:33:31 DEBUG (SyncWorker_4) [custom_components.yeelight_v2.python_yeelight.yeelight.main] LAN Control: Bulb<192.168.*.*:****, type=BulbType.Color> > {'id': 5, '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-01-30 08:33:34 ERROR (SyncWorker_4) [custom_components.yeelight_v2.python_yeelight.yeelight.main] timed out
2021-01-30 08:34:01 DEBUG (SyncWorker_7) [custom_components.yeelight_v2.python_yeelight.yeelight.main] Milo: False, SSDP: True
2021-01-30 08:34:01 DEBUG (SyncWorker_7) [custom_components.yeelight_v2.python_yeelight.yeelight.main] LAN Control: Bulb<192.168.*.*:****, type=BulbType.Color> > {'id': 6, '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-01-30 08:34:04 ERROR (SyncWorker_7) [custom_components.yeelight_v2.python_yeelight.yeelight.main] timed out
and so on and so forth.
Edit:
Also started getting this now:
2021-01-30 19:11:34 ERROR (SyncWorker_3) [custom_components.yeelight_v2.python_yeelight.yeelight.main] [Errno 32] Broken pipe
2021-01-30 19:11:34 ERROR (SyncWorker_4) [custom_components.yeelight_v2.python_yeelight.yeelight.main] [Errno 9] Bad file descriptor
EDIT: Just an update. I've added my miio token and it's now no longer timing out.
Both bulbs are on a separate VLAN from my HA server and don't have internet access.
I did
inside the custom_components folder
added these to my configuration.yaml
then restarted HA
they show up but time out after a few minutes or after I interact with them