Core: Broadlink RM mini 3 0x27cc Not working after 0.115

Created on 18 Sep 2020  Â·  25Comments  Â·  Source: home-assistant/core

The problem


After updating to HA 0.115 and 0.115.1 my RM mini 3 doesn't create a new remote.
The model (taken from the addon Broadlink Manager) is 0x27cc.
It used to work without problem before the update.

Environment

  • Home Assistant Core release with the issue: 0.115
  • Last working Home Assistant Core release (if known): 0.114
  • Operating environment (OS/Container/Supervised/Core): OS
  • Integration causing this issue: Broadlink
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/broadlink/

Problem-relevant configuration.yaml


Traceback/Error logs

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 228, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/broadlink/__init__.py", line 28, in async_setup_entry
    return await device.async_setup()
  File "/usr/src/homeassistant/homeassistant/components/broadlink/device.py", line 97, in async_setup
    update_manager = get_update_manager(self)
  File "/usr/src/homeassistant/homeassistant/components/broadlink/updater.py", line 24, in get_update_manager
    if device.api.model.startswith("RM mini"):
AttributeError: 'NoneType' object has no attribute 'startswith'

Additional information

broadlink

Most helpful comment

It may take a little while, but soon we will have a release with all these types.

All 25 comments

broadlink documentation
broadlink source
(message by IssueLinks)

Hey there @danielhiversen, @felipediel, mind taking a look at this issue as its been labeled with an integration (broadlink) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

Am also getting the same issue with an RM4 Mini. Was working great in 114.

Removed appropriate configuration references in breaking changes section of the blogpost and when I run through the integration setup, it works fine but I get this error in the log as well. No entity is created for the remote. Tried deleting the logs and DB file and restarting, disabling the integration, etc... keep running into this.

I will note that my broadlink setup would NOT work without the

type: rm4_mini

in my configuration for a switch originally with 114

@rwarner Please update to 0.115.1 and send me the unsupported device type that will show up in the logs.

@felipediel Sorry, this is on 115.1

Traceback (most recent call last):
  File "/srv/homeassistant/homeassistant_venv_3.7.5/lib/python3.7/site-packages/homeassistant/config_entries.py", line 228, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/srv/homeassistant/homeassistant_venv_3.7.5/lib/python3.7/site-packages/homeassistant/components/broadlink/__init__.py", line 28, in async_setup_entry
    return await device.async_setup()
  File "/srv/homeassistant/homeassistant_venv_3.7.5/lib/python3.7/site-packages/homeassistant/components/broadlink/device.py", line 97, in async_setup
    update_manager = get_update_manager(self)
  File "/srv/homeassistant/homeassistant_venv_3.7.5/lib/python3.7/site-packages/homeassistant/components/broadlink/updater.py", line 24, in get_update_manager
    if device.api.model.startswith("RM mini"):
AttributeError: 'NoneType' object has no attribute 'startswith'

Go to the Integrations page, remove the device and try to add it again.

I'm having the same issue and error on 0.115.1 and it doesn't work even after multiple restarts of HA and removing the integration and readding it.

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 228, in async_setup result = await component.async_setup_entry(hass, self) # type: ignore File "/usr/src/homeassistant/homeassistant/components/broadlink/__init__.py", line 28, in async_setup_entry return await device.async_setup() File "/usr/src/homeassistant/homeassistant/components/broadlink/device.py", line 97, in async_setup update_manager = get_update_manager(self) File "/usr/src/homeassistant/homeassistant/components/broadlink/updater.py", line 24, in get_update_manager if device.api.model.startswith("RM mini"): AttributeError: 'NoneType' object has no attribute 'startswith'

I’ve removed the integration multiple times and re-added it and doesn’t seem to make a difference. Mixing reboots in between — I keep getting this in my logs:

Logger: homeassistant.config_entries
Source: components/broadlink/updater.py:24 
First occurred: 10:30:09 PM (1 occurrences) 
Last logged: 10:30:09 PM

