Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tplink overloading power strips #104208

Merged
merged 2 commits into from Jan 4, 2024
Merged

Fix tplink overloading power strips #104208

merged 2 commits into from Jan 4, 2024

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Nov 19, 2023

replaces #103668 since I can't reopen that one as I forced pushed while trying to get the CI working from open/close

Breaking change

To prevent overloading the power strips, the energy data is only polled every 60 seconds. If you need to poll the data faster, please use an automation that calls the homeassistant.update_entity service.

Proposed change

In #87399 we reduced the polling interval to 5s, and this works great for most devices. However power strips do plugs * N + 1 updates which causes them to get overloaded.

  • Split the child power sensors into their own coordinators to reduce the update interval of the power data to prevent overloading the device

Turning on individual sockets is now reliable and doesn't fail ~20% of the time anymore. Also its now possible for the kasa app to be open when setting up the device without it failing.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@home-assistant
Copy link

Hey there @rytilahti, @TheGardenMonkey, mind taking a look at this pull request as it has been labeled with an integration (tplink) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of tplink can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign tplink Removes the current integration label and assignees on the pull request, add the integration domain after the command.

@bdraco
Copy link
Member Author

bdraco commented Nov 19, 2023

I just realized that since I've been running this my database average size has dropped 50mib over 10 days as most of the data was useless churn generated by the voltage and wattage sensors fluxing at 0.00.....

@bdraco bdraco marked this pull request as draft November 19, 2023 16:16
@bdraco
Copy link
Member Author

bdraco commented Nov 19, 2023

Thanks. leaving as a draft and will merge later after we fix #103150 since issues are building up there and it likely need to be backported (and it will conflict here)

@bdraco bdraco marked this pull request as ready for review January 4, 2024 22:14
@bdraco
Copy link
Member Author

bdraco commented Jan 4, 2024

Going to merge this now since I keep forgetting to merge it into my integration branch while testing #105143 and I was thinking we had regressed the power strips again

@bdraco bdraco merged commit f5e7631 into dev Jan 4, 2024
23 checks passed
@bdraco bdraco deleted the coordinator_per_child branch January 4, 2024 22:15
raman325 added a commit to raman325/home-assistant that referenced this pull request Jan 5, 2024
* upstream/dev: (2071 commits)
  Set zwave_js voltage sensor suggested precision (home-assistant#107116)
  Bump bluetooth-adapters to 0.17.0 (home-assistant#107195)
  Disable IPv6 in the opower integration to fix AEP utilities (home-assistant#107203)
  Fix conversation snapshots (home-assistant#107196)
  Report missing entities/areas instead of failing to match in Assist (home-assistant#107151)
  Bump to PyTado 0.17.3 (home-assistant#107181)
  Fix switch states in AVM FRITZ!Box Tools (home-assistant#107183)
  Fix tplink overloading power strips (home-assistant#104208)
  Update sensorpush-ble library to 1.6.1 (home-assistant#107168)
  Bump aiohomekit to 3.1.2 (home-assistant#107177)
  Introduce base entity in streamlabs water (home-assistant#107095)
  Clean up outdated entity replacement logic in Guardian (home-assistant#107160)
  Add conversation_id parameter to conversation.process service (home-assistant#106078)
  Pass aiohttp clientsession to tedee integration (home-assistant#107089)
  Update Home Assistant base image to 2024.01.0 - Python 3.12 (home-assistant#107175)
  Remove precision in streamlabs water (home-assistant#107096)
  Pass down language to hassil (home-assistant#106490)
  Use snapshots in Glances sensor tests (home-assistant#107159)
  Cache homekit_controller supported features (home-assistant#106702)
  Migrate AVM FRITZ!Box Call monitor to has entity name (home-assistant#99752)
  ...
@github-actions github-actions bot locked and limited conversation to collaborators Jan 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants