MQTT sensor not appearing in Home Assistant

Recently I dug up an old watermeter sensor, and now I’m trying to get its published messages into HA. Here’s my config and troubleshooting so far:

First, the sensor works and is visible through MQTT explorer and publishes messages on watermeter/reading/current_value for example.

Also, my Mosquitto broker nicely reports that the watermeter is connected successfully, without any warnings or errors later on in the logs.

My config yaml looks like this:

automation: !include_dir_merge_list automations/
sensor: !include_dir_merge_list sensors/
scene: !include_dir_merge_list scenes/
mqtt: !include_dir_merge_list mqtt/
switch: !include_dir_merge_list switches/
script: !include scripts.yaml
group: !include groups.yaml

Watermeter.yaml which lives in the mqtt folder looks like this:

sensor:
  - name: "connectix_watermeter_totaal"
    state_topic: "watermeter/reading/current_value"
    unit_of_measurement: "L"
    force_update: true
    device_class: water
    unique_id: "watermeter_totaal"

  - name: "Watermeter MAC Adres"
    state_topic: "watermeter/smart_gateways/mac_address"
    unique_id: "watermeter_mac_adres"

  - name: "Watermeter Firmware versie van gateway"
    state_topic: "watermeter/smart_gateways/running_firmware_version"
    unique_id: "watermeter_firmware_gateway"

  - name: "Watermeter Beschikbare firmware versie"
    state_topic: "watermeter/smart_gateways/available_firmware_version"
    unique_id: "watermeter_available_firmware"

  - name: "Watermeter Firmware update beschikbaar"
    state_topic: "watermeter/smart_gateways/update_available"
    unique_id: "watermeter_firmware_update_available"

  - name: "Watermeter WiFi Signaalsterkte (rssi)"
    state_topic: "watermeter/smart_gateways/wifi_rssi"
    unit_of_measurement: 'dB'
    device_class: signal_strength
    unique_id: "watermeter_wifi_signal_strength"

  - name: "Watermeter startup time"
    state_topic: "watermeter/smart_gateways/startup_time"
    unique_id: "watermeter_startup_time"

Sadly, no entities are created, I also do not see any devices being added.
Also, when I’m trying to listen in on watermeter/reading/current_value I do not get anything on the developer tools.

I have set MQTT to debugging and rebooted a couple of times, but I can’t see any error in the logs. Now I’m at a bit of a loss for where to look next.

The Developer Tools page listens to Home Assistant events, which are not MQTT messages, so you should not expect to see anything there.

If a search for “watermeter” in the States tab of Developer Tools finds nothing, then I’d say the yaml isn’t getting loaded. The entities should exist even if no mqtt message has been posted, as long as the config has loaded. You say you’ve rebooted so this should load them. Do you have other mqtt entities that are working? Anything relevant under Settings > System > Logs?

This should help

Thanks @michaelblight ! Your comment put me in the right direction, changing my config to this made all mqtt sensors visible and working:

automation: !include_dir_merge_list automations/
sensor: !include_dir_merge_list sensors/
scene: !include_dir_merge_list scenes/
# mqtt: !include_dir_merge_list mqtt/
switch: !include_dir_merge_list switches/
script: !include scripts.yaml
group: !include groups.yaml


mqtt:
  sensor:
    - name: "connectix_watermeter_totaal"
      state_topic: "watermeter/reading/current_value"
      unit_of_measurement: "L"
      force_update: true
      device_class: water
      unique_id: "watermeter_totaal"

    - name: "Watermeter MAC Adres"
      state_topic: "watermeter/smart_gateways/mac_address"
      unique_id: "watermeter_mac_adres"

    - name: "Watermeter Firmware versie van gateway"
      state_topic: "watermeter/smart_gateways/running_firmware_version"
      unique_id: "watermeter_firmware_gateway"

    - name: "Watermeter Beschikbare firmware versie"
      state_topic: "watermeter/smart_gateways/available_firmware_version"
      unique_id: "watermeter_available_firmware"

    - name: "Watermeter Firmware update beschikbaar"
      state_topic: "watermeter/smart_gateways/update_available"
      unique_id: "watermeter_firmware_update_available"

    - name: "Watermeter WiFi Signaalsterkte (rssi)"
      state_topic: "watermeter/smart_gateways/wifi_rssi"
      unit_of_measurement: 'dB'
      device_class: signal_strength
      unique_id: "watermeter_wifi_signal_strength"

    - name: "Watermeter startup time"
      state_topic: "watermeter/smart_gateways/startup_time"
      unique_id: "watermeter_startup_time"

I still don’t know why my previous config did not work (it parsed OK in StudioCodeServer) but will figure that out later.