add unique id

This commit is contained in:
FireBall1725 2022-05-20 06:10:18 -04:00
parent 2d9723ab03
commit 9ddc22ba79

View File

@ -169,7 +169,8 @@ class MQTT {
state_topic: this.getStateTopic(diag),
value_template: `{{ value_json.${MQTT.convertName(diagEl.name)} }}`,
json_attributes_topic: _.isUndefined(attr) ? undefined : this.getStateTopic(diag),
json_attributes_template: attr
json_attributes_template: attr,
unique_id: `${this.vehicle.vin}-${device_class}-${name}`
};
}