core: broadlink integration error

The problem

I tried to use new integration for my broadlink remote (rm_pro_phicom), it worked with custom components without problems, with new integration it fails and doesn’t create new entity.

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): Core
  • 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

Logger: homeassistant.config_entries
Source: components/broadlink/updater.py:29
First occurred: 20:41:02 (2 occurrences)
Last logged: 20:42:44

Error setting up entry despacho_remote for broadlink
Error setting up entry remote_despacho for broadlink
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 29, in get_update_manager
    return update_managers[device.api.type](device)
KeyError: 'Unknown'

Additional information

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 7
  • Comments: 190 (73 by maintainers)

Most upvoted comments

Here you go:

{'pwr': 1, 'ntlight': 0, 'indicator': 1, 'usbpwr': 0, 'maxworktime': 0, 'usbmaxworktime': 0, 'ntlbrightness': 100, 'current': -1, 'volt': -1, 'power': -1, 'totalconsum': -1, 'overload': -1, 'childlock': 0}

@occamatic Try unlocking the device with the official app first.

Thank you it worked! You saved me having to return these 2 units I bought. Keep up the good work!

looks also ok to me, thanks a lot !

my seven rm3mini also come back after 116, Thank @felipediel and all involved in the update very very much. You are the man.

Can also advise after upgrading HA to .116 my Rm4 ×0649b and sensorsensors work! Thanks again @felipediel and all involved in the update. Amazing work!!! 🎉🎉🎉

@alb147 Thank you. RM mini 3 (0x5f36) is already working, if that was your problem you can safely update.

@aryehassbian You can have both. Follow this thread and use Discord for support.

@Amir974 I added your device type the same day and linked the PR so that you could follow the progress. You should stick with the latest stable until you see this in the release notes.

@litinoveweedle Your problem will be solved with the same update.

All problems mentioned here were addressed in record time. They no longer exist in the dev branch. Sometimes it takes a while to get the code into production, especially when we are also dealing with library updates. No one is to blame, this is normal. New code needs treatment. There is a whole process involving tests, reviews and devops.

Home Assistant has more than 1600 integrations. Not an easy task to keep all these things up to date with a small team. So please, don’t push these guys. They are doing a great job. You just need to report the issue and wait politely. This is the easiest task and anything different is counterproductive.

Edit: I think I need to add something here. This is an open-source project. Everyone is invited to contribute by sending code, reviews, tests, documentation or whatever they think they can do to improve this integration and Home Assistant. Opening issues is also much appreciated as it helps us to identify problems that we were unable to reproduce before merging the code. What I meant is that sometimes we need to have a little patience after opening the issue.

HI Felipe,

Yes it works. I added a manual line into the init.py file and the integration found the devices and controls them correctly, as well as the state.

@felipediel

hi, i have the same problem (RM4c mini ver 2020) here ist output from python: [(‘192.168.x.x’, ‘0x6539’)]

can you help me? thx

@felipediel Yes, I use broadlink_s1c custom component, but it often disconnected. So I have to fork it and write some crutches, although I’m a Kotlin developer, not a Python, while it seems to work. I am afraid that the HA will be updated and this library will be laggy agin

RM4 Pro (‘192.168.1.69’, ‘0x653c’)

Just updated HA to 116, now I can integrate my two RMMini, and after changing configuration on Smart_ir everything is working again. Thank you @felipediel and all the people that makes HA a reality.

I am afraid the production level cannot be achieved on a builder like broadlink. Therefore, you need to be able to roll back. I think it is worth making it possible to roll back to the old version in the HA admin panel. And at home you can have two instances of HA, primary and backup. You can also save configs in git, and put release tags on them

All problems mentioned here were addressed in record time. They no longer exist on the dev branch. Sometimes it takes a while to get the code into production, especially when we are also dealing with library updates. No one is to blame, this is normal. New code needs treatment. There is a whole process involving tests, reviews and devops.

Home Assistant has more than 1600 integrations. Not an easy task to keep all these things up to date with a small team. So please, don’t push these guys. They are doing a great job. You just need to report the issue and wait politely. This is the easiest task and anything different is counterproductive.

Thank @felipediel for your reply, im still waiting, i know so hard for your dev team, we don’t push these guys, Thank for your Broadlink Integration, still waiting ^_^

You are waiting for this.

My RM pro PLUS is

[(‘192.168.11.12’, ‘0x27c3’)]

Like above, thank you,

image

Thank you! This update has not yet been released. It will be available soon.

@felipediel after updating to 0.115.2 I’m still having an issue connecting my RM4 mini, when I add the device it now show’s up as an unsupported device but my address(0x648d) is in the list.

Is this device yet to be supported or is there an error?

2020-09-19 23:20:10 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry IR blaster for broadlink 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”):

Love your work!!

0x649b will be supported when we release this.

@felipediel Here is the cause: https://github.com/algirdasc/hass-floureon/blob/master/custom_components/floureon/manifest.json. They need to update the manifest to broadlink==0.14.1 at least. You can test manually updating the manifest if you want to use both.

Yep, That was my problem. I’ve manually changed the manifest.json file and, after restarting Home Assistant, it was detected perfectly:

{
  "domain": "floureon",
  "name": "Floureon Thermostat",
  "documentation": "https://github.com/algirdasc/hass-floureon",
  "dependencies": [],
  "codeowners": ["@algirdasc"],
  "issue_tracker": "https://github.com/algirdasc/hass-floureon/issues",
  "requirements": ["pythoncrc", "broadlink==0.14.1"]
}

Maybe @algirdasc can take a look at this 👍

Hi, I have RM4 Pro -> 0x6026 when i try to install integration, in my logs show me this: Logger: aiohttp.server Source: components/broadlink/config_flow.py:47 First occurred: 17:55:21 (1 occurrences) Last logged: 17:55:21 Error handling request Traceback (most recent call last): File “/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py”, line 418, in start resp = await task File “/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py”, line 458, in _handle resp = await handler(request) File “/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py”, line 119, in impl return await handler(request) File “/usr/src/homeassistant/homeassistant/components/http/request_context.py”, line 18, in request_context_middleware return await handler(request) File “/usr/src/homeassistant/homeassistant/components/http/ban.py”, line 72, in ban_middleware return await handler(request) File “/usr/src/homeassistant/homeassistant/components/http/auth.py”, line 127, in auth_middleware return await handler(request) File “/usr/src/homeassistant/homeassistant/components/http/view.py”, line 129, in handle result = await result File “/usr/src/homeassistant/homeassistant/components/config/config_entries.py”, line 169, in post return await super().post(request, flow_id) File “/usr/src/homeassistant/homeassistant/components/http/data_validator.py”, line 60, in wrapper result = await method(view, request, *args, **kwargs) File “/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py”, line 106, in post result = await self._flow_mgr.async_configure(flow_id, data) File “/usr/src/homeassistant/homeassistant/data_entry_flow.py”, line 156, in async_configure result = await self._async_handle_step(flow, cur_step[“step_id”], user_input) File “/usr/src/homeassistant/homeassistant/data_entry_flow.py”, line 204, in _async_handle_step result: Dict = await getattr(flow, method)(user_input) File “/usr/src/homeassistant/homeassistant/components/broadlink/config_flow.py”, line 82, in async_step_user await self.async_set_device(device) File “/usr/src/homeassistant/homeassistant/components/broadlink/config_flow.py”, line 47, in async_set_device “model”: device.model, AttributeError: ‘rm4’ object has no attribute ‘model’ Do you have some solution for this??

@djhalun Could you please try this and see if it works for you?

Yes, this was solution for my problem. Thx very much for your help.

@felipediel here is mine:

[(‘192.168.xx.xx’, ‘0x649b’)] - RM4 Pro [(‘192.168.xx.xx’, ‘0x648d’)] - RM4 Mini

Thanks!

hi, I write just in case it can help someone else with my problem. I have a thermostat fluoreon component based on broadlink, and until I deactivated it too from configuration.yaml the integration via ui failed. So you have to deactivate all components that have a reference to the broadlink, restart, configure via ui and then reactivate the various components. thank a lot for you help @felipediel

@felipediel Thank you for your work on this upgrade. All my Ankuoo NEO Switches stopped working, please add to the code. Formerly used SP2 in configuration. Thanks
Ankuoo NEO Pro (shows wattage) 0x2716 Ankuoo NEO (no wattage) 0x2717

@felipediel i have the same problem this is the output python [(‘192.168.10.101’, ‘0x649b’)] it’s RM4Pro

You can learn the RF codes and send them with your RM pro. See this thread.

@occamatic Try unlocking the device with the official app first.

This?

That’s the one, I have the New Zealand outlet model but I doubt that it would matter

@paynenz Thank you! I created a PR. Is the brand correct? (Broadlink)

It’s an Efergy Ego smart plug. I have been using the older broadlink switch configuration with type sp2 on 0.114.4. Sorry I don’t know more about the smart plug internals. Thanks heaps!

@felipediel Can you please add 0x271d. It is an sp2

I’m sorry but I don’t understand the update process on github and how that works into Home Assistant, or how the changes by mjg feed in. I just updated to HA 0.118 and I can report the RM4 mini devices I was concerned about now install.

I did updated custom component manifest integration and upgraded again to 0.116.2. I can now confirm Broadlink RM on dedicated secondary network being detected automatically (2 from 3) and the one missing I was able to add manually using webUI.

@felipediel Thank you very much for you help! And to all for work on this project. 😃

@felipediel I upgraded HA to 0.116.0b2, now broadlink works with VPN, everything works, but broadlink S2C host doesn’t work. It works only on custom components, and never was supposed by HA. But I saw that there is support for it in the broadlink library. And I even post about it bug in HA forum year ago. Maybe you should fix it too? Log-> Unsupported device: 0x2722.

Rollback to previos version for “venv” instalation method: su - homeassistant cd /opt/homeassistant source bin/activate python3 -m pip install --upgrade homeassistant==0.114.4

I am afraid the production level cannot be achieved on a builder like broadlink. Therefore, you need to be able to roll back. I think it is worth making it possible to roll back to the old version in the HA admin panel. And at home you can have two instances of HA, primary and backup. You can also save configs in git, and put release tags on them

This would be so great feature to have. If done together with config held in local git repo and tagged automatically for HA releases even config downgrade could be automated!

For now, you can use this. You may also find this video useful.

Yep, downgrade was solution, but for my installation I used different approach - if someone running supervised (i.e. Docker install), then probably easiest way is to install SSH add-on and then use it to execute:

# ha core update --version=0.114.4

Let’s wait for 0.116. Thank you for help.

All problems mentioned here were addressed in record time. They no longer exist on the dev branch. Sometimes it takes a while to get the code into production, especially when we are also dealing with library updates. No one is to blame, this is normal. New code needs treatment. There is a whole process involving tests, reviews and devops.

Home Assistant has more than 1600 integrations. Not an easy task to keep all these things up to date with a small team. So please, don’t push these guys. They are doing a great job. You just need to report the issue and wait politely. This is the easiest task and anything different is counterproductive.

Hello, thank you for update. I can imagine dimension of the work you are doing and I would like to thank you for that. 🥇

On the other hand if HA would like to get from enthusiast world into consumer one, in my humble opinion such regression issues has to be dealt as patch releases a bit more swiftly. BFU will not understand when his automated home stopped suddenly working, that he should wait a month for new release or install beta. Honestly even I am not brave to install beta HA in my home. 😃 I know this is really off-topic discussion, but please understand, that your work has really impact to other people living now. Thank you. 😉

Hi, my rm2 pro plus, 0x279d is now not detected after upgrade. Can I know when will it be supported?

Thanks

EDIT: Nvm, I have to manually add rm2plus device under Integrations. It worked.

Hello @felipediel, version 0.115.3 have added Broadlink RM Pro+ 0x27c3 ? When i using Integration, it’s said unsupported device

This will fix. Thank you!

Thank you so much for your time. I’m willing to try it.

Thank you! It means xdiscover() is working fine for you, at least in the environment you tested. It is just a matter of time now.

Ok that was a pain, needed to install Ubuntu, then play with multiple errors. But in the end I got this! <rm: Broadlink RM pro+ (0x279d) at 192.168.1.60:80 | c8:f7:42:da:06:56 | 智能遥控 | Unlocked>

0x649b will be supported when we release this.

Thanks @felipediel! Legend!

@Rain-ZG Thank you! We will support your device soon.

@felipediel here is mine:

[(‘192.168.xx.xx’, ‘0x27cd’)] - RM mini 3 no entity be created

