home-assistant / architecture

Repo to discuss Home Assistant architecture
313 stars 100 forks source link

Add device classes to `sensor` for weight #491

Closed nareddyt closed 3 years ago

nareddyt commented 3 years ago

Context

Smart bathroom scales, load cells, etc. read dimensions that HA can handle only as generic. I would like to introduce a device class for weight-based sensors.

Proposal

Add 2 new device classes for weight-related items: force and mass

The original goal was to add a device class for weight. However, I found that the term weight is often misused. Weight is a force, but most people are really referring to mass when they measure their weight.

After further reading, the SI units clearly define the distinction:

So I added support for both. Users can choose between the two to refer to the correct scientific term when they want to measure weight.

PRs:

Consequences

Sensors can use more specific device class for "weight" measurement.

MartinHjelmare commented 3 years ago

It's easier to accept changes to the entity model if we can see an overview of the current integrations and also possible devices/brands in the wild and how many would benefit from the added device classes. Can you make a table or summary of this?

nareddyt commented 3 years ago

Good point. Here is a summary of what I've found:

blakadder commented 3 years ago

Tasmota supports load cells.

Bluetooth scale data gathered with https://github.com/lolouk44/xiaomi_mi_scale