Repository navigation
Feature request: device_class data_size (and state_class) for volume size sensors #301
Replies: 5 comments
|
Heya Borotes, thanks the detailed explanation - sounds legit, will give it a shot and keep you posted once done. :) /tom |
|
Ok, done. That was a quick fix. 2 things:
/tom |
|
Hi Tom, thanks a lot for the quick fix – that's exactly what I was hoping for. I'll install the beta as soon as it's out and let you know how it works on my side. Regarding TB vs. TiB: that wasn't a problem for me at all, I just wanted to mention it in passing. In my own dashboard I calculate the values from the raw bytes anyway. I understand your reasoning – personally I'd guess that people running Home Assistant with a custom integration are usually quite tech-savvy and would be fine with TiB, but it's absolutely your call. Please don't take any of this as criticism – I really appreciate all the work you put into this integration. It's a great piece of work and I use it every day. Thanks again and best regards, |
|
No worries, all good! :) Thanks for the feature request again - v2026.12.1-beta1 is out ... Enjoy! /tom |
|
Hi Tom, quick feedback on v2026.12.1: installed it and everything works fine. The raw volume sensors now have device_class data_size and state_class measurement, the values are still in bytes and long-term statistics are being recorded. My dashboard didn't need any changes. One more thing on TB vs. TiB: I just noticed that the UGREEN app itself shows exactly the same numbers labeled as "TB" (32.4 of 32.6 TB used, 214.1 GB free). So the mix-up already starts in UGOS – keeping it consistent with the app makes total sense. I'd leave it as is until UGREEN changes it on their side. Thanks again for the super quick fix! Best regards, |

Uh oh!
There was an error while loading. Please reload this page.
Hi, and thanks for this integration – it works very well on my DXP4800 Plus.
What I noticed
The raw volume size sensors report bytes (unit B), but have neither a device_class nor a state_class:
Because of this, Home Assistant treats them as plain numbers: the unit cannot be changed in the entity settings, dashboards show a 14-digit number, and no long-term statistics are recorded. As a test, I set the device class to data_size in the entity registry myself – Home Assistant accepted it, but did not offer the unit conversion. So it seems this has to come from the integration.
The formatted sensors (e.g. (Pool 1 | Volume 1) Total Size) also have no device_class or state_class. In addition, the unit looks mislabeled: Total Size shows 32.70 TB, but 35949950009344 bytes are 35.95 TB (base 1000) or 32.70 TiB (base 1024). So the value is calculated in TiB but labeled TB.
What I would like
device_class: data_size together with native_unit_of_measurement: B and state_class: measurement for the raw size sensors. Home Assistant would then offer unit conversion (GB, TB, GiB, TiB, …) in the UI, record statistics, and always use the correct unit label. The reported value would stay the same, so existing templates keep working.
The rate sensors (read/write rate, LAN upload/download) already have device_class data_rate and work fine – thank you for that.
Reference: https://developers.home-assistant.io/docs/core/entity/sensor
My setup
Happy to test a beta or provide more details if that helps.
All reactions