# https://www.home-assistant.io/integrations/sensor.mqtt/
mqtt:
sensor:
- name: "Apartment Energy Meter - Total"
unique_id: "apartment_energy_meter_total"
state_topic: "mbus/apartment/sensor"
value_template: "{{ value_json.sn.MeterReading.total }}"
unit_of_measurement: "kWh"
device_class: energy
device:
name: "Apartment Energy Meter"
- name: "Benito Energy Meter - Total"
unique_id: "benito_energy_meter_total"
state_topic: "mbus/benito/sensor"
value_template: "{{ value_json.sn.MeterReading.total }}"
unit_of_measurement: "kWh"
device_class: energy
device:
name: "Benito Energy Meter"
Now I’ld expect to see an entity, but none show’s even though I’ve restarted a few times. If I search entities or devices for ‘benito’ or ‘apartment’ I get nothing…
I’ve choosen ‘sensors’ because Tasmota does it like that as well…
EDIT: Big extraloud LOL… What a classic! Now that I checked the configuration.yaml again I saw my typo!!! But sadly still nothing after another restart
Logger: homeassistant.components.mqtt.entity
Quelle: components/mqtt/entity.py:329
Integration: MQTT (Dokumentation, Probleme)
Erstmals aufgetreten: 14:41:43 (2 Vorkommnisse)
Zuletzt protokolliert: 14:41:43
Device must have at least one identifying value in 'identifiers' and/or 'connections' for dictionary value @ data['device'] for manually configured MQTT sensor item, in /config/configuration.yaml, line 18 Got {'name': 'Apartment Energy Meter - Total', 'unique_id': 'apartment_energy_meter_total', 'state_topic': 'mbus/apartment/sensors', 'value_template': '{{ value_json.sn.MeterReading.total }}', 'unit_of_measurement': 'kWh', 'device_class': 'energy', 'device': {'name': 'Apartment Energy Meter'}}
Device must have at least one identifying value in 'identifiers' and/or 'connections' for dictionary value @ data['device'] for manually configured MQTT sensor item, in /config/configuration.yaml, line 26 Got {'name': 'Benito Energy Meter - Total', 'unique_id': 'benito_energy_meter_total', 'state_topic': 'mbus/benito/sensors', 'value_template': '{{ value_json.sn.MeterReading.total }}', 'unit_of_measurement': 'kWh', 'device_class': 'energy', 'device': {'name': 'Benito Energy Meter'}}
I will search for the string:
Device must have at least one identifying value in 'identifiers' and/or 'connections' for dictionary value
That config is not part of the sensor: integration. It is part of the mqtt: integration. Everything in your configuration.yaml file that is hard up against the left hand margin is a separate integration.
You can do this:
in configuration.yaml
mqtt: !include mqtt.yaml
then put the config (minus the first line, mqtt:, in that file (which you will have to create).