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

Provide input.current.nominal and ups.realpower.nominal for wattage display and statistics #86307

Closed
Bluscream opened this issue Jan 20, 2023 · 7 comments

Comments

@Bluscream
Copy link

Bluscream commented Jan 20, 2023

The problem

Please give out the sensor for ups.realpower.nominal and if that doesn't exist, calculate it from input.current.nominal, input.voltage.nominal and ups.load

Here's an example of WinNUT doing it: https://github.com/gawindx/WinNUT-Client/blob/master/WinNUT_V2/WinNUT_GUI/UPS_Network.vb#L677-L683

Me.OutPower = Double.Parse((GetUPSVar("ups.realpower.nominal", 0)), ciClone)
If Me.OutPower = 0 Then
    Me.InputA = Double.Parse(GetUPSVar("ups.current.nominal", 1), ciClone)
    Me.OutPower = Math.Round(Me.UPS_InputV * 0.95 * Me.UPS_InputA * CosPhi)
Else
    Me.OutPower = Math.Round(Me.UPS_OutPower * (Me.UPS_Load / 100))
End If

What version of Home Assistant Core has the issue?

Home Assistant 2023.1.6 Supervisor 2022.12.1 Operating System 9.4 Frontend 20230110.0 - latest

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Network UPS Tools

Link to integration documentation on our website

https://www.home-assistant.io/integrations/nut

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

Hey there @bdraco, @ollo69, mind taking a look at this issue as it has been labeled with an integration (nut) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of nut can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Change the title of the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign nut Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


nut documentation
nut source
(message by IssueLinks)

@Bluscream Bluscream changed the title Provide input.current.nominal and ups.realpower.nominal for wattage display Provide input.current.nominal and ups.realpower.nominal for wattage display and statistics Jan 20, 2023
@d9media
Copy link

d9media commented Feb 15, 2023

The calculation of Windows NUT is (partly) incorrect

if you were to integrate this, forget the line that says

Me.OutPower = Math.Round(Me.UPS_InputV * 0.95 * Me.UPS_InputA * CosPhi)

It's non-sense. Instead, you could allow the user to enter their UPS' capacity in which case you could roughly calculate the current use by Load * Capacity * 1.05

Explanation:
My UPS doesn't provide neither realpower.nominal or input.current.nominal. In my case, I know that the power pulled is in the range of 200-300W range but the Windows app showing much less (135W) so I started investigating where this calculation originated. Also in my case (Greencell 1500VA / 900W) the UPS draws ~30W even idle which is why I assume they take the value by .95 which is 5% loss. 25% in my case amounts to 225W.

@lyricnz
Copy link
Contributor

lyricnz commented Apr 13, 2023

I'd also like ups.realpower.nominal to be exposed, so I can do the calculation as described above.
EDIT: IGNORE previous comment, it's now available as "Nominal real power"

FWIW I have a https://www.cyberpower.com/au/en/product/sku/vp1000elcd which is 550W which I can see along with the load value

root@truenas[/etc/nut]# upsc ups@localhost | egrep '(realpower|load)'
ups.load: 15
ups.realpower.nominal: 550

So power ~= 0.15 * 550 * 1.05 ~= 86W

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@Bluscream
Copy link
Author

Please just implement this

@Blogshot
Copy link

Blogshot commented Aug 3, 2023

This is an issue for me, too.

When using nut-monitor on the Linux host, I can see ups.realpower and much more just fine, however the integration doesn't provide these sensors to HA.

Edit:
By using the load percentage that is made available, I was able to reverse calculate the ups.realpower attribute quite accurately:
"{{ (states('sensor.eaton_last') | int / 100 * 650 * 0.8) | int }}"

(eaton_last is german for eaton_load, so you might need to change the variable name in other locales)

Basically, I divide the load percentage by the nominal power multiplied by 0.8. This has resulted in an accurate approximation of ups.realpower as verified using NUT Monitor.

I can only guess why this is so accurate, my guess is that the UPS has an efficiency of 80%.

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@issue-triage-workflows issue-triage-workflows bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 8, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants