Mqtt, entity found. statistics_not_defined, Entity unavailable

Hi,

my setup:

mqtt listening.
entity found in mqtt

name = watermeter_m3
entity id = sensor.watermeter_m3
integration = MQTT
area = -
diabled by = -
status = -

add water source: i can select watermeter_m3 sensor.watermeter_m3

when saved i get following error: exclamtion marks

statistics_not_defined
sensor.watermeter_m3

Entity unavailable
The state of these configured entities are currently not available:
sensor.watermeter_m3 (unknown)

configuration.yaml:

mqtt:
  sensor:
    - name: watermeter_m3
      unique_id: 'sensor.watermeter_m3'
      device_class: water
      state_class: total_increasing
      unit_of_measurement: m³
      state_topic: 'water'
      value_template: '{{ (value | int) / 1000 }}'



in mqtt explorer i can see:

Water
 Water
  Count = 0.00
  Total = 149.00
  Time = 0.00

when listening in HA on MQTT i see data is being read.

i need some directions to start troubleshooting.

thanks!

your state_topic doesn’t look right

mine have a look like a path

state_topic: "stat/office/POWER"

now if it looks like

this json format we need to tell HA that

  - name: "Dishwasher Voltage"
    state_topic: "tele/SONOFF-POW3/SENSOR"
    value_template: "{{value_json['ENERGY'].Voltage }}"
    qos: 1
    unit_of_measurement: "V"

would read the value 244 into the Dishwasher Voltage Sensor

wow, i changed state_topic: ‘water’ to state_topic: ‘water/water/total’ and everything is working now.

Thanks!