Skip to content

MQTT discovery #2209

@carminou

Description

@carminou

MQTT discovery not working in some environment, in my case with Domoticz, due to the mixed (long and abbreviated) config topic labels in the same message.

Suggested modifications:

  1. Add a configuration option in the "MQTT Parameters" configuration screen to tell the gateway to use either full topic labels (ie 'device', 'device_class', 'identifiers', 'model_id'...) either abbreviated topic labels (ie. 'dev', 'dev_cla', 'ids', 'mdl_id'...) but never mixed labels. Maybe add an 'backward compatibility' value to keep the messages as they are now to avoid breaking existing and working installations.
    or
  2. be sure that you stick to abbreviated labels (ie. "dev" and not "device" see below).

I tried to ask Domoticz developers to allow mixed labels, but they stick to their position: labels should be either abbreviated either full length, but not mixed.

Here is one of the config topics I get, note the "device:{...} " (not abbreviated) while all other are abbreviated:

homeassistant/sensor/Ambientweather-F007TH-2-154-temperature_C/config
{"stat_t":"+/+/RTL_433toMQTT/Ambientweather-F007TH/2/154","dev_cla":"temperature","unit_of_meas":"°C","name":"Temperature","uniq_id":"Ambientweather-F007TH-2-154-temperature_C","val_tpl":"{{ value_json.temperature_C | is_defined }}","stat_cla":"measurement","device":{"ids":["Ambientweather-F007TH-2-154"],"cns":[["mac","Ambientweather-F007TH-2-154"]],"mdl":"Ambientweather-F007TH","name":"Ambientweather-F007TH-2-154","via_device":"OMG_multi_receiver"}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions