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
20 stars 0 forks source link

Update Interval and Unraid Drive Spin-down #7

Open Guruleenyc opened 1 week ago

Guruleenyc commented 1 week ago

I noticed that my unraid array drives were no longer spinning down after implementing this integration with homeassistant.

Can we increase the maximum update interval from one hour to at least 12 hours in (43200 sec) ?

This will allow unraid customers to have their Drive spin down without the need for near real time status updates and home assistant.

domalab commented 1 week ago

@Guruleenyc would you mind testing it out by updating the following files.

# const.py
DEFAULT_CHECK_INTERVAL = 3600  # increase default to 1 hour
MAX_CHECK_INTERVAL = 43200  # allow up to 12 hours

# config_flow.py
vol.Optional(CONF_CHECK_INTERVAL, default=DEFAULT_CHECK_INTERVAL): vol.All(
    int, vol.Range(min=300, max=MAX_CHECK_INTERVAL)  # increase max, set min to 5 minutes
),

Will be good to know if it makes a difference or not

Guruleenyc commented 1 week ago

I modified the two files and then reloaded the Unraid integration in HA. It's still not picking up the new Max and still States 3600 as being the limit. I also restarted home assistant and same issue, States maximum is 3600 when I try to hard code 43200 I also had to change the variable in the second file to an integer since upon integration reload it caused the configuration error.

domalab commented 1 week ago

@Guruleenyc thanks for checking. Working on a solution; will update soon.

Guruleenyc commented 1 week ago

Any update, or can I help test for you?

domalab commented 1 week ago

@Guruleenyc

Thank you for checking in! I’m currently traveling and won’t be able to update the code until mid-November. Once I’m back, I’ll prioritize reviewing and implementing any necessary changes. Appreciate your patience!

Guruleenyc commented 2 days ago

@domalab, Any update or advice?

mvanlijden commented 2 days ago

Also see the same behavior, hope you can update this month. Hope the new delayed update interval will only apply to disk updates, as I would like faster updates on other components that are not affected by disks which are spinned down.

domalab commented 2 days ago

@Guruleenyc @mvanlijden I'll be back on deck next week and expect an update by mid November 😊

Guruleenyc commented 2 days ago

@Guruleenyc @mvanlijden I'll be back on deck next week and expect an update by mid November 😊

Awesome! Thank you.