"CCF" unit not supported for the "water" device class anymore?

Hi. I’m using rtlamr2mqtt to track my water meter, which reports in CCF. Configuration looks like:

- id: 1573825902
  protocol: r900
  name: water_meter
  unit_of_measurement: ccf
  icon: mdi:water
  device_class: water
  force_update: true
  state_class: total_increasing
  format: "#####.###"

This has stopped working after one of the recent updates:

2025-03-11 14:41:55.720 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: sensor rtlamr water_meter
2025-03-11 14:41:55.721 ERROR (MainThread) [homeassistant.components.mqtt.entity] Error 'The unit of measurement `ccf` is not valid together with device class `water`' when processing MQTT discovery message topic: 'homeassistant/sensor/rtlamr/water_meter/config', message: '{'unique_id': '1573825902', 'unit_of_measurement': 'ccf', 'icon': 'mdi:water', 'availability_topic': 'rtlamr/status', 'force_update': True, 'state_class': 'total_increasing', 'state_topic': 'rtlamr/1573825902/state', 'json_attributes_topic': 'rtlamr/1573825902/attributes', 'device_class': 'water', 'name': 'water_meter'}'

any workarounds?

It was a “breaking change” in one of the releases - that the devs in their wisdom called a “bug fix” instead. In fairness it probably was - but it broke a few things. Read this post and the one after:

I found the list of valid units - try CCF in upper case rather than lower. Let us know if it works.

SensorDeviceClass.VOLUME L, mL, gal, fl. oz., m³, ft³, CCF Generic volume, this device class should be used for sensors representing a consumption, for example the amount of fuel consumed by a vehicle.

1 Like

Thank you! Both for the supported units list and for the fix