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

Broadlink failed to connect after update 0.115.1 #40267

Closed
nick2525 opened this issue Sep 18, 2020 · 12 comments
Closed

Broadlink failed to connect after update 0.115.1 #40267

nick2525 opened this issue Sep 18, 2020 · 12 comments

Comments

@nick2525
Copy link

nick2525 commented Sep 18, 2020

I have updated HA to 0.115.1, cleared broadlink in my yaml, reboot my pi, and have no suggestions about broadlink in integration, I pressed plus and try to add devices by IP. It can't connect. Ip of broadlink is constant. I have rm mini 3, rm pro, and broadlink a1

Environment

arch | armv7l
dev | false
docker | true
hassio | false
installation_type | Home Assistant Container
os_name | Linux
os_version | 4.19.66-v7+
python_version | 3.8.0
timezone | Europe/Moscow
version | 0.115.1
virtualenv | true
I also have VPN and local interface

  • Last working Home Assistant Core release (if known): 0.114.4
  • Integration causing this issue: broadlink

Problem-relevant configuration.yaml

I removed everything connected with broadlink from my config

Traceback/Error logs

Logger: homeassistant.components.broadlink
Source: components/broadlink/config_flow.py:100
Integration: broadlink (documentation, issues)
First occurred: 22:52:08 (2 occurrences)
Last logged: 22:54:37

Failed to connect to the device at 192.168.4.166: Device not found
Failed to connect to the device at 192.168.4.115: Device not found

Additional information

Router microtik

@probot-home-assistant
Copy link

broadlink documentation
broadlink source
(message by IssueLinks)

@nick2525
Copy link
Author

My raspberry pi also have two interfaces - VPN and local network.

@kirichkov
Copy link
Contributor

kirichkov commented Sep 19, 2020

The solution is for the config flow to expose broadlink-python's local_ip_address, which makes explicit selection of the interface to be used to communicate with the broadlink device.

In my setup ping works just fine. I also used a test script, and the script didn find any devices until i modified it to use local_ip_address:

import broadlink as blk

devs = blk.discover(discover_ip_address='192.168.1.101', local_ip_address='192.168.1.5', timeout=5)  # Your device IP address
print([(d.host[0], hex(d.devtype)) for d in devs])

The Xiaomi Aqara integration does that already:
Screen Shot 2020-09-19 at 13 27 01

@kirichkov
Copy link
Contributor

A temporary and very dirty workaround is to manually add the correct IP address of your HASS in the broadlink module, changing lib/python3.7/site-packages/broadlink/__init__.py line 120 to the IP address of your HASS interface which can communicate with your Broadlink.

I.e. if HASS has an IP address of 192.168.45.18 and your broadlink has IP address 192.168.45.55 the line becomes:

    local_ip_address = '192.168.45.18'

Keep in mind that once the broadlink module gets updated this dirty hack will stop working!

@nick2525
Copy link
Author

yes, when I set local ip, it works

devs = blk.discover(discover_ip_address='192.168.4.166', local_ip_address='192.168.4.117', timeout=5)

print([(d.host[0], hex(d.devtype)) for d in devs])
[('192.168.4.166', '0x279d')]

@felipediel
Copy link
Contributor

felipediel commented Sep 21, 2020

This problem will be fixed when we release this.

@litinoveweedle
Copy link

Is there any estimation when your fix will be released in HA? Especially if this will be release in 115? As I was expecting such breaking issue should be fixed ASAP, but unfortunately it seems to missed 115.4 as I still observe this problem. Thank you

@litinoveweedle
Copy link

This issue is still not addressed in HA 0.115.6 even this was already fixed in python-broadlink:

mjg59/python-broadlink#427

This issue prevents any HomeAssistant Broadlink based integration to work in multiple network interface configuration. All existing devices are rendered unavailable and new devices could not be detected and added using web based Broadlink integration.
I would be therefore great to fix this issue by pulling mentioned fix into HA as well.

existing broadlink devices report:

Logger: homeassistant.components.broadlink
Source: components/broadlink/config_flow.py:114
Integration: Broadlink (documentation, issues)
First occurred: 5:05:14 PM (3 occurrences)
Last logged: 5:05:14 PM

    Failed to connect to the device at 192.168.3.92: Device not found
    Failed to connect to the device at 192.168.3.61: Device not found
    Failed to connect to the device at 192.168.3.89: Device not found

When trying to add new using webui Broadlink integration:
2020-09-30 17:07:41 ERROR (MainThread) [homeassistant.components.broadlink] Failed to connect to the device at 192.168.3.61: Device not found

@paoloantinori
Copy link
Contributor

paoloantinori commented Oct 4, 2020

I can confirm that the issue's gone on Home Assistant 0.116.0b2

@felipediel
Copy link
Contributor

Good to know it worked. Thank you!

@nick2525
Copy link
Author

nick2525 commented Oct 4, 2020

Yes, it also works on my devices.

@github-actions
Copy link

github-actions bot commented Jan 2, 2021

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

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

No branches or pull requests

7 participants