How can i specify an unique_id for MQTT Number?

Hi all,

With the update of 2022.11.3 i got the message to do 4 repairs before the 2022.12 release.
This mentions the new mqtt configuration format.

I already put [sensor], [binary_sensor], [select] below the mqtt element last month or so. Without any problems.
Today i put [number], [cover], [climate] and [light] below the mqtt element.

When i specify unique_id for an number-item, then it won t show up in HA.
The mqtt [climate], [light] and [cover] stopped working also. No priority yet, i will look into this in a few days.

Question: What can i do to make items unique, so that it not breaks on changing de friendlyname.

Greetings,
Robin


Using Home Assistant 2022.11.3 on HassOS 9.3

Invalid configuration:

mqtt:
  number:
    - unique_id: mqtt_hv_setpointrookgas
      name: "Houtvergasser Setpoint Rookgastemperatuur"
      command_topic: "modbus/HvSpRookgasTemperatuur/set"
      command_template: >
        {{value * 10 |round|int}}
      state_topic: "modbus/HvSpRookgasTemperatuur"
      unit_of_measurement: "°C"
      value_template: >
        {{value | float / 10 }}
      min: 0
      max: 300

  sensor:
    - unique_id: mqtt_buffer_ah
      name: "MQTT Modbus: Buffer A Hoog"
      device_class: temperature
      state_topic: "modbus/BufferAH"
      unit_of_measurement: "°C"
      value_template: >
        {{value | float / 10 }}

Valid/Working configuration:

mqtt:
  number:
#    - unique_id: mqtt_hv_setpointrookgas
    - name: "Houtvergasser Setpoint Rookgastemperatuur"
      command_topic: "modbus/HvSpRookgasTemperatuur/set"
      command_template: >
        {{value * 10 |round|int}}
      state_topic: "modbus/HvSpRookgasTemperatuur"
      unit_of_measurement: "°C"
      value_template: >
        {{value | float / 10 }}
      min: 0
      max: 300

  sensor:
    - unique_id: mqtt_buffer_ah
      name: "MQTT Modbus: Buffer A Hoog"
      device_class: temperature
      state_topic: "modbus/BufferAH"
      unit_of_measurement: "°C"
      value_template: >
        {{value | float / 10 }}

When that happened, what was reported in Logs?

Hi 123,

I put in the unique_id again and restarted Home Assistant.

  • System->Settings->Logs says there are no errors reported.
  • At Developers Tools → States, my item is not showing up.
  • Where used at UI: “Entity not available”.

Update 23nov2022
When listing all entities from integration MQTT, there are entities which are ‘Disabled by Integration’.
This applies to all entities of: [number], [climate] and [cover].

I enabled loglevel debug for mqtt, but no usefull information was found there.

logger:
  default: info
  logs:
    homeassistant.components.mqtt: debug

The log lists lot of subscriptions, but the topic for [number],[climate],[cover] are missing.

... partial / omitted...
2022-11-23 22:25:56.382 DEBUG (SyncWorker_9) [homeassistant.components.mqtt.client] Subscribing to modbus/SchuurCvAanvoer, mid: 33
2022-11-23 22:25:56.384 DEBUG (SyncWorker_5) [homeassistant.components.mqtt.client] Subscribing to modbus/SchuurCvRetour, mid: 34
2022-11-23 22:25:56.387 DEBUG (SyncWorker_3) [homeassistant.components.mqtt.client] Subscribing to modbus/WerkplaatsTemperatuur, mid: 35
2022-11-23 22:25:56.391 DEBUG (SyncWorker_8) [homeassistant.components.mqtt.client] Subscribing to energiemeter/activeimport, mid: 36
2022-11-23 22:25:56.396 DEBUG (SyncWorker_6) [homeassistant.components.mqtt.client] Subscribing to energiemeter/activeexport, mid: 37
... partial / omitted...

One configured climate entitiy:

mqtt:
# ... partial / omitted ...
  climate:
    - unique_id: woonkamer1-trv-1
      current_temperature_topic: "zwave/36/49/1"
      temperature_command_topic: "zwave/36/67/1/set"
      temperature_state_topic: "zwave/36/67/1"
      mode_state_topic: "zwave/36/64/1"
      mode_command_topic: "zwave/36/64/1/set"
      modes: ["off", "heat"]
      name: "Woonkamer A - Radiator Zuid"
      precision: 0.1
      temp_step: 0.5

When anyone has an idea where to look…
Otherwise i will continue investigating this weekend.


Update 23nov22, second update

  1. The cover shows up, and is usable, when removing unique_id element from configuration.
  2. the 3 lines above are not present in configuration.yaml, also not removeable.