Error setting up entry Living_Room for broadlink
Traceback (most recent call last):
  File "/srv/homeassistant/homeassistant_venv_3.7.5/lib/python3.7/site-packages/homeassistant/config_entries.py", line 228, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/srv/homeassistant/homeassistant_venv_3.7.5/lib/python3.7/site-packages/homeassistant/components/broadlink/__init__.py", line 28, in async_setup_entry
    return await device.async_setup()
  File "/srv/homeassistant/homeassistant_venv_3.7.5/lib/python3.7/site-packages/homeassistant/components/broadlink/device.py", line 97, in async_setup
    update_manager = get_update_manager(self)
  File "/srv/homeassistant/homeassistant_venv_3.7.5/lib/python3.7/site-packages/homeassistant/components/broadlink/updater.py", line 24, in get_update_manager
    if device.api.model.startswith("RM mini"):
AttributeError: 'NoneType' object has no attribute 'startswith'

It does seem to “connect” to the device when I put in the IP address in the configuration workflow, comes back with chinese characters that I replace with “Living_Room” also tried with “Living Room”

I had to change the python code to single quotes instead of double quotes and used the following:

import broadlink as blk

devs = blk.discover(timeout=5)
print([(d.host[0], hex(d.devtype)) for d in devs])

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

Output is as follows:

$ python3 test.py
[]
[('192.168.3.25', '0x648d')]

Strange. Your device is supported, it should work. Are you using any custom components?

I’m using:

  • smartIR (Previously working together with the 0.114 broadlink integration)
  • variables

for custom components, everything else is mainly from the HACS community installs

  • bhyve
  • unifi protect

Feel free to check out my configuration in my git repo, I just pushed my attempted changes for 115 an hour or so ago

Please disable all your custom components before testing. They make it very difficult to find the problem. If you don't want to mess up with your installation, you should consider creating a venv or a container on your desktop for testing/debugging https://developers.home-assistant.io/docs/development_environment/.

I get the same error as @rwarner and am also using smartIR. It appears that only the RM4 Minis in my system are affected (4 of them). The RM3 Mini that I have appears to be connected.

I will attempt to remove that integration and let you know shortly.

I’ll try to test it out again tomorrow w/o any custom components.

Good to know @jasonatepaint is getting the same thing with the Rm4 Mini’s, perhaps this is an RM4 Mini specific thing? Although OP seems to have a problem with the RM3

The error is still obscure to me. The device is being generated here. If the device type is supported, gendevice() returns a device with a model from the dictionary. So the question is what is forcing the model to be None? My guess is that there is a dependency issue involving your custom components.

I removed all of my integrations and same results. The RM3 Mini continues to work. The RM4 Minis still produce that AttributeError: 'NoneType' object has no attribute 'startswith' error.

I turned on debug logging for homeassistant.components.broadlink but didn't get anything. Is the logger name something different?

Gonna roll back to .114 for now, but if there are additional things you'd like me to try, let me know.

Did you remove the custom components? https://github.com/home-assistant/core/issues/40191#issuecomment-694532131 What is the output?

Did you remove the custom components?

Yes, sorry... that's what I meant.... I just removed the entire folder and removed the references in my configuration.yaml.

Ah, I found the problem. Your device is not supported yet. This commit was not released. You need to wait for the next version of the python-broadlink library on PyPi.

This problem does not exist anymore. You just need to wait.

This problem does not exist anymore. You just need to wait.

Thanks for the quick response! No problem, I'll roll back until it gets released.

onfig_entries.py", line 228, in async_setup
result = await component.async_setup_entry

the same problem but my devtype is "0x27d0" (RM mini 3),
this devtype "0x27d0" is not the same as others, really inexplicable.

Thanks for the update on the subject and the quick replies as well last night.

@felipediel thanks for the link to the broadlink addition here: https://github.com/mjg59/python-broadlink/commit/b4aa15617aef4c24075bc06a99b929b725681838

I ended up adding that into my file here:
/srv/homeassistant/homeassistant_venv/lib/python3.7/site-packages/broadlink/__init__.py

Gave HA a reboot and now it works perfectly as intended through the Integrations page 👍

Doesn't look like there's been a new release on that repo for months, you think it'll be some time before that commit comes along to release?

It may take a little while, but soon we will have a release with all these types.

Was this page helpful?
0 / 5 - 0 ratings