Improve developer guidance regarding bandwidth sensors #621
Replies: 3 comments 3 replies
-
|
Speaking for huawei_lte, it exposes bytes per second simply because that's what the routers' API exposes, and because I was not aware of a recommendation to use some particular scale or bits instead of bytes. I'm all for consistency, although perhaps it'd make sense to have integrations report things as accurately as possible (so maybe make it bits or bytes everywhere, no kilos/megas on that level) and do the conversion in the UI. But then again this might be a bit annoying for automation conditions/triggers, lots of zeros there if they get to deal with the unscaled bits/bytes values. Sub-kilobit accuracy isn't probably that interesting these days, except for if it's really zero or even a bit (pun!) more. |
Beta Was this translation helpful? Give feedback.
-
|
Take care that there are many others usage as well, not only routers. Simone |
Beta Was this translation helpful? Give feedback.
-
|
Given that |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there!
I recently had a question regarding the integration for my router (fritz), and why it was using different units for the currently used bandwidth and the max available bandwidth (kilobits/s and kilobytes/s). When talking to the integration's code owner @chemelli74 we came to the conclusion that this issue is probably bigger than just one single integration, and that maybe it would be good to start an architecture discussion to get a general guideline for all integrations.
I've since looked into a couple of the router-related integrations, and found that most of them seem to use different units :
The relevant documentation for sensors doesn't cover bandwidth at all, since there's no dedicated device class, maybe that would be a place to change it.
There doesn't seem to be any consensus between the different integrations, my idea is that it might be good to have a general guidance about the scale of unit to be used from homeassistant (kilo, mega, etc), while maybe exposing the type of unit (bits/bytes per second) to the user as a toggle similar to the toggle for metric/imperial, or the local currency.
I'm hoping to get some insight into why different units are prepared by different developers, and to hopefully get a bit more consistency into the bandwidth sensors in the future.
Beta Was this translation helpful? Give feedback.
All reactions