File size in MB is wrongly calculated. See attached screenshot where bytes and MB are the same value.
Correct formula should be "total bytes / 1024 / 1024".
configuration.yaml- platform: filesize
file_paths:
- /config/home-assistant_v2.db
-

filesize documentation
filesize source
(message by IssueLinks)
Depends on who you ask I would say; If one follows the internal system of units (SI), the current is actually correct. Furthermore, your given calculation refers to the binary prefix, which is expressed as MiB, not MB.
Good point, even if most system still use 2^20 for files size and instead use 10^6 for network related calculations.
I ca easily solve using a custom sensor, but I think "MiB" should be added as attribute so nobody would have any doughs in future ;-)
Simone
I am working on adding that support. I already implemented a new data_size HA util that can convert between any SI and IEC data unit and added an optional parameter to the configuration for the user to set for the filesize integration. More details in the PR I am going to create soon.
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 now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
There is a PR that is ready to be merged; only issue is that is based on yaml.
Simone
Most helpful comment
I am working on adding that support. I already implemented a new
data_sizeHA util that can convert between any SI and IEC data unit and added an optional parameter to the configuration for the user to set for thefilesizeintegration. More details in the PR I am going to create soon.