core: New TPLink component does not work with declarative config. Discovery not working on different subnets.

Home Assistant release with the issue:

0.89.1

Last working Home Assistant release (if known): 0.88

Operating environment (Hass.io/Docker/Windows/etc.):

Docker, Hassio Tested Component/platform:

https://www.home-assistant.io/components/tplink/

Description of problem: TPLink declarative configuration not working. Discovery is limited to the same subnet. I have created a new docker instance with a baremetal config and still see the error. No devices show up as entities.

Note: The hass instance is running on the 10.0.1.x subnet and my IOT/TP-Link devices are on 10.0.8.x

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

tplink:
  discovery: true
  light:
    - host: 10.0.8.252

Traceback (if applicable):

2019-03-10 21:55:27 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/entity_platform.py", line 257, in _async_add_entity
    if entity.unique_id is not None:
  File "/usr/src/app/homeassistant/components/tplink/light.py", line 82, in unique_id
    return self._sysinfo["mac"]
TypeError: 'NoneType' object is not subscriptable

Additional information: I have also tested this with switches and neither are working as expected and throw the same error.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 23 (9 by maintainers)

Commits related to this issue

Most upvoted comments

I also have my TP-Link plugs on a different subnet and neither autodiscover or manual configuration are able to see my devices.

Here’s my 0.89 configuration.yaml (not working)

tplink:
  discovery: false
  switch:
    - host: 192.168.20.200
    - host: 192.168.20.201
    - host: 192.168.20.202
    - host: 192.168.20.203

and here’s my 0.88 configuration.yaml (working)

switch:
  - platform: tplink
    host: 192.168.20.200
  - platform: tplink
    host: 192.168.20.201
  - platform: tplink
    host: 192.168.20.202
  - platform: tplink
    host: 192.168.20.203

Logs:

2019-03-16 13:16:47 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry TP-Link Smart Home for tplink Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/pyHS100/smartdevice.py", line 116, in _query_helper request=request, File "/usr/local/lib/python3.7/site-packages/pyHS100/protocol.py", line 47, in query sock = socket.create_connection((host, port), timeout) File "/usr/local/lib/python3.7/socket.py", line 727, in create_connection raise err File "/usr/local/lib/python3.7/socket.py", line 716, in create_connection sock.connect(sa) OSError: [Errno 113] No route to host The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/app/homeassistant/config_entries.py", line 283, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/app/homeassistant/components/tplink/__init__.py", line 120, in async_setup_entry await hass.async_add_executor_job(_fill_device_lists) File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/usr/src/app/homeassistant/components/tplink/__init__.py", line 110, in _fill_device_lists if dev.is_dimmable: # Dimmers act as lights File "/usr/local/lib/python3.7/site-packages/pyHS100/smartplug.py", line 131, in is_dimmable return "brightness" in self.sys_info File "/usr/local/lib/python3.7/site-packages/pyHS100/smartdevice.py", line 185, in sys_info return defaultdict(lambda: None, self.get_sysinfo()) File "/usr/local/lib/python3.7/site-packages/pyHS100/smartdevice.py", line 195, in get_sysinfo return self._query_helper("system", "get_sysinfo") File "/usr/local/lib/python3.7/site-packages/pyHS100/smartdevice.py", line 119, in _query_helper raise SmartDeviceException('Communication error') from ex pyHS100.smartdevice.SmartDeviceException: Communication error

I’ve reverted back to 0.88 and my plugs are working again so they are definitely reachable from Home Assistant

tplink not working with different error.

Mon Mar 11 2019 11:56:55 GMT-0700 (Pacific Daylight Time)
Error while setting up platform tplink
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 127, in _async_setup_platform
    asyncio.shield(task, loop=hass.loop),
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 769, in shield
    inner = ensure_future(arg, loop=loop)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 592, in ensure_future
    raise TypeError('An asyncio.Future, a coroutine or an awaitable is '
TypeError: An asyncio.Future, a coroutine or an awaitable is required