question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tapo Plug p100 Entity doesn't show current status after UI switch pressed

See original GitHub issue

Version of the custom_component

v1.0

Describe the bug

Pressing a switch in home assistant switches the plug, but also shows an error. Status of the switch in UI is not updated. Bug happens only sometimes, mostly after longer pause between last switch.

Debug log


[547844523968] 'NoneType' object has no attribute 'device_on'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 143, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1480, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1515, in _execute_service
    await handler.job.target(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 206, in handle_service
    await self.hass.helpers.service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 649, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 692, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 686, in _handle_entity_call
    await result
  File "/config/custom_components/tapo/switch.py", line 27, in async_turn_on
    await self._tapo_coordinator.async_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 161, in async_refresh
    await self._async_refresh(log_failures=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 235, in _async_refresh
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 295, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 310, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 334, in _async_write_ha_state
    sstate = self.state
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 704, in state
    return STATE_ON if self.is_on else STATE_OFF
  File "/config/custom_components/tapo/switch.py", line 23, in is_on
    return self._tapo_coordinator.data.device_on
AttributeError: 'NoneType' object has no attribute 'device_on'

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
maximilianneumanncommented, Apr 22, 2021

I installed the new version the manuell way, but now I can’t find it in integrations.

When I installed your component the first time it was the same. Than after half an hour and multiple restarts it showed up.

I will write if it works later.

0reactions
maximilianneumanncommented, Apr 24, 2021

Yes, I can confirm that it’s working

Read more comments on GitHub >

github_iconTop Results From Across the Web

TP-Link Tapo P100 - #244 by itm1960 - Hardware
The automation detects when power is being drawn or not and runs ok, turning on and off the second Tapo plug. But the...
Read more >
Frequently Asked Questions about Tapo Smart Plugs
Can Tapo Smart Plug work with third-party APP, like Smart Life, Apple Home Kit, etc.? Can the Tapo Smart Plugs be controlled via...
Read more >
P100 smart plugs won't upgrade to latest 1.4.5 fw
P100 smart plugs won't upgrade to latest 1.4.5 fw · 1. Unplug plug and plug it back and try firmware update again on...
Read more >
Guidelines for Environmental Infection Control in Health- ...
Criteria for Selecting Citations and Studies for This Review: Articles dealing with outbreaks of infection due to environmental opportunistic microorganisms and.
Read more >
User Guide: XiO Cloud Service
The XiO Cloud service may be used to view the status of ... to display general information for the active XiO Cloud account....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found