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
Add unifi power stats for PDU outlets #98081
Add unifi power stats for PDU outlets #98081
Conversation
Hey there @Kane610, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
1796a42
to
696bc98
Compare
I did notice one issue when I run this locally in my "production" instance of HA, but suspect it's related to how I'm overriding. The localized strings don't show up in the "Configure" wizard for the integration. I am testing this locally by simply copying the unifi folder from my branch to custom_components and adding a version to the manifest. Please let me know if this doesn't sound like something related to my local hacked up setup and i'll dig into it further. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Im mostly worried about properly matching devices supporting metering as with if looking at caps would be enough.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
the PDU device has a few metrics that are exposed that provide info about the power budget and utilization all-up. I'm going to expand this PR to include diagnostics for those counters as well. |
If it's small else it's better to do a small separate pr |
696bc98
to
6bd136a
Compare
I'll create a new PR for it |
332054b
to
0a3cc8f
Compare
0a3cc8f
to
0be4e49
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Now only an update to the integration documentation is needed.
Ok, i'll look into what is needed to make that happen. I also just noticed that the PDU outlets don't get switch entities. I'm guessing because they are missing the "has_relay" property, so i'll probably look into a separate PR to address that. |
You can create a documentation PR in less than five minutes from github directly and you have two weeks to go :). Maybe investigate if we can utilize caps for the switch? This is what I got stuck on last time trying to figure out the common denominator. |
That would be convenient, wouldn't it? Unfortunately, the USP-Plug devices don't expose an outlet_caps property. |
PR for docs repo: home-assistant/home-assistant.io#28524 |
Proposed change
This PR adds support for the Unifi component to pull power statistics from power outlets on PDU devices that support providing power data.
Type of change
Additional information
This change was developed against the USP-PDU-Pro device, and tested with the USP-Plug as a device that shows up in the outlets API, but does not support power reporting. Additionally, the PDU-Pro has four outlets that are USB-C ports, which do not report power. In all cases, outlets that don't support this function are not included as power sensors.
My setup includes two PDU-Pro devices which properly associate their respective plugs.
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: