domalab / ha-unraid

Monitor and control your Unraid server directly from Home Assistant. Track system metrics (CPU, RAM, disk usage), manage VMs and Docker containers, monitor UPS status, and receive real-time alerts. Features automated discovery and an easy-to-use interface for seamless integration with your smart home.
Apache License 2.0
29 stars 1 forks source link

Power Consumption Monitoring #4

Open domalab opened 1 month ago

domalab commented 1 month ago

Is your feature request related to a problem? Please describe. Currently, the Unraid integration can detect and show basic UPS status information, but does not provide power consumption metrics that could be used in the Energy Dashboard. This misses the opportunity to track and visualize UPS power usage alongside other devices in Home Assistant.

Describe the solution you'd like Add power consumption monitoring for APC Smart-UPS devices connected to Unraid servers. Specifically:

Additional context The Unraid integration already detects UPS presence and pulls basic metrics using apcaccess. This feature would extend the existing UPS monitoring to include power-specific sensors with proper device classes (SensorDeviceClass.POWER and SensorDeviceClass.ENERGY) for Energy Dashboard integration.

domalab commented 1 week ago

Updated code to create 3 sensors to track UPS power and load

Screenshot 2024-11-13 at 11 52 44 am Screenshot 2024-11-13 at 11 53 01 am Screenshot 2024-11-13 at 11 56 17 am

Guruleenyc commented 1 week ago

AWESOME! Thank you for the great work. I'll check it out.

Guruleenyc commented 1 week ago

My HA integration is still at version 0.1.5, how do I upgrade to your new code to take advantage of new features?

domalab commented 1 week ago

@Guruleenyc I will release the new version this weekend.

domalab commented 1 week ago

@Guruleenyc I release a new version which creates power consumption sensors. Let me know if it works for you

Guruleenyc commented 1 week ago

How do I upgrade?

martindell commented 1 week ago

How do I upgrade?

in HACS, click the three dots and then 'update information' Screenshot 2024-11-17 at 09 54 17

domalab commented 1 week ago

Have you tried Update Information or Redownload to pull new version?

You can also try to clear web and HA mobile app cache as it sometimes holds onto old home assistant data.

You can also delete pycache folder from \config\custom_components\unraid to see if it resolves the issue.

Guruleenyc commented 1 week ago

I'm not getting any energy consumption data, just line voltage... Screenshot_20241118-062325.png

domalab commented 2 days ago

@Guruleenyc Is this still an issue for you?

Guruleenyc commented 2 days ago

@Guruleenyc Is this still an issue for you?

Yes still an issue. Screenshot_20241123-070249.png

domalab commented 1 day ago

@Guruleenyc I found the issue. The UPS Sensor is looking for the NOMPOWER attribute which your UPS model doesn't appear to have.

I might have a fix / workaround but you will need to test it please by downloading and copying the unraid folder from the repo to your HA instance custom_components folder.