Logger: homeassistant.config_entries Source: components/broadlink/updater.py:24 First occurred: 5:31:14 PM (1 occurrences) Last logged: 5:31:14 PM Error setting up entry rmmini3 for broadlink

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’

To everyone with the floureon component, @algirdasc fixed the codebase. Just updated via HACS and all seems to be working ok 😃

Thanks everyone for the help, and @felipediel for the integration! 😃

@felipediel here is mine:

[(‘192.168.xx.xx’, ‘0x27d0’)] - RM mini 3 no entity be created

Thank you very very much for your work hard…


Logger: homeassistant.config_entries Source: components/broadlink/updater.py:24 First occurred: 上午6:02:18 (3 occurrences) Last logged: 上午7:02:30

Error setting up entry rm3 for broadlink 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’

Here is the cause: https://github.com/algirdasc/hass-floureon/blob/master/custom_components/floureon/manifest.json. They need to update the manifest to broadlink==0.14.1 at least. You can test manually updating the manifest if you want to use both.

@joten75 Thanks for informing about this. We have no control over custom components so these things are really difficult to debug. So was that second error message being caused by this? What is the name of the component?

yes, the second error disappear when i deactivate the floureon thermostat component, it’s a component based on broadlink. So i think you must warning about this too, every component o configuration in yaml which have a relation whit broadlink must be deactivate . 👍

Hi. I’m very happy that you are working hard on this integration because I have many problems regarding Rm4 pro and RF learning command. I’m not a developer so, for me python instructions ar not clear. I put wifi on rm4 pro via broadlink app and setup this on home assistant. For IR code work fine. I have integration with smartIr and also try to learn IR signals from TV and Fujitsu climate remote. That’s good and I have file “broadlink_remote_24dfa7e476b7_codes” whit codes. Unfortunatelly, for RF, that’s is not possible. I tried to setup a CAME gate remote control via three different remote (two original and one cloned from first) whitout any code learned. How’s wrong? Could I ask if you explain step by step the python way (I’m activated the pip package…)

Thank you very much. Daniele

I was using the NEO app from the play store until a few weeks ago when they updated the app and they stopped working. Now I am using CHACON again from the play store

@felipediel here is mine [(‘192.168.xx.xx’, ‘0x2712’)] - RM Pro [(‘192.168.xx.xx’, ‘0x2714’)] - A1

@felipediel, Not working for me too. Here my grain of sand:

[('x.x.x.x, ‘0x279d’)] -> RM pro +

@felipediel I have a Broadlink RM4C Mini, on the earlier version it would only work if it’s not connected to the broadlink cloud (that method to connect but not add to a room in broadlink app). I’ve seen this is not anymore on the Home Assistant Broadlink Integration page… Does it works when connected to the broadlink app now? Thanks!

Here are mine : [(‘x.x.x.x’, ‘0x5f36’)] - rm mini 3 - newbleackbean [(‘x.x.x.x’, ‘0x2737’)] -rm mini 3

RM4 Pro (‘192.168.1.228’, ‘0x6026’)

@joten75 I need to see the types (represented in hex). This is how you get them: #40191 (comment)

RM2 Pro Plus 0x272a;

Yes, but it is hackish, you should not do it. I will implement this for normal people soon.

You are being tortured due to the lack of a decent error message that shows the unsupported type. I will improve this soon. I will also consider adding a manual step to the config flow. But for now, please be proactive, if it is not working, please find your type and send me so I can add it to the library and make it compatible with discover() soon.

Things had to get worse before getting better, hope you guys understand.

Thanks for all this work @felipediel. I think you already have my device in your PR, but I ran your code to get the info to be sure.

[('192.168.1.99', '0x5f36'), ('192.168.1.96', '0x5f36')]

You commented as I was checking!

Thanks!

@joten75 RM mini 3 new Blackbean (0x5f36) will be supported after this patch.

@neotrunks Thank you! Your device will be supported soon.

@neotrunks Please open a terminal on your computer, install the python-broadlink library (pip install broadlink), open Python 3 and type:

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.0.17", timeout=5)  # Your device IP address
print([(d.host[0], hex(d.devtype)) for d in devs])

What is the output?

[(‘192.168.0.136’, ‘0x27c3’)]