esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 34 forks source link

ESPHome not supporting Volume Flow device classes yet its supported by Home Assistant #5547

Open bashers222 opened 6 months ago

bashers222 commented 6 months ago

The problem

Home Assistant now supports Volume flow rate (litres per minutre), rather than volume (litres) I have a water flow meter that has been erroring for the last 12 months due to an unsupported device class for volume flow HA now supports this device class (https://github.com/home-assistant/architecture/discussions/915) , but ESPhome marks my yaml as invalid when entered there

Can w eget this added to ESPhome so it does not error

Which version of ESPHome has the issue?

20240207.1

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

20240207.1

What platform are you using?

ESP8266

Board

No response

Component causing the issue

ESPhome web page validation

Example YAML snippet

- platform: pulse_meter
    pin:
      number: GPIO14
      inverted: true
      mode:
        input: true
        pullup: true
    name: "Water Flow Rate"
    internal_filter: 100ms
    device_class: volume
    unit_of_measurement: "L/min"
    icon: "mdi:water"

Anything in the logs that might be useful for us?

HA Logs:
Entity sensor.water_flow_rate (<class 'homeassistant.components.esphome.sensor.EsphomeSensor'>) is using native unit of measurement 'L/min' which is not a valid unit for the device class ('volume') it is using; expected one of ['gal', 'ft³', 'L', 'mL', 'fl. oz.', 'm³', 'CCF']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+esphome%22

ESPHome logs when validating:
INFO ESPHome 2023.12.9
INFO Reading configuration /config/esphome/esp8266-04-watermeter.yaml...
Failed config

sensor.pulse_meter: [source <unicode string>:48]
  platform: pulse_meter
  pin: 
    number: GPIO14
    inverted: True
    mode: 
      input: True
      pullup: True
  name: Water Flow Rate
  internal_filter: 100ms

  Unknown value 'volume_flow_rate', did you mean 'volume_storage'?.
  device_class: volume_flow_rate
  unit_of_measurement: L/min
  icon: mdi:water
  total: 
    name: Water Meter Total
    unit_of_measurement: m³
    id: water_meter_total
    accuracy_decimals: 3
    device_class: water
    state_class: total_increasing
    filters: 
      - multiply: 0.001

Additional information

No response

MrIcemanLE commented 4 months ago

@balloob this would be very useful. Who's the right person to mention this idea?