remove field name from HA discovery for single-field messages
This commit is contained in:
@@ -52,6 +52,7 @@
|
||||
# %field the field name and key for JSON objects (equals the field index if no name is defined or the names are not
|
||||
# unique in the message).
|
||||
# %fieldname the field name (and nothing else like in %field, might be empty though!)
|
||||
# %fieldnamemult the field name unless there is a single field only (similar to %fieldname)
|
||||
# %type the field type (one of "number", "list", "string", "date", "time", or "datetime").
|
||||
# %basetype the base data type ID (e.g. "UCH").
|
||||
# %comment the field comment (if any).
|
||||
@@ -350,7 +351,7 @@ definition-topic ?= %haprefix/%type_topic/%{TOPIC}_%FIELD/config
|
||||
# HA integration: this is the config topic payload for HA's MQTT discovery.
|
||||
definition-payload = {
|
||||
"unique_id":"%{TOPIC}_%FIELD",
|
||||
"name":"%name %fieldname",
|
||||
"name":"%name %fieldnamemult",
|
||||
"device":%circuit_part,
|
||||
"value_template":"{{value_json[\"%field\"].value}}",
|
||||
"state_topic":"%topic"%field_payload
|
||||
|
||||
Reference in New Issue
Block a user