home-assistant / architecture

Repo to discuss Home Assistant architecture
315 stars 99 forks source link

Add device_classes for gas and valve, define const units for Light #388

Closed CoMPaTech closed 3 years ago

CoMPaTech commented 4 years ago

Context

For our climate and domestic Plugwise sensors we would like to introduce the device classes gas and valve. This allows us to classify the appropriate sensors (e.g. domestic gas measuring from a DSMR and valve for both open/close (binary_sensor) and open-% (sensor) measures.

While writing this for one of our PRs - there is a device class illuminance, but no defined unit for lx or lm.

Proposal

Introduce 'GAS or volume (in m3)' (as in used gas for DSMR) and 'VALVE (in %)' while adding light level

Consequences

The units for VOLUME and FLOW should also include non DSMR standards like VOLUME_LITERS and VOLUME_GALLONS?

BradleyFord commented 4 years ago

Gas does not seem like a Device, I feel it should be flowmeter. Then it can be used for multiple purposes such as liquid, gas, etc.

On Sat, 30 May 2020, 5:23 pm Tom, notifications@github.com wrote:

Context

For our climate and domestic Plugwise sensors we would like to introduce the device classes gas and valve. This allows us to classify the appropriate sensors (e.g. domestic gas measuring from a DSMR and valve for both open/close (binary_sensor) and open-% (sensor) measures.

While writing this for one of our PRs - there is a device class illuminance, but no defined unit for lx or lm. Proposal

Introduce 'GAS or volume (in m3)' (as in used gas for DSMR) and 'VALVE (in %)' while adding light level

  • Sensor DEVICE_CLASS_GAS declaring type: gas measured in (existing) unit VOLUME_CUBIC_METERS where users can use mdi:gas-cylinder or likewise indication
  • Sensor (and/or binary sensor) DEVICE_CLASS_VALVE declaring type: valve - measured in (existing) UNIT_PERCENTAGE where users can use mdi:valve or likewise indication (i.e. mdi:valve-open/mdi:valve-closed)
  • Introduce new Light level units LIGHT_LUX in lx and LIGHT_LUMEN in lm ?

Consequences

The units for GAS should also include non DSMR standards like VOLUME_LITERS and VOLUME_GALLONS?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/home-assistant/architecture/issues/388, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACOZ773HAASLE3RCHIZ5EDRUEJGDANCNFSM4NOW4PYA .

CoMPaTech commented 4 years ago

Valid comment, flow(meter) seems more in line too

BradleyFord commented 4 years ago

Yeah something along those lines should be good, I would probably use the device class for other purposes.

On Sat, 30 May 2020, 8:53 pm Tom, notifications@github.com wrote:

Valid comment, flow(meter) seems more in line too

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/home-assistant/architecture/issues/388#issuecomment-636363605, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACOZ75JPAJ3S3NHC6CU5UDRUFB23ANCNFSM4NOW4PYA .

CoMPaTech commented 4 years ago

Water-meters (ie DSMR-like if they exist), but also my city-heater volume/flow and probably people measuring guardenhose-systems or pond-fillers might benefit from DEVICE_CLASS_FLOW (in L/m3/whatnot)

CoMPaTech commented 4 years ago

Updated the issue, FLOW is definitely a good suggestion, but naturally would be a volume per time. For the original idea (DSMR-based metering) it should be a more generically VOLUME.

shbatm commented 4 years ago

What about VOLUMETRIC_FLOW and LIQUID_FLOW (using the engineering terms)?

MartinHjelmare commented 3 years ago

I'm going to close this issue as it contains multiple suggestions that should be split into separate discussions and the gas sensor device class has already been implemented.

CoMPaTech commented 3 years ago

Apologies Martin, didn't realise it was still open