core: Log error in CORE for adding integration to Broadlink SmartPlug

The problem

Since 0.115 - Broadlink SmartPlugs issue log errors -> need to be added via integrations I presume

Attempt 1:

  • I fixed the yaml setup of the smartplugs (had to comment the type & friendly_name to pass configuration check)
  • The integration discovery found the plug but issued log error on the core
  • Switch entity was not created

Attempt 2:

  • Removed yaml config completely, after restart try to add integration manually
  • The device was recognized with the IP i provided for host but another error was issued on core log
  • Switch entity was not created

Environment

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

Problem-relevant configuration.yaml

the yaml used on atemp # 1

  - platform: broadlink
    host: '192.168.1.53'
#!secret spmini_coffeemaker_ip
    mac: 'B4:43:0D:B7:87:03'
#    type:  sp2
#    friendly_name: 'Rancilio Coffee Machine'

on second attempt - relevant yaml removed !

Traceback/Error logs

Attempt 1 (with yaml) -> attempt to add integration following discovery

2020-09-19 10:40:10 ERROR (MainThread) [aiohttp.server] 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 160, in get
    return await super().get(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 92, in get
    result = await self._flow_mgr.async_configure(flow_id)
  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)
TypeError: async_step_auth() takes 1 positional argument but 2 were given

Attempt 2 (without yaml) -> attempt to add integration manually

2020-09-19 10:47:43 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Raid Mosquito for broadlink
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 313, in async_unload
    result = await component.async_unload_entry(hass, self)  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/broadlink/__init__.py", line 33, in async_unload_entry
    device = hass.data[DOMAIN].devices.pop(entry.entry_id)
KeyError: 'a2a7322ef9a911eabb428bfd13855d45'
2020-09-19 10:50:21 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Mosquito Switch 1 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'

Additional information

The device I am trying to add was previously identified as SP2 smart plug in yaml config that worked on 0.114.4 and previously

My router identifies the device as "BroadLink_SPmini-T1-d9-38-dc " incase it helps… - this is definitely NOT and RF/IR type RM of some sort - I have one of those and it was discovered and working properly)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 20 (8 by maintainers)

Most upvoted comments

Fixed, you can safely update to HA 0.116.

I’ve updated and it’s working very well! Thanks again!

The new version of the library has not been released yet, you need to wait.

@Amir974 Thanks for helping me improve this. Your device is an OEM Broadlink SP2. It will be automatically discovered in the future.

This is my devic Link

(This is a local Israeli brand I guess)

No power meter.

Some light comes up when the switch is on, but not as much as some other models I saw…