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

[Feature] dataset usage in % availble in the integration instead of calculating it in Home Assistant #192

Open
homonto opened this issue Dec 19, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@homonto
Copy link

homonto commented Dec 19, 2024

Is your feature request related to a problem? Please describe.

no, there is NO PROBLEM

Describe the solution you'd like

Today, datasets entities provide both: used and available values, but there is no usage in %. It would be very valuable to have such sensor or even attribute without a need of creating it in Home Assistant.
Today, with this super nice integration, to see in HA the usage in % and i.e. act on it if its value is above the defined threshold, I need to:
1- create sensor in HA (template) and calulate it, i.e:

  • platform: template
    sensors:
    truenas_pool_usage:
    friendly_name: "Truenas pool usage"
    unique_id: truenas_pool_usage
    unit_of_measurement: "%"
    value_template: "{{ (100 * state_attr('sensor.truenas_datasets_pool', 'Used') / (state_attr('sensor.truenas_datasets_pool', 'Used') + state_attr('sensor.truenas_datasets_pool', 'Available'))) |float|round(1) }}"

2- use the new sensor called: "truenas_pool_usage" in lovelace, i.e.:
Screenshot 2024-12-19 at 09 46 04

3- use the new sensor called: "truenas_pool_usage" in automations to i.e. send the message: "pool usage too high" or so

Describe alternatives you've considered

Manual creation of sensors in HA

@homonto homonto added the enhancement New feature or request label Dec 19, 2024
@homonto homonto changed the title [Feature] disk usage in % availble in the integration instead of calculating it in Home Assistant [Feature] dataset usage in % availble in the integration instead of calculating it in Home Assistant Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant